@akylas/nativescript-cli 8.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +385 -0
- package/bin/nativescript +3 -0
- package/bin/nativescript.js +3 -0
- package/bin/ns +3 -0
- package/bin/nsc +3 -0
- package/bin/nsc.js +3 -0
- package/bin/tns +12 -0
- package/bin/tns.cmd +1 -0
- package/config/config.json +8 -0
- package/config/test-dependencies.json +58 -0
- package/config/test-deps-versions-generated.json +1 -0
- package/docs/build-jekyll-md.sh +7 -0
- package/docs/helpers/favicon.ico +0 -0
- package/docs/helpers/logo.png +0 -0
- package/docs/man_pages/cloud/cloud-setup.md +29 -0
- package/docs/man_pages/device/device-android.md +32 -0
- package/docs/man_pages/device/device-ios.md +40 -0
- package/docs/man_pages/device/device-list-applications.md +37 -0
- package/docs/man_pages/device/device-log.md +37 -0
- package/docs/man_pages/device/device-run.md +55 -0
- package/docs/man_pages/device/device.md +46 -0
- package/docs/man_pages/env-configuration/setup.md +22 -0
- package/docs/man_pages/general/autocomplete-disable.md +37 -0
- package/docs/man_pages/general/autocomplete-enable.md +37 -0
- package/docs/man_pages/general/autocomplete-status.md +35 -0
- package/docs/man_pages/general/autocomplete.md +46 -0
- package/docs/man_pages/general/clean.md +22 -0
- package/docs/man_pages/general/doctor.md +33 -0
- package/docs/man_pages/general/error-reporting.md +41 -0
- package/docs/man_pages/general/extension-install.md +45 -0
- package/docs/man_pages/general/extension-uninstall.md +41 -0
- package/docs/man_pages/general/extension.md +35 -0
- package/docs/man_pages/general/help.md +39 -0
- package/docs/man_pages/general/info.md +33 -0
- package/docs/man_pages/general/migrate.md +79 -0
- package/docs/man_pages/general/package-manager-get.md +26 -0
- package/docs/man_pages/general/package-manager-set.md +29 -0
- package/docs/man_pages/general/package-manager.md +25 -0
- package/docs/man_pages/general/proxy-clear.md +26 -0
- package/docs/man_pages/general/proxy-set.md +45 -0
- package/docs/man_pages/general/proxy.md +31 -0
- package/docs/man_pages/general/update.md +40 -0
- package/docs/man_pages/general/usage-reporting.md +41 -0
- package/docs/man_pages/index.html +3 -0
- package/docs/man_pages/lib-management/plugin-add.md +42 -0
- package/docs/man_pages/lib-management/plugin-build.md +32 -0
- package/docs/man_pages/lib-management/plugin-create.md +48 -0
- package/docs/man_pages/lib-management/plugin-install.md +42 -0
- package/docs/man_pages/lib-management/plugin-remove.md +31 -0
- package/docs/man_pages/lib-management/plugin-update.md +41 -0
- package/docs/man_pages/lib-management/plugin.md +39 -0
- package/docs/man_pages/project/configuration/generate.md +36 -0
- package/docs/man_pages/project/configuration/install.md +43 -0
- package/docs/man_pages/project/configuration/open-android.md +27 -0
- package/docs/man_pages/project/configuration/open-ios.md +31 -0
- package/docs/man_pages/project/configuration/open.md +36 -0
- package/docs/man_pages/project/configuration/platform-add.md +46 -0
- package/docs/man_pages/project/configuration/platform-clean.md +41 -0
- package/docs/man_pages/project/configuration/platform-remove.md +41 -0
- package/docs/man_pages/project/configuration/platform-update.md +45 -0
- package/docs/man_pages/project/configuration/platform.md +29 -0
- package/docs/man_pages/project/configuration/prepare.md +49 -0
- package/docs/man_pages/project/configuration/resources/resources-generate-icons.md +39 -0
- package/docs/man_pages/project/configuration/resources/resources-generate-splashes.md +39 -0
- package/docs/man_pages/project/configuration/resources/resources-update.md +35 -0
- package/docs/man_pages/project/configuration/resources/resources.md +14 -0
- package/docs/man_pages/project/creation/create.md +64 -0
- package/docs/man_pages/project/testing/build-android.md +62 -0
- package/docs/man_pages/project/testing/build-ios.md +65 -0
- package/docs/man_pages/project/testing/build.md +66 -0
- package/docs/man_pages/project/testing/debug-android.md +64 -0
- package/docs/man_pages/project/testing/debug-ios.md +65 -0
- package/docs/man_pages/project/testing/debug.md +67 -0
- package/docs/man_pages/project/testing/deploy.md +72 -0
- package/docs/man_pages/project/testing/dev-test-android.md +31 -0
- package/docs/man_pages/project/testing/dev-test-ios.md +36 -0
- package/docs/man_pages/project/testing/preview.md +35 -0
- package/docs/man_pages/project/testing/run-android.md +79 -0
- package/docs/man_pages/project/testing/run-ios.md +83 -0
- package/docs/man_pages/project/testing/run.md +92 -0
- package/docs/man_pages/project/testing/test-android.md +46 -0
- package/docs/man_pages/project/testing/test-init.md +34 -0
- package/docs/man_pages/project/testing/test-ios.md +48 -0
- package/docs/man_pages/project/testing/test.md +48 -0
- package/docs/man_pages/project/testing/typings.md +52 -0
- package/docs/man_pages/publishing/apple-login.md +35 -0
- package/docs/man_pages/publishing/appstore-upload.md +52 -0
- package/docs/man_pages/publishing/appstore.md +42 -0
- package/docs/man_pages/publishing/publish-ios.md +55 -0
- package/docs/man_pages/publishing/publish.md +38 -0
- package/docs/man_pages/start.md +81 -0
- package/lib/.d.ts +494 -0
- package/lib/android-tools-info.js +135 -0
- package/lib/base-package-manager.js +129 -0
- package/lib/bash-scripts/terminateProcess.sh +12 -0
- package/lib/bootstrap.js +203 -0
- package/lib/bun-package-manager.js +135 -0
- package/lib/color.js +10 -0
- package/lib/commands/add-platform.js +49 -0
- package/lib/commands/apple-login.js +52 -0
- package/lib/commands/appstore-list.js +75 -0
- package/lib/commands/appstore-upload.js +106 -0
- package/lib/commands/build.js +161 -0
- package/lib/commands/clean.js +253 -0
- package/lib/commands/command-base.js +46 -0
- package/lib/commands/config.js +135 -0
- package/lib/commands/create-project.js +431 -0
- package/lib/commands/debug.js +191 -0
- package/lib/commands/deploy.js +78 -0
- package/lib/commands/extensibility/install-extension.js +33 -0
- package/lib/commands/extensibility/list-extensions.js +40 -0
- package/lib/commands/extensibility/uninstall-extension.js +32 -0
- package/lib/commands/fonts.js +64 -0
- package/lib/commands/generate-assets.js +71 -0
- package/lib/commands/generate-help.js +26 -0
- package/lib/commands/generate.js +78 -0
- package/lib/commands/info.js +26 -0
- package/lib/commands/install.js +80 -0
- package/lib/commands/list-platforms.js +45 -0
- package/lib/commands/migrate.js +44 -0
- package/lib/commands/platform-clean.js +54 -0
- package/lib/commands/plugin/add-plugin.js +43 -0
- package/lib/commands/plugin/build-plugin.js +70 -0
- package/lib/commands/plugin/create-plugin.js +175 -0
- package/lib/commands/plugin/list-plugins.js +54 -0
- package/lib/commands/plugin/remove-plugin.js +52 -0
- package/lib/commands/plugin/update-plugin.js +52 -0
- package/lib/commands/post-install.js +57 -0
- package/lib/commands/prepare.js +63 -0
- package/lib/commands/preview.js +93 -0
- package/lib/commands/remove-platform.js +40 -0
- package/lib/commands/resources/resources-update.js +45 -0
- package/lib/commands/run.js +177 -0
- package/lib/commands/setup.js +15 -0
- package/lib/commands/start.js +33 -0
- package/lib/commands/test-init.js +167 -0
- package/lib/commands/test.js +146 -0
- package/lib/commands/typings.js +180 -0
- package/lib/commands/update-platform.js +57 -0
- package/lib/commands/update.js +70 -0
- package/lib/common/LICENSE +201 -0
- package/lib/common/README.md +1084 -0
- package/lib/common/bin/common-lib.js +5 -0
- package/lib/common/bootstrap.js +97 -0
- package/lib/common/child-process.js +217 -0
- package/lib/common/codeGeneration/code-entity.js +47 -0
- package/lib/common/codeGeneration/code-generation.d.ts +47 -0
- package/lib/common/codeGeneration/code-printer.js +48 -0
- package/lib/common/command-params.js +45 -0
- package/lib/common/commands/analytics.js +81 -0
- package/lib/common/commands/autocompletion.js +110 -0
- package/lib/common/commands/device/device-log-stream.js +44 -0
- package/lib/common/commands/device/get-file.js +54 -0
- package/lib/common/commands/device/list-applications.js +42 -0
- package/lib/common/commands/device/list-devices.js +150 -0
- package/lib/common/commands/device/list-files.js +55 -0
- package/lib/common/commands/device/put-file.js +55 -0
- package/lib/common/commands/device/run-application.js +46 -0
- package/lib/common/commands/device/stop-application.js +42 -0
- package/lib/common/commands/device/uninstall-application.js +33 -0
- package/lib/common/commands/doctor.js +54 -0
- package/lib/common/commands/generate-messages.js +45 -0
- package/lib/common/commands/help.js +51 -0
- package/lib/common/commands/package-manager-get.js +32 -0
- package/lib/common/commands/package-manager-set.js +37 -0
- package/lib/common/commands/post-install.js +27 -0
- package/lib/common/commands/preuninstall.js +61 -0
- package/lib/common/commands/proxy/proxy-base.js +34 -0
- package/lib/common/commands/proxy/proxy-clear.js +32 -0
- package/lib/common/commands/proxy/proxy-get.js +31 -0
- package/lib/common/commands/proxy/proxy-set.js +150 -0
- package/lib/common/common-lib.js +5 -0
- package/lib/common/constants.js +122 -0
- package/lib/common/declarations.d.ts +1713 -0
- package/lib/common/decorators.js +201 -0
- package/lib/common/definitions/cli-global.d.ts +22 -0
- package/lib/common/definitions/commands-service.d.ts +27 -0
- package/lib/common/definitions/commands.d.ts +51 -0
- package/lib/common/definitions/config.d.ts +33 -0
- package/lib/common/definitions/extensibility.d.ts +147 -0
- package/lib/common/definitions/google-analytics.d.ts +109 -0
- package/lib/common/definitions/json-file-settings-service.d.ts +24 -0
- package/lib/common/definitions/key-commands.d.ts +62 -0
- package/lib/common/definitions/logger.d.ts +41 -0
- package/lib/common/definitions/mobile.d.ts +1499 -0
- package/lib/common/definitions/validator.d.ts +8 -0
- package/lib/common/definitions/yok.d.ts +56 -0
- package/lib/common/dispatchers.js +151 -0
- package/lib/common/docs/helpers/basic-extensions-page.html +15 -0
- package/lib/common/docs/helpers/basic-page.html +14 -0
- package/lib/common/docs/helpers/styles.css +365 -0
- package/lib/common/doctor.d.ts +6 -0
- package/lib/common/errors.js +206 -0
- package/lib/common/file-system.js +441 -0
- package/lib/common/header.js +30 -0
- package/lib/common/helpers.js +658 -0
- package/lib/common/host-info.js +133 -0
- package/lib/common/http-client.js +173 -0
- package/lib/common/logger/appenders/cli-appender.js +24 -0
- package/lib/common/logger/appenders/emit-appender.js +30 -0
- package/lib/common/logger/layouts/cli-layout.js +33 -0
- package/lib/common/logger/logger.js +199 -0
- package/lib/common/messages/messages.interface.d.ts +10 -0
- package/lib/common/messages/messages.js +15 -0
- package/lib/common/mobile/android/android-application-manager.js +228 -0
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +332 -0
- package/lib/common/mobile/android/android-debug-bridge.js +167 -0
- package/lib/common/mobile/android/android-device-file-system.js +176 -0
- package/lib/common/mobile/android/android-device-hash-service.js +133 -0
- package/lib/common/mobile/android/android-device.js +164 -0
- package/lib/common/mobile/android/android-emulator-services.js +205 -0
- package/lib/common/mobile/android/android-ini-file-parser.js +77 -0
- package/lib/common/mobile/android/android-log-filter.js +42 -0
- package/lib/common/mobile/android/android-virtual-device-service.js +360 -0
- package/lib/common/mobile/android/device-android-debug-bridge.js +48 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +211 -0
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +121 -0
- package/lib/common/mobile/android/logcat-helper.js +165 -0
- package/lib/common/mobile/application-manager-base.js +136 -0
- package/lib/common/mobile/device-emitter.js +61 -0
- package/lib/common/mobile/device-log-emitter.js +40 -0
- package/lib/common/mobile/device-log-provider-base.js +76 -0
- package/lib/common/mobile/device-log-provider.js +126 -0
- package/lib/common/mobile/device-platforms-constants.js +22 -0
- package/lib/common/mobile/emulator-helper.js +84 -0
- package/lib/common/mobile/ios/device/ios-application-manager.js +159 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +133 -0
- package/lib/common/mobile/ios/device/ios-device-operations.js +234 -0
- package/lib/common/mobile/ios/device/ios-device.js +153 -0
- package/lib/common/mobile/ios/ios-device-base.js +108 -0
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +65 -0
- package/lib/common/mobile/ios/ios-log-filter.js +24 -0
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +139 -0
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +23 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +147 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +106 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +81 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +69 -0
- package/lib/common/mobile/local-to-device-path-data-factory.js +37 -0
- package/lib/common/mobile/log-filter.js +51 -0
- package/lib/common/mobile/logging-levels.js +12 -0
- package/lib/common/mobile/mobile-core/android-device-discovery.js +91 -0
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +65 -0
- package/lib/common/mobile/mobile-core/android-process-service.js +259 -0
- package/lib/common/mobile/mobile-core/device-discovery.js +64 -0
- package/lib/common/mobile/mobile-core/devices-service.js +854 -0
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +63 -0
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +109 -0
- package/lib/common/mobile/mobile-helper.js +102 -0
- package/lib/common/mobile/wp8/wp8-emulator-services.js +82 -0
- package/lib/common/old.npmignore +12 -0
- package/lib/common/opener.js +16 -0
- package/lib/common/os-info.js +21 -0
- package/lib/common/plist-parser.js +24 -0
- package/lib/common/project-helper.js +70 -0
- package/lib/common/prompter.js +191 -0
- package/lib/common/queue.js +37 -0
- package/lib/common/resource-loader.js +25 -0
- package/lib/common/resources/messages/errorMessages.json +7 -0
- package/lib/common/resources/platform-tools/android/darwin/NOTICE.txt +3407 -0
- package/lib/common/resources/platform-tools/android/darwin/adb +0 -0
- package/lib/common/resources/platform-tools/android/linux/NOTICE.txt +4451 -0
- package/lib/common/resources/platform-tools/android/linux/adb +0 -0
- package/lib/common/resources/platform-tools/android/win32/AdbWinApi.dll +0 -0
- package/lib/common/resources/platform-tools/android/win32/AdbWinUsbApi.dll +0 -0
- package/lib/common/resources/platform-tools/android/win32/NOTICE.txt +4451 -0
- package/lib/common/resources/platform-tools/android/win32/adb.exe +0 -0
- package/lib/common/resources/platform-tools/android/win32/fastboot.exe +0 -0
- package/lib/common/resources/platform-tools/unzip/win32/unzip.exe +0 -0
- package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +16 -0
- package/lib/common/services/auto-completion-service.js +265 -0
- package/lib/common/services/cancellation.js +67 -0
- package/lib/common/services/commands-service.js +268 -0
- package/lib/common/services/help-service.js +252 -0
- package/lib/common/services/hooks-service.js +318 -0
- package/lib/common/services/ios-notification-service.js +49 -0
- package/lib/common/services/json-file-settings-service.js +133 -0
- package/lib/common/services/lock-service.js +129 -0
- package/lib/common/services/message-contract-generator.js +83 -0
- package/lib/common/services/messages-service.js +77 -0
- package/lib/common/services/micro-templating-service.js +49 -0
- package/lib/common/services/net-service.js +137 -0
- package/lib/common/services/project-files-manager.js +100 -0
- package/lib/common/services/project-files-provider-base.js +54 -0
- package/lib/common/services/proxy-service.js +64 -0
- package/lib/common/services/qr.js +39 -0
- package/lib/common/services/settings-service.js +42 -0
- package/lib/common/services/xcode-select-service.js +62 -0
- package/lib/common/utils.js +31 -0
- package/lib/common/validators/project-name-validator.js +88 -0
- package/lib/common/validators/validation-result.js +16 -0
- package/lib/common/vendor/License.txt +4 -0
- package/lib/common/vendor/jaro-winkler_distance.js +111 -0
- package/lib/common/verify-node-version.js +78 -0
- package/lib/common/yok.js +426 -0
- package/lib/config.js +137 -0
- package/lib/constants-provider.js +12 -0
- package/lib/constants.js +350 -0
- package/lib/controllers/build-controller.js +133 -0
- package/lib/controllers/debug-controller.js +235 -0
- package/lib/controllers/deploy-controller.js +38 -0
- package/lib/controllers/migrate-controller.js +1114 -0
- package/lib/controllers/platform-controller.js +127 -0
- package/lib/controllers/prepare-controller.js +353 -0
- package/lib/controllers/run-controller.js +525 -0
- package/lib/controllers/update-controller-base.js +84 -0
- package/lib/controllers/update-controller.js +188 -0
- package/lib/data/build-data.js +44 -0
- package/lib/data/controller-data-base.js +11 -0
- package/lib/data/debug-data.js +6 -0
- package/lib/data/platform-data.js +13 -0
- package/lib/data/prepare-data.js +46 -0
- package/lib/data/run-data.js +11 -0
- package/lib/declarations.d.ts +1256 -0
- package/lib/definitions/android-bundle-tool-service.d.ts +17 -0
- package/lib/definitions/android-plugin-migrator.d.ts +52 -0
- package/lib/definitions/build.d.ts +92 -0
- package/lib/definitions/cleanup-service.d.ts +79 -0
- package/lib/definitions/data.d.ts +7 -0
- package/lib/definitions/debug.d.ts +166 -0
- package/lib/definitions/deploy.d.ts +3 -0
- package/lib/definitions/file-log-service.d.ts +19 -0
- package/lib/definitions/files-hash-service.d.ts +35 -0
- package/lib/definitions/gradle.d.ts +33 -0
- package/lib/definitions/hmr-status-service.d.ts +5 -0
- package/lib/definitions/initialize-service.d.ts +11 -0
- package/lib/definitions/ios-debugger-port-service.d.ts +29 -0
- package/lib/definitions/ios.d.ts +97 -0
- package/lib/definitions/ip-service.d.ts +10 -0
- package/lib/definitions/livesync-global.d.ts +7 -0
- package/lib/definitions/livesync.d.ts +601 -0
- package/lib/definitions/lock-service.d.ts +43 -0
- package/lib/definitions/log-parser-service.d.ts +14 -0
- package/lib/definitions/marking-mode-service.d.ts +11 -0
- package/lib/definitions/metadata-filtering-service.d.ts +48 -0
- package/lib/definitions/migrate.d.ts +46 -0
- package/lib/definitions/nativescript-dev-xcode.d.ts +87 -0
- package/lib/definitions/pacote-service.d.ts +50 -0
- package/lib/definitions/platform.d.ts +146 -0
- package/lib/definitions/plugins.d.ts +75 -0
- package/lib/definitions/prepare.d.ts +51 -0
- package/lib/definitions/project-changes.d.ts +34 -0
- package/lib/definitions/project.d.ts +858 -0
- package/lib/definitions/prompter.d.ts +27 -0
- package/lib/definitions/qr-code.d.ts +3 -0
- package/lib/definitions/require.d.ts +11 -0
- package/lib/definitions/run.d.ts +45 -0
- package/lib/definitions/start-service.d.ts +15 -0
- package/lib/definitions/subscription-service.d.ts +11 -0
- package/lib/definitions/system-warnings.d.ts +4 -0
- package/lib/definitions/temp-service.d.ts +9 -0
- package/lib/definitions/terminal-spinner-service.d.ts +12 -0
- package/lib/definitions/update.d.ts +16 -0
- package/lib/definitions/xcode.d.ts +12 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +62 -0
- package/lib/detached-processes/cleanup-process-definitions.d.ts +70 -0
- package/lib/detached-processes/cleanup-process.js +281 -0
- package/lib/detached-processes/detached-process-enums.d.ts +70 -0
- package/lib/detached-processes/file-log-service.js +20 -0
- package/lib/device-path-provider.js +60 -0
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +217 -0
- package/lib/device-sockets/ios/notification.js +30 -0
- package/lib/device-sockets/ios/socket-request-executor.js +56 -0
- package/lib/helpers/android-bundle-validator-helper.js +52 -0
- package/lib/helpers/deploy-command-helper.js +70 -0
- package/lib/helpers/key-command-helper.js +124 -0
- package/lib/helpers/livesync-command-helper.js +220 -0
- package/lib/helpers/network-connectivity-validator.js +47 -0
- package/lib/helpers/options-track-helper.js +88 -0
- package/lib/helpers/package-path-helper.js +6 -0
- package/lib/helpers/platform-command-helper.js +192 -0
- package/lib/helpers/version-validator-helper.js +25 -0
- package/lib/key-commands/bootstrap.js +21 -0
- package/lib/key-commands/index.js +456 -0
- package/lib/nativescript-cli-lib-bootstrap.js +8 -0
- package/lib/nativescript-cli-lib.js +5 -0
- package/lib/nativescript-cli.js +55 -0
- package/lib/node/pbxproj-dom-xcode.js +5 -0
- package/lib/node/xcode.js +7 -0
- package/lib/node-package-manager.js +156 -0
- package/lib/options.js +393 -0
- package/lib/package-installation-manager.js +221 -0
- package/lib/package-manager.js +184 -0
- package/lib/platform-command-param.js +29 -0
- package/lib/pnpm-package-manager.js +136 -0
- package/lib/project-data.js +237 -0
- package/lib/providers/project-files-provider.js +46 -0
- package/lib/resolvers/livesync-service-resolver.js +22 -0
- package/lib/services/analytics/analytics-broker-process.js +77 -0
- package/lib/services/analytics/analytics-broker.js +53 -0
- package/lib/services/analytics/analytics-service.js +366 -0
- package/lib/services/analytics/analytics.d.ts +55 -0
- package/lib/services/analytics/google-analytics-cross-client-custom-dimensions.d.ts +6 -0
- package/lib/services/analytics/google-analytics-provider.js +152 -0
- package/lib/services/analytics-settings-service.js +104 -0
- package/lib/services/android/android-bundle-tool-service.js +81 -0
- package/lib/services/android/gradle-build-args-service.js +87 -0
- package/lib/services/android/gradle-build-service.js +68 -0
- package/lib/services/android/gradle-command-service.js +49 -0
- package/lib/services/android-device-debug-service.js +173 -0
- package/lib/services/android-plugin-build-service.js +527 -0
- package/lib/services/android-project-service.js +600 -0
- package/lib/services/android-resources-migration-service.js +104 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +82 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +53 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +277 -0
- package/lib/services/apple-portal/definitions.d.ts +87 -0
- package/lib/services/assets-generation/assets-generation-service.js +178 -0
- package/lib/services/build-artifacts-service.js +113 -0
- package/lib/services/build-data-service.js +20 -0
- package/lib/services/build-info-file-service.js +79 -0
- package/lib/services/cleanup-service.js +194 -0
- package/lib/services/cocoapods-platform-manager.js +137 -0
- package/lib/services/cocoapods-service.js +354 -0
- package/lib/services/debug-data-service.js +21 -0
- package/lib/services/debug-service-base.js +44 -0
- package/lib/services/device/device-install-app-service.js +118 -0
- package/lib/services/doctor-service.js +294 -0
- package/lib/services/extensibility-service.js +220 -0
- package/lib/services/files-hash-service.js +79 -0
- package/lib/services/hmr-status-service.js +128 -0
- package/lib/services/info-service.js +14 -0
- package/lib/services/initialize-service.js +70 -0
- package/lib/services/ios/export-options-plist-service.js +131 -0
- package/lib/services/ios/ios-signing-service.js +265 -0
- package/lib/services/ios/spm-service.js +78 -0
- package/lib/services/ios/xcodebuild-args-service.js +163 -0
- package/lib/services/ios/xcodebuild-command-service.js +40 -0
- package/lib/services/ios/xcodebuild-service.js +93 -0
- package/lib/services/ios-debugger-port-service.js +140 -0
- package/lib/services/ios-device-debug-service.js +167 -0
- package/lib/services/ios-entitlements-service.js +78 -0
- package/lib/services/ios-extensions-service.js +63 -0
- package/lib/services/ios-log-filter.js +70 -0
- package/lib/services/ios-native-target-service.js +108 -0
- package/lib/services/ios-project-service.js +851 -0
- package/lib/services/ios-provision-service.js +173 -0
- package/lib/services/ios-watch-app-service.js +76 -0
- package/lib/services/ip-service.js +78 -0
- package/lib/services/itmstransporter-service.js +216 -0
- package/lib/services/karma-execution.js +16 -0
- package/lib/services/livesync/android-device-livesync-service-base.js +68 -0
- package/lib/services/livesync/android-device-livesync-service.js +203 -0
- package/lib/services/livesync/android-device-livesync-sockets-service.js +198 -0
- package/lib/services/livesync/android-livesync-service.js +76 -0
- package/lib/services/livesync/android-livesync-tool.js +427 -0
- package/lib/services/livesync/android-livesync-tool.md +211 -0
- package/lib/services/livesync/device-livesync-service-base.js +69 -0
- package/lib/services/livesync/ios-device-livesync-service.js +218 -0
- package/lib/services/livesync/ios-livesync-service.js +95 -0
- package/lib/services/livesync/livesync-socket.js +14 -0
- package/lib/services/livesync/platform-livesync-service-base.js +180 -0
- package/lib/services/livesync-process-data-service.js +43 -0
- package/lib/services/log-parser-service.js +52 -0
- package/lib/services/log-source-map-service.js +235 -0
- package/lib/services/marking-mode-service.js +56 -0
- package/lib/services/metadata-filtering-service.js +105 -0
- package/lib/services/npm-config-service.js +39 -0
- package/lib/services/pacote-service.js +109 -0
- package/lib/services/performance-service.js +92 -0
- package/lib/services/platform/add-platform-service.js +119 -0
- package/lib/services/platform/platform-validation-service.js +85 -0
- package/lib/services/platform/prepare-native-platform-service.js +87 -0
- package/lib/services/platform-environment-requirements.js +87 -0
- package/lib/services/platform-project-service-base.js +32 -0
- package/lib/services/platforms-data-service.js +31 -0
- package/lib/services/plugins-service.js +477 -0
- package/lib/services/prepare-data-service.js +21 -0
- package/lib/services/project-backup-service.js +114 -0
- package/lib/services/project-changes-service.js +274 -0
- package/lib/services/project-cleanup-service.js +102 -0
- package/lib/services/project-config-service.js +335 -0
- package/lib/services/project-data-service.js +478 -0
- package/lib/services/project-name-service.js +67 -0
- package/lib/services/project-service.js +204 -0
- package/lib/services/project-templates-service.js +114 -0
- package/lib/services/qr-code-terminal-service.js +20 -0
- package/lib/services/require-service.js +11 -0
- package/lib/services/start-service.js +116 -0
- package/lib/services/temp-service.js +36 -0
- package/lib/services/terminal-spinner-service.js +38 -0
- package/lib/services/test-execution-service.js +154 -0
- package/lib/services/test-initialization-service.js +54 -0
- package/lib/services/timeline-profiler-service.js +108 -0
- package/lib/services/user-settings-service.js +34 -0
- package/lib/services/versions-service.js +196 -0
- package/lib/services/watch-ignore-list-service.js +20 -0
- package/lib/services/webpack/webpack-compiler-service.js +405 -0
- package/lib/services/webpack/webpack.d.ts +227 -0
- package/lib/services/xcconfig-service.js +76 -0
- package/lib/services/xcproj-service.js +11 -0
- package/lib/shared-event-bus.js +7 -0
- package/lib/sys-info.js +120 -0
- package/lib/tools/config-manipulation/config-transformer.js +201 -0
- package/lib/tools/node-modules/node-modules-builder.js +42 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +100 -0
- package/lib/yarn-package-manager.js +134 -0
- package/lib/yarn2-package-manager.js +143 -0
- package/package.json +192 -0
- package/postinstall.js +10 -0
- package/preuninstall.js +14 -0
- package/resources/assets/image-definitions.json +655 -0
- package/resources/test/example.jasmine.js +6 -0
- package/resources/test/example.jasmine.ts +6 -0
- package/resources/test/example.mocha.js +9 -0
- package/resources/test/example.mocha.ts +9 -0
- package/resources/test/example.qunit.js +7 -0
- package/resources/test/example.qunit.ts +7 -0
- package/resources/test/karma.conf.js +93 -0
- package/resources/test/test-main.js +9 -0
- package/resources/test/test-main.ts +11 -0
- package/resources/test/tsconfig.spec.json +9 -0
- package/setup/mac-startup-shell-script.sh +2 -0
- package/vendor/aab-tool/LICENSE +202 -0
- package/vendor/aab-tool/README.txt +1 -0
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-app/app/build.gradle +1054 -0
- package/vendor/gradle-app/app/gradle-helpers/AnalyticsCollector.gradle +48 -0
- package/vendor/gradle-app/app/gradle-helpers/BuildToolTask.gradle +50 -0
- package/vendor/gradle-app/app/gradle-helpers/CustomExecutionLogger.gradle +52 -0
- package/vendor/gradle-app/build.gradle +170 -0
- package/vendor/gradle-app/settings.gradle +78 -0
- package/vendor/gradle-plugin/LICENSE +995 -0
- package/vendor/gradle-plugin/build.gradle +363 -0
- package/vendor/gradle-plugin/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/vendor/gradle-plugin/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/vendor/gradle-plugin/gradle.properties +6 -0
- package/vendor/gradle-plugin/gradlew +172 -0
- package/vendor/gradle-plugin/gradlew.bat +84 -0
- package/vendor/gradle-plugin/settings.gradle +45 -0
|
@@ -0,0 +1,1713 @@
|
|
|
1
|
+
import { IOptions } from "../declarations";
|
|
2
|
+
import { IJsonFileSettingsService } from "./definitions/json-file-settings-service";
|
|
3
|
+
import {
|
|
4
|
+
IEventActionData,
|
|
5
|
+
IGoogleAnalyticsData,
|
|
6
|
+
} from "./definitions/google-analytics";
|
|
7
|
+
import * as child_process from "child_process";
|
|
8
|
+
|
|
9
|
+
// tslint:disable-next-line:interface-name
|
|
10
|
+
interface Object {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface IStringDictionary extends IDictionary<string> {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Describes iTunes Connect application types
|
|
18
|
+
*/
|
|
19
|
+
// tslint:disable-next-line:interface-name
|
|
20
|
+
interface IiTunesConnectApplicationType {
|
|
21
|
+
/**
|
|
22
|
+
* Applications developed for iOS
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
iOS: string;
|
|
26
|
+
/**
|
|
27
|
+
* Applications developed for Mac OS
|
|
28
|
+
* @type {string}
|
|
29
|
+
*/
|
|
30
|
+
Mac: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Describes the types of data that can be send to Google Analytics.
|
|
35
|
+
* Their values are the names of the methods in universnal-analytics that have to be called to track this type of data.
|
|
36
|
+
* Also known as Hit Type: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#t
|
|
37
|
+
*/
|
|
38
|
+
declare const enum GoogleAnalyticsDataType {
|
|
39
|
+
Page = "pageview",
|
|
40
|
+
Event = "event",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Descibes iTunes Connect applications
|
|
45
|
+
*/
|
|
46
|
+
// tslint:disable-next-line:interface-name
|
|
47
|
+
interface IiTunesConnectApplication {
|
|
48
|
+
/**
|
|
49
|
+
* Unique Apple ID for each application. Automatically generated and assigned by Apple.
|
|
50
|
+
* @type {string}
|
|
51
|
+
*/
|
|
52
|
+
adamId: string;
|
|
53
|
+
/**
|
|
54
|
+
* No information available.
|
|
55
|
+
* @type {number}
|
|
56
|
+
*/
|
|
57
|
+
addOnCount: number;
|
|
58
|
+
/**
|
|
59
|
+
* The application's bundle identifier.
|
|
60
|
+
* @type {string}
|
|
61
|
+
*/
|
|
62
|
+
bundleId: string;
|
|
63
|
+
/**
|
|
64
|
+
* Application's name
|
|
65
|
+
* @type {string}
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* Application's stock keeping unit. User-defined unique string to keep track of the applications
|
|
70
|
+
* @type {string}
|
|
71
|
+
*/
|
|
72
|
+
sku: string;
|
|
73
|
+
/**
|
|
74
|
+
* Application's type
|
|
75
|
+
* @type {string}
|
|
76
|
+
*/
|
|
77
|
+
type: string;
|
|
78
|
+
/**
|
|
79
|
+
* Application's current version
|
|
80
|
+
* @type {string}
|
|
81
|
+
*/
|
|
82
|
+
version: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Describes configuration settings that modify the behavior of some methods.
|
|
87
|
+
*/
|
|
88
|
+
interface IConfigurationSettings {
|
|
89
|
+
/**
|
|
90
|
+
* This string will be used when constructing the UserAgent http header.
|
|
91
|
+
* @type {string}
|
|
92
|
+
*/
|
|
93
|
+
userAgentName?: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Describes the profile directory that will be used for various CLI settings, like user-settings.json file location, extensions, etc.
|
|
97
|
+
* @type {string}
|
|
98
|
+
*/
|
|
99
|
+
profileDir?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Describes service used to confugure various settings.
|
|
104
|
+
*/
|
|
105
|
+
interface ISettingsService {
|
|
106
|
+
/**
|
|
107
|
+
* Used to set various settings in order to modify the behavior of some methods.
|
|
108
|
+
* @param {IConfigurationSettings} settings Settings which will modify the behaviour of some methods.
|
|
109
|
+
* @returns {void}
|
|
110
|
+
*/
|
|
111
|
+
setSettings(settings: IConfigurationSettings): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns currently used profile directory.
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
getProfileDir(): string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Describes data returned from querying itunes' Content Delivery api
|
|
122
|
+
*/
|
|
123
|
+
interface IContentDeliveryBody {
|
|
124
|
+
/**
|
|
125
|
+
* Error object - likely present if result's Success is false.
|
|
126
|
+
*/
|
|
127
|
+
error?: Error;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Query results.
|
|
131
|
+
*/
|
|
132
|
+
result: {
|
|
133
|
+
/**
|
|
134
|
+
* A list of the user's applications.
|
|
135
|
+
* @type {IiTunesConnectApplication[]}
|
|
136
|
+
*/
|
|
137
|
+
Applications: IiTunesConnectApplication[];
|
|
138
|
+
/**
|
|
139
|
+
* Error code - likely present if Success is false.
|
|
140
|
+
* @type {number}
|
|
141
|
+
*/
|
|
142
|
+
ErrorCode?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Error message - likely present if Success is false.
|
|
145
|
+
* @type {string}
|
|
146
|
+
*/
|
|
147
|
+
ErrorMessage?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Error message - likely present if Success is false.
|
|
150
|
+
* @type {string[]}
|
|
151
|
+
*/
|
|
152
|
+
Errors?: string[];
|
|
153
|
+
/**
|
|
154
|
+
* Indication whether the query was a success or not.
|
|
155
|
+
* @type {boolean}
|
|
156
|
+
*/
|
|
157
|
+
Success: boolean;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare module Server {
|
|
162
|
+
interface IResponse {
|
|
163
|
+
response: any;
|
|
164
|
+
body?: any;
|
|
165
|
+
headers: any;
|
|
166
|
+
error?: Error;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface IHttpClient {
|
|
170
|
+
httpRequest(url: string): Promise<IResponse>;
|
|
171
|
+
httpRequest(
|
|
172
|
+
options: any,
|
|
173
|
+
proxySettings?: IProxySettings
|
|
174
|
+
): Promise<IResponse>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface IRequestResponseData {
|
|
178
|
+
statusCode: number;
|
|
179
|
+
headers: { [index: string]: any };
|
|
180
|
+
complete: boolean;
|
|
181
|
+
pipe(destination: any, options?: { end?: boolean }): IRequestResponseData;
|
|
182
|
+
on(event: string, listener: Function): void;
|
|
183
|
+
destroy(error?: Error): void;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface IDisposable {
|
|
188
|
+
dispose(): void;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
interface IShouldDispose {
|
|
192
|
+
shouldDispose: boolean;
|
|
193
|
+
setShouldDispose(shouldDispose: boolean): void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Describes the type of data sent to analytics service.
|
|
198
|
+
*/
|
|
199
|
+
declare const enum TrackingTypes {
|
|
200
|
+
/**
|
|
201
|
+
* Defines that the data contains information for initialization of a new Analytics monitor.
|
|
202
|
+
*/
|
|
203
|
+
Initialization = "initialization",
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Defines that the data contains exception that should be tracked.
|
|
207
|
+
*/
|
|
208
|
+
Exception = "exception",
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Defines that the data contains the answer of the question if user allows to be tracked.
|
|
212
|
+
*/
|
|
213
|
+
AcceptTrackFeatureUsage = "acceptTrackFeatureUsage",
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Defines data that will be tracked to Google Analytics.
|
|
217
|
+
*/
|
|
218
|
+
GoogleAnalyticsData = "googleAnalyticsData",
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Defines that the broker process should send all the pending information to Analytics.
|
|
222
|
+
* After that the process should send information it has finished tracking and die gracefully.
|
|
223
|
+
*/
|
|
224
|
+
FinishTracking = "FinishTracking",
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Describes the status of the current Analytics status, i.e. has the user allowed to be tracked.
|
|
229
|
+
*/
|
|
230
|
+
declare const enum AnalyticsStatus {
|
|
231
|
+
/**
|
|
232
|
+
* User has allowed to be tracked.
|
|
233
|
+
*/
|
|
234
|
+
enabled = "enabled",
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* User has declined to be tracked.
|
|
238
|
+
*/
|
|
239
|
+
disabled = "disabled",
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* User has not been asked to allow feature and error tracking.
|
|
243
|
+
*/
|
|
244
|
+
notConfirmed = "not confirmed",
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Describes types of options that manage -- flags.
|
|
249
|
+
*/
|
|
250
|
+
declare const enum OptionType {
|
|
251
|
+
/**
|
|
252
|
+
* String option
|
|
253
|
+
*/
|
|
254
|
+
String = "string",
|
|
255
|
+
/**
|
|
256
|
+
* Boolean option
|
|
257
|
+
*/
|
|
258
|
+
Boolean = "boolean",
|
|
259
|
+
/**
|
|
260
|
+
* Number option
|
|
261
|
+
*/
|
|
262
|
+
Number = "number",
|
|
263
|
+
/**
|
|
264
|
+
* Array option
|
|
265
|
+
*/
|
|
266
|
+
Array = "array",
|
|
267
|
+
/**
|
|
268
|
+
* Object option
|
|
269
|
+
*/
|
|
270
|
+
Object = "object",
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Describes options that can be passed to fs.readFile method.
|
|
275
|
+
*/
|
|
276
|
+
interface IReadFileOptions {
|
|
277
|
+
/**
|
|
278
|
+
* Defines the encoding. Defaults to null.
|
|
279
|
+
*/
|
|
280
|
+
encoding?: BufferEncoding | null;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Defines file flags. Defaults to "r".
|
|
284
|
+
*/
|
|
285
|
+
flag?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
interface IFileSystem {
|
|
289
|
+
zipFiles(
|
|
290
|
+
zipFile: string,
|
|
291
|
+
files: string[],
|
|
292
|
+
zipPathCallback: (path: string) => string
|
|
293
|
+
): Promise<void>;
|
|
294
|
+
unzip(
|
|
295
|
+
zipFile: string,
|
|
296
|
+
destinationDir: string,
|
|
297
|
+
options?: { overwriteExisitingFiles?: boolean; caseSensitive?: boolean },
|
|
298
|
+
fileFilters?: string[]
|
|
299
|
+
): Promise<void>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Test whether or not the given path exists by checking with the file system.
|
|
303
|
+
* @param {string} path Path to be checked.
|
|
304
|
+
* @returns {boolean} True if path exists, false otherwise.
|
|
305
|
+
*/
|
|
306
|
+
exists(path: string): boolean;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Deletes a file.
|
|
310
|
+
* @param {string} path Path to be deleted.
|
|
311
|
+
* @returns {void} undefined
|
|
312
|
+
*/
|
|
313
|
+
deleteFile(path: string): void;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Deletes whole directory.
|
|
317
|
+
* @param {string} directory Path to directory that has to be deleted.
|
|
318
|
+
* @returns {void}
|
|
319
|
+
*/
|
|
320
|
+
deleteDirectory(directory: string): void;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Deletes whole directory without throwing exceptions.
|
|
324
|
+
* @param {string} directory Path to directory that has to be deleted.
|
|
325
|
+
* @returns {void}
|
|
326
|
+
*/
|
|
327
|
+
deleteDirectorySafe(directory: string): void;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Returns the size of specified file.
|
|
331
|
+
* @param {string} path Path to file.
|
|
332
|
+
* @returns {number} File size in bytes.
|
|
333
|
+
*/
|
|
334
|
+
getFileSize(path: string): number;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Returns the size of specified path (recurses into all sub-directories if the path is a directory).
|
|
338
|
+
* @param {string} path Path to file or directory.
|
|
339
|
+
* @returns {number} File size in bytes.
|
|
340
|
+
*/
|
|
341
|
+
getSize(path: string): number;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Change file timestamps of the file referenced by the supplied path.
|
|
345
|
+
* @param {string} path File path
|
|
346
|
+
* @param {Date} atime Access time
|
|
347
|
+
* @param {Date} mtime Modified time
|
|
348
|
+
* @returns {void}
|
|
349
|
+
*/
|
|
350
|
+
utimes(path: string, atime: Date, mtime: Date): void;
|
|
351
|
+
|
|
352
|
+
futureFromEvent(
|
|
353
|
+
eventEmitter: NodeJS.EventEmitter,
|
|
354
|
+
event: string
|
|
355
|
+
): Promise<any>;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Create a new directory and any necessary subdirectories at specified location.
|
|
359
|
+
* @param {string} path Directory to be created.
|
|
360
|
+
* @returns {void}
|
|
361
|
+
*/
|
|
362
|
+
createDirectory(path: string): void;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Reads contents of directory and returns an array of filenames excluding '.' and '..'.
|
|
366
|
+
* @param {string} path Path to directory to be checked.
|
|
367
|
+
* @retruns {string[]} Array of filenames excluding '.' and '..'
|
|
368
|
+
*/
|
|
369
|
+
readDirectory(path: string): string[];
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Reads the entire contents of a file.
|
|
373
|
+
* @param {string} filename Path to the file that has to be read.
|
|
374
|
+
* @param {string} options Options used for reading the file - encoding and flags.
|
|
375
|
+
* @returns {string|Buffer} Content of the file as buffer. In case encoding is specified, the content is returned as string.
|
|
376
|
+
*/
|
|
377
|
+
readFile(filename: string, options?: IReadFileOptions): string | Buffer;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Reads the entire contents of a file and returns the result as string.
|
|
381
|
+
* @param {string} filename Path to the file that has to be read.
|
|
382
|
+
* @param {IReadFileOptions | string} encoding Options used for reading the file - encoding and flags. If options are not passed, utf8 is used.
|
|
383
|
+
* @returns {string} Content of the file as string.
|
|
384
|
+
*/
|
|
385
|
+
readText(filename: string, encoding?: IReadFileOptions | string): string;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Reads the entire content of a file and parses it to JSON object.
|
|
389
|
+
* @param {string} filename Path to the file that has to be read.
|
|
390
|
+
* @param {string} encoding File encoding, defaults to utf8.
|
|
391
|
+
* @returns {string} Content of the file as JSON object.
|
|
392
|
+
*/
|
|
393
|
+
readJson(filename: string, encoding?: string): any;
|
|
394
|
+
|
|
395
|
+
readStdin(): Promise<string>;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Writes data to a file, replacing the file if it already exists. data can be a string or a buffer.
|
|
399
|
+
* @param {string} filename Path to file to be created.
|
|
400
|
+
* @param {string | Buffer} data Data to be written to file.
|
|
401
|
+
* @param {string} encoding @optional File encoding, defaults to utf8.
|
|
402
|
+
* @returns {void}
|
|
403
|
+
*/
|
|
404
|
+
writeFile(filename: string, data: string | Buffer, encoding?: string): void;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Appends data to a file, creating the file if it does not yet exist. Data can be a string or a buffer.
|
|
408
|
+
* @param {string} filename Path to file to be created.
|
|
409
|
+
* @param {string | Buffer} data Data to be appended to file.
|
|
410
|
+
* @param {string} encoding @optional File encoding, defaults to utf8.
|
|
411
|
+
* @returns {void}
|
|
412
|
+
*/
|
|
413
|
+
appendFile(filename: string, data: string | Buffer, encoding?: string): void;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Writes JSON data to file.
|
|
417
|
+
* @param {string} filename Path to file to be created.
|
|
418
|
+
* @param {any} data JSON data to be written to file.
|
|
419
|
+
* @param {string} space Identation that will be used for the file.
|
|
420
|
+
* @param {string} encoding @optional File encoding, defaults to utf8.
|
|
421
|
+
* @returns {void}
|
|
422
|
+
*/
|
|
423
|
+
writeJson(
|
|
424
|
+
filename: string,
|
|
425
|
+
data: any,
|
|
426
|
+
space?: string,
|
|
427
|
+
encoding?: string
|
|
428
|
+
): void;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Copies a file.
|
|
432
|
+
* @param {string} sourceFileName The original file that has to be copied.
|
|
433
|
+
* @param {string} destinationFileName The filepath where the file should be copied.
|
|
434
|
+
* @returns {void}
|
|
435
|
+
*/
|
|
436
|
+
copyFile(sourceFileName: string, destinationFileName: string): void;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Returns unique file name based on the passed name by checkin if it exists and adding numbers to the passed name until a non-existent file is found.
|
|
440
|
+
* @param {string} baseName The name based on which the unique name will be generated.
|
|
441
|
+
* @returns {string} Unique filename. In case baseName does not exist, it will be returned.
|
|
442
|
+
*/
|
|
443
|
+
getUniqueFileName(baseName: string): string;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Checks if specified directory is empty.
|
|
447
|
+
* @param {string} directoryPath The directory that will be checked.
|
|
448
|
+
* @returns {boolean} True in case the directory is empty. False otherwise.
|
|
449
|
+
*/
|
|
450
|
+
isEmptyDir(directoryPath: string): boolean;
|
|
451
|
+
|
|
452
|
+
isRelativePath(
|
|
453
|
+
path: string
|
|
454
|
+
): boolean /* feels so lonely here, I don't have a Future */;
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Checks if directory exists and if not - creates it.
|
|
458
|
+
* @param {string} directoryPath Directory path.
|
|
459
|
+
* @returns {void}
|
|
460
|
+
*/
|
|
461
|
+
ensureDirectoryExists(directoryPath: string): void;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Renames file/directory. This method throws error in case the original file name does not exist.
|
|
465
|
+
* @param {string} oldPath The original filename.
|
|
466
|
+
* @param {string} newPath New filename.
|
|
467
|
+
* @returns {string} void.
|
|
468
|
+
*/
|
|
469
|
+
rename(oldPath: string, newPath: string): void;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Renames specified file to the specified name only in case it exists.
|
|
473
|
+
* Used to skip ENOENT errors when rename is called directly.
|
|
474
|
+
* @param {string} oldPath Path to original file that has to be renamed. If this file does not exists, no operation is executed.
|
|
475
|
+
* @param {string} newPath The path where the file will be moved.
|
|
476
|
+
* @return {boolean} True in case of successful rename. False in case the file does not exist.
|
|
477
|
+
*/
|
|
478
|
+
renameIfExists(oldPath: string, newPath: string): boolean;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Returns information about the specified file.
|
|
482
|
+
* In case the passed path is symlink, the returned information is about the original file.
|
|
483
|
+
* @param {string} path Path to file for which the information will be taken.
|
|
484
|
+
* @returns {IFsStats} Inforamation about the specified file.
|
|
485
|
+
*/
|
|
486
|
+
getFsStats(path: string): IFsStats;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Returns information about the specified file.
|
|
490
|
+
* In case the passed path is symlink, the returned information is about the symlink itself.
|
|
491
|
+
* @param {string} path Path to file for which the information will be taken.
|
|
492
|
+
* @returns {IFsStats} Inforamation about the specified file.
|
|
493
|
+
*/
|
|
494
|
+
getLsStats(path: string): IFsStats;
|
|
495
|
+
|
|
496
|
+
symlink(sourcePath: string, destinationPath: string, type: "file"): void;
|
|
497
|
+
symlink(sourcePath: string, destinationPath: string, type: "dir"): void;
|
|
498
|
+
symlink(sourcePath: string, destinationPath: string, type: "junction"): void;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Creates a symbolic link.
|
|
502
|
+
* Symbolic links are interpreted at run time as if the contents of the
|
|
503
|
+
* link had been substituted into the path being followed to find a file
|
|
504
|
+
* or directory.
|
|
505
|
+
* @param {string} sourcePath The original path of the file/dir.
|
|
506
|
+
* @param {string} destinationPath The destination where symlink will be created.
|
|
507
|
+
* @param {string} type "file", "dir" or "junction". Default is 'file'.
|
|
508
|
+
* Type option is only available on Windows (ignored on other platforms).
|
|
509
|
+
* Note that Windows junction points require the destination path to be absolute.
|
|
510
|
+
* When using 'junction', the target argument will automatically be normalized to absolute path.
|
|
511
|
+
* @returns {void}
|
|
512
|
+
*/
|
|
513
|
+
symlink(sourcePath: string, destinationPath: string, type?: string): void;
|
|
514
|
+
|
|
515
|
+
createReadStream(
|
|
516
|
+
path: string,
|
|
517
|
+
options?: {
|
|
518
|
+
flags?: string;
|
|
519
|
+
encoding?: string;
|
|
520
|
+
fd?: number;
|
|
521
|
+
mode?: number;
|
|
522
|
+
bufferSize?: number;
|
|
523
|
+
start?: number;
|
|
524
|
+
end?: number;
|
|
525
|
+
highWaterMark?: number;
|
|
526
|
+
}
|
|
527
|
+
): NodeJS.ReadableStream;
|
|
528
|
+
createWriteStream(
|
|
529
|
+
path: string,
|
|
530
|
+
options?: {
|
|
531
|
+
flags?: string;
|
|
532
|
+
encoding?: string;
|
|
533
|
+
string?: string;
|
|
534
|
+
}
|
|
535
|
+
): any;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Changes file mode of the specified file. In case it is a symlink, the original file's mode is modified.
|
|
539
|
+
* @param {string} path Filepath to be modified.
|
|
540
|
+
* @param {number | string} mode File mode.
|
|
541
|
+
* @returns {void}
|
|
542
|
+
*/
|
|
543
|
+
chmod(path: string, mode: number | string): void;
|
|
544
|
+
|
|
545
|
+
setCurrentUserAsOwner(path: string, owner: string): Promise<void>;
|
|
546
|
+
enumerateFilesInDirectorySync(
|
|
547
|
+
directoryPath: string,
|
|
548
|
+
filterCallback?: (file: string, stat: IFsStats) => boolean,
|
|
549
|
+
opts?: { enumerateDirectories?: boolean; includeEmptyDirectories?: boolean }
|
|
550
|
+
): string[];
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Hashes a file's contents.
|
|
554
|
+
* @param {string} fileName Path to file
|
|
555
|
+
* @param {Object} options algorithm and digest encoding. Default values are sha1 for algorithm and hex for encoding
|
|
556
|
+
* @return {Promise<string>} The computed shasum
|
|
557
|
+
*/
|
|
558
|
+
getFileShasum(
|
|
559
|
+
fileName: string,
|
|
560
|
+
options?: { algorithm?: string; encoding?: "hex" | "base64" }
|
|
561
|
+
): Promise<string>;
|
|
562
|
+
|
|
563
|
+
// shell.js wrappers
|
|
564
|
+
/**
|
|
565
|
+
* @param {string} options Options, can be undefined or a combination of "-r" (recursive) and "-f" (force)
|
|
566
|
+
* @param {string[]} files files and direcories to delete
|
|
567
|
+
*/
|
|
568
|
+
rm(options: string, ...files: string[]): void;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Deletes all empty parent directories.
|
|
572
|
+
* @param {string} directory The directory from which this method will start looking for empty parents.
|
|
573
|
+
* @returns {void}
|
|
574
|
+
*/
|
|
575
|
+
deleteEmptyParents(directory: string): void;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Return the canonicalized absolute pathname.
|
|
579
|
+
* NOTE: The method accepts second argument, but it's type and usage is different in Node 4 and Node 6. Once we drop support for Node 4, we can use the second argument as well.
|
|
580
|
+
* @param {string} filePath Path to file which should be resolved.
|
|
581
|
+
* @returns {string} The canonicalized absolute path to file.
|
|
582
|
+
*/
|
|
583
|
+
realpath(filePath: string): string;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// duplicated from fs.Stats, because I cannot import it here
|
|
587
|
+
interface IFsStats {
|
|
588
|
+
isFile(): boolean;
|
|
589
|
+
isDirectory(): boolean;
|
|
590
|
+
isBlockDevice(): boolean;
|
|
591
|
+
isCharacterDevice(): boolean;
|
|
592
|
+
isSymbolicLink(): boolean;
|
|
593
|
+
isFIFO(): boolean;
|
|
594
|
+
isSocket(): boolean;
|
|
595
|
+
dev: number;
|
|
596
|
+
ino: number;
|
|
597
|
+
mode: number;
|
|
598
|
+
nlink: number;
|
|
599
|
+
uid: number;
|
|
600
|
+
gid: number;
|
|
601
|
+
rdev: number;
|
|
602
|
+
size: number;
|
|
603
|
+
blksize: number;
|
|
604
|
+
blocks: number;
|
|
605
|
+
atime: Date;
|
|
606
|
+
mtime: Date;
|
|
607
|
+
ctime: Date;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
interface IOpener {
|
|
611
|
+
open(filename: string, appname?: string): void;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
interface IErrors {
|
|
615
|
+
fail(formatStr: string, ...args: any[]): never;
|
|
616
|
+
fail(opts: IFailOptions, ...args: any[]): never;
|
|
617
|
+
/**
|
|
618
|
+
* @deprecated: use `fail` instead
|
|
619
|
+
*/
|
|
620
|
+
failWithoutHelp(message: string, ...args: any[]): never;
|
|
621
|
+
/**
|
|
622
|
+
* @deprecated: use `fail` instead
|
|
623
|
+
*/
|
|
624
|
+
failWithoutHelp(opts: IFailOptions, ...args: any[]): never;
|
|
625
|
+
failWithHelp(formatStr: string, ...args: any[]): never;
|
|
626
|
+
failWithHelp(opts: IFailOptions, ...args: any[]): never;
|
|
627
|
+
beginCommand(
|
|
628
|
+
action: () => Promise<boolean>,
|
|
629
|
+
printCommandHelp: () => Promise<void>
|
|
630
|
+
): Promise<boolean>;
|
|
631
|
+
verifyHeap(message: string): void;
|
|
632
|
+
printCallStack: boolean;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
interface IFailOptions {
|
|
636
|
+
name?: string;
|
|
637
|
+
formatStr?: string;
|
|
638
|
+
errorCode?: number;
|
|
639
|
+
proxyAuthenticationRequired?: boolean;
|
|
640
|
+
printOnStdout?: boolean;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Describes error raised when making http requests.
|
|
645
|
+
*/
|
|
646
|
+
interface IHttpRequestError extends Error {
|
|
647
|
+
/**
|
|
648
|
+
* Defines if the error is caused by the proxy requiring authentication.
|
|
649
|
+
*/
|
|
650
|
+
proxyAuthenticationRequired: boolean;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
interface ICommandOptions {
|
|
654
|
+
disableAnalytics?: boolean;
|
|
655
|
+
enableHooks?: boolean;
|
|
656
|
+
disableCommandHelpSuggestion?: boolean;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
declare const enum ErrorCodes {
|
|
660
|
+
UNCAUGHT = 120,
|
|
661
|
+
UNKNOWN = 127,
|
|
662
|
+
INVALID_ARGUMENT = 128,
|
|
663
|
+
RESOURCE_PROBLEM = 129,
|
|
664
|
+
KARMA_FAIL = 130,
|
|
665
|
+
UNHANDLED_REJECTION_FAILURE = 131,
|
|
666
|
+
DELETED_KILL_FILE = 132,
|
|
667
|
+
TESTS_INIT_REQUIRED = 133,
|
|
668
|
+
ALL_DEVICES_DISCONNECTED = 134,
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
interface IFutureDispatcher {
|
|
672
|
+
run(): void;
|
|
673
|
+
dispatch(action: () => Promise<void>): void;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
interface ICommandDispatcher {
|
|
677
|
+
dispatchCommand(): Promise<void>;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
interface ICancellationService extends IDisposable {
|
|
681
|
+
begin(name: string): Promise<void>;
|
|
682
|
+
end(name: string): void;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
interface IQueue<T> {
|
|
686
|
+
enqueue(item: T): void;
|
|
687
|
+
dequeue(): Promise<T>;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
interface IChildProcess extends NodeJS.EventEmitter {
|
|
691
|
+
exec(
|
|
692
|
+
command: string,
|
|
693
|
+
options?: any,
|
|
694
|
+
execOptions?: IExecOptions
|
|
695
|
+
): Promise<any>;
|
|
696
|
+
execFile<T>(command: string, args: string[]): Promise<T>;
|
|
697
|
+
spawn(
|
|
698
|
+
command: string,
|
|
699
|
+
args?: string[],
|
|
700
|
+
options?: any
|
|
701
|
+
): child_process.ChildProcess; // it returns child_process.ChildProcess you can safely cast to it
|
|
702
|
+
spawnFromEvent(
|
|
703
|
+
command: string,
|
|
704
|
+
args: string[],
|
|
705
|
+
event: string,
|
|
706
|
+
options?: any,
|
|
707
|
+
spawnFromEventOptions?: ISpawnFromEventOptions
|
|
708
|
+
): Promise<ISpawnResult>;
|
|
709
|
+
trySpawnFromCloseEvent(
|
|
710
|
+
command: string,
|
|
711
|
+
args: string[],
|
|
712
|
+
options?: any,
|
|
713
|
+
spawnFromEventOptions?: ISpawnFromEventOptions
|
|
714
|
+
): Promise<ISpawnResult>;
|
|
715
|
+
tryExecuteApplication(
|
|
716
|
+
command: string,
|
|
717
|
+
args: string[],
|
|
718
|
+
event: string,
|
|
719
|
+
errorMessage: string,
|
|
720
|
+
condition?: (childProcess: any) => boolean
|
|
721
|
+
): Promise<any>;
|
|
722
|
+
/**
|
|
723
|
+
* This is a special case of the child_process.spawn() functionality for spawning Node.js processes.
|
|
724
|
+
* In addition to having all the methods in a normal ChildProcess instance, the returned object has a communication channel built-in.
|
|
725
|
+
* Note: Unlike the fork() POSIX system call, child_process.fork() does not clone the current process.
|
|
726
|
+
* @param {string} modulePath String The module to run in the child
|
|
727
|
+
* @param {string[]} args Array List of string arguments You can access them in the child with 'process.argv'.
|
|
728
|
+
* @param {string} options Object
|
|
729
|
+
* @return {child_process} ChildProcess object.
|
|
730
|
+
*/
|
|
731
|
+
fork(
|
|
732
|
+
modulePath: string,
|
|
733
|
+
args?: string[],
|
|
734
|
+
options?: {
|
|
735
|
+
cwd?: string;
|
|
736
|
+
env?: any;
|
|
737
|
+
execPath?: string;
|
|
738
|
+
execArgv?: string[];
|
|
739
|
+
silent?: boolean;
|
|
740
|
+
uid?: number;
|
|
741
|
+
gid?: number;
|
|
742
|
+
}
|
|
743
|
+
): any;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
interface IExecOptions {
|
|
747
|
+
showStderr: boolean;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
interface ISpawnResult {
|
|
751
|
+
stderr: string;
|
|
752
|
+
stdout: string;
|
|
753
|
+
exitCode: number;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
interface ISpawnFromEventOptions {
|
|
757
|
+
throwError: boolean;
|
|
758
|
+
emitOptions?: {
|
|
759
|
+
eventName: string;
|
|
760
|
+
};
|
|
761
|
+
timeout?: number;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
interface IProjectDir {
|
|
765
|
+
projectDir: string;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
interface IProjectHelper extends IProjectDir {
|
|
769
|
+
generateDefaultAppId(appName: string, baseAppId: string): string;
|
|
770
|
+
sanitizeName(appName: string): string;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
interface IDictionary<T> {
|
|
774
|
+
[key: string]: T;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
interface IAnalyticsService {
|
|
778
|
+
checkConsent(): Promise<void>;
|
|
779
|
+
trackException(exception: any, message: string): Promise<void>;
|
|
780
|
+
setStatus(settingName: string, enabled: boolean): Promise<void>;
|
|
781
|
+
getStatusMessage(
|
|
782
|
+
settingName: string,
|
|
783
|
+
jsonFormat: boolean,
|
|
784
|
+
readableSettingName: string
|
|
785
|
+
): Promise<string>;
|
|
786
|
+
isEnabled(settingName: string): Promise<boolean>;
|
|
787
|
+
finishTracking(): Promise<void>;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Tracks the answer of question if user allows to be tracked.
|
|
791
|
+
* @param {{ acceptTrackFeatureUsage: boolean }} settings Object containing information about user's answer.
|
|
792
|
+
* @return {Promise<void>}
|
|
793
|
+
*/
|
|
794
|
+
trackAcceptFeatureUsage(settings: {
|
|
795
|
+
acceptTrackFeatureUsage: boolean;
|
|
796
|
+
}): Promise<void>;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Tracks data to Google Analytics project.
|
|
800
|
+
* @param {IGoogleAnalyticsData} data DTO describing the data that should be tracked.
|
|
801
|
+
* @return {Promise<void>}
|
|
802
|
+
*/
|
|
803
|
+
trackInGoogleAnalytics(data: IGoogleAnalyticsData): Promise<void>;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Tracks event action in Google Analytics project.
|
|
807
|
+
* @param {IEventActionData} data DTO describing information for the event.
|
|
808
|
+
* @return {Promise<void>}
|
|
809
|
+
*/
|
|
810
|
+
trackEventActionInGoogleAnalytics(data: IEventActionData): Promise<void>;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Defines if the instance should be disposed.
|
|
814
|
+
* @param {boolean} shouldDispose Defines if the instance should be disposed and the child processes should be disconnected.
|
|
815
|
+
* @returns {void}
|
|
816
|
+
*/
|
|
817
|
+
setShouldDispose(shouldDispose: boolean): void;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
interface IAllowEmpty {
|
|
821
|
+
allowEmpty?: boolean;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
interface IPrompterOptions extends IAllowEmpty {
|
|
825
|
+
defaultAction?: () => string;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
type IPrompterAnswers<T extends string = string> = { [id in T]: any };
|
|
829
|
+
|
|
830
|
+
interface IPrompterQuestion<
|
|
831
|
+
T extends IPrompterAnswers<any> = IPrompterAnswers<any>
|
|
832
|
+
> {
|
|
833
|
+
type?: string;
|
|
834
|
+
name?: string;
|
|
835
|
+
message?: string;
|
|
836
|
+
default?: any;
|
|
837
|
+
prefix?: string;
|
|
838
|
+
suffix?: string;
|
|
839
|
+
filter?(input: any, answers: T): any;
|
|
840
|
+
validate?(
|
|
841
|
+
input: any,
|
|
842
|
+
answers?: T
|
|
843
|
+
): boolean | string | Promise<boolean | string>;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
interface IAnalyticsSettingsService {
|
|
847
|
+
canDoRequest(): Promise<boolean>;
|
|
848
|
+
getUserId(): Promise<string>;
|
|
849
|
+
getClientName(): string;
|
|
850
|
+
/**
|
|
851
|
+
* Gets current user sessions count.
|
|
852
|
+
* @param {string} projectName The analytics project id for which the counter should be taken.
|
|
853
|
+
* @return {number} Number of user sessions.
|
|
854
|
+
*/
|
|
855
|
+
getUserSessionsCount(projectName: string): Promise<number>;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Set the number of user sessions.
|
|
859
|
+
* @param {number} count The number that will be set for user sessions.
|
|
860
|
+
* @param {string} projectName The analytics project id for which the counter should be set.
|
|
861
|
+
* @return {Promise<void>}
|
|
862
|
+
*/
|
|
863
|
+
setUserSessionsCount(count: number, projectName: string): Promise<void>;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Gets the unique client identifier (AnalyticsInstallationId). In case it does not exist - set it to new value and return it.
|
|
867
|
+
* @returns {Promise<string>}
|
|
868
|
+
*/
|
|
869
|
+
getClientId(): Promise<string>;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Gets user agent string identifing the current system in the following format: `${identifier} (${systemInfo}) ${osArch}`
|
|
873
|
+
* @param {string} identifier The product identifier.
|
|
874
|
+
* @returns {string} The user agent string.
|
|
875
|
+
*/
|
|
876
|
+
getUserAgentString(identifier: string): string;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
interface IAutoCompletionService {
|
|
880
|
+
/**
|
|
881
|
+
* Enables command line autocompletion by creating a `.<cliname>rc` file and sourcing it in all profiles (.bash_profile, .bashrc, etc.).
|
|
882
|
+
* @returns {Promise<void>}
|
|
883
|
+
*/
|
|
884
|
+
enableAutoCompletion(): Promise<void>;
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Disables auto completion by removing the entries from all profiles.
|
|
888
|
+
* @returns {void}
|
|
889
|
+
*/
|
|
890
|
+
disableAutoCompletion(): void;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Checks if autocompletion is enabled.
|
|
894
|
+
* @returns {boolean} true in case autocompletion is enabled in any file. false otherwise.
|
|
895
|
+
*/
|
|
896
|
+
isAutoCompletionEnabled(): boolean;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Checks if obsolete autocompletion code exists in any profile file.
|
|
900
|
+
* @returns {boolean} true in case there's some old code in any profile file. false otherwise.
|
|
901
|
+
*/
|
|
902
|
+
isObsoleteAutoCompletionEnabled(): boolean;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
interface IHooksService {
|
|
906
|
+
hookArgsName: string;
|
|
907
|
+
executeBeforeHooks(
|
|
908
|
+
commandName: string,
|
|
909
|
+
hookArguments?: IDictionary<any>
|
|
910
|
+
): Promise<void>;
|
|
911
|
+
executeAfterHooks(
|
|
912
|
+
commandName: string,
|
|
913
|
+
hookArguments?: IDictionary<any>
|
|
914
|
+
): Promise<void>;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
interface IHook {
|
|
918
|
+
name: string;
|
|
919
|
+
fullPath: string;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Describes standard username/password type credentials.
|
|
924
|
+
*/
|
|
925
|
+
interface ICredentials {
|
|
926
|
+
username: string;
|
|
927
|
+
password: string;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
interface IRejectUnauthorized {
|
|
931
|
+
/**
|
|
932
|
+
* Defines if NODE_TLS_REJECT_UNAUTHORIZED should be set to true or false. Default value is true.
|
|
933
|
+
*/
|
|
934
|
+
rejectUnauthorized: boolean;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Proxy settings required for http request.
|
|
939
|
+
*/
|
|
940
|
+
interface IProxySettings
|
|
941
|
+
extends IRejectUnauthorized,
|
|
942
|
+
ICredentials,
|
|
943
|
+
IProxySettingsBase {
|
|
944
|
+
/**
|
|
945
|
+
* Hostname of the machine used for proxy.
|
|
946
|
+
*/
|
|
947
|
+
hostname: string;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Port of the machine used for proxy that allows connections.
|
|
951
|
+
*/
|
|
952
|
+
port: string;
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Protocol of the proxy - http or https
|
|
956
|
+
*/
|
|
957
|
+
protocol?: string;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
interface IProxySettingsBase {
|
|
961
|
+
/**
|
|
962
|
+
* The url that should be passed to the request module in order to use the proxy.
|
|
963
|
+
* As request expects the property to be called `proxy` reuse the same name, so the IProxySettings object can be passed directly to request.
|
|
964
|
+
*/
|
|
965
|
+
proxy?: string;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
interface IProxyLibSettings extends IRejectUnauthorized, ICredentials {
|
|
969
|
+
proxyUrl: string;
|
|
970
|
+
credentialsKey?: string;
|
|
971
|
+
userSpecifiedSettingsFilePath?: string;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Describes Service used for interaction with the proxy cache.
|
|
976
|
+
*/
|
|
977
|
+
interface IProxyService {
|
|
978
|
+
/**
|
|
979
|
+
* Caches proxy data.
|
|
980
|
+
* @param {IProxyLibSettings} settings Data to be cached.
|
|
981
|
+
* @returns {Promise<void>} The cache.
|
|
982
|
+
*/
|
|
983
|
+
setCache(settings: IProxyLibSettings): Promise<void>;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Retrieves proxy cache data.
|
|
987
|
+
* @returns {Promise<IProxySettings>} Proxy data.
|
|
988
|
+
*/
|
|
989
|
+
getCache(): Promise<IProxySettings>;
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Clears proxy cache data.
|
|
993
|
+
* @returns {Promise<void>}
|
|
994
|
+
*/
|
|
995
|
+
clearCache(): Promise<void>;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Gets info about the proxy that can be printed and shown to the user.
|
|
999
|
+
* @returns {Promise<string>} Info about the proxy.
|
|
1000
|
+
*/
|
|
1001
|
+
getInfo(): Promise<string>;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
interface IQrCodeGenerator {
|
|
1005
|
+
generateDataUri(data: string): Promise<string>;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
interface IQrCodeImageData {
|
|
1009
|
+
/**
|
|
1010
|
+
* The original URL used for generating QR code image.
|
|
1011
|
+
*/
|
|
1012
|
+
originalUrl: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* The shorten URL used for generating QR code image.
|
|
1015
|
+
*/
|
|
1016
|
+
shortenUrl: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* Base64 encoded data used for generating QR code image.
|
|
1019
|
+
*/
|
|
1020
|
+
imageData: string;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
interface IMicroTemplateService {
|
|
1024
|
+
parseContent(data: string, options: { isHtml: boolean }): Promise<string>;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
interface IHelpService {
|
|
1028
|
+
generateHtmlPages(): Promise<void>;
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Finds the html help for specified command and opens it in the browser.
|
|
1032
|
+
* @param {ICommandData} commandData Data describing searched command - name and arguments.
|
|
1033
|
+
* @returns {Promise<void>}
|
|
1034
|
+
*/
|
|
1035
|
+
openHelpForCommandInBrowser(commandData: ICommandData): Promise<void>;
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Shows command line help for specified command.
|
|
1039
|
+
* @param {string} commandData The name of the command for which to show the help.
|
|
1040
|
+
* @returns {Promise<void>}
|
|
1041
|
+
*/
|
|
1042
|
+
showCommandLineHelp(commandData: ICommandData): Promise<void>;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Used to talk to xcode-select command-line tool.
|
|
1047
|
+
*/
|
|
1048
|
+
interface IXcodeSelectService {
|
|
1049
|
+
/**
|
|
1050
|
+
* Get the path to Contents directory inside Xcode.app.
|
|
1051
|
+
* With a default installation this path is /Applications/Xcode.app/Contents
|
|
1052
|
+
* @return {Promise<string>}
|
|
1053
|
+
*/
|
|
1054
|
+
getContentsDirectoryPath(): Promise<string>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Get the path to Developer directory inside Xcode.app.
|
|
1057
|
+
* With a default installation this path is /Applications/Xcode.app/Contents/Developer/
|
|
1058
|
+
* @return {Promise<string>}
|
|
1059
|
+
*/
|
|
1060
|
+
getDeveloperDirectoryPath(): Promise<string>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Get version of the currently used Xcode.
|
|
1063
|
+
* @return {Promise<IVersionData>}
|
|
1064
|
+
*/
|
|
1065
|
+
getXcodeVersion(): Promise<IVersionData>;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
interface IPlatform {
|
|
1069
|
+
platform: string;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
interface ISystemWarning {
|
|
1073
|
+
message: string;
|
|
1074
|
+
severity: SystemWarningsSeverity;
|
|
1075
|
+
toString?: () => string;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
interface ISysInfo {
|
|
1079
|
+
getSysInfo(
|
|
1080
|
+
config?: NativeScriptDoctor.ISysInfoConfig
|
|
1081
|
+
): Promise<NativeScriptDoctor.ISysInfoData>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Returns the currently installed version of Xcode.
|
|
1084
|
+
* @return {Promise<string>} Returns the currently installed version of Xcode or null if Xcode is not installed or executed on Linux or Windows.
|
|
1085
|
+
*/
|
|
1086
|
+
getXcodeVersion(): Promise<string>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Returns the currently installed Java path based on JAVA_HOME and PATH..
|
|
1089
|
+
* @return {Promise<string>} The currently installed Java path.
|
|
1090
|
+
*/
|
|
1091
|
+
getJavaPath(): Promise<string>;
|
|
1092
|
+
/**
|
|
1093
|
+
* Returns the currently installed Cocoapods version.
|
|
1094
|
+
* @return {Promise<string>} Returns the currently installed Cocoapods version. It will return null if Cocoapods is not installed.
|
|
1095
|
+
*/
|
|
1096
|
+
getCocoaPodsVersion(): Promise<string>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Returns the currently installed Java compiler version.
|
|
1099
|
+
* @return {Promise<string>} The currently installed Java compiler version.
|
|
1100
|
+
*/
|
|
1101
|
+
getJavaCompilerVersion(): Promise<string>;
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Gets JAVA version based on the executable in PATH.
|
|
1105
|
+
* @return {Promise<string>}
|
|
1106
|
+
*/
|
|
1107
|
+
getJavaVersionFromPath(): Promise<string>;
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Gets JAVA version based on the JAVA from JAVA_HOME.
|
|
1111
|
+
* @return {Promise<string>}
|
|
1112
|
+
*/
|
|
1113
|
+
getJavaVersionFromJavaHome(): Promise<string>;
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Gets all global warnings for the current environment, for example Node.js version compatibility, OS compatibility, etc.
|
|
1117
|
+
* @return {Promise<ISystemWarning[]>} All warnings. Empty array is returned in case the system is setup correctly.
|
|
1118
|
+
*/
|
|
1119
|
+
getSystemWarnings(): Promise<ISystemWarning[]>;
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Gets warning message for current macOS version.
|
|
1123
|
+
* @return {Promise<string>} Message in case the current macOS version is deprecated, null otherwise.
|
|
1124
|
+
*/
|
|
1125
|
+
getMacOSWarningMessage(): Promise<ISystemWarning>;
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Returns the value of engines.node key from CLI's package.json file.
|
|
1129
|
+
* @return {string} The range of supported Node.js versions.
|
|
1130
|
+
*/
|
|
1131
|
+
getSupportedNodeVersionRange(): string;
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Gets warning message in case the currently installed Xcode will not be supported in next versions
|
|
1135
|
+
* @returns {string}
|
|
1136
|
+
*/
|
|
1137
|
+
getXcodeWarning(): Promise<string>;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
interface IHostInfo {
|
|
1141
|
+
isWindows: boolean;
|
|
1142
|
+
isWindows64: boolean;
|
|
1143
|
+
isWindows32: boolean;
|
|
1144
|
+
isDarwin: boolean;
|
|
1145
|
+
isLinux: boolean;
|
|
1146
|
+
isLinux64: boolean;
|
|
1147
|
+
dotNetVersion(): Promise<string>;
|
|
1148
|
+
isDotNet40Installed(message: string): Promise<boolean>;
|
|
1149
|
+
getMacOSVersion(): Promise<string>;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
// tslint:disable-next-line:interface-name
|
|
1153
|
+
interface GenericFunction<T> extends Function {
|
|
1154
|
+
(...args: any[]): T;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
declare global {
|
|
1158
|
+
// tslint:disable-next-line:interface-name
|
|
1159
|
+
interface Function {
|
|
1160
|
+
$inject: {
|
|
1161
|
+
args: string[];
|
|
1162
|
+
name: string;
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* Extends Nodejs' Error interface.
|
|
1168
|
+
* The native interface already has name and message properties
|
|
1169
|
+
*/
|
|
1170
|
+
// tslint:disable-next-line:interface-name
|
|
1171
|
+
interface Error {
|
|
1172
|
+
/**
|
|
1173
|
+
* Error's stack trace
|
|
1174
|
+
* @type {string}
|
|
1175
|
+
*/
|
|
1176
|
+
stack?: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Error's code - could be a string ('ENOENT'), as well as a number (127)
|
|
1179
|
+
* @type {string|number}
|
|
1180
|
+
*/
|
|
1181
|
+
code?: string | number;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
interface IRelease {
|
|
1186
|
+
release: boolean;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
interface IDeviceIdentifier {
|
|
1190
|
+
device: string;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
interface IJustLaunch {
|
|
1194
|
+
justlaunch: boolean;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
interface IAvd {
|
|
1198
|
+
avd: string;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
interface IAvailableDevices {
|
|
1202
|
+
availableDevices: boolean;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
interface IProfileDir {
|
|
1206
|
+
profileDir: string;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
interface IHasEmulatorOption {
|
|
1210
|
+
emulator: boolean;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
interface IYargArgv extends IDictionary<any> {
|
|
1214
|
+
_: string[];
|
|
1215
|
+
$0: string;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Describes dashed option (starting with --) passed on the command line.
|
|
1220
|
+
* @interface
|
|
1221
|
+
*/
|
|
1222
|
+
interface IDashedOption {
|
|
1223
|
+
/**
|
|
1224
|
+
* Type of the option. It can be string, boolean, Array, etc.
|
|
1225
|
+
*/
|
|
1226
|
+
type: string;
|
|
1227
|
+
/**
|
|
1228
|
+
* Option has sensitive value
|
|
1229
|
+
*/
|
|
1230
|
+
hasSensitiveValue: boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* Shorthand option passed on the command line with `-` sign, for example `-v`
|
|
1233
|
+
*/
|
|
1234
|
+
alias?: any;
|
|
1235
|
+
/**
|
|
1236
|
+
* Defines if the options is mandatory or the number of mandatory arguments.
|
|
1237
|
+
*/
|
|
1238
|
+
demand?: any;
|
|
1239
|
+
/**
|
|
1240
|
+
* @see demand
|
|
1241
|
+
*/
|
|
1242
|
+
required?: any;
|
|
1243
|
+
/**
|
|
1244
|
+
* @see demand
|
|
1245
|
+
*/
|
|
1246
|
+
require?: any;
|
|
1247
|
+
/**
|
|
1248
|
+
* Sets default value of the -- option if it is NOT passed on the command line.
|
|
1249
|
+
*/
|
|
1250
|
+
default?: any;
|
|
1251
|
+
/**
|
|
1252
|
+
* Interpret the value as boolean, even if value is passed for it.
|
|
1253
|
+
*/
|
|
1254
|
+
boolean?: any;
|
|
1255
|
+
/**
|
|
1256
|
+
* Interpret the value as string, especially useful when you have to preserve numbers leading zeroes.
|
|
1257
|
+
*/
|
|
1258
|
+
string?: any;
|
|
1259
|
+
/**
|
|
1260
|
+
* Returns the count of the dashed options passed on the command line.
|
|
1261
|
+
*/
|
|
1262
|
+
count?: any;
|
|
1263
|
+
/**
|
|
1264
|
+
* Describes the usage of option.
|
|
1265
|
+
*/
|
|
1266
|
+
describe?: any;
|
|
1267
|
+
/**
|
|
1268
|
+
* No information about this option. Keep it here for backwards compatibility, but use describe instead.
|
|
1269
|
+
*/
|
|
1270
|
+
description?: any;
|
|
1271
|
+
/**
|
|
1272
|
+
* @see describe
|
|
1273
|
+
*/
|
|
1274
|
+
desc?: any;
|
|
1275
|
+
/**
|
|
1276
|
+
* Specifies either a single option key (string), or an array of options that must be followed by option values.
|
|
1277
|
+
*/
|
|
1278
|
+
requiresArg?: any;
|
|
1279
|
+
|
|
1280
|
+
/**
|
|
1281
|
+
* Set to true to define the option as an array option https://github.com/yargs/yargs/blob/main/docs/api.md#array
|
|
1282
|
+
*/
|
|
1283
|
+
array?: any;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Verifies the host OS configuration and prints warnings to the users
|
|
1288
|
+
* Code behind of the "doctor" command
|
|
1289
|
+
* @interface
|
|
1290
|
+
*/
|
|
1291
|
+
interface IDoctorService {
|
|
1292
|
+
/**
|
|
1293
|
+
* Verifies the host OS configuration and prints warnings to the users
|
|
1294
|
+
* @param configOptions: defines if the result should be tracked by Analytics
|
|
1295
|
+
* @returns {Promise<void>}
|
|
1296
|
+
*/
|
|
1297
|
+
printWarnings(configOptions?: {
|
|
1298
|
+
trackResult?: boolean;
|
|
1299
|
+
projectDir?: string;
|
|
1300
|
+
runtimeVersion?: string;
|
|
1301
|
+
options?: IOptions;
|
|
1302
|
+
forceCheck?: boolean;
|
|
1303
|
+
platform?: string;
|
|
1304
|
+
}): Promise<void>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Runs the setup script on host machine
|
|
1307
|
+
* @returns {Promise<ISpawnResult>}
|
|
1308
|
+
*/
|
|
1309
|
+
runSetupScript(): Promise<ISpawnResult>;
|
|
1310
|
+
/**
|
|
1311
|
+
* Checks if the envrironment is properly configured and it is possible to execute local builds
|
|
1312
|
+
* @returns {Promise<boolean>} true if the environment is properly configured for local builds
|
|
1313
|
+
* @param {object} configuration
|
|
1314
|
+
*/
|
|
1315
|
+
canExecuteLocalBuild(configuration?: {
|
|
1316
|
+
platform?: string;
|
|
1317
|
+
projectDir?: string;
|
|
1318
|
+
runtimeVersion?: string;
|
|
1319
|
+
forceCheck?: boolean;
|
|
1320
|
+
}): Promise<boolean>;
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Checks and notifies users for deprecated short imports in their applications.
|
|
1324
|
+
* @param {string} projectDir Path to the application.
|
|
1325
|
+
* @returns {void}
|
|
1326
|
+
*/
|
|
1327
|
+
checkForDeprecatedShortImportsInAppDir(projectDir: string): void;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
interface IUtils {
|
|
1331
|
+
getParsedTimeout(defaultTimeout: number): number;
|
|
1332
|
+
getMilliSecondsTimeout(defaultTimeout: number): number;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Used for parsing of .plist files
|
|
1337
|
+
*/
|
|
1338
|
+
interface IPlistParser {
|
|
1339
|
+
/**
|
|
1340
|
+
* Parses the .plist file and returns the result as object
|
|
1341
|
+
* @param {string} plistFilePath Absolute path to .plist file
|
|
1342
|
+
* @return {Promise<any>} The parsed object
|
|
1343
|
+
*/
|
|
1344
|
+
parseFile(plistFilePath: string): Promise<any>;
|
|
1345
|
+
parseFileSync(plistFilePath: string): any;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
interface IUserSettingsService extends IJsonFileSettingsService {
|
|
1349
|
+
// keep for backwards compatibility
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Used for interaction with various resources located in a resources folder.
|
|
1354
|
+
* @interface
|
|
1355
|
+
*/
|
|
1356
|
+
interface IResourceLoader {
|
|
1357
|
+
/**
|
|
1358
|
+
* Get an absolute path to a resource based on a relative one.
|
|
1359
|
+
* @param {string} path Relative path to resource
|
|
1360
|
+
* @return {string} Absolute path to resource
|
|
1361
|
+
*/
|
|
1362
|
+
resolvePath(path: string): string;
|
|
1363
|
+
/**
|
|
1364
|
+
* Opens a resource file for reading.
|
|
1365
|
+
* @param {string} path Relative path to resource
|
|
1366
|
+
* @return {NodeJS.ReadableStream} Read stream to the resource file
|
|
1367
|
+
*/
|
|
1368
|
+
openFile(path: string): NodeJS.ReadableStream;
|
|
1369
|
+
|
|
1370
|
+
readText(path: string): string;
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* Reads the contents of a resource file in JSON format.
|
|
1374
|
+
* @param {string} path Relative path to resource
|
|
1375
|
+
* @return {any} Object based on the JSON contents of the resource file.
|
|
1376
|
+
*/
|
|
1377
|
+
readJson(path: string): any;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* Used for getting strings for informational/error messages.
|
|
1382
|
+
*/
|
|
1383
|
+
interface IMessagesService {
|
|
1384
|
+
/**
|
|
1385
|
+
* Array of the paths to the .json files containing all the messages.
|
|
1386
|
+
* @type {string[]}
|
|
1387
|
+
*/
|
|
1388
|
+
pathsToMessageJsonFiles: string[];
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* @param {string} id Message's key in corresponding messages json file, could be complex (e.g. 'iOS.iTunes.ConnectError').
|
|
1392
|
+
* @param {string[]} args Additional arguments used when the message's value is a string format.
|
|
1393
|
+
* @return {string} The value found under the given id. If no value is found returns the id itself.
|
|
1394
|
+
*/
|
|
1395
|
+
getMessage(id: string, ...args: string[]): string;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* Describes generated code parts.
|
|
1400
|
+
*/
|
|
1401
|
+
interface IServiceContractClientCode {
|
|
1402
|
+
interfaceFile: string;
|
|
1403
|
+
implementationFile: string;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Used for code generation.
|
|
1408
|
+
*/
|
|
1409
|
+
interface IServiceContractGenerator {
|
|
1410
|
+
/**
|
|
1411
|
+
* Generate code implementation along with interface
|
|
1412
|
+
* @param {string} definitionsPath The path to the desired parent .d.ts file
|
|
1413
|
+
* @return {Promise<IServiceContractClientCode>} The generated code parts
|
|
1414
|
+
*/
|
|
1415
|
+
generate(definitionsPath?: string): Promise<IServiceContractClientCode>;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* Describes project file that should be livesynced
|
|
1420
|
+
*/
|
|
1421
|
+
interface IProjectFileInfo {
|
|
1422
|
+
/**
|
|
1423
|
+
* Full path to the file that has to be livesynced.
|
|
1424
|
+
*/
|
|
1425
|
+
filePath: string;
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Filename that will be transefered on the device. This is the original filename with stripped platform and configuration names.
|
|
1429
|
+
*/
|
|
1430
|
+
onDeviceFileName: string;
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* Defines if the file should be included in the transfer. For example when device is Android, files that contain iOS in the name should not be synced.
|
|
1434
|
+
*/
|
|
1435
|
+
shouldIncludeFile: boolean;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
interface IProjectFilesManager {
|
|
1439
|
+
/**
|
|
1440
|
+
* Enumerates all files and directories from the specified project files path.
|
|
1441
|
+
*/
|
|
1442
|
+
getProjectFiles(
|
|
1443
|
+
projectFilesPath: string,
|
|
1444
|
+
excludedProjectDirsAndFiles?: string[],
|
|
1445
|
+
filter?: (filePath: string, stat: IFsStats) => boolean,
|
|
1446
|
+
opts?: any
|
|
1447
|
+
): string[];
|
|
1448
|
+
/**
|
|
1449
|
+
* Checks if the file is excluded
|
|
1450
|
+
*/
|
|
1451
|
+
isFileExcluded(
|
|
1452
|
+
filePath: string,
|
|
1453
|
+
excludedProjectDirsAndFiles?: string[]
|
|
1454
|
+
): boolean;
|
|
1455
|
+
/**
|
|
1456
|
+
* Returns an object that maps every local file path to device file path
|
|
1457
|
+
* If projectFiles parameter is not specified enumerates the files from the specified projectFilesPath
|
|
1458
|
+
*/
|
|
1459
|
+
createLocalToDevicePaths(
|
|
1460
|
+
deviceAppData: Mobile.IDeviceAppData,
|
|
1461
|
+
projectFilesPath: string,
|
|
1462
|
+
files: string[],
|
|
1463
|
+
excludedProjectDirsAndFiles: string[],
|
|
1464
|
+
projectFilesConfig?: IProjectFilesConfig
|
|
1465
|
+
): Promise<Mobile.ILocalToDevicePathData[]>;
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Handle platform specific files.
|
|
1469
|
+
* @param {string} directoryPath Directory from which to start looking for platform specific files. All subdirectories will be included.
|
|
1470
|
+
* @param {string} platform Mobile platform - only platform specific files for this platform will be included.
|
|
1471
|
+
* @param {IProjectFilesConfig} projectFilesConfig
|
|
1472
|
+
* @param {string[]} excludedDirs Directories which should be skipped.
|
|
1473
|
+
* @returns {void}
|
|
1474
|
+
*/
|
|
1475
|
+
processPlatformSpecificFiles(
|
|
1476
|
+
directoryPath: string,
|
|
1477
|
+
platform: string,
|
|
1478
|
+
projectFilesConfig?: IProjectFilesConfig,
|
|
1479
|
+
excludedDirs?: string[]
|
|
1480
|
+
): void;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
interface IProjectFilesProvider {
|
|
1484
|
+
/**
|
|
1485
|
+
* Checks if the file is excluded
|
|
1486
|
+
*/
|
|
1487
|
+
isFileExcluded(filePath: string): boolean;
|
|
1488
|
+
/**
|
|
1489
|
+
* Performs local file path mapping
|
|
1490
|
+
*/
|
|
1491
|
+
mapFilePath(
|
|
1492
|
+
filePath: string,
|
|
1493
|
+
platform: string,
|
|
1494
|
+
projectData: any,
|
|
1495
|
+
projectFilesConfig?: IProjectFilesConfig
|
|
1496
|
+
): string;
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Returns information about file in the project, that includes file's name on device after removing platform or configuration from the name.
|
|
1500
|
+
* @param {string} filePath Path to the project file.
|
|
1501
|
+
* @param {string} platform platform for which to get the information.
|
|
1502
|
+
* @param {IProjectFilesConfig} projectFilesConfig configuration for additional parsing
|
|
1503
|
+
* @return {IProjectFileInfo}
|
|
1504
|
+
*/
|
|
1505
|
+
getProjectFileInfo(
|
|
1506
|
+
filePath: string,
|
|
1507
|
+
platform: string,
|
|
1508
|
+
projectFilesConfig: IProjectFilesConfig
|
|
1509
|
+
): IProjectFileInfo;
|
|
1510
|
+
/**
|
|
1511
|
+
* Parses file by removing platform or configuration from its name.
|
|
1512
|
+
* @param {string} filePath Path to the project file.
|
|
1513
|
+
* @param {IProjectFilesConfig} projectFilesConfig
|
|
1514
|
+
* @return {string} Parsed file name or original file name in case it does not have platform/configuration in the filename.
|
|
1515
|
+
*/
|
|
1516
|
+
getPreparedFilePath(
|
|
1517
|
+
filePath: string,
|
|
1518
|
+
projectFilesConfig: IProjectFilesConfig
|
|
1519
|
+
): string;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* Describes configuration for additional parsing.
|
|
1524
|
+
*/
|
|
1525
|
+
interface IProjectFilesConfig {
|
|
1526
|
+
/**
|
|
1527
|
+
* additional configurations for which to get the information. The basic configurations are `debug` and `release`.
|
|
1528
|
+
* @type {string[]}
|
|
1529
|
+
*/
|
|
1530
|
+
additionalConfigurations?: string[];
|
|
1531
|
+
/**
|
|
1532
|
+
* configuration for which to get information.
|
|
1533
|
+
* @type {string}
|
|
1534
|
+
*/
|
|
1535
|
+
configuration?: string;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
/**
|
|
1539
|
+
* Describes imformation about the version of component
|
|
1540
|
+
*/
|
|
1541
|
+
interface IVersionInformation {
|
|
1542
|
+
/**
|
|
1543
|
+
* Component name.
|
|
1544
|
+
*/
|
|
1545
|
+
componentName: string;
|
|
1546
|
+
/**
|
|
1547
|
+
* The current version of the component if available.
|
|
1548
|
+
*/
|
|
1549
|
+
currentVersion?: string;
|
|
1550
|
+
/**
|
|
1551
|
+
* The latest available version of the component.
|
|
1552
|
+
*/
|
|
1553
|
+
latestVersion: string;
|
|
1554
|
+
/**
|
|
1555
|
+
* The message that will be displayed.
|
|
1556
|
+
*/
|
|
1557
|
+
message?: string;
|
|
1558
|
+
/**
|
|
1559
|
+
* The type of the component. Can be UpToDate, UpdateAvailable, NotInstalled.
|
|
1560
|
+
*/
|
|
1561
|
+
type?: "UpToDate" | "UpdateAvailable" | "NotInstalled";
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
interface IVersionData {
|
|
1565
|
+
major: string;
|
|
1566
|
+
minor: string;
|
|
1567
|
+
patch: string;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
interface IWaitForPortListenData {
|
|
1571
|
+
/**
|
|
1572
|
+
* Port to be checked.
|
|
1573
|
+
* @type {number}
|
|
1574
|
+
*/
|
|
1575
|
+
port: number;
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Max amount of time in milliseconds to wait.
|
|
1579
|
+
* @type {number}
|
|
1580
|
+
*/
|
|
1581
|
+
timeout: number;
|
|
1582
|
+
/**
|
|
1583
|
+
* @optional The amount of time between each check.
|
|
1584
|
+
* @type {number}
|
|
1585
|
+
*/
|
|
1586
|
+
interval?: number;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* Wrapper for net module of Node.js.
|
|
1591
|
+
*/
|
|
1592
|
+
interface INet {
|
|
1593
|
+
/**
|
|
1594
|
+
* Get free port on your local machine.
|
|
1595
|
+
* @return {Promise<number>} The port.
|
|
1596
|
+
*/
|
|
1597
|
+
getFreePort(): Promise<number>;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Returns the first available port in the provided range.
|
|
1601
|
+
* @param {number} startPort the first port to check.
|
|
1602
|
+
* @param {number} endPort the last port to check. The default value is 65534.
|
|
1603
|
+
* @return {Promise<number>} returns the first available prot in the given range.
|
|
1604
|
+
*/
|
|
1605
|
+
getAvailablePortInRange(startPort: number, endPort?: number): Promise<number>;
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* Checks if the candidate port is available.
|
|
1609
|
+
* @param {number} port the candidate port.
|
|
1610
|
+
* @return {Promise<boolean>} true if the port is available.
|
|
1611
|
+
*/
|
|
1612
|
+
isPortAvailable(port: number): Promise<boolean>;
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* Waits for port to be in LISTEN state.
|
|
1616
|
+
* @param {IWaitForPortListenData} waitForPortListenData Data describing port, timeout and interval.
|
|
1617
|
+
* @returns {boolean} true in case port is in LISTEN state, false otherwise.
|
|
1618
|
+
*/
|
|
1619
|
+
waitForPortToListen(
|
|
1620
|
+
waitForPortListenData: IWaitForPortListenData
|
|
1621
|
+
): Promise<boolean>;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
interface IDependencyInformation {
|
|
1625
|
+
name: string;
|
|
1626
|
+
version?: string;
|
|
1627
|
+
projectType?: string;
|
|
1628
|
+
excludedPeerDependencies?: string[];
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Describes operating system-related utility methods
|
|
1633
|
+
*/
|
|
1634
|
+
interface IOsInfo {
|
|
1635
|
+
/**
|
|
1636
|
+
* Returns a string identifying the operating system name.
|
|
1637
|
+
* @return {string} A string identifying the operating system name.
|
|
1638
|
+
*/
|
|
1639
|
+
type(): string;
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Returns a string identifying the operating system release.
|
|
1643
|
+
* @return {string} A string identifying the operating system release.
|
|
1644
|
+
*/
|
|
1645
|
+
release(): string;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Returns a string identifying the operating system bitness.
|
|
1649
|
+
* @return {string} A string identifying the operating system bitness.
|
|
1650
|
+
*/
|
|
1651
|
+
arch(): string;
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Returns a string identifying the operating system platform.
|
|
1655
|
+
* @return {string} A string identifying the operating system platform.
|
|
1656
|
+
*/
|
|
1657
|
+
platform(): string;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
interface IPromiseActions<T> {
|
|
1661
|
+
resolve(value?: T | PromiseLike<T>): void;
|
|
1662
|
+
reject(reason?: any): void;
|
|
1663
|
+
isResolved(): boolean;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
interface IDeferPromise<T> extends IPromiseActions<T> {
|
|
1667
|
+
isRejected(): boolean;
|
|
1668
|
+
isPending(): boolean;
|
|
1669
|
+
getResult(): any;
|
|
1670
|
+
promise: Promise<T>;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* Describes service used for interaction with Notification Center
|
|
1675
|
+
*/
|
|
1676
|
+
// tslint:disable-next-line:interface-name
|
|
1677
|
+
interface IiOSNotificationService {
|
|
1678
|
+
/**
|
|
1679
|
+
* Posts a notification and waits for a response.
|
|
1680
|
+
* @param {string} deviceIdentifier Device's identifier.
|
|
1681
|
+
* @param {number} socket Socket where the notification will be post.
|
|
1682
|
+
* @param {number} timeout Timeout in seconds.
|
|
1683
|
+
* @return {Promise<string>} The response.
|
|
1684
|
+
*/
|
|
1685
|
+
awaitNotification(
|
|
1686
|
+
deviceIdentifier: string,
|
|
1687
|
+
socket: number,
|
|
1688
|
+
timeout: number
|
|
1689
|
+
): Promise<string>;
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Posts a notification.
|
|
1693
|
+
* @param {string} deviceIdentifier Device's identifier.
|
|
1694
|
+
* @param {string} notification The xml value of the Name key of the notification to be post.
|
|
1695
|
+
* @param {string} commandType The xml value of the Command key of the notification to be post.
|
|
1696
|
+
* @return {Promise<number>} A socket which can be queried for a response.
|
|
1697
|
+
*/
|
|
1698
|
+
postNotification(
|
|
1699
|
+
deviceIdentifier: string,
|
|
1700
|
+
notification: string,
|
|
1701
|
+
commandType?: string
|
|
1702
|
+
): Promise<number>;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* Describes information for application.
|
|
1707
|
+
*/
|
|
1708
|
+
interface IAppInstalledInfo extends Mobile.IDeviceApplicationInformationBase {
|
|
1709
|
+
/**
|
|
1710
|
+
* Defines if application is installed on device.
|
|
1711
|
+
*/
|
|
1712
|
+
isInstalled: boolean;
|
|
1713
|
+
}
|