diff --git a/.eslintignore b/.eslintignore index 2186947..42ceb9a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ dist/ lib/ -node_modules/ \ No newline at end of file +node_modules/ +jest.config.js diff --git a/.eslintrc.json b/.eslintrc.json index 5e93274..3957c9d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,57 +1,89 @@ { - "plugins": ["jest", "@typescript-eslint"], - "extends": ["plugin:github/recommended"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module", - "project": "./tsconfig.json" + "plugins": ["import", "jest", "@typescript-eslint"], + "extends": ["plugin:github/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "rules": { + "i18n-text/no-en": "off", + "eslint-comments/no-use": "off", + "import/no-namespace": "off", + "no-shadow": "off", + "no-unused-vars": "off", + "prefer-template": "off", + "@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}], + "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], + "@typescript-eslint/no-require-imports": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-comment": "error", + "camelcase": "off", + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], + "@typescript-eslint/func-call-spacing": ["error", "never"], + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-extraneous-class": "error", + "@typescript-eslint/no-for-in-array": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-unnecessary-qualifier": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-useless-constructor": "error", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-for-of": "warn", + "@typescript-eslint/prefer-function-type": "warn", + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/require-array-sort-compare": "error", + "@typescript-eslint/restrict-plus-operands": "error", + "semi": "off", + "@typescript-eslint/semi": ["error", "never"], + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unbound-method": "error" + }, + "env": { + "node": true, + "es6": true, + "jest/globals": true + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"] }, - "rules": { - "camelcase": "off", - "eslint-comments/no-use": "off", - "import/no-namespace": "off", - "no-shadow": "off", - "no-unused-vars": "off", - "prefer-template": "off", - "semi": [ "error", "never"], - "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], - "@typescript-eslint/array-type": "error", - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-comment": "error", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], - "@typescript-eslint/func-call-spacing": ["error", "never"], - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-extraneous-class": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-require-imports": "error", - "@typescript-eslint/no-shadow": "error", - "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-unnecessary-qualifier": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}], - "@typescript-eslint/no-useless-constructor": "error", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/prefer-function-type": "warn", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error", - "@typescript-eslint/promise-function-async": "error", - "@typescript-eslint/require-array-sort-compare": "error", - "@typescript-eslint/restrict-plus-operands": "error", - "@typescript-eslint/semi": ["error", "never"], - "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unbound-method": "error" - }, - "env": { - "node": true, - "es6": true, - "jest/globals": true + "import/resolver": { + "typescript": { + "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default + + // use /path/to/folder/tsconfig.json + "project": "path/to/folder", + + // Multiple tsconfigs (Useful for monorepos) + + // use a glob pattern + "project": "packages/*/tsconfig.json", + + // use an array + "project": [ + "packages/module-a/tsconfig.json", + "packages/module-b/tsconfig.json" + ], + + // use an array of glob patterns + "project": [ + "packages/*/tsconfig.json", + "other-packages/*/tsconfig.json" + ] + } } } +} diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml new file mode 100644 index 0000000..3cacc49 --- /dev/null +++ b/.github/workflows/check-dist.yml @@ -0,0 +1,53 @@ +# `dist/index.js` is a special file in Actions. +# When you reference an action with `uses:` in a workflow, +# `index.js` is the code that will run. +# For our project, we generate this file through a build process from other source files. +# We need to make sure the checked-in `index.js` actually matches what we expect it to be. +name: Check dist/ + +on: + push: + branches: + - main + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + workflow_dispatch: + +jobs: + check-dist: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set Node.js 16.x + uses: actions/setup-node@v3.5.1 + with: + node-version: 16.x + + - name: Install dependencies + run: npm ci + + - name: Rebuild the dist/ directory + run: | + npm run build + npm run package + + - name: Compare the expected and actual dist/ directories + run: | + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + + # If index.js was different than expected, upload the expected version as an artifact + - uses: actions/upload-artifact@v2 + if: ${{ failure() && steps.diff.conclusion == 'failure' }} + with: + name: dist + path: dist/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57144fc..f4adeb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: node --version - run: npm ci - run: npm run build - run: npm run format-check @@ -26,11 +27,3 @@ jobs: with: name: test-results path: __tests__/__results__/*.xml - - - name: Create test report - uses: ./ - if: success() || failure() - with: - name: JEST Tests - path: __tests__/__results__/*.xml - reporter: jest-junit diff --git a/.github/workflows/manual-run.yml b/.github/workflows/manual-run.yml new file mode 100644 index 0000000..90a9110 --- /dev/null +++ b/.github/workflows/manual-run.yml @@ -0,0 +1,22 @@ +name: Manual run + +on: + workflow_dispatch: + +jobs: + check-dist: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: npm ci + - run: npm run build + - run: npm test + + - name: Create test report + uses: ./ + if: success() || failure() + with: + name: JEST Tests + path: __tests__/__results__/*.xml + reporter: jest-junit diff --git a/.gitignore b/.gitignore index 639696a..f43ecf7 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,5 @@ lib/**/* # Project specific __tests__/__results__ + +.idea diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..79bdb1b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18.7.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index bb12289..869b125 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v1.6.0 +- [Update to node16 + recent versions of core and exec packages](https://github.com/dorny/test-reporter/pull/203) +- [Update all dependencies to latest versions](https://github.com/dorny/test-reporter/pull/186) +- [Fix tests on non us-EN local env](https://github.com/dorny/test-reporter/pull/185) + ## v1.5.0 - [Add option to convert backslashes in path pattern to forward slashes](https://github.com/dorny/test-reporter/pull/128) - [Add option to generate only the summary from processed test results files](https://github.com/dorny/test-reporter/pull/123) diff --git a/README.md b/README.md index a2d2d4a..727968f 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ To workaround this security restriction, it's required to use two separate workf 1. `CI` runs in the context of the PR head branch with the read-only token. It executes the tests and uploads test results as a build artifact 2. `Test Report` runs in the context of the repository main branch with read/write token. It will download test results and create reports +The second workflow will only run after it has been merged into your default branch (typically `main` or `master`), it won't run in a PR unless after the workflow file is part of that branch. + **PR head branch:** *.github/workflows/ci.yml* ```yaml name: 'CI' diff --git a/__tests__/__outputs__/dart-json.md b/__tests__/__outputs__/dart-json.md index 80a2846..6fec70c 100644 --- a/__tests__/__outputs__/dart-json.md +++ b/__tests__/__outputs__/dart-json.md @@ -3,12 +3,12 @@ **6** tests were completed in **4s** with **1** passed, **4** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[test/main_test.dart](#r0s0)|1✔️|3❌||74ms| -|[test/second_test.dart](#r0s1)||1❌|1✖️|51ms| +|[test/main_test.dart](#r0s0)|1✅|3❌||74ms| +|[test/second_test.dart](#r0s1)||1❌|1⚪|51ms| ### ❌ test/main_test.dart ``` Test 1 - ✔️ Passing test + ✅ Passing test Test 1 Test 1.1 ❌ Failing test Expected: <2> @@ -24,5 +24,5 @@ Test 2 ``` ❌ Timeout test TimeoutException after 0:00:00.000001: Test timed out after 0 seconds. -✖️ Skipped test +⚪ Skipped test ``` \ No newline at end of file diff --git a/__tests__/__outputs__/dotnet-trx.md b/__tests__/__outputs__/dotnet-trx.md index ddaaecd..0fc9f7b 100644 --- a/__tests__/__outputs__/dotnet-trx.md +++ b/__tests__/__outputs__/dotnet-trx.md @@ -3,10 +3,10 @@ **11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[DotnetTests.XUnitTests.CalculatorTests](#r0s0)|5✔️|5❌|1✖️|118ms| +|[DotnetTests.XUnitTests.CalculatorTests](#r0s0)|5✅|5❌|1⚪|118ms| ### ❌ DotnetTests.XUnitTests.CalculatorTests ``` -✔️ Custom Name +✅ Custom Name ❌ Exception_In_TargetTest System.DivideByZeroException : Attempted to divide by zero. ❌ Exception_In_Test @@ -15,17 +15,17 @@ Assert.Equal() Failure Expected: 3 Actual: 2 -✔️ Is_Even_Number(i: 2) +✅ Is_Even_Number(i: 2) ❌ Is_Even_Number(i: 3) Assert.True() Failure Expected: True Actual: False -✔️ Passing_Test -✔️ Should be even number(i: 2) +✅ Passing_Test +✅ Should be even number(i: 2) ❌ Should be even number(i: 3) Assert.True() Failure Expected: True Actual: False -✖️ Skipped_Test -✔️ Timeout_Test +⚪ Skipped_Test +✅ Timeout_Test ``` \ No newline at end of file diff --git a/__tests__/__outputs__/fluent-validation-test-results.md b/__tests__/__outputs__/fluent-validation-test-results.md index 9f35f00..59a056c 100644 --- a/__tests__/__outputs__/fluent-validation-test-results.md +++ b/__tests__/__outputs__/fluent-validation-test-results.md @@ -1,1057 +1,1057 @@ ![Tests passed successfully](https://img.shields.io/badge/tests-803%20passed%2C%201%20skipped-success) -## ✔️ fixtures/external/FluentValidation.Tests.trx +## ✅ fixtures/external/FluentValidation.Tests.trx **804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[FluentValidation.Tests.AbstractValidatorTester](#r0s0)|35✔️|||12ms| -|[FluentValidation.Tests.AccessorCacheTests](#r0s1)|4✔️||1✖️|4ms| -|[FluentValidation.Tests.AssemblyScannerTester](#r0s2)|2✔️|||2ms| -|[FluentValidation.Tests.CascadingFailuresTester](#r0s3)|38✔️|||23ms| -|[FluentValidation.Tests.ChainedValidationTester](#r0s4)|13✔️|||6ms| -|[FluentValidation.Tests.ChainingValidatorsTester](#r0s5)|3✔️|||1ms| -|[FluentValidation.Tests.ChildRulesTests](#r0s6)|2✔️|||7ms| -|[FluentValidation.Tests.CollectionValidatorWithParentTests](#r0s7)|16✔️|||13ms| -|[FluentValidation.Tests.ComplexValidationTester](#r0s8)|17✔️|||26ms| -|[FluentValidation.Tests.ConditionTests](#r0s9)|18✔️|||9ms| -|[FluentValidation.Tests.CreditCardValidatorTests](#r0s10)|2✔️|||2ms| -|[FluentValidation.Tests.CustomFailureActionTester](#r0s11)|3✔️|||1ms| -|[FluentValidation.Tests.CustomMessageFormatTester](#r0s12)|6✔️|||3ms| -|[FluentValidation.Tests.CustomValidatorTester](#r0s13)|10✔️|||6ms| -|[FluentValidation.Tests.DefaultValidatorExtensionTester](#r0s14)|30✔️|||38ms| -|[FluentValidation.Tests.EmailValidatorTests](#r0s15)|36✔️|||18ms| -|[FluentValidation.Tests.EmptyTester](#r0s16)|9✔️|||5ms| -|[FluentValidation.Tests.EnumValidatorTests](#r0s17)|12✔️|||24ms| -|[FluentValidation.Tests.EqualValidatorTests](#r0s18)|10✔️|||3ms| -|[FluentValidation.Tests.ExactLengthValidatorTester](#r0s19)|6✔️|||2ms| -|[FluentValidation.Tests.ExclusiveBetweenValidatorTests](#r0s20)|19✔️|||6ms| -|[FluentValidation.Tests.ExtensionTester](#r0s21)|4✔️|||1ms| -|[FluentValidation.Tests.ForEachRuleTests](#r0s22)|34✔️|||47ms| -|[FluentValidation.Tests.GreaterThanOrEqualToValidatorTester](#r0s23)|14✔️|||5ms| -|[FluentValidation.Tests.GreaterThanValidatorTester](#r0s24)|13✔️|||4ms| -|[FluentValidation.Tests.InclusiveBetweenValidatorTests](#r0s25)|18✔️|||4ms| -|[FluentValidation.Tests.InheritanceValidatorTest](#r0s26)|11✔️|||18ms| -|[FluentValidation.Tests.InlineValidatorTester](#r0s27)|1✔️|||2ms| -|[FluentValidation.Tests.LanguageManagerTests](#r0s28)|21✔️|||28ms| -|[FluentValidation.Tests.LengthValidatorTests](#r0s29)|16✔️|||17ms| -|[FluentValidation.Tests.LessThanOrEqualToValidatorTester](#r0s30)|13✔️|||4ms| -|[FluentValidation.Tests.LessThanValidatorTester](#r0s31)|16✔️|||6ms| -|[FluentValidation.Tests.LocalisedMessagesTester](#r0s32)|6✔️|||3ms| -|[FluentValidation.Tests.LocalisedNameTester](#r0s33)|2✔️|||1ms| -|[FluentValidation.Tests.MemberAccessorTests](#r0s34)|9✔️|||5ms| -|[FluentValidation.Tests.MessageFormatterTests](#r0s35)|10✔️|||2ms| -|[FluentValidation.Tests.ModelLevelValidatorTests](#r0s36)|2✔️|||1ms| -|[FluentValidation.Tests.NameResolutionPluggabilityTester](#r0s37)|3✔️|||2ms| -|[FluentValidation.Tests.NotEmptyTester](#r0s38)|10✔️|||7ms| -|[FluentValidation.Tests.NotEqualValidatorTests](#r0s39)|11✔️|||7ms| -|[FluentValidation.Tests.NotNullTester](#r0s40)|5✔️|||1ms| -|[FluentValidation.Tests.NullTester](#r0s41)|5✔️|||2ms| -|[FluentValidation.Tests.OnFailureTests](#r0s42)|10✔️|||8ms| -|[FluentValidation.Tests.PredicateValidatorTester](#r0s43)|5✔️|||2ms| -|[FluentValidation.Tests.PropertyChainTests](#r0s44)|7✔️|||1ms| -|[FluentValidation.Tests.RegularExpressionValidatorTests](#r0s45)|15✔️|||6ms| -|[FluentValidation.Tests.RuleBuilderTests](#r0s46)|29✔️|||96ms| -|[FluentValidation.Tests.RuleDependencyTests](#r0s47)|14✔️|||3s| -|[FluentValidation.Tests.RulesetTests](#r0s48)|21✔️|||14ms| -|[FluentValidation.Tests.ScalePrecisionValidatorTests](#r0s49)|6✔️|||4ms| -|[FluentValidation.Tests.SharedConditionTests](#r0s50)|42✔️|||42ms| -|[FluentValidation.Tests.StandalonePropertyValidationTester](#r0s51)|1✔️|||0ms| -|[FluentValidation.Tests.StringEnumValidatorTests](#r0s52)|10✔️|||5ms| -|[FluentValidation.Tests.TrackingCollectionTests](#r0s53)|3✔️|||2ms| -|[FluentValidation.Tests.TransformTests](#r0s54)|4✔️|||3ms| -|[FluentValidation.Tests.UserSeverityTester](#r0s55)|7✔️|||3ms| -|[FluentValidation.Tests.UserStateTester](#r0s56)|4✔️|||3ms| -|[FluentValidation.Tests.ValidateAndThrowTester](#r0s57)|14✔️|||25ms| -|[FluentValidation.Tests.ValidationResultTests](#r0s58)|8✔️|||8ms| -|[FluentValidation.Tests.ValidatorDescriptorTester](#r0s59)|5✔️|||1ms| -|[FluentValidation.Tests.ValidatorSelectorTests](#r0s60)|10✔️|||9ms| -|[FluentValidation.Tests.ValidatorTesterTester](#r0s61)|73✔️|||74ms| -### ✔️ FluentValidation.Tests.AbstractValidatorTester -``` -✔️ Can_replace_default_errorcode_resolver -✔️ CanValidateInstancesOfType_returns_false_when_comparing_against_some_other_type -✔️ CanValidateInstancesOfType_returns_true_when_comparing_against_same_type -✔️ CanValidateInstancesOfType_returns_true_when_comparing_against_subclass -✔️ Default_error_code_should_be_class_name -✔️ OverridePropertyName_should_override_property_name -✔️ OverridePropertyName_with_lambda_should_override_property_name -✔️ PreValidate_bypasses_nullcheck_on_instance -✔️ RuleForeach_with_null_instances -✔️ Should_be_valid_when_there_are_no_failures_for_single_property -✔️ Should_not_main_state -✔️ Should_throw_for_non_member_expression_when_validating_single_property -✔️ Should_throw_when_rule_is_null -✔️ Should_validate_public_Field -✔️ Should_validate_single_Field -✔️ Should_validate_single_property -✔️ Should_validate_single_property_where_invalid_property_as_string -✔️ Should_validate_single_property_where_property_as_string -✔️ Uses_named_parameters_to_validate_ruleset -✔️ Validates_single_property_by_path -✔️ Validates_type_when_using_non_generic_validate_overload -✔️ When_the_validators_fail_then_the_errors_Should_be_accessible_via_the_errors_property -✔️ When_the_validators_fail_then_validatorrunner_should_return_false -✔️ When_the_Validators_pass_then_the_validatorRunner_should_return_true -✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: ) -✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: AnotherInt Test Message) -✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: ) -✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: AnotherInt Test Message) -✔️ WhenPreValidationReturnsTrue_ValidatorsGetHit_Validate -✔️ WhenPreValidationReturnsTrue_ValidatorsGetHit_ValidateAsync -✔️ WithErrorCode_should_override_error_code -✔️ WithMessage_and_WithErrorCode_should_override_error_message_and_error_code -✔️ WithMessage_should_override_error_message -✔️ WithName_should_override_field_name -✔️ WithName_should_override_field_name_with_value_from_other_property -``` -### ✔️ FluentValidation.Tests.AccessorCacheTests -``` -✖️ Benchmark -✔️ Equality_comparison_check -✔️ Gets_accessor -✔️ Gets_member_for_nested_property -✔️ Identifies_if_memberexp_acts_on_model_instance -``` -### ✔️ FluentValidation.Tests.AssemblyScannerTester -``` -✔️ Finds_validators_for_types -✔️ ForEach_iterates_over_types -``` -### ✔️ FluentValidation.Tests.CascadingFailuresTester -``` -✔️ Cascade_mode_can_be_set_after_validator_instantiated -✔️ Cascade_mode_can_be_set_after_validator_instantiated_async -✔️ Cascade_mode_can_be_set_after_validator_instantiated_async_legacy -✔️ Cascade_mode_can_be_set_after_validator_instantiated_legacy -✔️ Validation_continues_on_failure -✔️ Validation_continues_on_failure_async -✔️ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level -✔️ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_async -✔️ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_async_legacy -✔️ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_legacy -✔️ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level -✔️ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_async -✔️ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_async_legacy -✔️ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_legacy -✔️ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop -✔️ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_async -✔️ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_async_legacy -✔️ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_legacy -✔️ Validation_continues_when_set_to_Continue_at_validator_level -✔️ Validation_continues_when_set_to_Continue_at_validator_level_async -✔️ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level -✔️ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_async -✔️ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_async_legacy -✔️ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_legacy -✔️ Validation_stops_on_first_failure -✔️ Validation_stops_on_first_failure_async -✔️ Validation_stops_on_first_failure_async_legacy -✔️ Validation_stops_on_first_failure_legacy -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_and_async_validator_is_invoked_synchronously -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_and_async_validator_is_invoked_synchronously_legacy -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_async -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_async_legacy -✔️ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_legacy -✔️ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level -✔️ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_async -✔️ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_async_legacy -✔️ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_legacy -``` -### ✔️ FluentValidation.Tests.ChainedValidationTester -``` -✔️ Can_validate_using_validator_for_base_type -✔️ Chained_property_should_be_excluded -✔️ Chained_validator_descriptor -✔️ Chained_validator_should_not_be_invoked_on_null_property -✔️ Condition_should_work_with_chained_property -✔️ Explicitly_included_properties_should_be_propagated_to_nested_validators -✔️ Explicitly_included_properties_should_be_propagated_to_nested_validators_using_strings -✔️ Separate_validation_on_chained_property -✔️ Separate_validation_on_chained_property_conditional -✔️ Separate_validation_on_chained_property_valid -✔️ Should_allow_normal_rules_and_chained_property_on_same_property -✔️ Uses_explicit_ruleset -✔️ Validates_chained_property -``` -### ✔️ FluentValidation.Tests.ChainingValidatorsTester -``` -✔️ Options_should_only_apply_to_current_validator -✔️ Should_create_multiple_validators -✔️ Should_execute_multiple_validators -``` -### ✔️ FluentValidation.Tests.ChildRulesTests -``` -✔️ Can_define_nested_rules_for_collection -✔️ ChildRules_works_with_RuleSet -``` -### ✔️ FluentValidation.Tests.CollectionValidatorWithParentTests -``` -✔️ Async_condition_should_work_with_child_collection -✔️ Can_specify_condition_for_individual_collection_elements -✔️ Can_validate_collection_using_validator_for_base_type -✔️ Collection_should_be_excluded -✔️ Collection_should_be_explicitly_included_with_expression -✔️ Collection_should_be_explicitly_included_with_string -✔️ Condition_should_work_with_child_collection -✔️ Creates_validator_using_context_from_property_value -✔️ Should_override_property_name -✔️ Should_work_with_top_level_collection_validator -✔️ Should_work_with_top_level_collection_validator_and_overriden_name -✔️ Skips_null_items -✔️ Validates_collection -✔️ Validates_collection_asynchronously -✔️ Validates_collection_several_levels_deep -✔️ Validates_collection_several_levels_deep_async -``` -### ✔️ FluentValidation.Tests.ComplexValidationTester -``` -✔️ Async_condition_should_work_with_complex_property -✔️ Async_condition_should_work_with_complex_property_when_validator_invoked_synchronously -✔️ Can_directly_validate_multiple_fields_of_same_type -✔️ Can_validate_using_validator_for_base_type -✔️ Complex_property_should_be_excluded -✔️ Complex_validator_should_not_be_invoked_on_null_property -✔️ Condition_should_work_with_complex_property -✔️ Condition_should_work_with_complex_property_when_invoked_async -✔️ Explicitly_included_properties_should_be_propagated_to_nested_validators -✔️ Explicitly_included_properties_should_be_propagated_to_nested_validators_using_strings -✔️ Multiple_rules_in_chain_with_childvalidator_shouldnt_reuse_accessor -✔️ Multiple_rules_in_chain_with_childvalidator_shouldnt_reuse_accessor_async -✔️ Should_allow_normal_rules_and_complex_property_on_same_property -✔️ Should_override_propertyName -✔️ Validates_child_validator_asynchronously -✔️ Validates_child_validator_synchronously -✔️ Validates_complex_property -``` -### ✔️ FluentValidation.Tests.ConditionTests -``` -✔️ Async_condition_executed_synchronosuly_with_asynchronous_collection_rule -✔️ Async_condition_executed_synchronosuly_with_asynchronous_rule -✔️ Async_condition_executed_synchronosuly_with_synchronous_collection_role -✔️ Async_condition_executed_synchronosuly_with_synchronous_role -✔️ Async_condition_is_applied_to_all_validators_in_the_chain -✔️ Async_condition_is_applied_to_all_validators_in_the_chain_when_executed_synchronously -✔️ Async_condition_is_applied_to_single_validator_in_the_chain_when_ApplyConditionTo_set_to_CurrentValidator -✔️ Condition_is_applied_to_all_validators_in_the_chain -✔️ Condition_is_applied_to_single_validator_in_the_chain_when_ApplyConditionTo_set_to_CurrentValidator -✔️ Sync_condition_is_applied_to_async_validators -✔️ Validation_should_fail_when_async_condition_does_not_match -✔️ Validation_should_fail_when_async_condition_matches -✔️ Validation_should_fail_when_condition_does_not_match -✔️ Validation_should_fail_when_condition_matches -✔️ Validation_should_succeed_when_async_condition_does_not_match -✔️ Validation_should_succeed_when_async_condition_matches -✔️ Validation_should_succeed_when_condition_does_not_match -✔️ Validation_should_succeed_when_condition_matches -``` -### ✔️ FluentValidation.Tests.CreditCardValidatorTests -``` -✔️ IsValidTests -✔️ When_validation_fails_the_default_error_should_be_set -``` -### ✔️ FluentValidation.Tests.CustomFailureActionTester -``` -✔️ Does_not_invoke_action_if_validation_success -✔️ Invokes_custom_action_on_failure -✔️ Passes_object_being_validated_to_action -``` -### ✔️ FluentValidation.Tests.CustomMessageFormatTester -``` -✔️ Replaces_propertyvalue_placeholder -✔️ Replaces_propertyvalue_with_empty_string_when_null -✔️ Should_format_custom_message -✔️ Uses_custom_delegate_for_building_message -✔️ Uses_custom_delegate_for_building_message_only_for_specific_validator -✔️ Uses_property_value_in_message -``` -### ✔️ FluentValidation.Tests.CustomValidatorTester -``` -✔️ New_Custom_Returns_single_failure -✔️ New_Custom_Returns_single_failure_async -✔️ New_custom_uses_empty_property_name_for_model_level_rule -✔️ New_Custom_When_property_name_omitted_infers_property_name -✔️ New_Custom_When_property_name_omitted_infers_property_name_nested -✔️ New_Custom_within_ruleset -✔️ New_CustomAsync_within_ruleset -✔️ Perserves_property_chain_using_custom -✔️ Runs_async_rule_synchronously_when_validator_invoked_synchronously -✔️ Runs_sync_rule_asynchronously_when_validator_invoked_asynchronously -``` -### ✔️ FluentValidation.Tests.DefaultValidatorExtensionTester -``` -✔️ Empty_should_create_EmptyValidator -✔️ Equal_should_create_EqualValidator_with_explicit_value -✔️ Equal_should_create_EqualValidator_with_lambda -✔️ GreaterThan_should_create_GreaterThanValidator_with_explicit_value -✔️ GreaterThan_should_create_GreaterThanValidator_with_lambda -✔️ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_explicit_value -✔️ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_lambda -✔️ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_lambda_with_other_Nullable -✔️ Length_should_create_ExactLengthValidator -✔️ Length_should_create_LengthValidator -✔️ Length_should_create_MaximumLengthValidator -✔️ Length_should_create_MinimumLengthValidator -✔️ LessThan_should_create_LessThanValidator_with_explicit_value -✔️ LessThan_should_create_LessThanValidator_with_lambda -✔️ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_explicit_value -✔️ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_lambda -✔️ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_lambda_with_other_Nullable -✔️ Must_should_create_PredicateValidator_with_context -✔️ Must_should_create_PredicateValidator_with_PropertyValidatorContext -✔️ Must_should_create_PredicteValidator -✔️ MustAsync_should_create_AsyncPredicateValidator_with_context -✔️ MustAsync_should_create_AsyncPredicateValidator_with_PropertyValidatorContext -✔️ MustAsync_should_create_AsyncPredicteValidator -✔️ MustAsync_should_not_throw_InvalidCastException -✔️ NotEmpty_should_create_NotEmptyValidator -✔️ NotEqual_should_create_NotEqualValidator_with_explicit_value -✔️ NotEqual_should_create_NotEqualValidator_with_lambda -✔️ NotNull_should_create_NotNullValidator -✔️ ScalePrecision_should_create_ScalePrecisionValidator -✔️ ScalePrecision_should_create_ScalePrecisionValidator_with_ignore_trailing_zeros -``` -### ✔️ FluentValidation.Tests.EmailValidatorTests -``` -✔️ Fails_email_validation_aspnetcore_compatible(email: " \r \t \n") -✔️ Fails_email_validation_aspnetcore_compatible(email: "") -✔️ Fails_email_validation_aspnetcore_compatible(email: "@someDomain.com") -✔️ Fails_email_validation_aspnetcore_compatible(email: "@someDomain@abc.com") -✔️ Fails_email_validation_aspnetcore_compatible(email: "0") -✔️ Fails_email_validation_aspnetcore_compatible(email: "someName") -✔️ Fails_email_validation_aspnetcore_compatible(email: "someName@") -✔️ Fails_email_validation_aspnetcore_compatible(email: "someName@a@b.com") -✔️ Invalid_email_addressex_regex(email: "") -✔️ Invalid_email_addressex_regex(email: "first.last@test..co.uk") -✔️ Invalid_email_addressex_regex(email: "testperso") -✔️ Invalid_email_addressex_regex(email: "thisisaverylongstringcodeplex.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: " @someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "!#$%&'*+-/=?^_`|~@someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "\"firstName.lastName\"@someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "1234@someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "firstName.lastName@someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@1234.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@some_domain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@some~domain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@someDomain.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@someDomain￯.com") -✔️ Valid_email_addresses_aspnetcore_compatible(email: null) -✔️ Valid_email_addresses_regex(email: "__somename@example.com") -✔️ Valid_email_addresses_regex(email: "!def!xyz%abc@example.com") -✔️ Valid_email_addresses_regex(email: "\"Abc@def\"@example.com") -✔️ Valid_email_addresses_regex(email: "\"Abc\\@def\"@example.com") -✔️ Valid_email_addresses_regex(email: "\"Fred Bloggs\"@example.com") -✔️ Valid_email_addresses_regex(email: "\"Joe\\Blow\"@example.com") -✔️ Valid_email_addresses_regex(email: "$A12345@example.com") -✔️ Valid_email_addresses_regex(email: "customer/department=shipping@example.com") -✔️ Valid_email_addresses_regex(email: "first.last@test.co.uk") -✔️ Valid_email_addresses_regex(email: "testperson@gmail.com") -✔️ Valid_email_addresses_regex(email: "TestPerson@gmail.com") -✔️ Valid_email_addresses_regex(email: "testperson+label@gmail.com") -✔️ Valid_email_addresses_regex(email: null) -``` -### ✔️ FluentValidation.Tests.EmptyTester -``` -✔️ Passes_for_ienumerable_that_doesnt_implement_ICollection -✔️ Passes_when_collection_empty -✔️ When_there_is_a_value_then_the_validator_should_fail -✔️ When_validation_fails_error_should_be_set -✔️ When_value_is_Default_for_type_validator_should_pass_datetime -✔️ When_value_is_Default_for_type_validator_should_pass_int -✔️ When_value_is_empty_string_validator_should_pass -✔️ When_value_is_null_validator_should_pass -✔️ When_value_is_whitespace_validation_should_pass -``` -### ✔️ FluentValidation.Tests.EnumValidatorTests -``` -✔️ Flags_enum_invalid_when_using_outofrange_negative_value -✔️ Flags_enum_invalid_when_using_outofrange_positive_value -✔️ Flags_enum_valid_when_using_bitwise_value -✔️ Flags_enum_validates_correctly_when_using_zero_value -✔️ Flags_enum_with_overlapping_flags_valid_when_using_bitwise_value -✔️ IsValidTests -✔️ Nullable_enum_invalid_when_bad_value_specified -✔️ Nullable_enum_valid_when_property_value_is_null -✔️ Nullable_enum_valid_when_value_specified -✔️ When_the_enum_is_initialized_with_invalid_value_then_the_validator_should_fail -✔️ When_the_enum_is_not_initialized_with_valid_value_then_the_validator_should_fail -✔️ When_validation_fails_the_default_error_should_be_set -``` -### ✔️ FluentValidation.Tests.EqualValidatorTests -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Should_store_comparison_type -✔️ Should_store_property_to_compare -✔️ Should_succeed_on_case_insensitive_comparison -✔️ Should_succeed_on_case_insensitive_comparison_using_expression -✔️ Should_use_ordinal_comparison_by_default -✔️ Validates_against_property -✔️ When_the_objects_are_equal_validation_should_succeed -✔️ When_the_objects_are_not_equal_validation_should_fail -✔️ When_validation_fails_the_error_should_be_set -``` -### ✔️ FluentValidation.Tests.ExactLengthValidatorTester -``` -✔️ Min_and_max_properties_should_be_set -✔️ When_exact_length_rule_failes_error_should_have_exact_length_error_errorcode -✔️ When_the_text_is_an_exact_length_the_validator_should_pass -✔️ When_the_text_length_is_larger_the_validator_should_fail -✔️ When_the_text_length_is_smaller_the_validator_should_fail -✔️ When_the_validator_fails_the_error_message_should_be_set -``` -### ✔️ FluentValidation.Tests.ExclusiveBetweenValidatorTests -``` -✔️ To_and_from_properties_should_be_set -✔️ To_and_from_properties_should_be_set_for_dates -✔️ To_and_from_properties_should_be_set_for_strings -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_not_null -✔️ When_the_text_is_larger_than_the_range_then_the_validator_should_fail -✔️ When_the_text_is_larger_than_the_range_then_the_validator_should_fail_for_strings -✔️ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw -✔️ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings -✔️ When_the_validator_fails_the_error_message_should_be_set -✔️ When_the_validator_fails_the_error_message_should_be_set_for_strings -✔️ When_the_value_is_between_the_range_specified_then_the_validator_should_pass -✔️ When_the_value_is_between_the_range_specified_then_the_validator_should_pass_for_strings -✔️ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_fail -✔️ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_fail_for_strings -✔️ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_fail -✔️ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_fail_for_strings -✔️ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail -✔️ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail_for_strings -``` -### ✔️ FluentValidation.Tests.ExtensionTester -``` -✔️ Should_extract_member_from_member_expression -✔️ Should_return_null_for_non_member_expressions -✔️ Should_split_pascal_cased_member_name -✔️ SplitPascalCase_should_return_null_when_input_is_null -``` -### ✔️ FluentValidation.Tests.ForEachRuleTests -``` -✔️ Async_condition_should_work_with_child_collection -✔️ Can_access_colletion_index -✔️ Can_access_colletion_index_async -✔️ Can_access_parent_index -✔️ Can_access_parent_index_async -✔️ Can_specify_condition_for_individual_collection_elements -✔️ Can_use_cascade_with_RuleForEach -✔️ Can_validate_collection_using_validator_for_base_type -✔️ Collection_should_be_excluded -✔️ Collection_should_be_explicitly_included_with_expression -✔️ Collection_should_be_explicitly_included_with_string -✔️ Condition_should_work_with_child_collection -✔️ Correctly_gets_collection_indices -✔️ Correctly_gets_collection_indices_async -✔️ Executes_rule_for_each_item_in_collection -✔️ Executes_rule_for_each_item_in_collection_async -✔️ Nested_collection_for_null_property_should_not_throw_null_reference -✔️ Nested_conditions_Rule_For -✔️ Nested_conditions_Rule_For_Each -✔️ Overrides_indexer -✔️ Overrides_indexer_async -✔️ Regular_rules_can_drop_into_RuleForEach -✔️ RuleForEach_async_RunsTasksSynchronously -✔️ Should_not_scramble_property_name_when_using_collection_validators_several_levels_deep -✔️ Should_not_scramble_property_name_when_using_collection_validators_several_levels_deep_with_ValidateAsync -✔️ Should_override_property_name -✔️ Skips_null_items -✔️ Top_level_collection -✔️ Uses_useful_error_message_when_used_on_non_property -✔️ Validates_child_validator_asynchronously -✔️ Validates_child_validator_synchronously -✔️ Validates_collection -✔️ When_runs_outside_RuleForEach_loop -✔️ When_runs_outside_RuleForEach_loop_async -``` -### ✔️ FluentValidation.Tests.GreaterThanOrEqualToValidatorTester -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Comparison_type -✔️ Should_fail_when_less_than_input -✔️ Should_localize_value -✔️ Should_set_default_error_when_validation_fails -✔️ Should_succeed_when_equal_to_input -✔️ Should_succeed_when_greater_than_input -✔️ Validates_nullable_with_nullable_property -✔️ Validates_with_nullable_property -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_is_null_cross_property -✔️ Validates_with_nullable_when_property_not_null -✔️ Validates_with_nullable_when_property_not_null_cross_property -✔️ Validates_with_property -``` -### ✔️ FluentValidation.Tests.GreaterThanValidatorTester -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Comparison_Type -✔️ Should_fail_when_equal_to_input -✔️ Should_fail_when_less_than_input -✔️ Should_set_default_error_when_validation_fails -✔️ Should_succeed_when_greater_than_input -✔️ Validates_nullable_with_nullable_property -✔️ Validates_with_nullable_property -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_is_null_cross_property -✔️ Validates_with_nullable_when_property_not_null -✔️ Validates_with_nullable_when_property_not_null_cross_property -✔️ Validates_with_property -``` -### ✔️ FluentValidation.Tests.InclusiveBetweenValidatorTests -``` -✔️ To_and_from_properties_should_be_set -✔️ To_and_from_properties_should_be_set_for_strings -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_not_null -✔️ When_the_text_is_larger_than_the_range_then_the_validator_should_fail -✔️ When_the_text_is_larger_than_the_range_then_the_validator_should_fail_for_strings -✔️ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw -✔️ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings -✔️ When_the_validator_fails_the_error_message_should_be_set -✔️ When_the_validator_fails_the_error_message_should_be_set_for_strings -✔️ When_the_value_is_between_the_range_specified_then_the_validator_should_pass -✔️ When_the_value_is_between_the_range_specified_then_the_validator_should_pass_for_strings -✔️ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass -✔️ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass_for_strings -✔️ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass -✔️ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass_for_strings -✔️ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail -✔️ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail_for_strings -``` -### ✔️ FluentValidation.Tests.InheritanceValidatorTest -``` -✔️ Can_use_custom_subclass_with_nongeneric_overload -✔️ Validates_collection -✔️ Validates_collection_async -✔️ Validates_inheritance_async -✔️ Validates_inheritance_hierarchy -✔️ Validates_ruleset -✔️ Validates_ruleset_async -✔️ Validates_with_callback -✔️ Validates_with_callback_accepting_derived -✔️ Validates_with_callback_accepting_derived_async -✔️ Validates_with_callback_async -``` -### ✔️ FluentValidation.Tests.InlineValidatorTester -``` -✔️ Uses_inline_validator_to_build_rules -``` -### ✔️ FluentValidation.Tests.LanguageManagerTests -``` -✔️ All_languages_should_be_loaded -✔️ All_localizations_have_same_parameters_as_English -✔️ Always_use_specific_language -✔️ Always_use_specific_language_with_string_source -✔️ Can_replace_message -✔️ Can_replace_message_without_overriding_all_languages -✔️ Disables_localization -✔️ Falls_back_to_default_localization_key_when_error_code_key_not_found -✔️ Falls_back_to_english_when_culture_not_registered -✔️ Falls_back_to_english_when_translation_missing -✔️ Falls_back_to_parent_culture -✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn-BA") -✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn") -✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs") -✔️ Gets_translation_for_croatian_culture -✔️ Gets_translation_for_culture -✔️ Gets_translation_for_serbian_culture(cultureName: "sr-Latn-RS") -✔️ Gets_translation_for_serbian_culture(cultureName: "sr-Latn") -✔️ Gets_translation_for_serbian_culture(cultureName: "sr") -✔️ Gets_translation_for_specific_culture -✔️ Uses_error_code_as_localization_key -``` -### ✔️ FluentValidation.Tests.LengthValidatorTests -``` -✔️ Min_and_max_properties_should_be_set -✔️ When_input_is_null_then_the_validator_should_pass -✔️ When_the_max_is_smaller_than_the_min_then_the_validator_should_throw -✔️ When_the_maxlength_validator_fails_the_error_message_should_be_set -✔️ When_the_minlength_validator_fails_the_error_message_should_be_set -✔️ When_the_text_is_between_the_lambda_range_specified_then_the_validator_should_pass -✔️ When_the_text_is_between_the_range_specified_then_the_validator_should_pass -✔️ When_the_text_is_exactly_the_size_of_the_lambda_lower_bound_then_the_validator_should_pass -✔️ When_the_text_is_exactly_the_size_of_the_lambda_upper_bound_then_the_validator_should_pass -✔️ When_the_text_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass -✔️ When_the_text_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass -✔️ When_the_text_is_larger_than_the_lambda_range_then_the_validator_should_fail -✔️ When_the_text_is_larger_than_the_range_then_the_validator_should_fail -✔️ When_the_text_is_smaller_than_the_lambda_range_then_the_validator_should_fail -✔️ When_the_text_is_smaller_than_the_range_then_the_validator_should_fail -✔️ When_the_validator_fails_the_error_message_should_be_set -``` -### ✔️ FluentValidation.Tests.LessThanOrEqualToValidatorTester -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Comparison_type -✔️ Should_fail_when_greater_than_input -✔️ Should_set_default_error_when_validation_fails -✔️ Should_succeed_when_equal_to_input -✔️ Should_succeed_when_less_than_input -✔️ Validates_nullable_with_nullable_property -✔️ Validates_with_nullable_property -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_is_null_cross_property -✔️ Validates_with_nullable_when_property_not_null -✔️ Validates_with_nullable_when_property_not_null_cross_property -✔️ Validates_with_property -``` -### ✔️ FluentValidation.Tests.LessThanValidatorTester -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Comparison_type -✔️ Extracts_property_from_constant_using_expression -✔️ Extracts_property_from_expression -✔️ Should_fail_when_equal_to_input -✔️ Should_fail_when_greater_than_input -✔️ Should_set_default_validation_message_when_validation_fails -✔️ Should_succeed_when_less_than_input -✔️ Should_throw_when_value_to_compare_is_null -✔️ Validates_against_property -✔️ Validates_nullable_with_nullable_property -✔️ Validates_with_nullable_property -✔️ Validates_with_nullable_when_property_is_null -✔️ Validates_with_nullable_when_property_not_null -✔️ Validates_with_nullable_when_property_not_null_cross_property -✔️ Validates_with_nullable_when_property_null_cross_property -``` -### ✔️ FluentValidation.Tests.LocalisedMessagesTester -``` -✔️ Correctly_assigns_default_localized_error_message -✔️ Does_not_throw_InvalidCastException_when_using_RuleForEach -✔️ Formats_string_with_placeholders -✔️ Formats_string_with_placeholders_when_you_cant_edit_the_string -✔️ Uses_func_to_get_message -✔️ Uses_string_format_with_property_value -``` -### ✔️ FluentValidation.Tests.LocalisedNameTester -``` -✔️ Uses_localized_name -✔️ Uses_localized_name_expression -``` -### ✔️ FluentValidation.Tests.MemberAccessorTests -``` -✔️ ComplexPropertyGet -✔️ ComplexPropertySet -✔️ Equality -✔️ ImplicitCast -✔️ Name -✔️ SimpleFieldGet -✔️ SimpleFieldSet -✔️ SimplePropertyGet -✔️ SimplePropertySet -``` -### ✔️ FluentValidation.Tests.MessageFormatterTests -``` -✔️ Adds_argument_and_custom_arguments -✔️ Adds_formatted_argument_and_custom_arguments -✔️ Adds_formatted_argument_and_formatted_custom_arguments -✔️ Adds_PropertyName_to_message -✔️ Adds_value_to_message -✔️ Format_property_value -✔️ Should_ignore_unknown_numbered_parameters -✔️ Should_ignore_unknown_parameters -✔️ Understands_date_formats -✔️ Understands_numeric_formats -``` -### ✔️ FluentValidation.Tests.ModelLevelValidatorTests -``` -✔️ Can_use_child_validator_at_model_level -✔️ Validates_at_model_level -``` -### ✔️ FluentValidation.Tests.NameResolutionPluggabilityTester -``` -✔️ Resolves_nested_properties -✔️ ShouldHaveValidationError_Should_support_custom_propertynameresolver -✔️ Uses_custom_property_name -``` -### ✔️ FluentValidation.Tests.NotEmptyTester -``` -✔️ Fails_for_array -✔️ Fails_for_ienumerable_that_doesnt_implement_ICollection -✔️ Fails_when_collection_empty -✔️ When_there_is_a_value_then_the_validator_should_pass -✔️ When_validation_fails_error_should_be_set -✔️ When_value_is_Default_for_type_validator_should_fail_datetime -✔️ When_value_is_Default_for_type_validator_should_fail_int -✔️ When_value_is_empty_string_validator_should_fail -✔️ When_value_is_null_validator_should_fail -✔️ When_value_is_whitespace_validation_should_fail -``` -### ✔️ FluentValidation.Tests.NotEqualValidatorTests -``` -✔️ Comparison_property_uses_custom_resolver -✔️ Should_handle_custom_value_types_correctly -✔️ Should_not_be_valid_for_case_insensitve_comparison -✔️ Should_not_be_valid_for_case_insensitve_comparison_with_expression -✔️ Should_store_comparison_type -✔️ Should_store_property_to_compare -✔️ Should_use_ordinal_comparison_by_default -✔️ Validates_across_properties -✔️ When_the_objects_are_equal_then_the_validator_should_fail -✔️ When_the_objects_are_not_equal_then_the_validator_should_pass -✔️ When_the_validator_fails_the_error_message_should_be_set -``` -### ✔️ FluentValidation.Tests.NotNullTester -``` -✔️ Fails_when_nullable_value_type_is_null -✔️ Not_null_validator_should_not_crash_with_non_nullable_value_type -✔️ NotNullValidator_should_fail_if_value_is_null -✔️ NotNullValidator_should_pass_if_value_has_value -✔️ When_the_validator_fails_the_error_message_should_be_set -``` -### ✔️ FluentValidation.Tests.NullTester -``` -✔️ Not_null_validator_should_not_crash_with_non_nullable_value_type -✔️ NullValidator_should_fail_if_value_has_value -✔️ NullValidator_should_pass_if_value_is_null -✔️ Passes_when_nullable_value_type_is_null -✔️ When_the_validator_passes_the_error_message_should_be_set -``` -### ✔️ FluentValidation.Tests.OnFailureTests -``` -✔️ OnFailure_called_for_each_failed_rule -✔️ OnFailure_called_for_each_failed_rule_asyncAsync -✔️ Should_be_able_to_access_error_message_in_OnFailure -✔️ ShouldHaveChildValidator_should_be_true -✔️ ShouldHaveChildValidator_works_with_Include -✔️ WhenAsyncWithOnFailure_should_invoke_condition_on_async_inner_validator -✔️ WhenAsyncWithOnFailure_should_invoke_condition_on_inner_validator -✔️ WhenAsyncWithOnFailure_should_invoke_condition_on_inner_validator_invoked_synchronously -✔️ WhenWithOnFailure_should_invoke_condition_on_async_inner_validator -✔️ WhenWithOnFailure_should_invoke_condition_on_inner_validator -``` -### ✔️ FluentValidation.Tests.PredicateValidatorTester -``` -✔️ Should_fail_when_predicate_returns_false -✔️ Should_succeed_when_predicate_returns_true -✔️ Should_throw_when_predicate_is_null -✔️ When_validation_fails_metadata_should_be_set_on_failure -✔️ When_validation_fails_the_default_error_should_be_set -``` -### ✔️ FluentValidation.Tests.PropertyChainTests -``` -✔️ AddIndexer_throws_when_nothing_added -✔️ Calling_ToString_should_construct_string_representation_of_chain -✔️ Calling_ToString_should_construct_string_representation_of_chain_with_indexers -✔️ Creates_from_expression -✔️ Should_be_subchain -✔️ Should_ignore_blanks -✔️ Should_not_be_subchain -``` -### ✔️ FluentValidation.Tests.RegularExpressionValidatorTests -``` -✔️ Can_access_expression_in_message -✔️ Can_access_expression_in_message_lambda -✔️ Can_access_expression_in_message_lambda_regex -✔️ Uses_lazily_loaded_expression -✔️ Uses_lazily_loaded_expression_with_options -✔️ Uses_regex_object -✔️ When_the_text_does_not_match_the_lambda_regex_regular_expression_then_the_validator_should_fail -✔️ When_the_text_does_not_match_the_lambda_regular_expression_then_the_validator_should_fail -✔️ When_the_text_does_not_match_the_regular_expression_then_the_validator_should_fail -✔️ When_the_text_is_empty_then_the_validator_should_fail -✔️ When_the_text_is_null_then_the_validator_should_pass -✔️ When_the_text_matches_the_lambda_regex_regular_expression_then_the_validator_should_pass -✔️ When_the_text_matches_the_lambda_regular_expression_then_the_validator_should_pass -✔️ When_the_text_matches_the_regular_expression_then_the_validator_should_pass -✔️ When_validation_fails_the_default_error_should_be_set -``` -### ✔️ FluentValidation.Tests.RuleBuilderTests -``` -✔️ Adding_a_validator_should_return_builder -✔️ Adding_a_validator_should_store_validator -✔️ Calling_validate_should_delegate_to_underlying_validator -✔️ Calling_ValidateAsync_should_delegate_to_underlying_async_validator -✔️ Calling_ValidateAsync_should_delegate_to_underlying_sync_validator -✔️ Conditional_child_validator_should_register_with_validator_type_not_property -✔️ Nullable_object_with_async_condition_should_not_throw -✔️ Nullable_object_with_condition_should_not_throw -✔️ Property_should_return_null_when_it_is_not_a_property_being_validated -✔️ Property_should_return_property_being_validated -✔️ PropertyDescription_should_return_custom_property_name -✔️ PropertyDescription_should_return_property_name_split -✔️ Result_should_use_custom_property_name_when_no_property_name_can_be_determined -✔️ Rule_for_a_non_memberexpression_should_not_generate_property_name -✔️ Should_build_property_name -✔️ Should_compile_expression -✔️ Should_set_custom_error -✔️ Should_set_custom_property_name -✔️ Should_throw_if_message_is_null -✔️ Should_throw_if_overriding_validator_is_null -✔️ Should_throw_if_overriding_validator_provider_is_null -✔️ Should_throw_if_property_name_is_null -✔️ Should_throw_if_validator_is_null -✔️ Should_throw_when_async_inverse_predicate_is_null -✔️ Should_throw_when_async_predicate_is_null -✔️ Should_throw_when_context_predicate_is_null -✔️ Should_throw_when_inverse_context_predicate_is_null -✔️ Should_throw_when_inverse_predicate_is_null -✔️ Should_throw_when_predicate_is_null -``` -### ✔️ FluentValidation.Tests.RuleDependencyTests -``` -✔️ Async_inside_dependent_rules -✔️ Async_inside_dependent_rules_when_parent_rule_not_async -✔️ Dependent_rules_inside_ruleset -✔️ Dependent_rules_inside_when -✔️ Does_not_invoke_dependent_rule_if_parent_rule_does_not_pass -✔️ Invokes_dependent_rule_if_parent_rule_passes -✔️ Nested_dependent_rules -✔️ Nested_dependent_rules_inside_ruleset -✔️ Nested_dependent_rules_inside_ruleset_inside_method -✔️ Nested_dependent_rules_inside_ruleset_no_result_when_second_level_fails -✔️ Nested_dependent_rules_inside_ruleset_no_result_when_top_level_fails -✔️ TestAsyncWithDependentRules_AsyncEntry -✔️ TestAsyncWithDependentRules_SyncEntry -✔️ Treats_root_level_RuleFor_call_as_dependent_rule_if_user_forgets_to_use_DependentRulesBuilder -``` -### ✔️ FluentValidation.Tests.RulesetTests -``` -✔️ Applies_multiple_rulesets_to_rule -✔️ Combines_rulesets_and_explicit_properties -✔️ Combines_rulesets_and_explicit_properties_async -✔️ Executes_all_rules -✔️ Executes_in_rule_in_default_and_none -✔️ Executes_in_rule_in_ruleset_and_default -✔️ Executes_multiple_rulesets -✔️ Executes_rules_in_default_ruleset_and_specific_ruleset -✔️ Executes_rules_in_specified_ruleset -✔️ Executes_rules_not_specified_in_ruleset -✔️ Includes_all_rulesets -✔️ Includes_all_rulesets_async -✔️ Includes_combination_of_rulesets -✔️ Includes_combination_of_rulesets_async -✔️ Ruleset_cascades_to_child_collection_validator -✔️ Ruleset_cascades_to_child_validator -✔️ Ruleset_selection_should_cascade_downwards_with_when_setting_child_validator_using_include_statement -✔️ Ruleset_selection_should_cascade_downwards_with_when_setting_child_validator_using_include_statement_with_lambda -✔️ Ruleset_selection_should_not_cascade_downwards_when_set_on_property -✔️ Trims_spaces -✔️ WithMessage_works_inside_rulesets -``` -### ✔️ FluentValidation.Tests.ScalePrecisionValidatorTests -``` -✔️ Scale_precision_should_be_valid -✔️ Scale_precision_should_be_valid_when_ignoring_trailing_zeroes -✔️ Scale_precision_should_be_valid_when_they_are_equal -✔️ Scale_precision_should_not_be_valid -✔️ Scale_precision_should_not_be_valid_when_ignoring_trailing_zeroes -✔️ Scale_precision_should_not_be_valid_when_they_are_equal -``` -### ✔️ FluentValidation.Tests.SharedConditionTests -``` -✔️ Async_condition_can_be_used_inside_ruleset -✔️ Condition_can_be_used_inside_ruleset -✔️ Does_not_execute_custom_Rule_when_async_condition_false -✔️ Does_not_execute_custom_Rule_when_condition_false -✔️ Does_not_execute_customasync_Rule_when_async_condition_false -✔️ Does_not_execute_customasync_Rule_when_condition_false -✔️ Doesnt_throw_NullReferenceException_when_instance_not_null -✔️ Doesnt_throw_NullReferenceException_when_instance_not_null_async -✔️ Executes_custom_rule_when_async_condition_true -✔️ Executes_custom_rule_when_condition_true -✔️ Executes_customasync_rule_when_async_condition_true -✔️ Executes_customasync_rule_when_condition_true -✔️ Nested_async_conditions_with_Custom_rule -✔️ Nested_async_conditions_with_CustomAsync_rule -✔️ Nested_conditions_with_Custom_rule -✔️ Nested_conditions_with_CustomAsync_rule -✔️ Outer_async_Unless_clause_will_trump_an_inner_Unless_clause_when_inner_fails_but_the_outer_is_satisfied -✔️ Outer_Unless_clause_will_trump_an_inner_Unless_clause_when_inner_fails_but_the_outer_is_satisfied -✔️ Rules_invoke_when_inverse_shared_async_condition_matches -✔️ Rules_invoke_when_inverse_shared_condition_matches -✔️ Rules_not_invoked_when_inverse_shared_async_condition_does_not_match -✔️ Rules_not_invoked_when_inverse_shared_condition_does_not_match -✔️ RuleSet_can_be_used_inside_async_condition -✔️ RuleSet_can_be_used_inside_condition -✔️ Runs_otherwise_conditions_for_UnlessAsync -✔️ Runs_otherwise_conditions_for_When -✔️ Runs_otherwise_conditions_for_WhenAsync -✔️ Runs_otherwise_conditons_for_Unless -✔️ Shared_async_When_is_applied_to_groupd_rules_when_initial_predicate_is_true_and_all_individual_rules_are_satisfied -✔️ Shared_async_When_is_applied_to_grouped_rules_when_initial_predicate_is_true -✔️ Shared_async_When_is_not_applied_to_grouped_rules_when_initial_predicate_is_false -✔️ Shared_async_When_respects_the_smaller_scope_of_a_inner_Unless_when_the_inner_Unless_predicate_fails -✔️ Shared_async_When_respects_the_smaller_scope_of_an_inner_Unless_when_the_inner_Unless_predicate_is_satisfied -✔️ Shared_When_is_applied_to_groupd_rules_when_initial_predicate_is_true_and_all_individual_rules_are_satisfied -✔️ Shared_When_is_applied_to_grouped_rules_when_initial_predicate_is_true -✔️ Shared_When_is_not_applied_to_grouped_rules_when_initial_predicate_is_false -✔️ Shared_When_respects_the_smaller_scope_of_a_inner_Unless_when_the_inner_Unless_predicate_fails -✔️ Shared_When_respects_the_smaller_scope_of_an_inner_Unless_when_the_inner_Unless_predicate_is_satisfied -✔️ When_async_condition_executed_for_each_instance_of_RuleForEach_condition_should_not_be_cached -✔️ When_condition_executed_for_each_instance_of_RuleForEach_condition_should_not_be_cached -✔️ When_condition_only_executed_once -✔️ WhenAsync_condition_only_executed_once -``` -### ✔️ FluentValidation.Tests.StandalonePropertyValidationTester -``` -✔️ Should_validate_property_value_without_instance -``` -### ✔️ FluentValidation.Tests.StringEnumValidatorTests -``` -✔️ IsValidTests_CaseInsensitive_CaseCorrect -✔️ IsValidTests_CaseInsensitive_CaseIncorrect -✔️ IsValidTests_CaseSensitive_CaseCorrect -✔️ IsValidTests_CaseSensitive_CaseIncorrect -✔️ When_enumType_is_not_an_enum_it_should_throw -✔️ When_enumType_is_null_it_should_throw -✔️ When_the_property_is_initialized_with_empty_string_then_the_validator_should_fail -✔️ When_the_property_is_initialized_with_invalid_string_then_the_validator_should_fail -✔️ When_the_property_is_initialized_with_null_then_the_validator_should_be_valid -✔️ When_validation_fails_the_default_error_should_be_set -``` -### ✔️ FluentValidation.Tests.TrackingCollectionTests -``` -✔️ Add_AddsItem -✔️ Should_not_raise_event_once_handler_detached -✔️ When_Item_Added_Raises_ItemAdded -``` -### ✔️ FluentValidation.Tests.TransformTests -``` -✔️ Transforms_collection_element -✔️ Transforms_collection_element_async -✔️ Transforms_property_value -✔️ Transforms_property_value_to_another_type -``` -### ✔️ FluentValidation.Tests.UserSeverityTester -``` -✔️ Can_Provide_conditional_severity -✔️ Can_Provide_severity_for_item_in_collection -✔️ Correctly_provides_object_being_validated -✔️ Defaults_user_severity_to_error -✔️ Should_use_last_supplied_severity -✔️ Stores_user_severity_against_validation_failure -✔️ Throws_when_provider_is_null -``` -### ✔️ FluentValidation.Tests.UserStateTester -``` -✔️ Can_Provide_state_for_item_in_collection -✔️ Correctly_provides_object_being_validated -✔️ Stores_user_state_against_validation_failure -✔️ Throws_when_provider_is_null -``` -### ✔️ FluentValidation.Tests.ValidateAndThrowTester -``` -✔️ Does_not_throw_when_valid -✔️ Does_not_throw_when_valid_and_a_ruleset -✔️ Does_not_throw_when_valid_and_a_ruleset_async -✔️ Does_not_throw_when_valid_async -✔️ Only_root_validator_throws -✔️ Populates_errors -✔️ Serializes_exception -✔️ Throws_exception -✔️ Throws_exception_async -✔️ Throws_exception_with_a_ruleset -✔️ Throws_exception_with_a_ruleset_async -✔️ ToString_provides_error_details -✔️ ValidationException_provides_correct_message_when_appendDefaultMessage_false -✔️ ValidationException_provides_correct_message_when_appendDefaultMessage_true -``` -### ✔️ FluentValidation.Tests.ValidationResultTests -``` -✔️ Can_serialize_failure -✔️ Can_serialize_result -✔️ Should_add_errors -✔️ Should_be_valid_when_there_are_no_errors -✔️ Should_not_be_valid_when_there_are_errors -✔️ ToString_return_empty_string_when_there_is_no_error -✔️ ToString_return_error_messages_with_given_separator -✔️ ToString_return_error_messages_with_newline_as_separator -``` -### ✔️ FluentValidation.Tests.ValidatorDescriptorTester -``` -✔️ Does_not_throw_when_rule_declared_without_property -✔️ Gets_validators_for_property -✔️ GetValidatorsForMember_and_GetRulesForMember_can_both_retrieve_for_model_level_rule -✔️ Returns_empty_collection_for_property_with_no_validators -✔️ Should_retrieve_name_given_to_it_pass_property_as_string -``` -### ✔️ FluentValidation.Tests.ValidatorSelectorTests -``` -✔️ Can_use_property_with_include -✔️ Does_not_validate_other_property -✔️ Does_not_validate_other_property_using_expression -✔️ Executes_correct_rule_when_using_property_with_include -✔️ Executes_correct_rule_when_using_property_with_include_async -✔️ Includes_nested_property -✔️ Includes_nested_property_using_expression -✔️ MemberNameValidatorSelector_returns_true_when_property_name_matches -✔️ Validates_nullable_property_with_overriden_name_when_selected -✔️ Validates_property_using_expression -``` -### ✔️ FluentValidation.Tests.ValidatorTesterTester -``` -✔️ Allows_only_one_failure_to_match -✔️ Can_use_indexer_in_string_message -✔️ Can_use_indexer_in_string_message_inverse -✔️ Expected_error_code_check -✔️ Expected_message_argument_check -✔️ Expected_message_check -✔️ Expected_severity_check -✔️ Expected_state_check -✔️ Matches_any_failure -✔️ Matches_model_level_rule -✔️ Model_level_check_fails_if_no_model_level_failures -✔️ ShouldHaveChildValidator_should_not_throw_when_property_Does_have_child_validator -✔️ ShouldHaveChildValidator_should_not_throw_when_property_Does_have_child_validator_and_expecting_a_basetype -✔️ ShouldHaveChildValidator_should_not_throw_when_property_has_collection_validators -✔️ ShouldHaveChildValidator_should_throw_when_property_has_a_different_child_validator -✔️ ShouldHaveChildValidator_should_work_with_DependentRules -✔️ ShouldHaveChildvalidator_throws_when_collection_property_Does_not_have_child_validator -✔️ ShouldHaveChildValidator_throws_when_property_does_not_have_child_validator -✔️ ShouldHaveChildValidator_works_on_model_level_rules -✔️ ShouldHaveValidationError_async -✔️ ShouldHaveValidationError_async_throws -✔️ ShouldHaveValidationError_model_async -✔️ ShouldHaveValidationError_model_async_throws -✔️ ShouldHaveValidationError_preconstructed_object_does_not_throw_for_unwritable_property -✔️ ShouldHaveValidationError_should_not_throw_when_there_are_errors_with_preconstructed_object -✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors -✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "") -✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null) -✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors_ruleforeach -✔️ ShouldHaveValidationError_Should_support_nested_properties -✔️ ShouldHaveValidationError_Should_throw_when_there_are_no_validation_errors -✔️ ShouldHaveValidationError_should_throw_when_there_are_no_validation_errors_with_preconstructed_object -✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "") -✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "cardNumber") -✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: null) -✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 42, cardNumber: "cardNumber") -✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors_ruleforeach -✔️ ShouldHaveValidationError_with_an_unmatched_rule_and_a_single_error_should_throw_an_exception -✔️ ShouldHaveValidationError_with_an_unmatched_rule_and_multiple_errors_should_throw_an_exception -✔️ ShouldHaveValidationErrorFor_takes_account_of_rulesets -✔️ ShouldHaveValidationErrorFor_takes_account_of_rulesets_fluent_approach -✔️ ShouldNotHaveValidationError_async -✔️ ShouldNotHaveValidationError_async_model_throws -✔️ ShouldNotHaveValidationError_async_throws -✔️ ShouldNotHaveValidationError_model_async -✔️ ShouldNotHaveValidationError_should_correctly_handle_explicitly_providing_object_to_validate -✔️ ShouldNotHaveValidationError_should_correctly_handle_explicitly_providing_object_to_validate_and_other_property_fails_validation -✔️ ShouldNotHaveValidationError_should_have_validation_error_details_when_thrown_ruleforeach -✔️ ShouldNotHaveValidationError_should_not_throw_when_there_are_no_errors -✔️ ShouldNotHAveValidationError_should_not_throw_When_there_are_no_errors_with_preconstructed_object -✔️ ShouldNotHaveValidationError_should_not_throw_when_there_are_not_validation_errors_ruleforeach -✔️ ShouldNotHaveValidationError_Should_support_nested_properties -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_errors -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_errors_with_preconstructed_object -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "") -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "cardNumber") -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: null) -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "cardNumber") -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "") -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null) -✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors_ruleforeach -✔️ Tests_nested_property -✔️ Tests_nested_property_reverse -✔️ Tests_nested_property_using_obsolete_method -✔️ TestValidate_runs_async -✔️ TestValidate_runs_async_throws -✔️ Unexpected_error_code_check -✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["bar"]) -✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo", "bar"]) -✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo"]) -✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: []) -✔️ Unexpected_severity_check -✔️ Unexpected_state_check +|[FluentValidation.Tests.AbstractValidatorTester](#r0s0)|35✅|||12ms| +|[FluentValidation.Tests.AccessorCacheTests](#r0s1)|4✅||1⚪|4ms| +|[FluentValidation.Tests.AssemblyScannerTester](#r0s2)|2✅|||2ms| +|[FluentValidation.Tests.CascadingFailuresTester](#r0s3)|38✅|||23ms| +|[FluentValidation.Tests.ChainedValidationTester](#r0s4)|13✅|||6ms| +|[FluentValidation.Tests.ChainingValidatorsTester](#r0s5)|3✅|||1ms| +|[FluentValidation.Tests.ChildRulesTests](#r0s6)|2✅|||7ms| +|[FluentValidation.Tests.CollectionValidatorWithParentTests](#r0s7)|16✅|||13ms| +|[FluentValidation.Tests.ComplexValidationTester](#r0s8)|17✅|||26ms| +|[FluentValidation.Tests.ConditionTests](#r0s9)|18✅|||9ms| +|[FluentValidation.Tests.CreditCardValidatorTests](#r0s10)|2✅|||2ms| +|[FluentValidation.Tests.CustomFailureActionTester](#r0s11)|3✅|||1ms| +|[FluentValidation.Tests.CustomMessageFormatTester](#r0s12)|6✅|||3ms| +|[FluentValidation.Tests.CustomValidatorTester](#r0s13)|10✅|||6ms| +|[FluentValidation.Tests.DefaultValidatorExtensionTester](#r0s14)|30✅|||38ms| +|[FluentValidation.Tests.EmailValidatorTests](#r0s15)|36✅|||18ms| +|[FluentValidation.Tests.EmptyTester](#r0s16)|9✅|||5ms| +|[FluentValidation.Tests.EnumValidatorTests](#r0s17)|12✅|||24ms| +|[FluentValidation.Tests.EqualValidatorTests](#r0s18)|10✅|||3ms| +|[FluentValidation.Tests.ExactLengthValidatorTester](#r0s19)|6✅|||2ms| +|[FluentValidation.Tests.ExclusiveBetweenValidatorTests](#r0s20)|19✅|||6ms| +|[FluentValidation.Tests.ExtensionTester](#r0s21)|4✅|||1ms| +|[FluentValidation.Tests.ForEachRuleTests](#r0s22)|34✅|||47ms| +|[FluentValidation.Tests.GreaterThanOrEqualToValidatorTester](#r0s23)|14✅|||5ms| +|[FluentValidation.Tests.GreaterThanValidatorTester](#r0s24)|13✅|||4ms| +|[FluentValidation.Tests.InclusiveBetweenValidatorTests](#r0s25)|18✅|||4ms| +|[FluentValidation.Tests.InheritanceValidatorTest](#r0s26)|11✅|||18ms| +|[FluentValidation.Tests.InlineValidatorTester](#r0s27)|1✅|||2ms| +|[FluentValidation.Tests.LanguageManagerTests](#r0s28)|21✅|||28ms| +|[FluentValidation.Tests.LengthValidatorTests](#r0s29)|16✅|||17ms| +|[FluentValidation.Tests.LessThanOrEqualToValidatorTester](#r0s30)|13✅|||4ms| +|[FluentValidation.Tests.LessThanValidatorTester](#r0s31)|16✅|||6ms| +|[FluentValidation.Tests.LocalisedMessagesTester](#r0s32)|6✅|||3ms| +|[FluentValidation.Tests.LocalisedNameTester](#r0s33)|2✅|||1ms| +|[FluentValidation.Tests.MemberAccessorTests](#r0s34)|9✅|||5ms| +|[FluentValidation.Tests.MessageFormatterTests](#r0s35)|10✅|||2ms| +|[FluentValidation.Tests.ModelLevelValidatorTests](#r0s36)|2✅|||1ms| +|[FluentValidation.Tests.NameResolutionPluggabilityTester](#r0s37)|3✅|||2ms| +|[FluentValidation.Tests.NotEmptyTester](#r0s38)|10✅|||7ms| +|[FluentValidation.Tests.NotEqualValidatorTests](#r0s39)|11✅|||7ms| +|[FluentValidation.Tests.NotNullTester](#r0s40)|5✅|||1ms| +|[FluentValidation.Tests.NullTester](#r0s41)|5✅|||2ms| +|[FluentValidation.Tests.OnFailureTests](#r0s42)|10✅|||8ms| +|[FluentValidation.Tests.PredicateValidatorTester](#r0s43)|5✅|||2ms| +|[FluentValidation.Tests.PropertyChainTests](#r0s44)|7✅|||1ms| +|[FluentValidation.Tests.RegularExpressionValidatorTests](#r0s45)|15✅|||6ms| +|[FluentValidation.Tests.RuleBuilderTests](#r0s46)|29✅|||96ms| +|[FluentValidation.Tests.RuleDependencyTests](#r0s47)|14✅|||3s| +|[FluentValidation.Tests.RulesetTests](#r0s48)|21✅|||14ms| +|[FluentValidation.Tests.ScalePrecisionValidatorTests](#r0s49)|6✅|||4ms| +|[FluentValidation.Tests.SharedConditionTests](#r0s50)|42✅|||42ms| +|[FluentValidation.Tests.StandalonePropertyValidationTester](#r0s51)|1✅|||0ms| +|[FluentValidation.Tests.StringEnumValidatorTests](#r0s52)|10✅|||5ms| +|[FluentValidation.Tests.TrackingCollectionTests](#r0s53)|3✅|||2ms| +|[FluentValidation.Tests.TransformTests](#r0s54)|4✅|||3ms| +|[FluentValidation.Tests.UserSeverityTester](#r0s55)|7✅|||3ms| +|[FluentValidation.Tests.UserStateTester](#r0s56)|4✅|||3ms| +|[FluentValidation.Tests.ValidateAndThrowTester](#r0s57)|14✅|||25ms| +|[FluentValidation.Tests.ValidationResultTests](#r0s58)|8✅|||8ms| +|[FluentValidation.Tests.ValidatorDescriptorTester](#r0s59)|5✅|||1ms| +|[FluentValidation.Tests.ValidatorSelectorTests](#r0s60)|10✅|||9ms| +|[FluentValidation.Tests.ValidatorTesterTester](#r0s61)|73✅|||74ms| +### ✅ FluentValidation.Tests.AbstractValidatorTester +``` +✅ Can_replace_default_errorcode_resolver +✅ CanValidateInstancesOfType_returns_false_when_comparing_against_some_other_type +✅ CanValidateInstancesOfType_returns_true_when_comparing_against_same_type +✅ CanValidateInstancesOfType_returns_true_when_comparing_against_subclass +✅ Default_error_code_should_be_class_name +✅ OverridePropertyName_should_override_property_name +✅ OverridePropertyName_with_lambda_should_override_property_name +✅ PreValidate_bypasses_nullcheck_on_instance +✅ RuleForeach_with_null_instances +✅ Should_be_valid_when_there_are_no_failures_for_single_property +✅ Should_not_main_state +✅ Should_throw_for_non_member_expression_when_validating_single_property +✅ Should_throw_when_rule_is_null +✅ Should_validate_public_Field +✅ Should_validate_single_Field +✅ Should_validate_single_property +✅ Should_validate_single_property_where_invalid_property_as_string +✅ Should_validate_single_property_where_property_as_string +✅ Uses_named_parameters_to_validate_ruleset +✅ Validates_single_property_by_path +✅ Validates_type_when_using_non_generic_validate_overload +✅ When_the_validators_fail_then_the_errors_Should_be_accessible_via_the_errors_property +✅ When_the_validators_fail_then_validatorrunner_should_return_false +✅ When_the_Validators_pass_then_the_validatorRunner_should_return_true +✅ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: ) +✅ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: AnotherInt Test Message) +✅ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: ) +✅ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: AnotherInt Test Message) +✅ WhenPreValidationReturnsTrue_ValidatorsGetHit_Validate +✅ WhenPreValidationReturnsTrue_ValidatorsGetHit_ValidateAsync +✅ WithErrorCode_should_override_error_code +✅ WithMessage_and_WithErrorCode_should_override_error_message_and_error_code +✅ WithMessage_should_override_error_message +✅ WithName_should_override_field_name +✅ WithName_should_override_field_name_with_value_from_other_property +``` +### ✅ FluentValidation.Tests.AccessorCacheTests +``` +⚪ Benchmark +✅ Equality_comparison_check +✅ Gets_accessor +✅ Gets_member_for_nested_property +✅ Identifies_if_memberexp_acts_on_model_instance +``` +### ✅ FluentValidation.Tests.AssemblyScannerTester +``` +✅ Finds_validators_for_types +✅ ForEach_iterates_over_types +``` +### ✅ FluentValidation.Tests.CascadingFailuresTester +``` +✅ Cascade_mode_can_be_set_after_validator_instantiated +✅ Cascade_mode_can_be_set_after_validator_instantiated_async +✅ Cascade_mode_can_be_set_after_validator_instantiated_async_legacy +✅ Cascade_mode_can_be_set_after_validator_instantiated_legacy +✅ Validation_continues_on_failure +✅ Validation_continues_on_failure_async +✅ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level +✅ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_async +✅ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_async_legacy +✅ Validation_continues_on_failure_when_set_to_Stop_globally_and_overriden_at_rule_level_legacy +✅ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level +✅ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_async +✅ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_async_legacy +✅ Validation_continues_on_failure_when_set_to_StopOnFirstFailure_at_validator_level_and_overriden_at_rule_level_legacy +✅ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop +✅ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_async +✅ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_async_legacy +✅ Validation_continues_to_second_validator_when_first_validator_succeeds_and_cascade_set_to_stop_legacy +✅ Validation_continues_when_set_to_Continue_at_validator_level +✅ Validation_continues_when_set_to_Continue_at_validator_level_async +✅ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level +✅ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_async +✅ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_async_legacy +✅ Validation_stops_on_failure_when_set_to_Continue_and_overriden_at_rule_level_legacy +✅ Validation_stops_on_first_failure +✅ Validation_stops_on_first_failure_async +✅ Validation_stops_on_first_failure_async_legacy +✅ Validation_stops_on_first_failure_legacy +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_and_async_validator_is_invoked_synchronously +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_and_async_validator_is_invoked_synchronously_legacy +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_async +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_async_legacy +✅ Validation_stops_on_first_Failure_when_set_to_Continue_globally_and_overriden_at_rule_level_legacy +✅ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level +✅ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_async +✅ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_async_legacy +✅ Validation_stops_on_first_failure_when_set_to_StopOnFirstFailure_at_validator_level_legacy +``` +### ✅ FluentValidation.Tests.ChainedValidationTester +``` +✅ Can_validate_using_validator_for_base_type +✅ Chained_property_should_be_excluded +✅ Chained_validator_descriptor +✅ Chained_validator_should_not_be_invoked_on_null_property +✅ Condition_should_work_with_chained_property +✅ Explicitly_included_properties_should_be_propagated_to_nested_validators +✅ Explicitly_included_properties_should_be_propagated_to_nested_validators_using_strings +✅ Separate_validation_on_chained_property +✅ Separate_validation_on_chained_property_conditional +✅ Separate_validation_on_chained_property_valid +✅ Should_allow_normal_rules_and_chained_property_on_same_property +✅ Uses_explicit_ruleset +✅ Validates_chained_property +``` +### ✅ FluentValidation.Tests.ChainingValidatorsTester +``` +✅ Options_should_only_apply_to_current_validator +✅ Should_create_multiple_validators +✅ Should_execute_multiple_validators +``` +### ✅ FluentValidation.Tests.ChildRulesTests +``` +✅ Can_define_nested_rules_for_collection +✅ ChildRules_works_with_RuleSet +``` +### ✅ FluentValidation.Tests.CollectionValidatorWithParentTests +``` +✅ Async_condition_should_work_with_child_collection +✅ Can_specify_condition_for_individual_collection_elements +✅ Can_validate_collection_using_validator_for_base_type +✅ Collection_should_be_excluded +✅ Collection_should_be_explicitly_included_with_expression +✅ Collection_should_be_explicitly_included_with_string +✅ Condition_should_work_with_child_collection +✅ Creates_validator_using_context_from_property_value +✅ Should_override_property_name +✅ Should_work_with_top_level_collection_validator +✅ Should_work_with_top_level_collection_validator_and_overriden_name +✅ Skips_null_items +✅ Validates_collection +✅ Validates_collection_asynchronously +✅ Validates_collection_several_levels_deep +✅ Validates_collection_several_levels_deep_async +``` +### ✅ FluentValidation.Tests.ComplexValidationTester +``` +✅ Async_condition_should_work_with_complex_property +✅ Async_condition_should_work_with_complex_property_when_validator_invoked_synchronously +✅ Can_directly_validate_multiple_fields_of_same_type +✅ Can_validate_using_validator_for_base_type +✅ Complex_property_should_be_excluded +✅ Complex_validator_should_not_be_invoked_on_null_property +✅ Condition_should_work_with_complex_property +✅ Condition_should_work_with_complex_property_when_invoked_async +✅ Explicitly_included_properties_should_be_propagated_to_nested_validators +✅ Explicitly_included_properties_should_be_propagated_to_nested_validators_using_strings +✅ Multiple_rules_in_chain_with_childvalidator_shouldnt_reuse_accessor +✅ Multiple_rules_in_chain_with_childvalidator_shouldnt_reuse_accessor_async +✅ Should_allow_normal_rules_and_complex_property_on_same_property +✅ Should_override_propertyName +✅ Validates_child_validator_asynchronously +✅ Validates_child_validator_synchronously +✅ Validates_complex_property +``` +### ✅ FluentValidation.Tests.ConditionTests +``` +✅ Async_condition_executed_synchronosuly_with_asynchronous_collection_rule +✅ Async_condition_executed_synchronosuly_with_asynchronous_rule +✅ Async_condition_executed_synchronosuly_with_synchronous_collection_role +✅ Async_condition_executed_synchronosuly_with_synchronous_role +✅ Async_condition_is_applied_to_all_validators_in_the_chain +✅ Async_condition_is_applied_to_all_validators_in_the_chain_when_executed_synchronously +✅ Async_condition_is_applied_to_single_validator_in_the_chain_when_ApplyConditionTo_set_to_CurrentValidator +✅ Condition_is_applied_to_all_validators_in_the_chain +✅ Condition_is_applied_to_single_validator_in_the_chain_when_ApplyConditionTo_set_to_CurrentValidator +✅ Sync_condition_is_applied_to_async_validators +✅ Validation_should_fail_when_async_condition_does_not_match +✅ Validation_should_fail_when_async_condition_matches +✅ Validation_should_fail_when_condition_does_not_match +✅ Validation_should_fail_when_condition_matches +✅ Validation_should_succeed_when_async_condition_does_not_match +✅ Validation_should_succeed_when_async_condition_matches +✅ Validation_should_succeed_when_condition_does_not_match +✅ Validation_should_succeed_when_condition_matches +``` +### ✅ FluentValidation.Tests.CreditCardValidatorTests +``` +✅ IsValidTests +✅ When_validation_fails_the_default_error_should_be_set +``` +### ✅ FluentValidation.Tests.CustomFailureActionTester +``` +✅ Does_not_invoke_action_if_validation_success +✅ Invokes_custom_action_on_failure +✅ Passes_object_being_validated_to_action +``` +### ✅ FluentValidation.Tests.CustomMessageFormatTester +``` +✅ Replaces_propertyvalue_placeholder +✅ Replaces_propertyvalue_with_empty_string_when_null +✅ Should_format_custom_message +✅ Uses_custom_delegate_for_building_message +✅ Uses_custom_delegate_for_building_message_only_for_specific_validator +✅ Uses_property_value_in_message +``` +### ✅ FluentValidation.Tests.CustomValidatorTester +``` +✅ New_Custom_Returns_single_failure +✅ New_Custom_Returns_single_failure_async +✅ New_custom_uses_empty_property_name_for_model_level_rule +✅ New_Custom_When_property_name_omitted_infers_property_name +✅ New_Custom_When_property_name_omitted_infers_property_name_nested +✅ New_Custom_within_ruleset +✅ New_CustomAsync_within_ruleset +✅ Perserves_property_chain_using_custom +✅ Runs_async_rule_synchronously_when_validator_invoked_synchronously +✅ Runs_sync_rule_asynchronously_when_validator_invoked_asynchronously +``` +### ✅ FluentValidation.Tests.DefaultValidatorExtensionTester +``` +✅ Empty_should_create_EmptyValidator +✅ Equal_should_create_EqualValidator_with_explicit_value +✅ Equal_should_create_EqualValidator_with_lambda +✅ GreaterThan_should_create_GreaterThanValidator_with_explicit_value +✅ GreaterThan_should_create_GreaterThanValidator_with_lambda +✅ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_explicit_value +✅ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_lambda +✅ GreaterThanOrEqual_should_create_GreaterThanOrEqualValidator_with_lambda_with_other_Nullable +✅ Length_should_create_ExactLengthValidator +✅ Length_should_create_LengthValidator +✅ Length_should_create_MaximumLengthValidator +✅ Length_should_create_MinimumLengthValidator +✅ LessThan_should_create_LessThanValidator_with_explicit_value +✅ LessThan_should_create_LessThanValidator_with_lambda +✅ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_explicit_value +✅ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_lambda +✅ LessThanOrEqual_should_create_LessThanOrEqualValidator_with_lambda_with_other_Nullable +✅ Must_should_create_PredicateValidator_with_context +✅ Must_should_create_PredicateValidator_with_PropertyValidatorContext +✅ Must_should_create_PredicteValidator +✅ MustAsync_should_create_AsyncPredicateValidator_with_context +✅ MustAsync_should_create_AsyncPredicateValidator_with_PropertyValidatorContext +✅ MustAsync_should_create_AsyncPredicteValidator +✅ MustAsync_should_not_throw_InvalidCastException +✅ NotEmpty_should_create_NotEmptyValidator +✅ NotEqual_should_create_NotEqualValidator_with_explicit_value +✅ NotEqual_should_create_NotEqualValidator_with_lambda +✅ NotNull_should_create_NotNullValidator +✅ ScalePrecision_should_create_ScalePrecisionValidator +✅ ScalePrecision_should_create_ScalePrecisionValidator_with_ignore_trailing_zeros +``` +### ✅ FluentValidation.Tests.EmailValidatorTests +``` +✅ Fails_email_validation_aspnetcore_compatible(email: " \r \t \n") +✅ Fails_email_validation_aspnetcore_compatible(email: "") +✅ Fails_email_validation_aspnetcore_compatible(email: "@someDomain.com") +✅ Fails_email_validation_aspnetcore_compatible(email: "@someDomain@abc.com") +✅ Fails_email_validation_aspnetcore_compatible(email: "0") +✅ Fails_email_validation_aspnetcore_compatible(email: "someName") +✅ Fails_email_validation_aspnetcore_compatible(email: "someName@") +✅ Fails_email_validation_aspnetcore_compatible(email: "someName@a@b.com") +✅ Invalid_email_addressex_regex(email: "") +✅ Invalid_email_addressex_regex(email: "first.last@test..co.uk") +✅ Invalid_email_addressex_regex(email: "testperso") +✅ Invalid_email_addressex_regex(email: "thisisaverylongstringcodeplex.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: " @someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "!#$%&'*+-/=?^_`|~@someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "\"firstName.lastName\"@someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "1234@someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "firstName.lastName@someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "someName@1234.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "someName@some_domain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "someName@some~domain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "someName@someDomain.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: "someName@someDomain￯.com") +✅ Valid_email_addresses_aspnetcore_compatible(email: null) +✅ Valid_email_addresses_regex(email: "__somename@example.com") +✅ Valid_email_addresses_regex(email: "!def!xyz%abc@example.com") +✅ Valid_email_addresses_regex(email: "\"Abc@def\"@example.com") +✅ Valid_email_addresses_regex(email: "\"Abc\\@def\"@example.com") +✅ Valid_email_addresses_regex(email: "\"Fred Bloggs\"@example.com") +✅ Valid_email_addresses_regex(email: "\"Joe\\Blow\"@example.com") +✅ Valid_email_addresses_regex(email: "$A12345@example.com") +✅ Valid_email_addresses_regex(email: "customer/department=shipping@example.com") +✅ Valid_email_addresses_regex(email: "first.last@test.co.uk") +✅ Valid_email_addresses_regex(email: "testperson@gmail.com") +✅ Valid_email_addresses_regex(email: "TestPerson@gmail.com") +✅ Valid_email_addresses_regex(email: "testperson+label@gmail.com") +✅ Valid_email_addresses_regex(email: null) +``` +### ✅ FluentValidation.Tests.EmptyTester +``` +✅ Passes_for_ienumerable_that_doesnt_implement_ICollection +✅ Passes_when_collection_empty +✅ When_there_is_a_value_then_the_validator_should_fail +✅ When_validation_fails_error_should_be_set +✅ When_value_is_Default_for_type_validator_should_pass_datetime +✅ When_value_is_Default_for_type_validator_should_pass_int +✅ When_value_is_empty_string_validator_should_pass +✅ When_value_is_null_validator_should_pass +✅ When_value_is_whitespace_validation_should_pass +``` +### ✅ FluentValidation.Tests.EnumValidatorTests +``` +✅ Flags_enum_invalid_when_using_outofrange_negative_value +✅ Flags_enum_invalid_when_using_outofrange_positive_value +✅ Flags_enum_valid_when_using_bitwise_value +✅ Flags_enum_validates_correctly_when_using_zero_value +✅ Flags_enum_with_overlapping_flags_valid_when_using_bitwise_value +✅ IsValidTests +✅ Nullable_enum_invalid_when_bad_value_specified +✅ Nullable_enum_valid_when_property_value_is_null +✅ Nullable_enum_valid_when_value_specified +✅ When_the_enum_is_initialized_with_invalid_value_then_the_validator_should_fail +✅ When_the_enum_is_not_initialized_with_valid_value_then_the_validator_should_fail +✅ When_validation_fails_the_default_error_should_be_set +``` +### ✅ FluentValidation.Tests.EqualValidatorTests +``` +✅ Comparison_property_uses_custom_resolver +✅ Should_store_comparison_type +✅ Should_store_property_to_compare +✅ Should_succeed_on_case_insensitive_comparison +✅ Should_succeed_on_case_insensitive_comparison_using_expression +✅ Should_use_ordinal_comparison_by_default +✅ Validates_against_property +✅ When_the_objects_are_equal_validation_should_succeed +✅ When_the_objects_are_not_equal_validation_should_fail +✅ When_validation_fails_the_error_should_be_set +``` +### ✅ FluentValidation.Tests.ExactLengthValidatorTester +``` +✅ Min_and_max_properties_should_be_set +✅ When_exact_length_rule_failes_error_should_have_exact_length_error_errorcode +✅ When_the_text_is_an_exact_length_the_validator_should_pass +✅ When_the_text_length_is_larger_the_validator_should_fail +✅ When_the_text_length_is_smaller_the_validator_should_fail +✅ When_the_validator_fails_the_error_message_should_be_set +``` +### ✅ FluentValidation.Tests.ExclusiveBetweenValidatorTests +``` +✅ To_and_from_properties_should_be_set +✅ To_and_from_properties_should_be_set_for_dates +✅ To_and_from_properties_should_be_set_for_strings +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_not_null +✅ When_the_text_is_larger_than_the_range_then_the_validator_should_fail +✅ When_the_text_is_larger_than_the_range_then_the_validator_should_fail_for_strings +✅ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw +✅ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings +✅ When_the_validator_fails_the_error_message_should_be_set +✅ When_the_validator_fails_the_error_message_should_be_set_for_strings +✅ When_the_value_is_between_the_range_specified_then_the_validator_should_pass +✅ When_the_value_is_between_the_range_specified_then_the_validator_should_pass_for_strings +✅ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_fail +✅ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_fail_for_strings +✅ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_fail +✅ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_fail_for_strings +✅ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail +✅ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail_for_strings +``` +### ✅ FluentValidation.Tests.ExtensionTester +``` +✅ Should_extract_member_from_member_expression +✅ Should_return_null_for_non_member_expressions +✅ Should_split_pascal_cased_member_name +✅ SplitPascalCase_should_return_null_when_input_is_null +``` +### ✅ FluentValidation.Tests.ForEachRuleTests +``` +✅ Async_condition_should_work_with_child_collection +✅ Can_access_colletion_index +✅ Can_access_colletion_index_async +✅ Can_access_parent_index +✅ Can_access_parent_index_async +✅ Can_specify_condition_for_individual_collection_elements +✅ Can_use_cascade_with_RuleForEach +✅ Can_validate_collection_using_validator_for_base_type +✅ Collection_should_be_excluded +✅ Collection_should_be_explicitly_included_with_expression +✅ Collection_should_be_explicitly_included_with_string +✅ Condition_should_work_with_child_collection +✅ Correctly_gets_collection_indices +✅ Correctly_gets_collection_indices_async +✅ Executes_rule_for_each_item_in_collection +✅ Executes_rule_for_each_item_in_collection_async +✅ Nested_collection_for_null_property_should_not_throw_null_reference +✅ Nested_conditions_Rule_For +✅ Nested_conditions_Rule_For_Each +✅ Overrides_indexer +✅ Overrides_indexer_async +✅ Regular_rules_can_drop_into_RuleForEach +✅ RuleForEach_async_RunsTasksSynchronously +✅ Should_not_scramble_property_name_when_using_collection_validators_several_levels_deep +✅ Should_not_scramble_property_name_when_using_collection_validators_several_levels_deep_with_ValidateAsync +✅ Should_override_property_name +✅ Skips_null_items +✅ Top_level_collection +✅ Uses_useful_error_message_when_used_on_non_property +✅ Validates_child_validator_asynchronously +✅ Validates_child_validator_synchronously +✅ Validates_collection +✅ When_runs_outside_RuleForEach_loop +✅ When_runs_outside_RuleForEach_loop_async +``` +### ✅ FluentValidation.Tests.GreaterThanOrEqualToValidatorTester +``` +✅ Comparison_property_uses_custom_resolver +✅ Comparison_type +✅ Should_fail_when_less_than_input +✅ Should_localize_value +✅ Should_set_default_error_when_validation_fails +✅ Should_succeed_when_equal_to_input +✅ Should_succeed_when_greater_than_input +✅ Validates_nullable_with_nullable_property +✅ Validates_with_nullable_property +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_is_null_cross_property +✅ Validates_with_nullable_when_property_not_null +✅ Validates_with_nullable_when_property_not_null_cross_property +✅ Validates_with_property +``` +### ✅ FluentValidation.Tests.GreaterThanValidatorTester +``` +✅ Comparison_property_uses_custom_resolver +✅ Comparison_Type +✅ Should_fail_when_equal_to_input +✅ Should_fail_when_less_than_input +✅ Should_set_default_error_when_validation_fails +✅ Should_succeed_when_greater_than_input +✅ Validates_nullable_with_nullable_property +✅ Validates_with_nullable_property +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_is_null_cross_property +✅ Validates_with_nullable_when_property_not_null +✅ Validates_with_nullable_when_property_not_null_cross_property +✅ Validates_with_property +``` +### ✅ FluentValidation.Tests.InclusiveBetweenValidatorTests +``` +✅ To_and_from_properties_should_be_set +✅ To_and_from_properties_should_be_set_for_strings +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_not_null +✅ When_the_text_is_larger_than_the_range_then_the_validator_should_fail +✅ When_the_text_is_larger_than_the_range_then_the_validator_should_fail_for_strings +✅ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw +✅ When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings +✅ When_the_validator_fails_the_error_message_should_be_set +✅ When_the_validator_fails_the_error_message_should_be_set_for_strings +✅ When_the_value_is_between_the_range_specified_then_the_validator_should_pass +✅ When_the_value_is_between_the_range_specified_then_the_validator_should_pass_for_strings +✅ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass +✅ When_the_value_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass_for_strings +✅ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass +✅ When_the_value_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass_for_strings +✅ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail +✅ When_the_value_is_smaller_than_the_range_then_the_validator_should_fail_for_strings +``` +### ✅ FluentValidation.Tests.InheritanceValidatorTest +``` +✅ Can_use_custom_subclass_with_nongeneric_overload +✅ Validates_collection +✅ Validates_collection_async +✅ Validates_inheritance_async +✅ Validates_inheritance_hierarchy +✅ Validates_ruleset +✅ Validates_ruleset_async +✅ Validates_with_callback +✅ Validates_with_callback_accepting_derived +✅ Validates_with_callback_accepting_derived_async +✅ Validates_with_callback_async +``` +### ✅ FluentValidation.Tests.InlineValidatorTester +``` +✅ Uses_inline_validator_to_build_rules +``` +### ✅ FluentValidation.Tests.LanguageManagerTests +``` +✅ All_languages_should_be_loaded +✅ All_localizations_have_same_parameters_as_English +✅ Always_use_specific_language +✅ Always_use_specific_language_with_string_source +✅ Can_replace_message +✅ Can_replace_message_without_overriding_all_languages +✅ Disables_localization +✅ Falls_back_to_default_localization_key_when_error_code_key_not_found +✅ Falls_back_to_english_when_culture_not_registered +✅ Falls_back_to_english_when_translation_missing +✅ Falls_back_to_parent_culture +✅ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn-BA") +✅ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn") +✅ Gets_translation_for_bosnian_latin_culture(cultureName: "bs") +✅ Gets_translation_for_croatian_culture +✅ Gets_translation_for_culture +✅ Gets_translation_for_serbian_culture(cultureName: "sr-Latn-RS") +✅ Gets_translation_for_serbian_culture(cultureName: "sr-Latn") +✅ Gets_translation_for_serbian_culture(cultureName: "sr") +✅ Gets_translation_for_specific_culture +✅ Uses_error_code_as_localization_key +``` +### ✅ FluentValidation.Tests.LengthValidatorTests +``` +✅ Min_and_max_properties_should_be_set +✅ When_input_is_null_then_the_validator_should_pass +✅ When_the_max_is_smaller_than_the_min_then_the_validator_should_throw +✅ When_the_maxlength_validator_fails_the_error_message_should_be_set +✅ When_the_minlength_validator_fails_the_error_message_should_be_set +✅ When_the_text_is_between_the_lambda_range_specified_then_the_validator_should_pass +✅ When_the_text_is_between_the_range_specified_then_the_validator_should_pass +✅ When_the_text_is_exactly_the_size_of_the_lambda_lower_bound_then_the_validator_should_pass +✅ When_the_text_is_exactly_the_size_of_the_lambda_upper_bound_then_the_validator_should_pass +✅ When_the_text_is_exactly_the_size_of_the_lower_bound_then_the_validator_should_pass +✅ When_the_text_is_exactly_the_size_of_the_upper_bound_then_the_validator_should_pass +✅ When_the_text_is_larger_than_the_lambda_range_then_the_validator_should_fail +✅ When_the_text_is_larger_than_the_range_then_the_validator_should_fail +✅ When_the_text_is_smaller_than_the_lambda_range_then_the_validator_should_fail +✅ When_the_text_is_smaller_than_the_range_then_the_validator_should_fail +✅ When_the_validator_fails_the_error_message_should_be_set +``` +### ✅ FluentValidation.Tests.LessThanOrEqualToValidatorTester +``` +✅ Comparison_property_uses_custom_resolver +✅ Comparison_type +✅ Should_fail_when_greater_than_input +✅ Should_set_default_error_when_validation_fails +✅ Should_succeed_when_equal_to_input +✅ Should_succeed_when_less_than_input +✅ Validates_nullable_with_nullable_property +✅ Validates_with_nullable_property +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_is_null_cross_property +✅ Validates_with_nullable_when_property_not_null +✅ Validates_with_nullable_when_property_not_null_cross_property +✅ Validates_with_property +``` +### ✅ FluentValidation.Tests.LessThanValidatorTester +``` +✅ Comparison_property_uses_custom_resolver +✅ Comparison_type +✅ Extracts_property_from_constant_using_expression +✅ Extracts_property_from_expression +✅ Should_fail_when_equal_to_input +✅ Should_fail_when_greater_than_input +✅ Should_set_default_validation_message_when_validation_fails +✅ Should_succeed_when_less_than_input +✅ Should_throw_when_value_to_compare_is_null +✅ Validates_against_property +✅ Validates_nullable_with_nullable_property +✅ Validates_with_nullable_property +✅ Validates_with_nullable_when_property_is_null +✅ Validates_with_nullable_when_property_not_null +✅ Validates_with_nullable_when_property_not_null_cross_property +✅ Validates_with_nullable_when_property_null_cross_property +``` +### ✅ FluentValidation.Tests.LocalisedMessagesTester +``` +✅ Correctly_assigns_default_localized_error_message +✅ Does_not_throw_InvalidCastException_when_using_RuleForEach +✅ Formats_string_with_placeholders +✅ Formats_string_with_placeholders_when_you_cant_edit_the_string +✅ Uses_func_to_get_message +✅ Uses_string_format_with_property_value +``` +### ✅ FluentValidation.Tests.LocalisedNameTester +``` +✅ Uses_localized_name +✅ Uses_localized_name_expression +``` +### ✅ FluentValidation.Tests.MemberAccessorTests +``` +✅ ComplexPropertyGet +✅ ComplexPropertySet +✅ Equality +✅ ImplicitCast +✅ Name +✅ SimpleFieldGet +✅ SimpleFieldSet +✅ SimplePropertyGet +✅ SimplePropertySet +``` +### ✅ FluentValidation.Tests.MessageFormatterTests +``` +✅ Adds_argument_and_custom_arguments +✅ Adds_formatted_argument_and_custom_arguments +✅ Adds_formatted_argument_and_formatted_custom_arguments +✅ Adds_PropertyName_to_message +✅ Adds_value_to_message +✅ Format_property_value +✅ Should_ignore_unknown_numbered_parameters +✅ Should_ignore_unknown_parameters +✅ Understands_date_formats +✅ Understands_numeric_formats +``` +### ✅ FluentValidation.Tests.ModelLevelValidatorTests +``` +✅ Can_use_child_validator_at_model_level +✅ Validates_at_model_level +``` +### ✅ FluentValidation.Tests.NameResolutionPluggabilityTester +``` +✅ Resolves_nested_properties +✅ ShouldHaveValidationError_Should_support_custom_propertynameresolver +✅ Uses_custom_property_name +``` +### ✅ FluentValidation.Tests.NotEmptyTester +``` +✅ Fails_for_array +✅ Fails_for_ienumerable_that_doesnt_implement_ICollection +✅ Fails_when_collection_empty +✅ When_there_is_a_value_then_the_validator_should_pass +✅ When_validation_fails_error_should_be_set +✅ When_value_is_Default_for_type_validator_should_fail_datetime +✅ When_value_is_Default_for_type_validator_should_fail_int +✅ When_value_is_empty_string_validator_should_fail +✅ When_value_is_null_validator_should_fail +✅ When_value_is_whitespace_validation_should_fail +``` +### ✅ FluentValidation.Tests.NotEqualValidatorTests +``` +✅ Comparison_property_uses_custom_resolver +✅ Should_handle_custom_value_types_correctly +✅ Should_not_be_valid_for_case_insensitve_comparison +✅ Should_not_be_valid_for_case_insensitve_comparison_with_expression +✅ Should_store_comparison_type +✅ Should_store_property_to_compare +✅ Should_use_ordinal_comparison_by_default +✅ Validates_across_properties +✅ When_the_objects_are_equal_then_the_validator_should_fail +✅ When_the_objects_are_not_equal_then_the_validator_should_pass +✅ When_the_validator_fails_the_error_message_should_be_set +``` +### ✅ FluentValidation.Tests.NotNullTester +``` +✅ Fails_when_nullable_value_type_is_null +✅ Not_null_validator_should_not_crash_with_non_nullable_value_type +✅ NotNullValidator_should_fail_if_value_is_null +✅ NotNullValidator_should_pass_if_value_has_value +✅ When_the_validator_fails_the_error_message_should_be_set +``` +### ✅ FluentValidation.Tests.NullTester +``` +✅ Not_null_validator_should_not_crash_with_non_nullable_value_type +✅ NullValidator_should_fail_if_value_has_value +✅ NullValidator_should_pass_if_value_is_null +✅ Passes_when_nullable_value_type_is_null +✅ When_the_validator_passes_the_error_message_should_be_set +``` +### ✅ FluentValidation.Tests.OnFailureTests +``` +✅ OnFailure_called_for_each_failed_rule +✅ OnFailure_called_for_each_failed_rule_asyncAsync +✅ Should_be_able_to_access_error_message_in_OnFailure +✅ ShouldHaveChildValidator_should_be_true +✅ ShouldHaveChildValidator_works_with_Include +✅ WhenAsyncWithOnFailure_should_invoke_condition_on_async_inner_validator +✅ WhenAsyncWithOnFailure_should_invoke_condition_on_inner_validator +✅ WhenAsyncWithOnFailure_should_invoke_condition_on_inner_validator_invoked_synchronously +✅ WhenWithOnFailure_should_invoke_condition_on_async_inner_validator +✅ WhenWithOnFailure_should_invoke_condition_on_inner_validator +``` +### ✅ FluentValidation.Tests.PredicateValidatorTester +``` +✅ Should_fail_when_predicate_returns_false +✅ Should_succeed_when_predicate_returns_true +✅ Should_throw_when_predicate_is_null +✅ When_validation_fails_metadata_should_be_set_on_failure +✅ When_validation_fails_the_default_error_should_be_set +``` +### ✅ FluentValidation.Tests.PropertyChainTests +``` +✅ AddIndexer_throws_when_nothing_added +✅ Calling_ToString_should_construct_string_representation_of_chain +✅ Calling_ToString_should_construct_string_representation_of_chain_with_indexers +✅ Creates_from_expression +✅ Should_be_subchain +✅ Should_ignore_blanks +✅ Should_not_be_subchain +``` +### ✅ FluentValidation.Tests.RegularExpressionValidatorTests +``` +✅ Can_access_expression_in_message +✅ Can_access_expression_in_message_lambda +✅ Can_access_expression_in_message_lambda_regex +✅ Uses_lazily_loaded_expression +✅ Uses_lazily_loaded_expression_with_options +✅ Uses_regex_object +✅ When_the_text_does_not_match_the_lambda_regex_regular_expression_then_the_validator_should_fail +✅ When_the_text_does_not_match_the_lambda_regular_expression_then_the_validator_should_fail +✅ When_the_text_does_not_match_the_regular_expression_then_the_validator_should_fail +✅ When_the_text_is_empty_then_the_validator_should_fail +✅ When_the_text_is_null_then_the_validator_should_pass +✅ When_the_text_matches_the_lambda_regex_regular_expression_then_the_validator_should_pass +✅ When_the_text_matches_the_lambda_regular_expression_then_the_validator_should_pass +✅ When_the_text_matches_the_regular_expression_then_the_validator_should_pass +✅ When_validation_fails_the_default_error_should_be_set +``` +### ✅ FluentValidation.Tests.RuleBuilderTests +``` +✅ Adding_a_validator_should_return_builder +✅ Adding_a_validator_should_store_validator +✅ Calling_validate_should_delegate_to_underlying_validator +✅ Calling_ValidateAsync_should_delegate_to_underlying_async_validator +✅ Calling_ValidateAsync_should_delegate_to_underlying_sync_validator +✅ Conditional_child_validator_should_register_with_validator_type_not_property +✅ Nullable_object_with_async_condition_should_not_throw +✅ Nullable_object_with_condition_should_not_throw +✅ Property_should_return_null_when_it_is_not_a_property_being_validated +✅ Property_should_return_property_being_validated +✅ PropertyDescription_should_return_custom_property_name +✅ PropertyDescription_should_return_property_name_split +✅ Result_should_use_custom_property_name_when_no_property_name_can_be_determined +✅ Rule_for_a_non_memberexpression_should_not_generate_property_name +✅ Should_build_property_name +✅ Should_compile_expression +✅ Should_set_custom_error +✅ Should_set_custom_property_name +✅ Should_throw_if_message_is_null +✅ Should_throw_if_overriding_validator_is_null +✅ Should_throw_if_overriding_validator_provider_is_null +✅ Should_throw_if_property_name_is_null +✅ Should_throw_if_validator_is_null +✅ Should_throw_when_async_inverse_predicate_is_null +✅ Should_throw_when_async_predicate_is_null +✅ Should_throw_when_context_predicate_is_null +✅ Should_throw_when_inverse_context_predicate_is_null +✅ Should_throw_when_inverse_predicate_is_null +✅ Should_throw_when_predicate_is_null +``` +### ✅ FluentValidation.Tests.RuleDependencyTests +``` +✅ Async_inside_dependent_rules +✅ Async_inside_dependent_rules_when_parent_rule_not_async +✅ Dependent_rules_inside_ruleset +✅ Dependent_rules_inside_when +✅ Does_not_invoke_dependent_rule_if_parent_rule_does_not_pass +✅ Invokes_dependent_rule_if_parent_rule_passes +✅ Nested_dependent_rules +✅ Nested_dependent_rules_inside_ruleset +✅ Nested_dependent_rules_inside_ruleset_inside_method +✅ Nested_dependent_rules_inside_ruleset_no_result_when_second_level_fails +✅ Nested_dependent_rules_inside_ruleset_no_result_when_top_level_fails +✅ TestAsyncWithDependentRules_AsyncEntry +✅ TestAsyncWithDependentRules_SyncEntry +✅ Treats_root_level_RuleFor_call_as_dependent_rule_if_user_forgets_to_use_DependentRulesBuilder +``` +### ✅ FluentValidation.Tests.RulesetTests +``` +✅ Applies_multiple_rulesets_to_rule +✅ Combines_rulesets_and_explicit_properties +✅ Combines_rulesets_and_explicit_properties_async +✅ Executes_all_rules +✅ Executes_in_rule_in_default_and_none +✅ Executes_in_rule_in_ruleset_and_default +✅ Executes_multiple_rulesets +✅ Executes_rules_in_default_ruleset_and_specific_ruleset +✅ Executes_rules_in_specified_ruleset +✅ Executes_rules_not_specified_in_ruleset +✅ Includes_all_rulesets +✅ Includes_all_rulesets_async +✅ Includes_combination_of_rulesets +✅ Includes_combination_of_rulesets_async +✅ Ruleset_cascades_to_child_collection_validator +✅ Ruleset_cascades_to_child_validator +✅ Ruleset_selection_should_cascade_downwards_with_when_setting_child_validator_using_include_statement +✅ Ruleset_selection_should_cascade_downwards_with_when_setting_child_validator_using_include_statement_with_lambda +✅ Ruleset_selection_should_not_cascade_downwards_when_set_on_property +✅ Trims_spaces +✅ WithMessage_works_inside_rulesets +``` +### ✅ FluentValidation.Tests.ScalePrecisionValidatorTests +``` +✅ Scale_precision_should_be_valid +✅ Scale_precision_should_be_valid_when_ignoring_trailing_zeroes +✅ Scale_precision_should_be_valid_when_they_are_equal +✅ Scale_precision_should_not_be_valid +✅ Scale_precision_should_not_be_valid_when_ignoring_trailing_zeroes +✅ Scale_precision_should_not_be_valid_when_they_are_equal +``` +### ✅ FluentValidation.Tests.SharedConditionTests +``` +✅ Async_condition_can_be_used_inside_ruleset +✅ Condition_can_be_used_inside_ruleset +✅ Does_not_execute_custom_Rule_when_async_condition_false +✅ Does_not_execute_custom_Rule_when_condition_false +✅ Does_not_execute_customasync_Rule_when_async_condition_false +✅ Does_not_execute_customasync_Rule_when_condition_false +✅ Doesnt_throw_NullReferenceException_when_instance_not_null +✅ Doesnt_throw_NullReferenceException_when_instance_not_null_async +✅ Executes_custom_rule_when_async_condition_true +✅ Executes_custom_rule_when_condition_true +✅ Executes_customasync_rule_when_async_condition_true +✅ Executes_customasync_rule_when_condition_true +✅ Nested_async_conditions_with_Custom_rule +✅ Nested_async_conditions_with_CustomAsync_rule +✅ Nested_conditions_with_Custom_rule +✅ Nested_conditions_with_CustomAsync_rule +✅ Outer_async_Unless_clause_will_trump_an_inner_Unless_clause_when_inner_fails_but_the_outer_is_satisfied +✅ Outer_Unless_clause_will_trump_an_inner_Unless_clause_when_inner_fails_but_the_outer_is_satisfied +✅ Rules_invoke_when_inverse_shared_async_condition_matches +✅ Rules_invoke_when_inverse_shared_condition_matches +✅ Rules_not_invoked_when_inverse_shared_async_condition_does_not_match +✅ Rules_not_invoked_when_inverse_shared_condition_does_not_match +✅ RuleSet_can_be_used_inside_async_condition +✅ RuleSet_can_be_used_inside_condition +✅ Runs_otherwise_conditions_for_UnlessAsync +✅ Runs_otherwise_conditions_for_When +✅ Runs_otherwise_conditions_for_WhenAsync +✅ Runs_otherwise_conditons_for_Unless +✅ Shared_async_When_is_applied_to_groupd_rules_when_initial_predicate_is_true_and_all_individual_rules_are_satisfied +✅ Shared_async_When_is_applied_to_grouped_rules_when_initial_predicate_is_true +✅ Shared_async_When_is_not_applied_to_grouped_rules_when_initial_predicate_is_false +✅ Shared_async_When_respects_the_smaller_scope_of_a_inner_Unless_when_the_inner_Unless_predicate_fails +✅ Shared_async_When_respects_the_smaller_scope_of_an_inner_Unless_when_the_inner_Unless_predicate_is_satisfied +✅ Shared_When_is_applied_to_groupd_rules_when_initial_predicate_is_true_and_all_individual_rules_are_satisfied +✅ Shared_When_is_applied_to_grouped_rules_when_initial_predicate_is_true +✅ Shared_When_is_not_applied_to_grouped_rules_when_initial_predicate_is_false +✅ Shared_When_respects_the_smaller_scope_of_a_inner_Unless_when_the_inner_Unless_predicate_fails +✅ Shared_When_respects_the_smaller_scope_of_an_inner_Unless_when_the_inner_Unless_predicate_is_satisfied +✅ When_async_condition_executed_for_each_instance_of_RuleForEach_condition_should_not_be_cached +✅ When_condition_executed_for_each_instance_of_RuleForEach_condition_should_not_be_cached +✅ When_condition_only_executed_once +✅ WhenAsync_condition_only_executed_once +``` +### ✅ FluentValidation.Tests.StandalonePropertyValidationTester +``` +✅ Should_validate_property_value_without_instance +``` +### ✅ FluentValidation.Tests.StringEnumValidatorTests +``` +✅ IsValidTests_CaseInsensitive_CaseCorrect +✅ IsValidTests_CaseInsensitive_CaseIncorrect +✅ IsValidTests_CaseSensitive_CaseCorrect +✅ IsValidTests_CaseSensitive_CaseIncorrect +✅ When_enumType_is_not_an_enum_it_should_throw +✅ When_enumType_is_null_it_should_throw +✅ When_the_property_is_initialized_with_empty_string_then_the_validator_should_fail +✅ When_the_property_is_initialized_with_invalid_string_then_the_validator_should_fail +✅ When_the_property_is_initialized_with_null_then_the_validator_should_be_valid +✅ When_validation_fails_the_default_error_should_be_set +``` +### ✅ FluentValidation.Tests.TrackingCollectionTests +``` +✅ Add_AddsItem +✅ Should_not_raise_event_once_handler_detached +✅ When_Item_Added_Raises_ItemAdded +``` +### ✅ FluentValidation.Tests.TransformTests +``` +✅ Transforms_collection_element +✅ Transforms_collection_element_async +✅ Transforms_property_value +✅ Transforms_property_value_to_another_type +``` +### ✅ FluentValidation.Tests.UserSeverityTester +``` +✅ Can_Provide_conditional_severity +✅ Can_Provide_severity_for_item_in_collection +✅ Correctly_provides_object_being_validated +✅ Defaults_user_severity_to_error +✅ Should_use_last_supplied_severity +✅ Stores_user_severity_against_validation_failure +✅ Throws_when_provider_is_null +``` +### ✅ FluentValidation.Tests.UserStateTester +``` +✅ Can_Provide_state_for_item_in_collection +✅ Correctly_provides_object_being_validated +✅ Stores_user_state_against_validation_failure +✅ Throws_when_provider_is_null +``` +### ✅ FluentValidation.Tests.ValidateAndThrowTester +``` +✅ Does_not_throw_when_valid +✅ Does_not_throw_when_valid_and_a_ruleset +✅ Does_not_throw_when_valid_and_a_ruleset_async +✅ Does_not_throw_when_valid_async +✅ Only_root_validator_throws +✅ Populates_errors +✅ Serializes_exception +✅ Throws_exception +✅ Throws_exception_async +✅ Throws_exception_with_a_ruleset +✅ Throws_exception_with_a_ruleset_async +✅ ToString_provides_error_details +✅ ValidationException_provides_correct_message_when_appendDefaultMessage_false +✅ ValidationException_provides_correct_message_when_appendDefaultMessage_true +``` +### ✅ FluentValidation.Tests.ValidationResultTests +``` +✅ Can_serialize_failure +✅ Can_serialize_result +✅ Should_add_errors +✅ Should_be_valid_when_there_are_no_errors +✅ Should_not_be_valid_when_there_are_errors +✅ ToString_return_empty_string_when_there_is_no_error +✅ ToString_return_error_messages_with_given_separator +✅ ToString_return_error_messages_with_newline_as_separator +``` +### ✅ FluentValidation.Tests.ValidatorDescriptorTester +``` +✅ Does_not_throw_when_rule_declared_without_property +✅ Gets_validators_for_property +✅ GetValidatorsForMember_and_GetRulesForMember_can_both_retrieve_for_model_level_rule +✅ Returns_empty_collection_for_property_with_no_validators +✅ Should_retrieve_name_given_to_it_pass_property_as_string +``` +### ✅ FluentValidation.Tests.ValidatorSelectorTests +``` +✅ Can_use_property_with_include +✅ Does_not_validate_other_property +✅ Does_not_validate_other_property_using_expression +✅ Executes_correct_rule_when_using_property_with_include +✅ Executes_correct_rule_when_using_property_with_include_async +✅ Includes_nested_property +✅ Includes_nested_property_using_expression +✅ MemberNameValidatorSelector_returns_true_when_property_name_matches +✅ Validates_nullable_property_with_overriden_name_when_selected +✅ Validates_property_using_expression +``` +### ✅ FluentValidation.Tests.ValidatorTesterTester +``` +✅ Allows_only_one_failure_to_match +✅ Can_use_indexer_in_string_message +✅ Can_use_indexer_in_string_message_inverse +✅ Expected_error_code_check +✅ Expected_message_argument_check +✅ Expected_message_check +✅ Expected_severity_check +✅ Expected_state_check +✅ Matches_any_failure +✅ Matches_model_level_rule +✅ Model_level_check_fails_if_no_model_level_failures +✅ ShouldHaveChildValidator_should_not_throw_when_property_Does_have_child_validator +✅ ShouldHaveChildValidator_should_not_throw_when_property_Does_have_child_validator_and_expecting_a_basetype +✅ ShouldHaveChildValidator_should_not_throw_when_property_has_collection_validators +✅ ShouldHaveChildValidator_should_throw_when_property_has_a_different_child_validator +✅ ShouldHaveChildValidator_should_work_with_DependentRules +✅ ShouldHaveChildvalidator_throws_when_collection_property_Does_not_have_child_validator +✅ ShouldHaveChildValidator_throws_when_property_does_not_have_child_validator +✅ ShouldHaveChildValidator_works_on_model_level_rules +✅ ShouldHaveValidationError_async +✅ ShouldHaveValidationError_async_throws +✅ ShouldHaveValidationError_model_async +✅ ShouldHaveValidationError_model_async_throws +✅ ShouldHaveValidationError_preconstructed_object_does_not_throw_for_unwritable_property +✅ ShouldHaveValidationError_should_not_throw_when_there_are_errors_with_preconstructed_object +✅ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors +✅ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "") +✅ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null) +✅ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors_ruleforeach +✅ ShouldHaveValidationError_Should_support_nested_properties +✅ ShouldHaveValidationError_Should_throw_when_there_are_no_validation_errors +✅ ShouldHaveValidationError_should_throw_when_there_are_no_validation_errors_with_preconstructed_object +✅ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "") +✅ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "cardNumber") +✅ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: null) +✅ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 42, cardNumber: "cardNumber") +✅ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors_ruleforeach +✅ ShouldHaveValidationError_with_an_unmatched_rule_and_a_single_error_should_throw_an_exception +✅ ShouldHaveValidationError_with_an_unmatched_rule_and_multiple_errors_should_throw_an_exception +✅ ShouldHaveValidationErrorFor_takes_account_of_rulesets +✅ ShouldHaveValidationErrorFor_takes_account_of_rulesets_fluent_approach +✅ ShouldNotHaveValidationError_async +✅ ShouldNotHaveValidationError_async_model_throws +✅ ShouldNotHaveValidationError_async_throws +✅ ShouldNotHaveValidationError_model_async +✅ ShouldNotHaveValidationError_should_correctly_handle_explicitly_providing_object_to_validate +✅ ShouldNotHaveValidationError_should_correctly_handle_explicitly_providing_object_to_validate_and_other_property_fails_validation +✅ ShouldNotHaveValidationError_should_have_validation_error_details_when_thrown_ruleforeach +✅ ShouldNotHaveValidationError_should_not_throw_when_there_are_no_errors +✅ ShouldNotHAveValidationError_should_not_throw_When_there_are_no_errors_with_preconstructed_object +✅ ShouldNotHaveValidationError_should_not_throw_when_there_are_not_validation_errors_ruleforeach +✅ ShouldNotHaveValidationError_Should_support_nested_properties +✅ ShouldNotHaveValidationError_should_throw_when_there_are_errors +✅ ShouldNotHaveValidationError_should_throw_when_there_are_errors_with_preconstructed_object +✅ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "") +✅ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "cardNumber") +✅ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: null) +✅ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "cardNumber") +✅ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "") +✅ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null) +✅ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors_ruleforeach +✅ Tests_nested_property +✅ Tests_nested_property_reverse +✅ Tests_nested_property_using_obsolete_method +✅ TestValidate_runs_async +✅ TestValidate_runs_async_throws +✅ Unexpected_error_code_check +✅ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["bar"]) +✅ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo", "bar"]) +✅ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo"]) +✅ Unexpected_message_check(withoutErrMsg: "bar", errMessages: []) +✅ Unexpected_severity_check +✅ Unexpected_state_check ``` \ No newline at end of file diff --git a/__tests__/__outputs__/jest-junit.md b/__tests__/__outputs__/jest-junit.md index 5aecf5d..1579828 100644 --- a/__tests__/__outputs__/jest-junit.md +++ b/__tests__/__outputs__/jest-junit.md @@ -3,12 +3,12 @@ **6** tests were completed in **1s** with **1** passed, **4** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[__tests__\main.test.js](#r0s0)|1✔️|3❌||486ms| -|[__tests__\second.test.js](#r0s1)||1❌|1✖️|82ms| +|[__tests__\main.test.js](#r0s0)|1✅|3❌||486ms| +|[__tests__\second.test.js](#r0s1)||1❌|1⚪|82ms| ### ❌ __tests__\main.test.js ``` Test 1 - ✔️ Passing test + ✅ Passing test Test 1 › Test 1.1 ❌ Failing test Error: expect(received).toBeTruthy() @@ -22,5 +22,5 @@ Test 2 ``` ❌ Timeout test : Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Error: -✖️ Skipped test +⚪ Skipped test ``` \ No newline at end of file diff --git a/__tests__/__outputs__/jest-test-results.md b/__tests__/__outputs__/jest-test-results.md index ed545bf..bc86f3c 100644 --- a/__tests__/__outputs__/jest-test-results.md +++ b/__tests__/__outputs__/jest-test-results.md @@ -3,430 +3,430 @@ **4239** tests were completed in **166s** with **4207** passed, **2** failed and **30** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|e2e/__tests__/asyncAndCallback.test.ts|1✔️|||746ms| -|e2e/__tests__/asyncRegenerator.test.ts|1✔️|||4s| -|e2e/__tests__/autoClearMocks.test.ts|2✔️|||2s| -|e2e/__tests__/autoResetMocks.test.ts|2✔️|||2s| -|e2e/__tests__/autoRestoreMocks.test.ts|2✔️|||2s| -|e2e/__tests__/babelPluginJestHoist.test.ts|1✔️|||6s| -|e2e/__tests__/badSourceMap.test.ts|1✔️|||858ms| -|e2e/__tests__/beforeAllFiltered.ts|1✔️|||958ms| -|e2e/__tests__/beforeEachQueue.ts|1✔️||1✖️|55ms| -|e2e/__tests__/callDoneTwice.test.ts|1✔️|||882ms| -|e2e/__tests__/chaiAssertionLibrary.ts|1✔️|||2s| -|e2e/__tests__/circularInequality.test.ts|1✔️|||1s| -|e2e/__tests__/circusConcurrentEach.test.ts|2✔️|||2s| -|e2e/__tests__/circusDeclarationErrors.test.ts|1✔️|||869ms| -|e2e/__tests__/clearCache.test.ts|2✔️|||1s| -|e2e/__tests__/cliHandlesExactFilenames.test.ts|2✔️|||1s| -|e2e/__tests__/compareDomNodes.test.ts|1✔️|||1s| -|e2e/__tests__/config.test.ts|6✔️|||4s| -|e2e/__tests__/console.test.ts|7✔️|||8s| -|e2e/__tests__/consoleAfterTeardown.test.ts|1✔️|||1s| -|e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts|1✔️|||793ms| -|e2e/__tests__/coverageHandlebars.test.ts|1✔️|||2s| -|e2e/__tests__/coverageRemapping.test.ts|1✔️|||13s| -|e2e/__tests__/coverageReport.test.ts|12✔️|||22s| -|e2e/__tests__/coverageThreshold.test.ts|5✔️|||5s| -|e2e/__tests__/coverageTransformInstrumented.test.ts|1✔️|||5s| -|e2e/__tests__/coverageWithoutTransform.test.ts|1✔️|||1s| -|e2e/__tests__/createProcessObject.test.ts|1✔️|||908ms| -|e2e/__tests__/customInlineSnapshotMatchers.test.ts|1✔️|||2s| -|e2e/__tests__/customMatcherStackTrace.test.ts|2✔️|||2s| -|e2e/__tests__/customReporters.test.ts|9✔️|||7s| -|e2e/__tests__/customResolver.test.ts|1✔️|||826ms| -|e2e/__tests__/customTestSequencers.test.ts|3✔️|||3s| -|e2e/__tests__/debug.test.ts|1✔️|||899ms| -|e2e/__tests__/declarationErrors.test.ts|3✔️|||2s| -|e2e/__tests__/dependencyClash.test.ts|1✔️|||833ms| -|e2e/__tests__/detectOpenHandles.ts|8✔️|||8s| -|e2e/__tests__/domDiffing.test.ts|1✔️|||1s| -|e2e/__tests__/doneInHooks.test.ts|1✔️|||855ms| -|e2e/__tests__/dynamicRequireDependencies.ts|1✔️|||847ms| -|e2e/__tests__/each.test.ts|7✔️|||5s| -|e2e/__tests__/emptyDescribeWithHooks.test.ts|4✔️|||3s| -|e2e/__tests__/emptySuiteError.test.ts|1✔️|||885ms| -|e2e/__tests__/env.test.ts|6✔️|||5s| -|e2e/__tests__/environmentAfterTeardown.test.ts|1✔️|||892ms| -|e2e/__tests__/errorOnDeprecated.test.ts|1✔️||24✖️|56ms| -|e2e/__tests__/esmConfigFile.test.ts|3✔️|||526ms| -|e2e/__tests__/executeTestsOnceInMpr.ts|1✔️|||976ms| -|e2e/__tests__/existentRoots.test.ts|4✔️|||627ms| -|e2e/__tests__/expectAsyncMatcher.test.ts|2✔️|||3s| -|e2e/__tests__/expectInVm.test.ts|1✔️|||2s| -|e2e/__tests__/extraGlobals.test.ts|1✔️|||1s| -|e2e/__tests__/failureDetailsProperty.test.ts|1✔️|||907ms| -|e2e/__tests__/failures.test.ts|7✔️|||10s| -|e2e/__tests__/fakePromises.test.ts|2✔️|||2s| -|e2e/__tests__/fatalWorkerError.test.ts|1✔️|||3s| -|e2e/__tests__/filter.test.ts|7✔️|||5s| -|e2e/__tests__/findRelatedFiles.test.ts|5✔️|||6s| -|e2e/__tests__/focusedTests.test.ts|1✔️|||888ms| -|e2e/__tests__/forceExit.test.ts|1✔️|||2s| -|e2e/__tests__/generatorMock.test.ts|1✔️|||1s| -|e2e/__tests__/global-mutation.test.ts|1✔️|||40ms| -|e2e/__tests__/global.test.ts|1✔️|||31ms| -|e2e/__tests__/globals.test.ts|10✔️|||8s| -|e2e/__tests__/globalSetup.test.ts|10✔️|||14s| -|e2e/__tests__/globalTeardown.test.ts|7✔️|||12s| -|e2e/__tests__/hasteMapMockChanged.test.ts|1✔️|||379ms| -|e2e/__tests__/hasteMapSha1.test.ts|1✔️|||298ms| -|e2e/__tests__/hasteMapSize.test.ts|2✔️|||397ms| -|e2e/__tests__/importedGlobals.test.ts|1✔️|||1s| -|e2e/__tests__/injectGlobals.test.ts|2✔️|||2s| -|e2e/__tests__/jasmineAsync.test.ts|15✔️|||28s| -|e2e/__tests__/jasmineAsyncWithPendingDuringTest.ts|1✔️||1✖️|72ms| -|e2e/__tests__/jest.config.js.test.ts|3✔️|||2s| -|e2e/__tests__/jest.config.ts.test.ts|5✔️|||14s| -|[e2e/__tests__/jestChangedFiles.test.ts](#r0s75)|9✔️|1❌||9s| -|e2e/__tests__/jestEnvironmentJsdom.test.ts|1✔️|||2s| -|e2e/__tests__/jestRequireActual.test.ts|1✔️|||2s| -|e2e/__tests__/jestRequireMock.test.ts|1✔️|||2s| -|e2e/__tests__/json.test.ts|2✔️|||29ms| -|e2e/__tests__/jsonReporter.test.ts|2✔️|||2s| -|e2e/__tests__/lifecycles.ts|1✔️|||861ms| -|e2e/__tests__/listTests.test.ts|2✔️|||945ms| -|e2e/__tests__/locationInResults.test.ts|2✔️|||2s| -|e2e/__tests__/logHeapUsage.test.ts|1✔️|||884ms| -|e2e/__tests__/mockNames.test.ts|8✔️|||7s| -|e2e/__tests__/modernFakeTimers.test.ts|2✔️|||2s| -|e2e/__tests__/moduleNameMapper.test.ts|5✔️|||5s| -|e2e/__tests__/moduleParentNullInTest.ts|1✔️|||886ms| -|e2e/__tests__/multiProjectRunner.test.ts|14✔️|||16s| -|e2e/__tests__/nativeAsyncMock.test.ts|1✔️|||55ms| -|e2e/__tests__/nativeEsm.test.ts|2✔️||1✖️|905ms| -|e2e/__tests__/nativeEsmTypescript.test.ts|1✔️|||956ms| -|e2e/__tests__/nestedEventLoop.test.ts|1✔️|||1s| -|e2e/__tests__/nestedTestDefinitions.test.ts|4✔️|||5s| -|e2e/__tests__/nodePath.test.ts|1✔️|||866ms| -|e2e/__tests__/noTestFound.test.ts|2✔️|||1s| -|e2e/__tests__/noTestsFound.test.ts|5✔️|||3s| -|[e2e/__tests__/onlyChanged.test.ts](#r0s98)|8✔️|1❌||22s| -|e2e/__tests__/onlyFailuresNonWatch.test.ts|1✔️|||3s| -|e2e/__tests__/overrideGlobals.test.ts|2✔️|||2s| -|e2e/__tests__/pnp.test.ts|1✔️|||3s| -|e2e/__tests__/presets.test.ts|2✔️|||2s| -|e2e/__tests__/processExit.test.ts|1✔️|||1s| -|e2e/__tests__/promiseReject.test.ts|1✔️|||967ms| -|e2e/__tests__/regexCharInPath.test.ts|1✔️|||962ms| -|e2e/__tests__/requireAfterTeardown.test.ts|1✔️|||921ms| -|e2e/__tests__/requireMain.test.ts|1✔️|||1s| -|e2e/__tests__/requireMainAfterCreateRequire.test.ts|1✔️|||966ms| -|e2e/__tests__/requireMainIsolateModules.test.ts|1✔️|||976ms| -|e2e/__tests__/requireMainResetModules.test.ts|2✔️|||2s| -|e2e/__tests__/requireV8Module.test.ts|1✔️|||30ms| -|e2e/__tests__/resetModules.test.ts|1✔️|||926ms| -|e2e/__tests__/resolve.test.ts|1✔️|||2s| -|e2e/__tests__/resolveGetPaths.test.ts|1✔️|||1s| -|e2e/__tests__/resolveNodeModule.test.ts|1✔️|||943ms| -|e2e/__tests__/resolveNoFileExtensions.test.ts|2✔️|||1s| -|e2e/__tests__/resolveWithPaths.test.ts|1✔️|||1s| -|e2e/__tests__/runProgrammatically.test.ts|2✔️|||575ms| -|e2e/__tests__/runTestsByPath.test.ts|1✔️|||2s| -|e2e/__tests__/runtimeInternalModuleRegistry.test.ts|1✔️|||1s| -|e2e/__tests__/selectProjects.test.ts|18✔️|||5s| -|e2e/__tests__/setImmediate.test.ts|1✔️|||904ms| -|e2e/__tests__/setupFilesAfterEnvConfig.test.ts|2✔️|||2s| -|e2e/__tests__/showConfig.test.ts|1✔️|||195ms| -|e2e/__tests__/skipBeforeAfterAll.test.ts|1✔️|||1s| -|e2e/__tests__/snapshot-unknown.test.ts|1✔️|||838ms| -|e2e/__tests__/snapshot.test.ts|9✔️|||14s| -|e2e/__tests__/snapshotMockFs.test.ts|1✔️|||883ms| -|e2e/__tests__/snapshotResolver.test.ts|1✔️|||823ms| -|e2e/__tests__/snapshotSerializers.test.ts|2✔️|||2s| -|e2e/__tests__/stackTrace.test.ts|7✔️|||5s| -|e2e/__tests__/stackTraceNoCaptureStackTrace.test.ts|1✔️|||899ms| -|e2e/__tests__/stackTraceSourceMaps.test.ts|1✔️|||2s| -|e2e/__tests__/stackTraceSourceMapsWithCoverage.test.ts|1✔️|||2s| -|e2e/__tests__/supportsDashedArgs.ts|2✔️|||968ms| -|e2e/__tests__/symbol.test.ts|1✔️|||49ms| -|e2e/__tests__/testEnvironment.test.ts|1✔️|||2s| -|e2e/__tests__/testEnvironmentAsync.test.ts|1✔️|||1s| -|e2e/__tests__/testEnvironmentCircus.test.ts|1✔️|||2s| -|e2e/__tests__/testEnvironmentCircusAsync.test.ts|1✔️|||2s| -|e2e/__tests__/testFailureExitCode.test.ts|2✔️|||4s| -|e2e/__tests__/testInRoot.test.ts|1✔️|||1s| -|e2e/__tests__/testNamePattern.test.ts|1✔️|||859ms| -|e2e/__tests__/testNamePatternSkipped.test.ts|1✔️|||991ms| -|e2e/__tests__/testPathPatternReporterMessage.test.ts|1✔️|||3s| -|e2e/__tests__/testResultsProcessor.test.ts|1✔️|||910ms| -|e2e/__tests__/testRetries.test.ts|4✔️|||3s| -|e2e/__tests__/testTodo.test.ts|5✔️|||4s| -|e2e/__tests__/timeouts.test.ts|4✔️|||4s| -|e2e/__tests__/timeoutsLegacy.test.ts|1✔️||3✖️|71ms| -|e2e/__tests__/timerResetMocks.test.ts|2✔️|||2s| -|e2e/__tests__/timerUseRealTimers.test.ts|1✔️|||1s| -|e2e/__tests__/toMatchInlineSnapshot.test.ts|12✔️|||24s| -|e2e/__tests__/toMatchInlineSnapshotWithRetries.test.ts|3✔️|||5s| -|e2e/__tests__/toMatchSnapshot.test.ts|9✔️|||17s| -|e2e/__tests__/toMatchSnapshotWithRetries.test.ts|2✔️|||4s| -|e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts|3✔️|||4s| -|e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts|4✔️|||4s| -|e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts|5✔️|||4s| -|e2e/__tests__/transform.test.ts|16✔️|||27s| -|e2e/__tests__/transformLinkedModules.test.ts|1✔️|||783ms| -|e2e/__tests__/typescriptCoverage.test.ts|1✔️|||3s| -|e2e/__tests__/unexpectedToken.test.ts|3✔️|||3s| -|e2e/__tests__/useStderr.test.ts|1✔️|||1s| -|e2e/__tests__/v8Coverage.test.ts|2✔️|||2s| -|e2e/__tests__/verbose.test.ts|1✔️|||683ms| -|e2e/__tests__/version.test.ts|1✔️|||138ms| -|e2e/__tests__/watchModeNoAccess.test.ts|1✔️|||4s| -|e2e/__tests__/watchModeOnlyFailed.test.ts|1✔️|||1s| -|e2e/__tests__/watchModePatterns.test.ts|2✔️|||4s| -|e2e/__tests__/watchModeUpdateSnapshot.test.ts|1✔️|||1s| -|e2e/__tests__/workerForceExit.test.ts|2✔️|||5s| -|e2e/__tests__/wrongEnv.test.ts|5✔️|||4s| -|e2e/custom-test-sequencer/a.test.js|1✔️|||29ms| -|e2e/custom-test-sequencer/b.test.js|1✔️|||21ms| -|e2e/custom-test-sequencer/c.test.js|1✔️|||42ms| -|e2e/custom-test-sequencer/d.test.js|1✔️|||21ms| -|e2e/custom-test-sequencer/e.test.js|1✔️|||27ms| -|e2e/test-in-root/spec.js|1✔️|||19ms| -|e2e/test-in-root/test.js|1✔️|||37ms| -|e2e/timer-reset-mocks/after-reset-all-mocks/timerAndMock.test.js|2✔️|||30ms| -|e2e/timer-reset-mocks/with-reset-mocks/timerWithMock.test.js|1✔️|||34ms| -|e2e/v8-coverage/empty-sourcemap/test.ts|1✔️|||31ms| -|examples/angular/app.component.spec.ts|3✔️|||654ms| -|examples/angular/shared/data.service.spec.ts|2✔️|||431ms| -|examples/angular/shared/sub.service.spec.ts|1✔️|||109ms| -|examples/async/__tests__/user.test.js|8✔️|||96ms| -|examples/automatic-mocks/__tests__/automock.test.js|2✔️|||74ms| -|examples/automatic-mocks/__tests__/createMockFromModule.test.js|2✔️|||115ms| -|examples/automatic-mocks/__tests__/disableAutomocking.test.js|1✔️|||24ms| -|examples/enzyme/__tests__/CheckboxWithLabel-test.js|1✔️|||434ms| -|examples/getting-started/sum.test.js|1✔️|||78ms| -|examples/jquery/__tests__/display_user.test.js|1✔️|||196ms| -|examples/jquery/__tests__/fetch_current_user.test.js|2✔️|||196ms| -|examples/manual-mocks/__tests__/file_summarizer.test.js|1✔️|||87ms| -|examples/manual-mocks/__tests__/lodashMocking.test.js|1✔️|||109ms| -|examples/manual-mocks/__tests__/user.test.js|1✔️|||41ms| -|examples/manual-mocks/__tests__/userMocked.test.js|1✔️|||105ms| -|examples/module-mock/__tests__/full_mock.js|1✔️|||60ms| -|examples/module-mock/__tests__/mock_per_test.js|2✔️|||116ms| -|examples/module-mock/__tests__/partial_mock.js|1✔️|||215ms| -|examples/mongodb/__test__/db.test.js|1✔️|||236ms| -|examples/react-native/__tests__/intro.test.js|4✔️|||9s| -|examples/react-testing-library/__tests__/CheckboxWithLabel-test.js|1✔️|||469ms| -|examples/react/__tests__/CheckboxWithLabel-test.js|1✔️|||256ms| -|examples/snapshot/__tests__/clock.react.test.js|1✔️|||62ms| -|examples/snapshot/__tests__/link.react.test.js|4✔️|||181ms| -|examples/timer/__tests__/infinite_timer_game.test.js|1✔️|||94ms| -|examples/timer/__tests__/timer_game.test.js|3✔️|||74ms| -|examples/typescript/__tests__/calc.test.ts|6✔️|||276ms| -|examples/typescript/__tests__/CheckboxWithLabel-test.tsx|1✔️|||227ms| -|examples/typescript/__tests__/sub-test.ts|1✔️|||43ms| -|examples/typescript/__tests__/sum-test.ts|2✔️|||69ms| -|examples/typescript/__tests__/sum.test.js|2✔️|||100ms| -|packages/babel-jest/src/__tests__/index.ts|6✔️|||371ms| -|packages/babel-plugin-jest-hoist/src/__tests__/hoistPlugin.test.ts|4✔️|||347ms| -|packages/diff-sequences/src/__tests__/index.property.test.ts|7✔️|||357ms| -|packages/diff-sequences/src/__tests__/index.test.ts|48✔️|||195ms| -|packages/expect/src/__tests__/assertionCounts.test.ts|6✔️|||60ms| -|packages/expect/src/__tests__/asymmetricMatchers.test.ts|38✔️|||207ms| -|packages/expect/src/__tests__/extend.test.ts|10✔️|||99ms| -|packages/expect/src/__tests__/isError.test.ts|4✔️|||43ms| -|packages/expect/src/__tests__/matchers-toContain.property.test.ts|2✔️|||236ms| -|packages/expect/src/__tests__/matchers-toContainEqual.property.test.ts|2✔️|||287ms| -|packages/expect/src/__tests__/matchers-toEqual.property.test.ts|2✔️|||1s| -|packages/expect/src/__tests__/matchers-toStrictEqual.property.test.ts|3✔️|||394ms| -|packages/expect/src/__tests__/matchers.test.js|592✔️|||862ms| -|packages/expect/src/__tests__/spyMatchers.test.ts|248✔️|||395ms| -|packages/expect/src/__tests__/stacktrace.test.ts|3✔️|||69ms| -|packages/expect/src/__tests__/symbolInObjects.test.ts|3✔️|||33ms| -|packages/expect/src/__tests__/toEqual-dom.test.ts|12✔️|||99ms| -|packages/expect/src/__tests__/toThrowMatchers.test.ts|98✔️|||257ms| -|packages/expect/src/__tests__/utils.test.ts|41✔️|||147ms| -|packages/jest-circus/src/__tests__/afterAll.test.ts|6✔️|||6s| -|packages/jest-circus/src/__tests__/baseTest.test.ts|2✔️|||3s| -|packages/jest-circus/src/__tests__/circusItTestError.test.ts|8✔️|||300ms| -|packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts|3✔️|||81ms| -|packages/jest-circus/src/__tests__/hooks.test.ts|3✔️|||4s| -|packages/jest-circus/src/__tests__/hooksError.test.ts|32✔️|||127ms| -|packages/jest-cli/src/__tests__/cli/args.test.ts|17✔️|||345ms| -|packages/jest-cli/src/init/__tests__/init.test.js|24✔️|||119ms| -|packages/jest-cli/src/init/__tests__/modifyPackageJson.test.ts|4✔️|||30ms| -|packages/jest-config/src/__tests__/Defaults.test.ts|1✔️|||672ms| -|packages/jest-config/src/__tests__/getMaxWorkers.test.ts|7✔️|||67ms| -|packages/jest-config/src/__tests__/normalize.test.js|118✔️|||798ms| -|packages/jest-config/src/__tests__/readConfig.test.ts|1✔️|||76ms| -|packages/jest-config/src/__tests__/readConfigs.test.ts|3✔️|||135ms| -|packages/jest-config/src/__tests__/resolveConfigPath.test.ts|10✔️|||183ms| -|packages/jest-config/src/__tests__/setFromArgv.test.ts|4✔️|||53ms| -|packages/jest-config/src/__tests__/validatePattern.test.ts|4✔️|||52ms| -|packages/jest-console/src/__tests__/bufferedConsole.test.ts|20✔️|||171ms| -|packages/jest-console/src/__tests__/CustomConsole.test.ts|23✔️|||115ms| -|packages/jest-console/src/__tests__/getConsoleOutput.test.ts|12✔️|||56ms| -|packages/jest-core/src/__tests__/FailedTestsCache.test.js|1✔️|||25ms| -|packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.js|5✔️|||61ms| -|packages/jest-core/src/__tests__/globals.test.ts|1✔️|||22ms| -|packages/jest-core/src/__tests__/runJest.test.js|2✔️|||261ms| -|packages/jest-core/src/__tests__/SearchSource.test.ts|27✔️|||3s| -|packages/jest-core/src/__tests__/SnapshotInteractiveMode.test.js|13✔️|||89ms| -|packages/jest-core/src/__tests__/TestScheduler.test.js|8✔️|||520ms| -|packages/jest-core/src/__tests__/testSchedulerHelper.test.js|12✔️|||48ms| -|packages/jest-core/src/__tests__/watch.test.js|80✔️|||7s| -|packages/jest-core/src/__tests__/watchFileChanges.test.ts|1✔️|||2s| -|packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js|2✔️|||165ms| -|packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js|1✔️|||246ms| -|packages/jest-core/src/lib/__tests__/isValidPath.test.ts|3✔️|||166ms| -|packages/jest-core/src/lib/__tests__/logDebugMessages.test.ts|3✔️|||48ms| -|packages/jest-create-cache-key-function/src/__tests__/index.test.ts|1✔️|||75ms| -|packages/jest-diff/src/__tests__/diff.test.ts|107✔️|||625ms| -|packages/jest-diff/src/__tests__/diffStringsRaw.test.ts|2✔️|||55ms| -|packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts|24✔️|||72ms| -|packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts|6✔️|||44ms| -|packages/jest-docblock/src/__tests__/index.test.ts|36✔️|||177ms| -|packages/jest-each/src/__tests__/array.test.ts|159✔️|||192ms| -|packages/jest-each/src/__tests__/index.test.ts|10✔️|||44ms| -|packages/jest-each/src/__tests__/template.test.ts|242✔️|||483ms| -|packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts|2✔️|||783ms| -|packages/jest-environment-node/src/__tests__/node_environment.test.ts|6✔️|||184ms| -|packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts|50✔️|||302ms| -|packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts|40✔️|||317ms| -|packages/jest-get-type/src/__tests__/getType.test.ts|14✔️|||45ms| -|packages/jest-get-type/src/__tests__/isPrimitive.test.ts|18✔️|||36ms| -|packages/jest-globals/src/__tests__/index.ts|1✔️|||533ms| -|packages/jest-haste-map/src/__tests__/get_mock_name.test.js|1✔️|||22ms| -|packages/jest-haste-map/src/__tests__/includes_dotfiles.test.ts|1✔️|||337ms| -|packages/jest-haste-map/src/__tests__/index.test.js|44✔️|||1s| -|packages/jest-haste-map/src/__tests__/worker.test.js|7✔️|||100ms| -|packages/jest-haste-map/src/crawlers/__tests__/node.test.js|10✔️|||170ms| -|packages/jest-haste-map/src/crawlers/__tests__/watchman.test.js|8✔️|||153ms| -|packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js|15✔️|||56ms| -|packages/jest-haste-map/src/lib/__tests__/fast_path.test.js|5✔️|||29ms| -|packages/jest-haste-map/src/lib/__tests__/getPlatformExtension.test.js|1✔️|||35ms| -|packages/jest-haste-map/src/lib/__tests__/isRegExpSupported.test.js|2✔️|||31ms| -|packages/jest-haste-map/src/lib/__tests__/normalizePathSep.test.js|2✔️|||35ms| -|packages/jest-jasmine2/src/__tests__/concurrent.test.ts|3✔️|||24ms| -|packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts|7✔️|||70ms| -|packages/jest-jasmine2/src/__tests__/hooksError.test.ts|32✔️|||51ms| -|packages/jest-jasmine2/src/__tests__/iterators.test.ts|4✔️|||43ms| -|packages/jest-jasmine2/src/__tests__/itTestError.test.ts|6✔️|||32ms| -|packages/jest-jasmine2/src/__tests__/itToTestAlias.test.ts|1✔️|||23ms| -|packages/jest-jasmine2/src/__tests__/pTimeout.test.ts|3✔️|||44ms| -|packages/jest-jasmine2/src/__tests__/queueRunner.test.ts|6✔️|||93ms| -|packages/jest-jasmine2/src/__tests__/reporter.test.ts|1✔️|||107ms| -|packages/jest-jasmine2/src/__tests__/Suite.test.ts|1✔️|||84ms| -|packages/jest-jasmine2/src/__tests__/todoError.test.ts|3✔️|||27ms| -|packages/jest-leak-detector/src/__tests__/index.test.ts|6✔️|||986ms| -|packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceable.test.ts|11✔️|||49ms| -|packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts|2✔️|||48ms| -|packages/jest-matcher-utils/src/__tests__/index.test.ts|48✔️|||391ms| -|packages/jest-matcher-utils/src/__tests__/printDiffOrStringify.test.ts|21✔️|||114ms| -|packages/jest-matcher-utils/src/__tests__/Replaceable.test.ts|17✔️|||111ms| -|packages/jest-message-util/src/__tests__/messages.test.ts|11✔️|||205ms| -|packages/jest-mock/src/__tests__/index.test.ts|84✔️|||509ms| -|packages/jest-regex-util/src/__tests__/index.test.ts|8✔️|||56ms| -|packages/jest-repl/src/__tests__/jest_repl.test.js|1✔️|||1s| -|packages/jest-repl/src/__tests__/runtime_cli.test.js|4✔️|||4s| -|packages/jest-reporters/src/__tests__/CoverageReporter.test.js|12✔️|||397ms| -|packages/jest-reporters/src/__tests__/CoverageWorker.test.js|2✔️|||199ms| -|packages/jest-reporters/src/__tests__/DefaultReporter.test.js|2✔️|||148ms| -|packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js|3✔️|||1s| -|packages/jest-reporters/src/__tests__/getResultHeader.test.js|4✔️|||30ms| -|packages/jest-reporters/src/__tests__/getSnapshotStatus.test.js|3✔️|||28ms| -|packages/jest-reporters/src/__tests__/getSnapshotSummary.test.js|4✔️|||49ms| -|packages/jest-reporters/src/__tests__/getWatermarks.test.ts|2✔️|||37ms| -|packages/jest-reporters/src/__tests__/NotifyReporter.test.ts|18✔️|||166ms| -|packages/jest-reporters/src/__tests__/SummaryReporter.test.js|4✔️|||366ms| -|packages/jest-reporters/src/__tests__/utils.test.ts|10✔️|||85ms| -|packages/jest-reporters/src/__tests__/VerboseReporter.test.js|11✔️|||425ms| -|packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts|11✔️|||666ms| -|packages/jest-resolve/src/__tests__/isBuiltinModule.test.ts|4✔️|||36ms| -|packages/jest-resolve/src/__tests__/resolve.test.ts|16✔️|||1s| -|packages/jest-runner/src/__tests__/testRunner.test.ts|2✔️|||905ms| -|packages/jest-runtime/src/__tests__/instrumentation.test.ts|1✔️|||275ms| -|packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js|3✔️|||606ms| -|packages/jest-runtime/src/__tests__/runtime_environment.test.js|2✔️|||497ms| -|packages/jest-runtime/src/__tests__/runtime_internal_module.test.js|4✔️|||727ms| -|packages/jest-runtime/src/__tests__/runtime_jest_fn.js|4✔️|||479ms| -|packages/jest-runtime/src/__tests__/runtime_jest_spy_on.test.js|2✔️|||521ms| -|packages/jest-runtime/src/__tests__/runtime_mock.test.js|4✔️|||743ms| -|packages/jest-runtime/src/__tests__/runtime_module_directories.test.js|4✔️|||525ms| -|packages/jest-runtime/src/__tests__/runtime_node_path.test.js|4✔️|||1s| -|packages/jest-runtime/src/__tests__/runtime_require_actual.test.js|2✔️|||478ms| -|packages/jest-runtime/src/__tests__/runtime_require_cache.test.js|2✔️|||454ms| -|packages/jest-runtime/src/__tests__/runtime_require_mock.test.js|13✔️|||962ms| -|packages/jest-runtime/src/__tests__/runtime_require_module_no_ext.test.js|1✔️|||261ms| -|packages/jest-runtime/src/__tests__/runtime_require_module_or_mock_transitive_deps.test.js|6✔️|||2s| -|packages/jest-runtime/src/__tests__/runtime_require_module_or_mock.test.js|17✔️|||1s| -|packages/jest-runtime/src/__tests__/runtime_require_module.test.js|27✔️|||2s| -|packages/jest-runtime/src/__tests__/runtime_require_resolve.test.ts|5✔️|||707ms| -|packages/jest-runtime/src/__tests__/runtime_wrap.js|2✔️|||263ms| -|packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js|1✔️|||584ms| -|packages/jest-runtime/src/__tests__/Runtime-statics.test.js|2✔️|||162ms| -|packages/jest-serializer/src/__tests__/index.test.ts|17✔️|||158ms| -|packages/jest-snapshot/src/__tests__/dedentLines.test.ts|17✔️|||94ms| -|packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts|22✔️|||1s| -|packages/jest-snapshot/src/__tests__/matcher.test.ts|1✔️|||131ms| -|packages/jest-snapshot/src/__tests__/mockSerializer.test.ts|10✔️|||45ms| -|packages/jest-snapshot/src/__tests__/printSnapshot.test.ts|71✔️|||1s| -|packages/jest-snapshot/src/__tests__/SnapshotResolver.test.ts|10✔️|||98ms| -|packages/jest-snapshot/src/__tests__/throwMatcher.test.ts|3✔️|||481ms| -|packages/jest-snapshot/src/__tests__/utils.test.ts|26✔️|||214ms| -|packages/jest-source-map/src/__tests__/getCallsite.test.ts|3✔️|||86ms| -|packages/jest-test-result/src/__tests__/formatTestResults.test.ts|1✔️|||53ms| -|packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js|8✔️|||251ms| -|packages/jest-transform/src/__tests__/ScriptTransformer.test.ts|22✔️|||2s| -|packages/jest-transform/src/__tests__/shouldInstrument.test.ts|25✔️|||155ms| -|packages/jest-util/src/__tests__/createProcessObject.test.ts|4✔️|||81ms| -|packages/jest-util/src/__tests__/deepCyclicCopy.test.ts|12✔️|||86ms| -|packages/jest-util/src/__tests__/errorWithStack.test.ts|1✔️|||41ms| -|packages/jest-util/src/__tests__/formatTime.test.ts|11✔️|||82ms| -|packages/jest-util/src/__tests__/globsToMatcher.test.ts|4✔️|||56ms| -|packages/jest-util/src/__tests__/installCommonGlobals.test.ts|2✔️|||68ms| -|packages/jest-util/src/__tests__/isInteractive.test.ts|2✔️|||35ms| -|packages/jest-util/src/__tests__/isPromise.test.ts|10✔️|||30ms| -|packages/jest-validate/src/__tests__/validate.test.ts|23✔️|||283ms| -|packages/jest-validate/src/__tests__/validateCLIOptions.test.js|6✔️|||83ms| -|packages/jest-watcher/src/lib/__tests__/formatTestNameByPattern.test.ts|11✔️|||129ms| -|packages/jest-watcher/src/lib/__tests__/prompt.test.ts|3✔️|||91ms| -|packages/jest-watcher/src/lib/__tests__/scroll.test.ts|5✔️|||57ms| -|packages/jest-worker/src/__tests__/Farm.test.js|10✔️|||158ms| -|packages/jest-worker/src/__tests__/FifoQueue.test.js|3✔️|||48ms| -|packages/jest-worker/src/__tests__/index.test.js|8✔️|||230ms| -|packages/jest-worker/src/__tests__/PriorityQueue.test.js|5✔️|||63ms| -|packages/jest-worker/src/__tests__/process-integration.test.js|5✔️|||62ms| -|packages/jest-worker/src/__tests__/thread-integration.test.js|6✔️|||114ms| -|packages/jest-worker/src/__tests__/WorkerPool.test.js|3✔️|||51ms| -|packages/jest-worker/src/base/__tests__/BaseWorkerPool.test.js|11✔️|||653ms| -|packages/jest-worker/src/workers/__tests__/ChildProcessWorker.test.js|17✔️|||184ms| -|packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js|15✔️|||258ms| -|packages/jest-worker/src/workers/__tests__/processChild.test.js|10✔️|||135ms| -|packages/jest-worker/src/workers/__tests__/threadChild.test.js|10✔️|||120ms| -|packages/pretty-format/src/__tests__/AsymmetricMatcher.test.ts|38✔️|||137ms| -|packages/pretty-format/src/__tests__/ConvertAnsi.test.ts|6✔️|||43ms| -|packages/pretty-format/src/__tests__/DOMCollection.test.ts|10✔️|||64ms| -|packages/pretty-format/src/__tests__/DOMElement.test.ts|28✔️|||148ms| -|packages/pretty-format/src/__tests__/Immutable.test.ts|111✔️|||443ms| -|packages/pretty-format/src/__tests__/prettyFormat.test.ts|86✔️|||219ms| -|packages/pretty-format/src/__tests__/react.test.tsx|55✔️|||325ms| -|packages/pretty-format/src/__tests__/ReactElement.test.ts|3✔️|||64ms| +|e2e/__tests__/asyncAndCallback.test.ts|1✅|||746ms| +|e2e/__tests__/asyncRegenerator.test.ts|1✅|||4s| +|e2e/__tests__/autoClearMocks.test.ts|2✅|||2s| +|e2e/__tests__/autoResetMocks.test.ts|2✅|||2s| +|e2e/__tests__/autoRestoreMocks.test.ts|2✅|||2s| +|e2e/__tests__/babelPluginJestHoist.test.ts|1✅|||6s| +|e2e/__tests__/badSourceMap.test.ts|1✅|||858ms| +|e2e/__tests__/beforeAllFiltered.ts|1✅|||958ms| +|e2e/__tests__/beforeEachQueue.ts|1✅||1⚪|55ms| +|e2e/__tests__/callDoneTwice.test.ts|1✅|||882ms| +|e2e/__tests__/chaiAssertionLibrary.ts|1✅|||2s| +|e2e/__tests__/circularInequality.test.ts|1✅|||1s| +|e2e/__tests__/circusConcurrentEach.test.ts|2✅|||2s| +|e2e/__tests__/circusDeclarationErrors.test.ts|1✅|||869ms| +|e2e/__tests__/clearCache.test.ts|2✅|||1s| +|e2e/__tests__/cliHandlesExactFilenames.test.ts|2✅|||1s| +|e2e/__tests__/compareDomNodes.test.ts|1✅|||1s| +|e2e/__tests__/config.test.ts|6✅|||4s| +|e2e/__tests__/console.test.ts|7✅|||8s| +|e2e/__tests__/consoleAfterTeardown.test.ts|1✅|||1s| +|e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts|1✅|||793ms| +|e2e/__tests__/coverageHandlebars.test.ts|1✅|||2s| +|e2e/__tests__/coverageRemapping.test.ts|1✅|||13s| +|e2e/__tests__/coverageReport.test.ts|12✅|||22s| +|e2e/__tests__/coverageThreshold.test.ts|5✅|||5s| +|e2e/__tests__/coverageTransformInstrumented.test.ts|1✅|||5s| +|e2e/__tests__/coverageWithoutTransform.test.ts|1✅|||1s| +|e2e/__tests__/createProcessObject.test.ts|1✅|||908ms| +|e2e/__tests__/customInlineSnapshotMatchers.test.ts|1✅|||2s| +|e2e/__tests__/customMatcherStackTrace.test.ts|2✅|||2s| +|e2e/__tests__/customReporters.test.ts|9✅|||7s| +|e2e/__tests__/customResolver.test.ts|1✅|||826ms| +|e2e/__tests__/customTestSequencers.test.ts|3✅|||3s| +|e2e/__tests__/debug.test.ts|1✅|||899ms| +|e2e/__tests__/declarationErrors.test.ts|3✅|||2s| +|e2e/__tests__/dependencyClash.test.ts|1✅|||833ms| +|e2e/__tests__/detectOpenHandles.ts|8✅|||8s| +|e2e/__tests__/domDiffing.test.ts|1✅|||1s| +|e2e/__tests__/doneInHooks.test.ts|1✅|||855ms| +|e2e/__tests__/dynamicRequireDependencies.ts|1✅|||847ms| +|e2e/__tests__/each.test.ts|7✅|||5s| +|e2e/__tests__/emptyDescribeWithHooks.test.ts|4✅|||3s| +|e2e/__tests__/emptySuiteError.test.ts|1✅|||885ms| +|e2e/__tests__/env.test.ts|6✅|||5s| +|e2e/__tests__/environmentAfterTeardown.test.ts|1✅|||892ms| +|e2e/__tests__/errorOnDeprecated.test.ts|1✅||24⚪|56ms| +|e2e/__tests__/esmConfigFile.test.ts|3✅|||526ms| +|e2e/__tests__/executeTestsOnceInMpr.ts|1✅|||976ms| +|e2e/__tests__/existentRoots.test.ts|4✅|||627ms| +|e2e/__tests__/expectAsyncMatcher.test.ts|2✅|||3s| +|e2e/__tests__/expectInVm.test.ts|1✅|||2s| +|e2e/__tests__/extraGlobals.test.ts|1✅|||1s| +|e2e/__tests__/failureDetailsProperty.test.ts|1✅|||907ms| +|e2e/__tests__/failures.test.ts|7✅|||10s| +|e2e/__tests__/fakePromises.test.ts|2✅|||2s| +|e2e/__tests__/fatalWorkerError.test.ts|1✅|||3s| +|e2e/__tests__/filter.test.ts|7✅|||5s| +|e2e/__tests__/findRelatedFiles.test.ts|5✅|||6s| +|e2e/__tests__/focusedTests.test.ts|1✅|||888ms| +|e2e/__tests__/forceExit.test.ts|1✅|||2s| +|e2e/__tests__/generatorMock.test.ts|1✅|||1s| +|e2e/__tests__/global-mutation.test.ts|1✅|||40ms| +|e2e/__tests__/global.test.ts|1✅|||31ms| +|e2e/__tests__/globals.test.ts|10✅|||8s| +|e2e/__tests__/globalSetup.test.ts|10✅|||14s| +|e2e/__tests__/globalTeardown.test.ts|7✅|||12s| +|e2e/__tests__/hasteMapMockChanged.test.ts|1✅|||379ms| +|e2e/__tests__/hasteMapSha1.test.ts|1✅|||298ms| +|e2e/__tests__/hasteMapSize.test.ts|2✅|||397ms| +|e2e/__tests__/importedGlobals.test.ts|1✅|||1s| +|e2e/__tests__/injectGlobals.test.ts|2✅|||2s| +|e2e/__tests__/jasmineAsync.test.ts|15✅|||28s| +|e2e/__tests__/jasmineAsyncWithPendingDuringTest.ts|1✅||1⚪|72ms| +|e2e/__tests__/jest.config.js.test.ts|3✅|||2s| +|e2e/__tests__/jest.config.ts.test.ts|5✅|||14s| +|[e2e/__tests__/jestChangedFiles.test.ts](#r0s75)|9✅|1❌||9s| +|e2e/__tests__/jestEnvironmentJsdom.test.ts|1✅|||2s| +|e2e/__tests__/jestRequireActual.test.ts|1✅|||2s| +|e2e/__tests__/jestRequireMock.test.ts|1✅|||2s| +|e2e/__tests__/json.test.ts|2✅|||29ms| +|e2e/__tests__/jsonReporter.test.ts|2✅|||2s| +|e2e/__tests__/lifecycles.ts|1✅|||861ms| +|e2e/__tests__/listTests.test.ts|2✅|||945ms| +|e2e/__tests__/locationInResults.test.ts|2✅|||2s| +|e2e/__tests__/logHeapUsage.test.ts|1✅|||884ms| +|e2e/__tests__/mockNames.test.ts|8✅|||7s| +|e2e/__tests__/modernFakeTimers.test.ts|2✅|||2s| +|e2e/__tests__/moduleNameMapper.test.ts|5✅|||5s| +|e2e/__tests__/moduleParentNullInTest.ts|1✅|||886ms| +|e2e/__tests__/multiProjectRunner.test.ts|14✅|||16s| +|e2e/__tests__/nativeAsyncMock.test.ts|1✅|||55ms| +|e2e/__tests__/nativeEsm.test.ts|2✅||1⚪|905ms| +|e2e/__tests__/nativeEsmTypescript.test.ts|1✅|||956ms| +|e2e/__tests__/nestedEventLoop.test.ts|1✅|||1s| +|e2e/__tests__/nestedTestDefinitions.test.ts|4✅|||5s| +|e2e/__tests__/nodePath.test.ts|1✅|||866ms| +|e2e/__tests__/noTestFound.test.ts|2✅|||1s| +|e2e/__tests__/noTestsFound.test.ts|5✅|||3s| +|[e2e/__tests__/onlyChanged.test.ts](#r0s98)|8✅|1❌||22s| +|e2e/__tests__/onlyFailuresNonWatch.test.ts|1✅|||3s| +|e2e/__tests__/overrideGlobals.test.ts|2✅|||2s| +|e2e/__tests__/pnp.test.ts|1✅|||3s| +|e2e/__tests__/presets.test.ts|2✅|||2s| +|e2e/__tests__/processExit.test.ts|1✅|||1s| +|e2e/__tests__/promiseReject.test.ts|1✅|||967ms| +|e2e/__tests__/regexCharInPath.test.ts|1✅|||962ms| +|e2e/__tests__/requireAfterTeardown.test.ts|1✅|||921ms| +|e2e/__tests__/requireMain.test.ts|1✅|||1s| +|e2e/__tests__/requireMainAfterCreateRequire.test.ts|1✅|||966ms| +|e2e/__tests__/requireMainIsolateModules.test.ts|1✅|||976ms| +|e2e/__tests__/requireMainResetModules.test.ts|2✅|||2s| +|e2e/__tests__/requireV8Module.test.ts|1✅|||30ms| +|e2e/__tests__/resetModules.test.ts|1✅|||926ms| +|e2e/__tests__/resolve.test.ts|1✅|||2s| +|e2e/__tests__/resolveGetPaths.test.ts|1✅|||1s| +|e2e/__tests__/resolveNodeModule.test.ts|1✅|||943ms| +|e2e/__tests__/resolveNoFileExtensions.test.ts|2✅|||1s| +|e2e/__tests__/resolveWithPaths.test.ts|1✅|||1s| +|e2e/__tests__/runProgrammatically.test.ts|2✅|||575ms| +|e2e/__tests__/runTestsByPath.test.ts|1✅|||2s| +|e2e/__tests__/runtimeInternalModuleRegistry.test.ts|1✅|||1s| +|e2e/__tests__/selectProjects.test.ts|18✅|||5s| +|e2e/__tests__/setImmediate.test.ts|1✅|||904ms| +|e2e/__tests__/setupFilesAfterEnvConfig.test.ts|2✅|||2s| +|e2e/__tests__/showConfig.test.ts|1✅|||195ms| +|e2e/__tests__/skipBeforeAfterAll.test.ts|1✅|||1s| +|e2e/__tests__/snapshot-unknown.test.ts|1✅|||838ms| +|e2e/__tests__/snapshot.test.ts|9✅|||14s| +|e2e/__tests__/snapshotMockFs.test.ts|1✅|||883ms| +|e2e/__tests__/snapshotResolver.test.ts|1✅|||823ms| +|e2e/__tests__/snapshotSerializers.test.ts|2✅|||2s| +|e2e/__tests__/stackTrace.test.ts|7✅|||5s| +|e2e/__tests__/stackTraceNoCaptureStackTrace.test.ts|1✅|||899ms| +|e2e/__tests__/stackTraceSourceMaps.test.ts|1✅|||2s| +|e2e/__tests__/stackTraceSourceMapsWithCoverage.test.ts|1✅|||2s| +|e2e/__tests__/supportsDashedArgs.ts|2✅|||968ms| +|e2e/__tests__/symbol.test.ts|1✅|||49ms| +|e2e/__tests__/testEnvironment.test.ts|1✅|||2s| +|e2e/__tests__/testEnvironmentAsync.test.ts|1✅|||1s| +|e2e/__tests__/testEnvironmentCircus.test.ts|1✅|||2s| +|e2e/__tests__/testEnvironmentCircusAsync.test.ts|1✅|||2s| +|e2e/__tests__/testFailureExitCode.test.ts|2✅|||4s| +|e2e/__tests__/testInRoot.test.ts|1✅|||1s| +|e2e/__tests__/testNamePattern.test.ts|1✅|||859ms| +|e2e/__tests__/testNamePatternSkipped.test.ts|1✅|||991ms| +|e2e/__tests__/testPathPatternReporterMessage.test.ts|1✅|||3s| +|e2e/__tests__/testResultsProcessor.test.ts|1✅|||910ms| +|e2e/__tests__/testRetries.test.ts|4✅|||3s| +|e2e/__tests__/testTodo.test.ts|5✅|||4s| +|e2e/__tests__/timeouts.test.ts|4✅|||4s| +|e2e/__tests__/timeoutsLegacy.test.ts|1✅||3⚪|71ms| +|e2e/__tests__/timerResetMocks.test.ts|2✅|||2s| +|e2e/__tests__/timerUseRealTimers.test.ts|1✅|||1s| +|e2e/__tests__/toMatchInlineSnapshot.test.ts|12✅|||24s| +|e2e/__tests__/toMatchInlineSnapshotWithRetries.test.ts|3✅|||5s| +|e2e/__tests__/toMatchSnapshot.test.ts|9✅|||17s| +|e2e/__tests__/toMatchSnapshotWithRetries.test.ts|2✅|||4s| +|e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts|3✅|||4s| +|e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts|4✅|||4s| +|e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts|5✅|||4s| +|e2e/__tests__/transform.test.ts|16✅|||27s| +|e2e/__tests__/transformLinkedModules.test.ts|1✅|||783ms| +|e2e/__tests__/typescriptCoverage.test.ts|1✅|||3s| +|e2e/__tests__/unexpectedToken.test.ts|3✅|||3s| +|e2e/__tests__/useStderr.test.ts|1✅|||1s| +|e2e/__tests__/v8Coverage.test.ts|2✅|||2s| +|e2e/__tests__/verbose.test.ts|1✅|||683ms| +|e2e/__tests__/version.test.ts|1✅|||138ms| +|e2e/__tests__/watchModeNoAccess.test.ts|1✅|||4s| +|e2e/__tests__/watchModeOnlyFailed.test.ts|1✅|||1s| +|e2e/__tests__/watchModePatterns.test.ts|2✅|||4s| +|e2e/__tests__/watchModeUpdateSnapshot.test.ts|1✅|||1s| +|e2e/__tests__/workerForceExit.test.ts|2✅|||5s| +|e2e/__tests__/wrongEnv.test.ts|5✅|||4s| +|e2e/custom-test-sequencer/a.test.js|1✅|||29ms| +|e2e/custom-test-sequencer/b.test.js|1✅|||21ms| +|e2e/custom-test-sequencer/c.test.js|1✅|||42ms| +|e2e/custom-test-sequencer/d.test.js|1✅|||21ms| +|e2e/custom-test-sequencer/e.test.js|1✅|||27ms| +|e2e/test-in-root/spec.js|1✅|||19ms| +|e2e/test-in-root/test.js|1✅|||37ms| +|e2e/timer-reset-mocks/after-reset-all-mocks/timerAndMock.test.js|2✅|||30ms| +|e2e/timer-reset-mocks/with-reset-mocks/timerWithMock.test.js|1✅|||34ms| +|e2e/v8-coverage/empty-sourcemap/test.ts|1✅|||31ms| +|examples/angular/app.component.spec.ts|3✅|||654ms| +|examples/angular/shared/data.service.spec.ts|2✅|||431ms| +|examples/angular/shared/sub.service.spec.ts|1✅|||109ms| +|examples/async/__tests__/user.test.js|8✅|||96ms| +|examples/automatic-mocks/__tests__/automock.test.js|2✅|||74ms| +|examples/automatic-mocks/__tests__/createMockFromModule.test.js|2✅|||115ms| +|examples/automatic-mocks/__tests__/disableAutomocking.test.js|1✅|||24ms| +|examples/enzyme/__tests__/CheckboxWithLabel-test.js|1✅|||434ms| +|examples/getting-started/sum.test.js|1✅|||78ms| +|examples/jquery/__tests__/display_user.test.js|1✅|||196ms| +|examples/jquery/__tests__/fetch_current_user.test.js|2✅|||196ms| +|examples/manual-mocks/__tests__/file_summarizer.test.js|1✅|||87ms| +|examples/manual-mocks/__tests__/lodashMocking.test.js|1✅|||109ms| +|examples/manual-mocks/__tests__/user.test.js|1✅|||41ms| +|examples/manual-mocks/__tests__/userMocked.test.js|1✅|||105ms| +|examples/module-mock/__tests__/full_mock.js|1✅|||60ms| +|examples/module-mock/__tests__/mock_per_test.js|2✅|||116ms| +|examples/module-mock/__tests__/partial_mock.js|1✅|||215ms| +|examples/mongodb/__test__/db.test.js|1✅|||236ms| +|examples/react-native/__tests__/intro.test.js|4✅|||9s| +|examples/react-testing-library/__tests__/CheckboxWithLabel-test.js|1✅|||469ms| +|examples/react/__tests__/CheckboxWithLabel-test.js|1✅|||256ms| +|examples/snapshot/__tests__/clock.react.test.js|1✅|||62ms| +|examples/snapshot/__tests__/link.react.test.js|4✅|||181ms| +|examples/timer/__tests__/infinite_timer_game.test.js|1✅|||94ms| +|examples/timer/__tests__/timer_game.test.js|3✅|||74ms| +|examples/typescript/__tests__/calc.test.ts|6✅|||276ms| +|examples/typescript/__tests__/CheckboxWithLabel-test.tsx|1✅|||227ms| +|examples/typescript/__tests__/sub-test.ts|1✅|||43ms| +|examples/typescript/__tests__/sum-test.ts|2✅|||69ms| +|examples/typescript/__tests__/sum.test.js|2✅|||100ms| +|packages/babel-jest/src/__tests__/index.ts|6✅|||371ms| +|packages/babel-plugin-jest-hoist/src/__tests__/hoistPlugin.test.ts|4✅|||347ms| +|packages/diff-sequences/src/__tests__/index.property.test.ts|7✅|||357ms| +|packages/diff-sequences/src/__tests__/index.test.ts|48✅|||195ms| +|packages/expect/src/__tests__/assertionCounts.test.ts|6✅|||60ms| +|packages/expect/src/__tests__/asymmetricMatchers.test.ts|38✅|||207ms| +|packages/expect/src/__tests__/extend.test.ts|10✅|||99ms| +|packages/expect/src/__tests__/isError.test.ts|4✅|||43ms| +|packages/expect/src/__tests__/matchers-toContain.property.test.ts|2✅|||236ms| +|packages/expect/src/__tests__/matchers-toContainEqual.property.test.ts|2✅|||287ms| +|packages/expect/src/__tests__/matchers-toEqual.property.test.ts|2✅|||1s| +|packages/expect/src/__tests__/matchers-toStrictEqual.property.test.ts|3✅|||394ms| +|packages/expect/src/__tests__/matchers.test.js|592✅|||862ms| +|packages/expect/src/__tests__/spyMatchers.test.ts|248✅|||395ms| +|packages/expect/src/__tests__/stacktrace.test.ts|3✅|||69ms| +|packages/expect/src/__tests__/symbolInObjects.test.ts|3✅|||33ms| +|packages/expect/src/__tests__/toEqual-dom.test.ts|12✅|||99ms| +|packages/expect/src/__tests__/toThrowMatchers.test.ts|98✅|||257ms| +|packages/expect/src/__tests__/utils.test.ts|41✅|||147ms| +|packages/jest-circus/src/__tests__/afterAll.test.ts|6✅|||6s| +|packages/jest-circus/src/__tests__/baseTest.test.ts|2✅|||3s| +|packages/jest-circus/src/__tests__/circusItTestError.test.ts|8✅|||300ms| +|packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts|3✅|||81ms| +|packages/jest-circus/src/__tests__/hooks.test.ts|3✅|||4s| +|packages/jest-circus/src/__tests__/hooksError.test.ts|32✅|||127ms| +|packages/jest-cli/src/__tests__/cli/args.test.ts|17✅|||345ms| +|packages/jest-cli/src/init/__tests__/init.test.js|24✅|||119ms| +|packages/jest-cli/src/init/__tests__/modifyPackageJson.test.ts|4✅|||30ms| +|packages/jest-config/src/__tests__/Defaults.test.ts|1✅|||672ms| +|packages/jest-config/src/__tests__/getMaxWorkers.test.ts|7✅|||67ms| +|packages/jest-config/src/__tests__/normalize.test.js|118✅|||798ms| +|packages/jest-config/src/__tests__/readConfig.test.ts|1✅|||76ms| +|packages/jest-config/src/__tests__/readConfigs.test.ts|3✅|||135ms| +|packages/jest-config/src/__tests__/resolveConfigPath.test.ts|10✅|||183ms| +|packages/jest-config/src/__tests__/setFromArgv.test.ts|4✅|||53ms| +|packages/jest-config/src/__tests__/validatePattern.test.ts|4✅|||52ms| +|packages/jest-console/src/__tests__/bufferedConsole.test.ts|20✅|||171ms| +|packages/jest-console/src/__tests__/CustomConsole.test.ts|23✅|||115ms| +|packages/jest-console/src/__tests__/getConsoleOutput.test.ts|12✅|||56ms| +|packages/jest-core/src/__tests__/FailedTestsCache.test.js|1✅|||25ms| +|packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.js|5✅|||61ms| +|packages/jest-core/src/__tests__/globals.test.ts|1✅|||22ms| +|packages/jest-core/src/__tests__/runJest.test.js|2✅|||261ms| +|packages/jest-core/src/__tests__/SearchSource.test.ts|27✅|||3s| +|packages/jest-core/src/__tests__/SnapshotInteractiveMode.test.js|13✅|||89ms| +|packages/jest-core/src/__tests__/TestScheduler.test.js|8✅|||520ms| +|packages/jest-core/src/__tests__/testSchedulerHelper.test.js|12✅|||48ms| +|packages/jest-core/src/__tests__/watch.test.js|80✅|||7s| +|packages/jest-core/src/__tests__/watchFileChanges.test.ts|1✅|||2s| +|packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js|2✅|||165ms| +|packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js|1✅|||246ms| +|packages/jest-core/src/lib/__tests__/isValidPath.test.ts|3✅|||166ms| +|packages/jest-core/src/lib/__tests__/logDebugMessages.test.ts|3✅|||48ms| +|packages/jest-create-cache-key-function/src/__tests__/index.test.ts|1✅|||75ms| +|packages/jest-diff/src/__tests__/diff.test.ts|107✅|||625ms| +|packages/jest-diff/src/__tests__/diffStringsRaw.test.ts|2✅|||55ms| +|packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts|24✅|||72ms| +|packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts|6✅|||44ms| +|packages/jest-docblock/src/__tests__/index.test.ts|36✅|||177ms| +|packages/jest-each/src/__tests__/array.test.ts|159✅|||192ms| +|packages/jest-each/src/__tests__/index.test.ts|10✅|||44ms| +|packages/jest-each/src/__tests__/template.test.ts|242✅|||483ms| +|packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts|2✅|||783ms| +|packages/jest-environment-node/src/__tests__/node_environment.test.ts|6✅|||184ms| +|packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts|50✅|||302ms| +|packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts|40✅|||317ms| +|packages/jest-get-type/src/__tests__/getType.test.ts|14✅|||45ms| +|packages/jest-get-type/src/__tests__/isPrimitive.test.ts|18✅|||36ms| +|packages/jest-globals/src/__tests__/index.ts|1✅|||533ms| +|packages/jest-haste-map/src/__tests__/get_mock_name.test.js|1✅|||22ms| +|packages/jest-haste-map/src/__tests__/includes_dotfiles.test.ts|1✅|||337ms| +|packages/jest-haste-map/src/__tests__/index.test.js|44✅|||1s| +|packages/jest-haste-map/src/__tests__/worker.test.js|7✅|||100ms| +|packages/jest-haste-map/src/crawlers/__tests__/node.test.js|10✅|||170ms| +|packages/jest-haste-map/src/crawlers/__tests__/watchman.test.js|8✅|||153ms| +|packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js|15✅|||56ms| +|packages/jest-haste-map/src/lib/__tests__/fast_path.test.js|5✅|||29ms| +|packages/jest-haste-map/src/lib/__tests__/getPlatformExtension.test.js|1✅|||35ms| +|packages/jest-haste-map/src/lib/__tests__/isRegExpSupported.test.js|2✅|||31ms| +|packages/jest-haste-map/src/lib/__tests__/normalizePathSep.test.js|2✅|||35ms| +|packages/jest-jasmine2/src/__tests__/concurrent.test.ts|3✅|||24ms| +|packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts|7✅|||70ms| +|packages/jest-jasmine2/src/__tests__/hooksError.test.ts|32✅|||51ms| +|packages/jest-jasmine2/src/__tests__/iterators.test.ts|4✅|||43ms| +|packages/jest-jasmine2/src/__tests__/itTestError.test.ts|6✅|||32ms| +|packages/jest-jasmine2/src/__tests__/itToTestAlias.test.ts|1✅|||23ms| +|packages/jest-jasmine2/src/__tests__/pTimeout.test.ts|3✅|||44ms| +|packages/jest-jasmine2/src/__tests__/queueRunner.test.ts|6✅|||93ms| +|packages/jest-jasmine2/src/__tests__/reporter.test.ts|1✅|||107ms| +|packages/jest-jasmine2/src/__tests__/Suite.test.ts|1✅|||84ms| +|packages/jest-jasmine2/src/__tests__/todoError.test.ts|3✅|||27ms| +|packages/jest-leak-detector/src/__tests__/index.test.ts|6✅|||986ms| +|packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceable.test.ts|11✅|||49ms| +|packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts|2✅|||48ms| +|packages/jest-matcher-utils/src/__tests__/index.test.ts|48✅|||391ms| +|packages/jest-matcher-utils/src/__tests__/printDiffOrStringify.test.ts|21✅|||114ms| +|packages/jest-matcher-utils/src/__tests__/Replaceable.test.ts|17✅|||111ms| +|packages/jest-message-util/src/__tests__/messages.test.ts|11✅|||205ms| +|packages/jest-mock/src/__tests__/index.test.ts|84✅|||509ms| +|packages/jest-regex-util/src/__tests__/index.test.ts|8✅|||56ms| +|packages/jest-repl/src/__tests__/jest_repl.test.js|1✅|||1s| +|packages/jest-repl/src/__tests__/runtime_cli.test.js|4✅|||4s| +|packages/jest-reporters/src/__tests__/CoverageReporter.test.js|12✅|||397ms| +|packages/jest-reporters/src/__tests__/CoverageWorker.test.js|2✅|||199ms| +|packages/jest-reporters/src/__tests__/DefaultReporter.test.js|2✅|||148ms| +|packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js|3✅|||1s| +|packages/jest-reporters/src/__tests__/getResultHeader.test.js|4✅|||30ms| +|packages/jest-reporters/src/__tests__/getSnapshotStatus.test.js|3✅|||28ms| +|packages/jest-reporters/src/__tests__/getSnapshotSummary.test.js|4✅|||49ms| +|packages/jest-reporters/src/__tests__/getWatermarks.test.ts|2✅|||37ms| +|packages/jest-reporters/src/__tests__/NotifyReporter.test.ts|18✅|||166ms| +|packages/jest-reporters/src/__tests__/SummaryReporter.test.js|4✅|||366ms| +|packages/jest-reporters/src/__tests__/utils.test.ts|10✅|||85ms| +|packages/jest-reporters/src/__tests__/VerboseReporter.test.js|11✅|||425ms| +|packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts|11✅|||666ms| +|packages/jest-resolve/src/__tests__/isBuiltinModule.test.ts|4✅|||36ms| +|packages/jest-resolve/src/__tests__/resolve.test.ts|16✅|||1s| +|packages/jest-runner/src/__tests__/testRunner.test.ts|2✅|||905ms| +|packages/jest-runtime/src/__tests__/instrumentation.test.ts|1✅|||275ms| +|packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js|3✅|||606ms| +|packages/jest-runtime/src/__tests__/runtime_environment.test.js|2✅|||497ms| +|packages/jest-runtime/src/__tests__/runtime_internal_module.test.js|4✅|||727ms| +|packages/jest-runtime/src/__tests__/runtime_jest_fn.js|4✅|||479ms| +|packages/jest-runtime/src/__tests__/runtime_jest_spy_on.test.js|2✅|||521ms| +|packages/jest-runtime/src/__tests__/runtime_mock.test.js|4✅|||743ms| +|packages/jest-runtime/src/__tests__/runtime_module_directories.test.js|4✅|||525ms| +|packages/jest-runtime/src/__tests__/runtime_node_path.test.js|4✅|||1s| +|packages/jest-runtime/src/__tests__/runtime_require_actual.test.js|2✅|||478ms| +|packages/jest-runtime/src/__tests__/runtime_require_cache.test.js|2✅|||454ms| +|packages/jest-runtime/src/__tests__/runtime_require_mock.test.js|13✅|||962ms| +|packages/jest-runtime/src/__tests__/runtime_require_module_no_ext.test.js|1✅|||261ms| +|packages/jest-runtime/src/__tests__/runtime_require_module_or_mock_transitive_deps.test.js|6✅|||2s| +|packages/jest-runtime/src/__tests__/runtime_require_module_or_mock.test.js|17✅|||1s| +|packages/jest-runtime/src/__tests__/runtime_require_module.test.js|27✅|||2s| +|packages/jest-runtime/src/__tests__/runtime_require_resolve.test.ts|5✅|||707ms| +|packages/jest-runtime/src/__tests__/runtime_wrap.js|2✅|||263ms| +|packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js|1✅|||584ms| +|packages/jest-runtime/src/__tests__/Runtime-statics.test.js|2✅|||162ms| +|packages/jest-serializer/src/__tests__/index.test.ts|17✅|||158ms| +|packages/jest-snapshot/src/__tests__/dedentLines.test.ts|17✅|||94ms| +|packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts|22✅|||1s| +|packages/jest-snapshot/src/__tests__/matcher.test.ts|1✅|||131ms| +|packages/jest-snapshot/src/__tests__/mockSerializer.test.ts|10✅|||45ms| +|packages/jest-snapshot/src/__tests__/printSnapshot.test.ts|71✅|||1s| +|packages/jest-snapshot/src/__tests__/SnapshotResolver.test.ts|10✅|||98ms| +|packages/jest-snapshot/src/__tests__/throwMatcher.test.ts|3✅|||481ms| +|packages/jest-snapshot/src/__tests__/utils.test.ts|26✅|||214ms| +|packages/jest-source-map/src/__tests__/getCallsite.test.ts|3✅|||86ms| +|packages/jest-test-result/src/__tests__/formatTestResults.test.ts|1✅|||53ms| +|packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js|8✅|||251ms| +|packages/jest-transform/src/__tests__/ScriptTransformer.test.ts|22✅|||2s| +|packages/jest-transform/src/__tests__/shouldInstrument.test.ts|25✅|||155ms| +|packages/jest-util/src/__tests__/createProcessObject.test.ts|4✅|||81ms| +|packages/jest-util/src/__tests__/deepCyclicCopy.test.ts|12✅|||86ms| +|packages/jest-util/src/__tests__/errorWithStack.test.ts|1✅|||41ms| +|packages/jest-util/src/__tests__/formatTime.test.ts|11✅|||82ms| +|packages/jest-util/src/__tests__/globsToMatcher.test.ts|4✅|||56ms| +|packages/jest-util/src/__tests__/installCommonGlobals.test.ts|2✅|||68ms| +|packages/jest-util/src/__tests__/isInteractive.test.ts|2✅|||35ms| +|packages/jest-util/src/__tests__/isPromise.test.ts|10✅|||30ms| +|packages/jest-validate/src/__tests__/validate.test.ts|23✅|||283ms| +|packages/jest-validate/src/__tests__/validateCLIOptions.test.js|6✅|||83ms| +|packages/jest-watcher/src/lib/__tests__/formatTestNameByPattern.test.ts|11✅|||129ms| +|packages/jest-watcher/src/lib/__tests__/prompt.test.ts|3✅|||91ms| +|packages/jest-watcher/src/lib/__tests__/scroll.test.ts|5✅|||57ms| +|packages/jest-worker/src/__tests__/Farm.test.js|10✅|||158ms| +|packages/jest-worker/src/__tests__/FifoQueue.test.js|3✅|||48ms| +|packages/jest-worker/src/__tests__/index.test.js|8✅|||230ms| +|packages/jest-worker/src/__tests__/PriorityQueue.test.js|5✅|||63ms| +|packages/jest-worker/src/__tests__/process-integration.test.js|5✅|||62ms| +|packages/jest-worker/src/__tests__/thread-integration.test.js|6✅|||114ms| +|packages/jest-worker/src/__tests__/WorkerPool.test.js|3✅|||51ms| +|packages/jest-worker/src/base/__tests__/BaseWorkerPool.test.js|11✅|||653ms| +|packages/jest-worker/src/workers/__tests__/ChildProcessWorker.test.js|17✅|||184ms| +|packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js|15✅|||258ms| +|packages/jest-worker/src/workers/__tests__/processChild.test.js|10✅|||135ms| +|packages/jest-worker/src/workers/__tests__/threadChild.test.js|10✅|||120ms| +|packages/pretty-format/src/__tests__/AsymmetricMatcher.test.ts|38✅|||137ms| +|packages/pretty-format/src/__tests__/ConvertAnsi.test.ts|6✅|||43ms| +|packages/pretty-format/src/__tests__/DOMCollection.test.ts|10✅|||64ms| +|packages/pretty-format/src/__tests__/DOMElement.test.ts|28✅|||148ms| +|packages/pretty-format/src/__tests__/Immutable.test.ts|111✅|||443ms| +|packages/pretty-format/src/__tests__/prettyFormat.test.ts|86✅|||219ms| +|packages/pretty-format/src/__tests__/react.test.tsx|55✅|||325ms| +|packages/pretty-format/src/__tests__/ReactElement.test.ts|3✅|||64ms| ### ❌ e2e/__tests__/jestChangedFiles.test.ts ``` -✔️ gets hg SCM roots and dedupes them -✔️ gets git SCM roots and dedupes them -✔️ gets mixed git and hg SCM roots and dedupes them -✔️ gets changed files for git -✔️ monitors only root paths for git -✔️ does not find changes in files with no diff, for git -✔️ handles a bad revision for "changedSince", for git +✅ gets hg SCM roots and dedupes them +✅ gets git SCM roots and dedupes them +✅ gets mixed git and hg SCM roots and dedupes them +✅ gets changed files for git +✅ monitors only root paths for git +✅ does not find changes in files with no diff, for git +✅ handles a bad revision for "changedSince", for git ❌ gets changed files for hg Error: abort: empty revision range -✔️ monitors only root paths for hg -✔️ handles a bad revision for "changedSince", for hg +✅ monitors only root paths for hg +✅ handles a bad revision for "changedSince", for hg ``` ### ❌ e2e/__tests__/onlyChanged.test.ts ``` -✔️ run for "onlyChanged" and "changedSince" -✔️ run only changed files -✔️ report test coverage for only changed files -✔️ report test coverage of source on test file change under only changed files -✔️ do not pickup non-tested files when reporting coverage on only changed files -✔️ collect test coverage when using onlyChanged -✔️ onlyChanged in config is overwritten by --all or testPathPattern +✅ run for "onlyChanged" and "changedSince" +✅ run only changed files +✅ report test coverage for only changed files +✅ report test coverage of source on test file change under only changed files +✅ do not pickup non-tested files when reporting coverage on only changed files +✅ collect test coverage when using onlyChanged +✅ onlyChanged in config is overwritten by --all or testPathPattern ❌ gets changed files for hg Error: expect(received).toMatch(expected) -✔️ path on Windows is case-insensitive +✅ path on Windows is case-insensitive ``` \ No newline at end of file diff --git a/__tests__/__outputs__/mocha-json.md b/__tests__/__outputs__/mocha-json.md index 9eadcae..e104bc4 100644 --- a/__tests__/__outputs__/mocha-json.md +++ b/__tests__/__outputs__/mocha-json.md @@ -3,12 +3,12 @@ **6** tests were completed in **12ms** with **1** passed, **4** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[test/main.test.js](#r0s0)|1✔️|3❌||1ms| -|[test/second.test.js](#r0s1)||1❌|1✖️|8ms| +|[test/main.test.js](#r0s0)|1✅|3❌||1ms| +|[test/second.test.js](#r0s1)||1❌|1⚪|8ms| ### ❌ test/main.test.js ``` Test 1 - ✔️ Passing test + ✅ Passing test Test 1 Test 1.1 ❌ Exception in target unit Some error @@ -23,7 +23,7 @@ Test 2 ``` ### ❌ test/second.test.js ``` -✖️ Skipped test +⚪ Skipped test ❌ Timeout test Timeout of 1ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\Users\Michal\Workspace\dorny\test-reporter\reports\mocha\test\second.test.js) ``` \ No newline at end of file diff --git a/__tests__/__outputs__/mocha-test-results.md b/__tests__/__outputs__/mocha-test-results.md index fd85859..a1cb89b 100644 --- a/__tests__/__outputs__/mocha-test-results.md +++ b/__tests__/__outputs__/mocha-test-results.md @@ -1,41 +1,41 @@ ![Tests passed successfully](https://img.shields.io/badge/tests-833%20passed%2C%206%20skipped-success) -## ✔️ fixtures/external/mocha/mocha-test-results.json +## ✅ fixtures/external/mocha/mocha-test-results.json **839** tests were completed in **6s** with **833** passed, **0** failed and **6** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|test/node-unit/buffered-worker-pool.spec.js|14✔️|||8ms| -|test/node-unit/cli/config.spec.js|10✔️|||8ms| -|test/node-unit/cli/node-flags.spec.js|105✔️|||9ms| -|test/node-unit/cli/options.spec.js|36✔️|||250ms| -|test/node-unit/cli/run-helpers.spec.js|9✔️|||8ms| -|test/node-unit/cli/run.spec.js|40✔️|||4ms| -|test/node-unit/mocha.spec.js|24✔️|||33ms| -|test/node-unit/parallel-buffered-runner.spec.js|19✔️|||23ms| -|test/node-unit/reporters/parallel-buffered.spec.js|6✔️|||16ms| -|test/node-unit/serializer.spec.js|40✔️|||31ms| -|test/node-unit/stack-trace-filter.spec.js|2✔️||4✖️|1ms| -|test/node-unit/utils.spec.js|5✔️|||1ms| -|test/node-unit/worker.spec.js|15✔️|||92ms| -|test/unit/context.spec.js|8✔️|||5ms| -|test/unit/duration.spec.js|3✔️|||166ms| -|test/unit/errors.spec.js|13✔️|||5ms| -|test/unit/globals.spec.js|4✔️|||0ms| -|test/unit/grep.spec.js|8✔️|||2ms| -|test/unit/hook-async.spec.js|3✔️|||1ms| -|test/unit/hook-sync-nested.spec.js|4✔️|||1ms| -|test/unit/hook-sync.spec.js|3✔️|||0ms| -|test/unit/hook-timeout.spec.js|1✔️|||0ms| -|test/unit/hook.spec.js|4✔️|||0ms| -|test/unit/mocha.spec.js|115✔️||1✖️|128ms| -|test/unit/overspecified-async.spec.js|1✔️|||3ms| -|test/unit/parse-query.spec.js|2✔️|||1ms| -|test/unit/plugin-loader.spec.js|41✔️||1✖️|16ms| -|test/unit/required-tokens.spec.js|1✔️|||0ms| -|test/unit/root.spec.js|1✔️|||0ms| -|test/unit/runnable.spec.js|55✔️|||122ms| -|test/unit/runner.spec.js|77✔️|||43ms| -|test/unit/suite.spec.js|57✔️|||14ms| -|test/unit/test.spec.js|15✔️|||0ms| -|test/unit/throw.spec.js|9✔️|||9ms| -|test/unit/timeout.spec.js|8✔️|||109ms| -|test/unit/utils.spec.js|75✔️|||24ms| \ No newline at end of file +|test/node-unit/buffered-worker-pool.spec.js|14✅|||8ms| +|test/node-unit/cli/config.spec.js|10✅|||8ms| +|test/node-unit/cli/node-flags.spec.js|105✅|||9ms| +|test/node-unit/cli/options.spec.js|36✅|||250ms| +|test/node-unit/cli/run-helpers.spec.js|9✅|||8ms| +|test/node-unit/cli/run.spec.js|40✅|||4ms| +|test/node-unit/mocha.spec.js|24✅|||33ms| +|test/node-unit/parallel-buffered-runner.spec.js|19✅|||23ms| +|test/node-unit/reporters/parallel-buffered.spec.js|6✅|||16ms| +|test/node-unit/serializer.spec.js|40✅|||31ms| +|test/node-unit/stack-trace-filter.spec.js|2✅||4⚪|1ms| +|test/node-unit/utils.spec.js|5✅|||1ms| +|test/node-unit/worker.spec.js|15✅|||92ms| +|test/unit/context.spec.js|8✅|||5ms| +|test/unit/duration.spec.js|3✅|||166ms| +|test/unit/errors.spec.js|13✅|||5ms| +|test/unit/globals.spec.js|4✅|||0ms| +|test/unit/grep.spec.js|8✅|||2ms| +|test/unit/hook-async.spec.js|3✅|||1ms| +|test/unit/hook-sync-nested.spec.js|4✅|||1ms| +|test/unit/hook-sync.spec.js|3✅|||0ms| +|test/unit/hook-timeout.spec.js|1✅|||0ms| +|test/unit/hook.spec.js|4✅|||0ms| +|test/unit/mocha.spec.js|115✅||1⚪|128ms| +|test/unit/overspecified-async.spec.js|1✅|||3ms| +|test/unit/parse-query.spec.js|2✅|||1ms| +|test/unit/plugin-loader.spec.js|41✅||1⚪|16ms| +|test/unit/required-tokens.spec.js|1✅|||0ms| +|test/unit/root.spec.js|1✅|||0ms| +|test/unit/runnable.spec.js|55✅|||122ms| +|test/unit/runner.spec.js|77✅|||43ms| +|test/unit/suite.spec.js|57✅|||14ms| +|test/unit/test.spec.js|15✅|||0ms| +|test/unit/throw.spec.js|9✅|||9ms| +|test/unit/timeout.spec.js|8✅|||109ms| +|test/unit/utils.spec.js|75✅|||24ms| \ No newline at end of file diff --git a/__tests__/__outputs__/provider-test-results.md b/__tests__/__outputs__/provider-test-results.md index 79b13aa..2cfa0ba 100644 --- a/__tests__/__outputs__/provider-test-results.md +++ b/__tests__/__outputs__/provider-test-results.md @@ -3,368 +3,368 @@ **269** tests were completed in **0ms** with **268** passed, **1** failed and **0** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[test/builder_test.dart](#r0s0)|24✔️|||402ms| -|[test/change_notifier_provider_test.dart](#r0s1)|10✔️|||306ms| -|[test/consumer_test.dart](#r0s2)|18✔️|||340ms| -|[test/context_test.dart](#r0s3)|31✔️|||698ms| -|[test/future_provider_test.dart](#r0s4)|10✔️|||305ms| -|[test/inherited_provider_test.dart](#r0s5)|81✔️|||1s| -|[test/listenable_provider_test.dart](#r0s6)|16✔️|||353ms| -|[test/listenable_proxy_provider_test.dart](#r0s7)|12✔️|||373ms| -|[test/multi_provider_test.dart](#r0s8)|3✔️|||198ms| -|[test/provider_test.dart](#r0s9)|11✔️|||306ms| -|[test/proxy_provider_test.dart](#r0s10)|16✔️|||438ms| -|[test/reassemble_test.dart](#r0s11)|3✔️|||221ms| -|[test/selector_test.dart](#r0s12)|17✔️|||364ms| -|[test/stateful_provider_test.dart](#r0s13)|4✔️|||254ms| -|[test/stream_provider_test.dart](#r0s14)|8✔️|||282ms| -|[test/value_listenable_provider_test.dart](#r0s15)|4✔️|1❌||327ms| -### ✔️ test/builder_test.dart +|[test/builder_test.dart](#r0s0)|24✅|||402ms| +|[test/change_notifier_provider_test.dart](#r0s1)|10✅|||306ms| +|[test/consumer_test.dart](#r0s2)|18✅|||340ms| +|[test/context_test.dart](#r0s3)|31✅|||698ms| +|[test/future_provider_test.dart](#r0s4)|10✅|||305ms| +|[test/inherited_provider_test.dart](#r0s5)|81✅|||1s| +|[test/listenable_provider_test.dart](#r0s6)|16✅|||353ms| +|[test/listenable_proxy_provider_test.dart](#r0s7)|12✅|||373ms| +|[test/multi_provider_test.dart](#r0s8)|3✅|||198ms| +|[test/provider_test.dart](#r0s9)|11✅|||306ms| +|[test/proxy_provider_test.dart](#r0s10)|16✅|||438ms| +|[test/reassemble_test.dart](#r0s11)|3✅|||221ms| +|[test/selector_test.dart](#r0s12)|17✅|||364ms| +|[test/stateful_provider_test.dart](#r0s13)|4✅|||254ms| +|[test/stream_provider_test.dart](#r0s14)|8✅|||282ms| +|[test/value_listenable_provider_test.dart](#r0s15)|4✅|1❌||327ms| +### ✅ test/builder_test.dart ``` ChangeNotifierProvider - ✔️ default - ✔️ .value + ✅ default + ✅ .value ListenableProvider - ✔️ default - ✔️ .value + ✅ default + ✅ .value Provider - ✔️ default - ✔️ .value + ✅ default + ✅ .value ProxyProvider - ✔️ 0 - ✔️ 1 - ✔️ 2 - ✔️ 3 - ✔️ 4 - ✔️ 5 - ✔️ 6 + ✅ 0 + ✅ 1 + ✅ 2 + ✅ 3 + ✅ 4 + ✅ 5 + ✅ 6 MultiProvider - ✔️ with 1 ChangeNotifierProvider default - ✔️ with 2 ChangeNotifierProvider default - ✔️ with ListenableProvider default - ✔️ with Provider default - ✔️ with ProxyProvider0 - ✔️ with ProxyProvider1 - ✔️ with ProxyProvider2 - ✔️ with ProxyProvider3 - ✔️ with ProxyProvider4 - ✔️ with ProxyProvider5 - ✔️ with ProxyProvider6 + ✅ with 1 ChangeNotifierProvider default + ✅ with 2 ChangeNotifierProvider default + ✅ with ListenableProvider default + ✅ with Provider default + ✅ with ProxyProvider0 + ✅ with ProxyProvider1 + ✅ with ProxyProvider2 + ✅ with ProxyProvider3 + ✅ with ProxyProvider4 + ✅ with ProxyProvider5 + ✅ with ProxyProvider6 ``` -### ✔️ test/change_notifier_provider_test.dart +### ✅ test/change_notifier_provider_test.dart ``` -✔️ Use builder property, not child +✅ Use builder property, not child ChangeNotifierProvider - ✔️ value - ✔️ builder - ✔️ builder1 - ✔️ builder2 - ✔️ builder3 - ✔️ builder4 - ✔️ builder5 - ✔️ builder6 - ✔️ builder0 + ✅ value + ✅ builder + ✅ builder1 + ✅ builder2 + ✅ builder3 + ✅ builder4 + ✅ builder5 + ✅ builder6 + ✅ builder0 ``` -### ✔️ test/consumer_test.dart +### ✅ test/consumer_test.dart ``` consumer - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider consumer2 - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider consumer3 - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider consumer4 - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider consumer5 - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider consumer6 - ✔️ obtains value from Provider - ✔️ crashed with no builder - ✔️ can be used inside MultiProvider + ✅ obtains value from Provider + ✅ crashed with no builder + ✅ can be used inside MultiProvider ``` -### ✔️ test/context_test.dart +### ✅ test/context_test.dart ``` -✔️ watch in layoutbuilder -✔️ select in layoutbuilder -✔️ cannot select in listView -✔️ watch in listView -✔️ watch in gridView -✔️ clears select dependencies for all dependents +✅ watch in layoutbuilder +✅ select in layoutbuilder +✅ cannot select in listView +✅ watch in listView +✅ watch in gridView +✅ clears select dependencies for all dependents BuildContext - ✔️ internal selected value is updated - ✔️ create can use read without being lazy - ✔️ watch can be used inside InheritedProvider.update - ✔️ select doesn't fail if it loads a provider that depends on other providers - ✔️ don't call old selectors if the child rebuilds individually - ✔️ selects throws inside click handlers - ✔️ select throws if try to read dynamic - ✔️ select throws ProviderNotFoundException - ✔️ select throws if watch called inside the callback from build - ✔️ select throws if read called inside the callback from build - ✔️ select throws if select called inside the callback from build - ✔️ select throws if read called inside the callback on dependency change - ✔️ select throws if watch called inside the callback on dependency change - ✔️ select throws if select called inside the callback on dependency change - ✔️ can call read inside didChangeDependencies - ✔️ select cannot be called inside didChangeDependencies - ✔️ select in initState throws - ✔️ watch in initState throws - ✔️ read in initState works - ✔️ consumer can be removed and selector stops to be called - ✔️ context.select deeply compares maps - ✔️ context.select deeply compares lists - ✔️ context.select deeply compares iterables - ✔️ context.select deeply compares sets - ✔️ context.watch listens to value changes + ✅ internal selected value is updated + ✅ create can use read without being lazy + ✅ watch can be used inside InheritedProvider.update + ✅ select doesn't fail if it loads a provider that depends on other providers + ✅ don't call old selectors if the child rebuilds individually + ✅ selects throws inside click handlers + ✅ select throws if try to read dynamic + ✅ select throws ProviderNotFoundException + ✅ select throws if watch called inside the callback from build + ✅ select throws if read called inside the callback from build + ✅ select throws if select called inside the callback from build + ✅ select throws if read called inside the callback on dependency change + ✅ select throws if watch called inside the callback on dependency change + ✅ select throws if select called inside the callback on dependency change + ✅ can call read inside didChangeDependencies + ✅ select cannot be called inside didChangeDependencies + ✅ select in initState throws + ✅ watch in initState throws + ✅ read in initState works + ✅ consumer can be removed and selector stops to be called + ✅ context.select deeply compares maps + ✅ context.select deeply compares lists + ✅ context.select deeply compares iterables + ✅ context.select deeply compares sets + ✅ context.watch listens to value changes ``` -### ✔️ test/future_provider_test.dart +### ✅ test/future_provider_test.dart ``` -✔️ works with MultiProvider -✔️ (catchError) previous future completes after transition is no-op -✔️ previous future completes after transition is no-op -✔️ transition from future to future preserve state -✔️ throws if future has error and catchError is missing -✔️ calls catchError if present and future has error -✔️ works with null -✔️ create and dispose future with builder -✔️ FutureProvider() crashes if builder is null +✅ works with MultiProvider +✅ (catchError) previous future completes after transition is no-op +✅ previous future completes after transition is no-op +✅ transition from future to future preserve state +✅ throws if future has error and catchError is missing +✅ calls catchError if present and future has error +✅ works with null +✅ create and dispose future with builder +✅ FutureProvider() crashes if builder is null FutureProvider() - ✔️ crashes if builder is null + ✅ crashes if builder is null ``` -### ✔️ test/inherited_provider_test.dart +### ✅ test/inherited_provider_test.dart ``` -✔️ regression test #377 -✔️ rebuild on dependency flags update -✔️ properly update debug flags if a create triggers another deferred create -✔️ properly update debug flags if a create triggers another deferred create -✔️ properly update debug flags if an update triggers another create/update -✔️ properly update debug flags if a create triggers another create/update -✔️ Provider.of(listen: false) outside of build works when it loads a provider -✔️ new value is available in didChangeDependencies -✔️ builder receives the current value and updates independently from `update` -✔️ builder can _not_ rebuild when provider updates -✔️ builder rebuilds if provider is recreated -✔️ provider.of throws if listen:true outside of the widget tree -✔️ InheritedProvider throws if no child is provided with default constructor -✔️ InheritedProvider throws if no child is provided with value constructor -✔️ DeferredInheritedProvider throws if no child is provided with default constructor -✔️ DeferredInheritedProvider throws if no child is provided with value constructor -✔️ startListening markNeedsNotifyDependents -✔️ InheritedProvider can be subclassed -✔️ DeferredInheritedProvider can be subclassed -✔️ can be used with MultiProvider -✔️ throw if the widget ctor changes -✔️ InheritedProvider lazy loading can be disabled -✔️ InheritedProvider.value lazy loading can be disabled -✔️ InheritedProvider subclass don't have to specify default lazy value -✔️ DeferredInheritedProvider lazy loading can be disabled -✔️ DeferredInheritedProvider.value lazy loading can be disabled -✔️ selector -✔️ can select multiple types from same provider -✔️ can select same type on two different providers -✔️ can select same type twice on same provider -✔️ Provider.of has a proper error message if context is null +✅ regression test #377 +✅ rebuild on dependency flags update +✅ properly update debug flags if a create triggers another deferred create +✅ properly update debug flags if a create triggers another deferred create +✅ properly update debug flags if an update triggers another create/update +✅ properly update debug flags if a create triggers another create/update +✅ Provider.of(listen: false) outside of build works when it loads a provider +✅ new value is available in didChangeDependencies +✅ builder receives the current value and updates independently from `update` +✅ builder can _not_ rebuild when provider updates +✅ builder rebuilds if provider is recreated +✅ provider.of throws if listen:true outside of the widget tree +✅ InheritedProvider throws if no child is provided with default constructor +✅ InheritedProvider throws if no child is provided with value constructor +✅ DeferredInheritedProvider throws if no child is provided with default constructor +✅ DeferredInheritedProvider throws if no child is provided with value constructor +✅ startListening markNeedsNotifyDependents +✅ InheritedProvider can be subclassed +✅ DeferredInheritedProvider can be subclassed +✅ can be used with MultiProvider +✅ throw if the widget ctor changes +✅ InheritedProvider lazy loading can be disabled +✅ InheritedProvider.value lazy loading can be disabled +✅ InheritedProvider subclass don't have to specify default lazy value +✅ DeferredInheritedProvider lazy loading can be disabled +✅ DeferredInheritedProvider.value lazy loading can be disabled +✅ selector +✅ can select multiple types from same provider +✅ can select same type on two different providers +✅ can select same type twice on same provider +✅ Provider.of has a proper error message if context is null diagnostics - ✔️ InheritedProvider.value - ✔️ InheritedProvider doesn't break lazy loading - ✔️ InheritedProvider show if listening - ✔️ DeferredInheritedProvider.value - ✔️ DeferredInheritedProvider + ✅ InheritedProvider.value + ✅ InheritedProvider doesn't break lazy loading + ✅ InheritedProvider show if listening + ✅ DeferredInheritedProvider.value + ✅ DeferredInheritedProvider InheritedProvider.value() - ✔️ markNeedsNotifyDependents during startListening is noop - ✔️ startListening called again when create returns new value - ✔️ startListening - ✔️ stopListening not called twice if rebuild doesn't have listeners - ✔️ removeListener cannot be null - ✔️ pass down current value - ✔️ default updateShouldNotify - ✔️ custom updateShouldNotify + ✅ markNeedsNotifyDependents during startListening is noop + ✅ startListening called again when create returns new value + ✅ startListening + ✅ stopListening not called twice if rebuild doesn't have listeners + ✅ removeListener cannot be null + ✅ pass down current value + ✅ default updateShouldNotify + ✅ custom updateShouldNotify InheritedProvider() - ✔️ hasValue - ✔️ provider calls update if rebuilding only due to didChangeDependencies - ✔️ provider notifying dependents doesn't call update - ✔️ update can call Provider.of with listen:true - ✔️ update lazy loaded can call Provider.of with listen:true - ✔️ markNeedsNotifyDependents during startListening is noop - ✔️ update can obtain parent of the same type than self - ✔️ _debugCheckInvalidValueType - ✔️ startListening - ✔️ startListening called again when create returns new value - ✔️ stopListening not called twice if rebuild doesn't have listeners - ✔️ removeListener cannot be null - ✔️ fails if initialValueBuilder calls inheritFromElement/inheritFromWiggetOfExactType - ✔️ builder is called on every rebuild and after a dependency change - ✔️ builder with no updateShouldNotify use == - ✔️ builder calls updateShouldNotify callback - ✔️ initialValue is transmitted to valueBuilder - ✔️ calls builder again if dependencies change - ✔️ exposes initialValue if valueBuilder is null - ✔️ call dispose on unmount - ✔️ builder unmount, dispose not called if value never read - ✔️ call dispose after new value - ✔️ valueBuilder works without initialBuilder - ✔️ calls initialValueBuilder lazily once - ✔️ throws if both builder and initialBuilder are missing + ✅ hasValue + ✅ provider calls update if rebuilding only due to didChangeDependencies + ✅ provider notifying dependents doesn't call update + ✅ update can call Provider.of with listen:true + ✅ update lazy loaded can call Provider.of with listen:true + ✅ markNeedsNotifyDependents during startListening is noop + ✅ update can obtain parent of the same type than self + ✅ _debugCheckInvalidValueType + ✅ startListening + ✅ startListening called again when create returns new value + ✅ stopListening not called twice if rebuild doesn't have listeners + ✅ removeListener cannot be null + ✅ fails if initialValueBuilder calls inheritFromElement/inheritFromWiggetOfExactType + ✅ builder is called on every rebuild and after a dependency change + ✅ builder with no updateShouldNotify use == + ✅ builder calls updateShouldNotify callback + ✅ initialValue is transmitted to valueBuilder + ✅ calls builder again if dependencies change + ✅ exposes initialValue if valueBuilder is null + ✅ call dispose on unmount + ✅ builder unmount, dispose not called if value never read + ✅ call dispose after new value + ✅ valueBuilder works without initialBuilder + ✅ calls initialValueBuilder lazily once + ✅ throws if both builder and initialBuilder are missing DeferredInheritedProvider.value() - ✔️ hasValue - ✔️ startListening - ✔️ stopListening cannot be null - ✔️ startListening doesn't need setState if already initialized - ✔️ setState without updateShouldNotify - ✔️ setState with updateShouldNotify - ✔️ startListening never leave the widget uninitialized - ✔️ startListening called again on controller change + ✅ hasValue + ✅ startListening + ✅ stopListening cannot be null + ✅ startListening doesn't need setState if already initialized + ✅ setState without updateShouldNotify + ✅ setState with updateShouldNotify + ✅ startListening never leave the widget uninitialized + ✅ startListening called again on controller change DeferredInheritedProvider() - ✔️ create can't call inherited widgets - ✔️ creates the value lazily - ✔️ dispose - ✔️ dispose no-op if never built + ✅ create can't call inherited widgets + ✅ creates the value lazily + ✅ dispose + ✅ dispose no-op if never built ``` -### ✔️ test/listenable_provider_test.dart +### ✅ test/listenable_provider_test.dart ``` ListenableProvider - ✔️ works with MultiProvider - ✔️ asserts that the created notifier can have listeners - ✔️ don't listen again if listenable instance doesn't change - ✔️ works with null (default) - ✔️ works with null (create) - ✔️ stateful create called once - ✔️ dispose called on unmount - ✔️ dispose can be null - ✔️ changing listenable rebuilds descendants - ✔️ rebuilding with the same provider don't rebuilds descendants - ✔️ notifylistener rebuilds descendants + ✅ works with MultiProvider + ✅ asserts that the created notifier can have listeners + ✅ don't listen again if listenable instance doesn't change + ✅ works with null (default) + ✅ works with null (create) + ✅ stateful create called once + ✅ dispose called on unmount + ✅ dispose can be null + ✅ changing listenable rebuilds descendants + ✅ rebuilding with the same provider don't rebuilds descendants + ✅ notifylistener rebuilds descendants ListenableProvider value constructor - ✔️ pass down key - ✔️ changing the Listenable instance rebuilds dependents + ✅ pass down key + ✅ changing the Listenable instance rebuilds dependents ListenableProvider stateful constructor - ✔️ called with context - ✔️ pass down key - ✔️ throws if create is null + ✅ called with context + ✅ pass down key + ✅ throws if create is null ``` -### ✔️ test/listenable_proxy_provider_test.dart +### ✅ test/listenable_proxy_provider_test.dart ``` ListenableProxyProvider - ✔️ throws if update is missing - ✔️ asserts that the created notifier has no listener - ✔️ asserts that the created notifier has no listener after rebuild - ✔️ rebuilds dependendents when listeners are called - ✔️ update returning a new Listenable disposes the previously created value and update dependents - ✔️ disposes of created value + ✅ throws if update is missing + ✅ asserts that the created notifier has no listener + ✅ asserts that the created notifier has no listener after rebuild + ✅ rebuilds dependendents when listeners are called + ✅ update returning a new Listenable disposes the previously created value and update dependents + ✅ disposes of created value ListenableProxyProvider variants - ✔️ ListenableProxyProvider - ✔️ ListenableProxyProvider2 - ✔️ ListenableProxyProvider3 - ✔️ ListenableProxyProvider4 - ✔️ ListenableProxyProvider5 - ✔️ ListenableProxyProvider6 + ✅ ListenableProxyProvider + ✅ ListenableProxyProvider2 + ✅ ListenableProxyProvider3 + ✅ ListenableProxyProvider4 + ✅ ListenableProxyProvider5 + ✅ ListenableProxyProvider6 ``` -### ✔️ test/multi_provider_test.dart +### ✅ test/multi_provider_test.dart ``` MultiProvider - ✔️ throw if providers is null - ✔️ MultiProvider children can only access parent providers - ✔️ MultiProvider.providers with ignored child + ✅ throw if providers is null + ✅ MultiProvider children can only access parent providers + ✅ MultiProvider.providers with ignored child ``` -### ✔️ test/provider_test.dart +### ✅ test/provider_test.dart ``` -✔️ works with MultiProvider +✅ works with MultiProvider Provider.of - ✔️ throws if T is dynamic - ✔️ listen defaults to true when building widgets - ✔️ listen defaults to false outside of the widget tree - ✔️ listen:false doesn't trigger rebuild - ✔️ listen:true outside of the widget tree throws + ✅ throws if T is dynamic + ✅ listen defaults to true when building widgets + ✅ listen defaults to false outside of the widget tree + ✅ listen:false doesn't trigger rebuild + ✅ listen:true outside of the widget tree throws Provider - ✔️ throws if the provided value is a Listenable/Stream - ✔️ debugCheckInvalidValueType can be disabled - ✔️ simple usage - ✔️ throws an error if no provider found - ✔️ update should notify + ✅ throws if the provided value is a Listenable/Stream + ✅ debugCheckInvalidValueType can be disabled + ✅ simple usage + ✅ throws an error if no provider found + ✅ update should notify ``` -### ✔️ test/proxy_provider_test.dart +### ✅ test/proxy_provider_test.dart ``` ProxyProvider - ✔️ throws if the provided value is a Listenable/Stream - ✔️ debugCheckInvalidValueType can be disabled - ✔️ create creates initial value - ✔️ consume another providers - ✔️ rebuild descendants if value change - ✔️ call dispose when unmounted with the latest result - ✔️ don't rebuild descendants if value doesn't change - ✔️ pass down updateShouldNotify - ✔️ works with MultiProvider - ✔️ update callback can trigger descendants setState synchronously - ✔️ throws if update is null + ✅ throws if the provided value is a Listenable/Stream + ✅ debugCheckInvalidValueType can be disabled + ✅ create creates initial value + ✅ consume another providers + ✅ rebuild descendants if value change + ✅ call dispose when unmounted with the latest result + ✅ don't rebuild descendants if value doesn't change + ✅ pass down updateShouldNotify + ✅ works with MultiProvider + ✅ update callback can trigger descendants setState synchronously + ✅ throws if update is null ProxyProvider variants - ✔️ ProxyProvider2 - ✔️ ProxyProvider3 - ✔️ ProxyProvider4 - ✔️ ProxyProvider5 - ✔️ ProxyProvider6 + ✅ ProxyProvider2 + ✅ ProxyProvider3 + ✅ ProxyProvider4 + ✅ ProxyProvider5 + ✅ ProxyProvider6 ``` -### ✔️ test/reassemble_test.dart +### ✅ test/reassemble_test.dart ``` -✔️ ReassembleHandler -✔️ unevaluated create -✔️ unevaluated create +✅ ReassembleHandler +✅ unevaluated create +✅ unevaluated create ``` -### ✔️ test/selector_test.dart +### ✅ test/selector_test.dart ``` -✔️ asserts that builder/selector are not null -✔️ Deep compare maps by default -✔️ Deep compare iterables by default -✔️ Deep compare sets by default -✔️ Deep compare lists by default -✔️ custom shouldRebuid -✔️ passes `child` and `key` -✔️ calls builder if the callback changes -✔️ works with MultiProvider -✔️ don't call builder again if it rebuilds but selector returns the same thing -✔️ call builder again if it rebuilds abd selector returns the a different variable -✔️ Selector -✔️ Selector2 -✔️ Selector3 -✔️ Selector4 -✔️ Selector5 -✔️ Selector6 +✅ asserts that builder/selector are not null +✅ Deep compare maps by default +✅ Deep compare iterables by default +✅ Deep compare sets by default +✅ Deep compare lists by default +✅ custom shouldRebuid +✅ passes `child` and `key` +✅ calls builder if the callback changes +✅ works with MultiProvider +✅ don't call builder again if it rebuilds but selector returns the same thing +✅ call builder again if it rebuilds abd selector returns the a different variable +✅ Selector +✅ Selector2 +✅ Selector3 +✅ Selector4 +✅ Selector5 +✅ Selector6 ``` -### ✔️ test/stateful_provider_test.dart +### ✅ test/stateful_provider_test.dart ``` -✔️ asserts -✔️ works with MultiProvider -✔️ calls create only once -✔️ dispose +✅ asserts +✅ works with MultiProvider +✅ calls create only once +✅ dispose ``` -### ✔️ test/stream_provider_test.dart +### ✅ test/stream_provider_test.dart ``` -✔️ works with MultiProvider -✔️ transition from stream to stream preserve state -✔️ throws if stream has error and catchError is missing -✔️ calls catchError if present and stream has error -✔️ works with null -✔️ StreamProvider() crashes if builder is null +✅ works with MultiProvider +✅ transition from stream to stream preserve state +✅ throws if stream has error and catchError is missing +✅ calls catchError if present and stream has error +✅ works with null +✅ StreamProvider() crashes if builder is null StreamProvider() - ✔️ create and dispose stream with builder - ✔️ crashes if builder is null + ✅ create and dispose stream with builder + ✅ crashes if builder is null ``` ### ❌ test/value_listenable_provider_test.dart ``` valueListenableProvider - ✔️ rebuilds when value change - ✔️ don't rebuild dependents by default - ✔️ pass keys - ✔️ don't listen again if stream instance doesn't change + ✅ rebuilds when value change + ✅ don't rebuild dependents by default + ✅ pass keys + ✅ don't listen again if stream instance doesn't change ❌ pass updateShouldNotify The following TestFailure object was thrown running a test: Expected: <2> diff --git a/__tests__/__outputs__/pulsar-test-results-no-merge.md b/__tests__/__outputs__/pulsar-test-results-no-merge.md index dbf7601..cc873e0 100644 --- a/__tests__/__outputs__/pulsar-test-results-no-merge.md +++ b/__tests__/__outputs__/pulsar-test-results-no-merge.md @@ -3,10 +3,10 @@ **2** tests were completed in **116ms** with **0** passed, **1** failed and **1** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[org.apache.pulsar.AddMissingPatchVersionTest](#r0s0)||1❌|1✖️|116ms| +|[org.apache.pulsar.AddMissingPatchVersionTest](#r0s0)||1❌|1⚪|116ms| ### ❌ org.apache.pulsar.AddMissingPatchVersionTest ``` -✖️ testVersionStrings +⚪ testVersionStrings ❌ testVersionStrings java.lang.AssertionError: expected [1.2.1] but found [1.2.0] ``` \ No newline at end of file diff --git a/__tests__/__outputs__/pulsar-test-results.md b/__tests__/__outputs__/pulsar-test-results.md index 88e8bea..058f71b 100644 --- a/__tests__/__outputs__/pulsar-test-results.md +++ b/__tests__/__outputs__/pulsar-test-results.md @@ -3,1516 +3,1516 @@ **808** tests were completed in **2127s** with **793** passed, **1** failed and **14** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[org.apache.pulsar.AddMissingPatchVersionTest](#r0s0)||1❌|1✖️|116ms| -|[org.apache.pulsar.broker.admin.AdminApiOffloadTest](#r0s1)|7✔️|||19s| -|[org.apache.pulsar.broker.auth.AuthenticationServiceTest](#r0s2)|2✔️|||185ms| -|[org.apache.pulsar.broker.auth.AuthLogsTest](#r0s3)|2✔️|||1s| -|[org.apache.pulsar.broker.auth.AuthorizationTest](#r0s4)|1✔️|||2s| -|[org.apache.pulsar.broker.lookup.http.HttpTopicLookupv2Test](#r0s5)|4✔️|||2s| -|[org.apache.pulsar.broker.namespace.NamespaceCreateBundlesTest](#r0s6)|2✔️|||33s| -|[org.apache.pulsar.broker.namespace.NamespaceOwnershipListenerTests](#r0s7)|2✔️|||32s| -|[org.apache.pulsar.broker.namespace.NamespaceServiceTest](#r0s8)|10✔️|||75s| -|[org.apache.pulsar.broker.namespace.NamespaceUnloadingTest](#r0s9)|2✔️|||14s| -|[org.apache.pulsar.broker.namespace.OwnerShipCacheForCurrentServerTest](#r0s10)|1✔️|||16s| -|[org.apache.pulsar.broker.namespace.OwnershipCacheTest](#r0s11)|8✔️|||16s| -|[org.apache.pulsar.broker.protocol.ProtocolHandlersTest](#r0s12)|6✔️|||946ms| -|[org.apache.pulsar.broker.protocol.ProtocolHandlerUtilsTest](#r0s13)|3✔️|||7s| -|[org.apache.pulsar.broker.protocol.ProtocolHandlerWithClassLoaderTest](#r0s14)|1✔️|||15ms| -|[org.apache.pulsar.broker.PulsarServiceTest](#r0s15)|2✔️|||96ms| -|[org.apache.pulsar.broker.service.MessagePublishBufferThrottleTest](#r0s16)|3✔️|||14s| -|[org.apache.pulsar.broker.service.ReplicatorTest](#r0s17)|22✔️|||40s| -|[org.apache.pulsar.broker.service.TopicOwnerTest](#r0s18)|8✔️|||114s| -|[org.apache.pulsar.broker.SLAMonitoringTest](#r0s19)|4✔️|||9s| -|[org.apache.pulsar.broker.stats.BookieClientsStatsGeneratorTest](#r0s20)|2✔️|||49ms| -|[org.apache.pulsar.broker.stats.ConsumerStatsTest](#r0s21)|3✔️|||21s| -|[org.apache.pulsar.broker.stats.ManagedCursorMetricsTest](#r0s22)|1✔️|||281ms| -|[org.apache.pulsar.broker.stats.ManagedLedgerMetricsTest](#r0s23)|1✔️|||285ms| -|[org.apache.pulsar.broker.stats.prometheus.AggregatedNamespaceStatsTest](#r0s24)|1✔️|||40ms| -|[org.apache.pulsar.broker.stats.PrometheusMetricsTest](#r0s25)|15✔️|||83s| -|[org.apache.pulsar.broker.stats.SubscriptionStatsTest](#r0s26)|2✔️|||2s| -|[org.apache.pulsar.broker.systopic.NamespaceEventsSystemTopicServiceTest](#r0s27)|1✔️|||1s| -|[org.apache.pulsar.broker.transaction.buffer.InMemTransactionBufferReaderTest](#r0s28)|3✔️|||28ms| -|[org.apache.pulsar.broker.transaction.buffer.TransactionBufferClientTest](#r0s29)|4✔️|||93ms| -|[org.apache.pulsar.broker.transaction.buffer.TransactionBufferTest](#r0s30)|7✔️|||81ms| -|[org.apache.pulsar.broker.transaction.buffer.TransactionEntryImplTest](#r0s31)|1✔️|||14ms| -|[org.apache.pulsar.broker.transaction.buffer.TransactionLowWaterMarkTest](#r0s32)|2✔️|||38s| -|[org.apache.pulsar.broker.transaction.buffer.TransactionStablePositionTest](#r0s33)|2✔️||1✖️|49s| -|[org.apache.pulsar.broker.transaction.coordinator.TransactionCoordinatorClientTest](#r0s34)|3✔️|||95ms| -|[org.apache.pulsar.broker.transaction.coordinator.TransactionMetaStoreAssignmentTest](#r0s35)|1✔️|||1s| -|[org.apache.pulsar.broker.transaction.pendingack.PendingAckInMemoryDeleteTest](#r0s36)|2✔️||1✖️|57s| -|[org.apache.pulsar.broker.transaction.TransactionConsumeTest](#r0s37)|2✔️|||30s| -|[org.apache.pulsar.broker.web.RestExceptionTest](#r0s38)|3✔️|||37ms| -|[org.apache.pulsar.broker.web.WebServiceTest](#r0s39)|9✔️|||27s| -|[org.apache.pulsar.client.impl.AdminApiKeyStoreTlsAuthTest](#r0s40)|4✔️|||8s| -|[org.apache.pulsar.client.impl.BatchMessageIdImplSerializationTest](#r0s41)|4✔️|||30ms| -|[org.apache.pulsar.client.impl.BatchMessageIndexAckDisableTest](#r0s42)|4✔️|||14s| -|[org.apache.pulsar.client.impl.BatchMessageIndexAckTest](#r0s43)|5✔️|||44s| -|[org.apache.pulsar.client.impl.BrokerClientIntegrationTest](#r0s44)|15✔️|||148s| -|[org.apache.pulsar.client.impl.CompactedOutBatchMessageTest](#r0s45)|1✔️|||1s| -|[org.apache.pulsar.client.impl.ConsumerAckResponseTest](#r0s46)|1✔️|||549ms| -|[org.apache.pulsar.client.impl.ConsumerConfigurationTest](#r0s47)|4✔️|||12s| -|[org.apache.pulsar.client.impl.ConsumerDedupPermitsUpdate](#r0s48)|7✔️|||4s| -|[org.apache.pulsar.client.impl.ConsumerUnsubscribeTest](#r0s49)|1✔️|||129ms| -|[org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithAuth](#r0s50)|3✔️|||23s| -|[org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithoutAuth](#r0s51)|3✔️|||8s| -|[org.apache.pulsar.client.impl.KeyStoreTlsTest](#r0s52)|1✔️|||183ms| -|[org.apache.pulsar.client.impl.MessageChecksumTest](#r0s53)|3✔️|||47s| -|[org.apache.pulsar.client.impl.MessageChunkingTest](#r0s54)|8✔️||1✖️|73s| -|[org.apache.pulsar.client.impl.MessageParserTest](#r0s55)|2✔️|||5s| -|[org.apache.pulsar.client.impl.MultiTopicsReaderTest](#r0s56)|8✔️|||35s| -|[org.apache.pulsar.client.impl.NegativeAcksTest](#r0s57)|32✔️|||11s| -|[org.apache.pulsar.client.impl.PatternTopicsConsumerImplTest](#r0s58)|11✔️|||63s| -|[org.apache.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest](#r0s59)|5✔️|||34s| -|[org.apache.pulsar.client.impl.PulsarMultiHostClientTest](#r0s60)|3✔️|||15s| -|[org.apache.pulsar.client.impl.RawMessageSerDeserTest](#r0s61)|1✔️|||10ms| -|[org.apache.pulsar.client.impl.SchemaDeleteTest](#r0s62)|1✔️|||2s| -|[org.apache.pulsar.client.impl.SequenceIdWithErrorTest](#r0s63)|3✔️||2✖️|18s| -|[org.apache.pulsar.client.impl.TopicDoesNotExistsTest](#r0s64)|2✔️|||4s| -|[org.apache.pulsar.client.impl.TopicFromMessageTest](#r0s65)|5✔️|||14s| -|[org.apache.pulsar.client.impl.TopicsConsumerImplTest](#r0s66)|17✔️|||133s| -|[org.apache.pulsar.client.impl.UnAcknowledgedMessagesTimeoutTest](#r0s67)|7✔️|||44s| -|[org.apache.pulsar.client.impl.ZeroQueueSizeTest](#r0s68)|14✔️|||16s| -|[org.apache.pulsar.common.api.raw.RawMessageImplTest](#r0s69)|1✔️|||316ms| -|[org.apache.pulsar.common.compression.CommandsTest](#r0s70)|1✔️|||30ms| -|[org.apache.pulsar.common.compression.CompressorCodecBackwardCompatTest](#r0s71)|6✔️|||223ms| -|[org.apache.pulsar.common.compression.CompressorCodecTest](#r0s72)|45✔️|||737ms| -|[org.apache.pulsar.common.compression.Crc32cChecksumTest](#r0s73)|6✔️|||5s| -|[org.apache.pulsar.common.lookup.data.LookupDataTest](#r0s74)|4✔️|||2s| -|[org.apache.pulsar.common.naming.MetadataTests](#r0s75)|2✔️|||161ms| -|[org.apache.pulsar.common.naming.NamespaceBundlesTest](#r0s76)|5✔️|||99ms| -|[org.apache.pulsar.common.naming.NamespaceBundleTest](#r0s77)|6✔️|||64ms| -|[org.apache.pulsar.common.naming.NamespaceNameTest](#r0s78)|2✔️|||207ms| -|[org.apache.pulsar.common.naming.ServiceConfigurationTest](#r0s79)|4✔️|||48ms| -|[org.apache.pulsar.common.naming.TopicNameTest](#r0s80)|4✔️|||529ms| -|[org.apache.pulsar.common.net.ServiceURITest](#r0s81)|21✔️|||237ms| -|[org.apache.pulsar.common.policies.data.AutoFailoverPolicyDataTest](#r0s82)|1✔️|||15ms| -|[org.apache.pulsar.common.policies.data.AutoFailoverPolicyTypeTest](#r0s83)|1✔️|||19ms| -|[org.apache.pulsar.common.policies.data.AutoTopicCreationOverrideTest](#r0s84)|6✔️|||64ms| -|[org.apache.pulsar.common.policies.data.BacklogQuotaTest](#r0s85)|1✔️|||12ms| -|[org.apache.pulsar.common.policies.data.ClusterDataTest](#r0s86)|1✔️|||9ms| -|[org.apache.pulsar.common.policies.data.ConsumerStatsTest](#r0s87)|1✔️|||8ms| -|[org.apache.pulsar.common.policies.data.EnsemblePlacementPolicyConfigTest](#r0s88)|2✔️|||948ms| -|[org.apache.pulsar.common.policies.data.LocalPolicesTest](#r0s89)|1✔️|||48ms| -|[org.apache.pulsar.common.policies.data.NamespaceIsolationDataTest](#r0s90)|1✔️|||76ms| -|[org.apache.pulsar.common.policies.data.NamespaceOwnershipStatusTest](#r0s91)|1✔️|||45ms| -|[org.apache.pulsar.common.policies.data.OffloadPoliciesTest](#r0s92)|6✔️|||216ms| -|[org.apache.pulsar.common.policies.data.PartitionedTopicStatsTest](#r0s93)|1✔️|||12ms| -|[org.apache.pulsar.common.policies.data.PersistencePoliciesTest](#r0s94)|1✔️|||19ms| -|[org.apache.pulsar.common.policies.data.PersistentOfflineTopicStatsTest](#r0s95)|1✔️|||29ms| -|[org.apache.pulsar.common.policies.data.PersistentTopicStatsTest](#r0s96)|2✔️|||51ms| -|[org.apache.pulsar.common.policies.data.PoliciesDataTest](#r0s97)|4✔️|||1s| -|[org.apache.pulsar.common.policies.data.PublisherStatsTest](#r0s98)|2✔️|||37ms| -|[org.apache.pulsar.common.policies.data.ReplicatorStatsTest](#r0s99)|2✔️|||30ms| -|[org.apache.pulsar.common.policies.data.ResourceQuotaTest](#r0s100)|2✔️|||45ms| -|[org.apache.pulsar.common.policies.data.RetentionPolicesTest](#r0s101)|1✔️|||8ms| -|[org.apache.pulsar.common.policies.impl.AutoFailoverPolicyFactoryTest](#r0s102)|1✔️|||22ms| -|[org.apache.pulsar.common.policies.impl.MinAvailablePolicyTest](#r0s103)|1✔️|||1ms| -|[org.apache.pulsar.common.policies.impl.NamespaceIsolationPoliciesTest](#r0s104)|7✔️|||265ms| -|[org.apache.pulsar.common.policies.impl.NamespaceIsolationPolicyImplTest](#r0s105)|7✔️|||309ms| -|[org.apache.pulsar.common.protocol.ByteBufPairTest](#r0s106)|2✔️|||5s| -|[org.apache.pulsar.common.protocol.CommandUtilsTests](#r0s107)|7✔️|||3s| -|[org.apache.pulsar.common.protocol.MarkersTest](#r0s108)|6✔️|||3s| -|[org.apache.pulsar.common.protocol.PulsarDecoderTest](#r0s109)|1✔️|||4s| -|[org.apache.pulsar.common.stats.JvmDefaultGCMetricsLoggerTest](#r0s110)|1✔️|||82ms| -|[org.apache.pulsar.common.util.collections.BitSetRecyclableRecyclableTest](#r0s111)|2✔️|||13ms| -|[org.apache.pulsar.common.util.collections.ConcurrentBitSetRecyclableTest](#r0s112)|2✔️|||63ms| -|[org.apache.pulsar.common.util.collections.ConcurrentLongHashMapTest](#r0s113)|13✔️|||28s| -|[org.apache.pulsar.common.util.collections.ConcurrentLongPairSetTest](#r0s114)|15✔️|||2s| -|[org.apache.pulsar.common.util.collections.ConcurrentOpenHashMapTest](#r0s115)|12✔️|||9s| -|[org.apache.pulsar.common.util.collections.ConcurrentOpenHashSetTest](#r0s116)|11✔️|||7s| -|[org.apache.pulsar.common.util.collections.ConcurrentOpenLongPairRangeSetTest](#r0s117)|13✔️|||1s| -|[org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSetTest](#r0s118)|9✔️|||342ms| -|[org.apache.pulsar.common.util.collections.FieldParserTest](#r0s119)|2✔️|||64ms| -|[org.apache.pulsar.common.util.collections.GrowableArrayBlockingQueueTest](#r0s120)|6✔️|||350ms| -|[org.apache.pulsar.common.util.collections.GrowablePriorityLongPairQueueTest](#r0s121)|15✔️|||3s| -|[org.apache.pulsar.common.util.collections.TripleLongPriorityQueueTest](#r0s122)|3✔️|||238ms| -|[org.apache.pulsar.common.util.FieldParserTest](#r0s123)|1✔️|||242ms| -|[org.apache.pulsar.common.util.FileModifiedTimeUpdaterTest](#r0s124)|6✔️|||6s| -|[org.apache.pulsar.common.util.netty.ChannelFuturesTest](#r0s125)|5✔️|||2s| -|[org.apache.pulsar.common.util.RateLimiterTest](#r0s126)|11✔️|||7s| -|[org.apache.pulsar.common.util.ReflectionsTest](#r0s127)|12✔️|||172ms| -|[org.apache.pulsar.common.util.RelativeTimeUtilTest](#r0s128)|1✔️|||39ms| -|[org.apache.pulsar.discovery.service.web.DiscoveryServiceWebTest](#r0s129)|1✔️|||5s| -|[org.apache.pulsar.functions.worker.PulsarFunctionE2ESecurityTest](#r0s130)|2✔️|||28s| -|[org.apache.pulsar.functions.worker.PulsarFunctionPublishTest](#r0s131)|3✔️|||42s| -|[org.apache.pulsar.functions.worker.PulsarFunctionTlsTest](#r0s132)|1✔️|||12s| -|[org.apache.pulsar.io.PulsarFunctionTlsTest](#r0s133)|1✔️|||30s| -|[org.apache.pulsar.proxy.server.AdminProxyHandlerTest](#r0s134)|1✔️|||474ms| -|[org.apache.pulsar.proxy.server.AuthedAdminProxyHandlerTest](#r0s135)|1✔️|||2s| -|[org.apache.pulsar.proxy.server.FunctionWorkerRoutingTest](#r0s136)|1✔️|||10ms| -|[org.apache.pulsar.proxy.server.ProxyAdditionalServletTest](#r0s137)|1✔️|||125ms| -|[org.apache.pulsar.proxy.server.ProxyAuthenticatedProducerConsumerTest](#r0s138)|1✔️|||2s| -|[org.apache.pulsar.proxy.server.ProxyAuthenticationTest](#r0s139)|1✔️|||17s| -|[org.apache.pulsar.proxy.server.ProxyConnectionThrottlingTest](#r0s140)|1✔️|||2s| -|[org.apache.pulsar.proxy.server.ProxyEnableHAProxyProtocolTest](#r0s141)|1✔️|||511ms| -|[org.apache.pulsar.proxy.server.ProxyForwardAuthDataTest](#r0s142)|1✔️|||32s| -|[org.apache.pulsar.proxy.server.ProxyIsAHttpProxyTest](#r0s143)|10✔️|||2s| -|[org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithAuth](#r0s144)|3✔️|||7s| -|[org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithoutAuth](#r0s145)|3✔️|||7s| -|[org.apache.pulsar.proxy.server.ProxyLookupThrottlingTest](#r0s146)|1✔️|||3s| -|[org.apache.pulsar.proxy.server.ProxyParserTest](#r0s147)|5✔️|||1s| -|[org.apache.pulsar.proxy.server.ProxyRolesEnforcementTest](#r0s148)|1✔️|||10s| -|[org.apache.pulsar.proxy.server.ProxyStatsTest](#r0s149)|3✔️|||533ms| -|[org.apache.pulsar.proxy.server.ProxyTest](#r0s150)|6✔️|||3s| -|[org.apache.pulsar.proxy.server.ProxyTlsTest](#r0s151)|2✔️|||414ms| -|[org.apache.pulsar.proxy.server.ProxyTlsTestWithAuth](#r0s152)|1✔️|||4ms| -|[org.apache.pulsar.proxy.server.ProxyWithAuthorizationNegTest](#r0s153)|1✔️|||2s| -|[org.apache.pulsar.proxy.server.ProxyWithAuthorizationTest](#r0s154)|13✔️|||33s| -|[org.apache.pulsar.proxy.server.ProxyWithoutServiceDiscoveryTest](#r0s155)|1✔️|||2s| -|[org.apache.pulsar.proxy.server.SuperUserAuthedAdminProxyHandlerTest](#r0s156)|3✔️|||8s| -|[org.apache.pulsar.proxy.server.UnauthedAdminProxyHandlerTest](#r0s157)|2✔️|||114ms| -|[org.apache.pulsar.PulsarBrokerStarterTest](#r0s158)|9✔️|||591ms| -|[org.apache.pulsar.schema.compatibility.SchemaCompatibilityCheckTest](#r0s159)|23✔️|||107s| -|[org.apache.pulsar.schema.PartitionedTopicSchemaTest](#r0s160)|1✔️|||29s| -|[org.apache.pulsar.schema.SchemaTest](#r0s161)|3✔️|||31s| -|[org.apache.pulsar.stats.client.PulsarBrokerStatsClientTest](#r0s162)|2✔️|||41s| -|[org.apache.pulsar.tests.EnumValuesDataProviderTest](#r0s163)|6✔️|||23ms| -|[org.apache.pulsar.tests.TestRetrySupportBeforeMethodRetryTest](#r0s164)|1✔️||4✖️|36ms| -|[org.apache.pulsar.tests.TestRetrySupportRetryTest](#r0s165)|1✔️||4✖️|27ms| -|[org.apache.pulsar.tests.TestRetrySupportSuccessTest](#r0s166)|3✔️|||1ms| -|[org.apache.pulsar.tests.ThreadDumpUtilTest](#r0s167)|2✔️|||17ms| -|[org.apache.pulsar.utils.SimpleTextOutputStreamTest](#r0s168)|4✔️|||50ms| -|[org.apache.pulsar.utils.StatsOutputStreamTest](#r0s169)|6✔️|||59ms| -|[org.apache.pulsar.websocket.proxy.ProxyAuthenticationTest](#r0s170)|4✔️|||29s| -|[org.apache.pulsar.websocket.proxy.ProxyAuthorizationTest](#r0s171)|1✔️|||1s| -|[org.apache.pulsar.websocket.proxy.ProxyConfigurationTest](#r0s172)|2✔️|||9s| -|[org.apache.pulsar.websocket.proxy.ProxyPublishConsumeTlsTest](#r0s173)|1✔️|||11s| -|[org.apache.pulsar.websocket.proxy.ProxyPublishConsumeWithoutZKTest](#r0s174)|1✔️|||7s| -|[org.apache.pulsar.websocket.proxy.v1.V1_ProxyAuthenticationTest](#r0s175)|4✔️|||30s| +|[org.apache.pulsar.AddMissingPatchVersionTest](#r0s0)||1❌|1⚪|116ms| +|[org.apache.pulsar.broker.admin.AdminApiOffloadTest](#r0s1)|7✅|||19s| +|[org.apache.pulsar.broker.auth.AuthenticationServiceTest](#r0s2)|2✅|||185ms| +|[org.apache.pulsar.broker.auth.AuthLogsTest](#r0s3)|2✅|||1s| +|[org.apache.pulsar.broker.auth.AuthorizationTest](#r0s4)|1✅|||2s| +|[org.apache.pulsar.broker.lookup.http.HttpTopicLookupv2Test](#r0s5)|4✅|||2s| +|[org.apache.pulsar.broker.namespace.NamespaceCreateBundlesTest](#r0s6)|2✅|||33s| +|[org.apache.pulsar.broker.namespace.NamespaceOwnershipListenerTests](#r0s7)|2✅|||32s| +|[org.apache.pulsar.broker.namespace.NamespaceServiceTest](#r0s8)|10✅|||75s| +|[org.apache.pulsar.broker.namespace.NamespaceUnloadingTest](#r0s9)|2✅|||14s| +|[org.apache.pulsar.broker.namespace.OwnerShipCacheForCurrentServerTest](#r0s10)|1✅|||16s| +|[org.apache.pulsar.broker.namespace.OwnershipCacheTest](#r0s11)|8✅|||16s| +|[org.apache.pulsar.broker.protocol.ProtocolHandlersTest](#r0s12)|6✅|||946ms| +|[org.apache.pulsar.broker.protocol.ProtocolHandlerUtilsTest](#r0s13)|3✅|||7s| +|[org.apache.pulsar.broker.protocol.ProtocolHandlerWithClassLoaderTest](#r0s14)|1✅|||15ms| +|[org.apache.pulsar.broker.PulsarServiceTest](#r0s15)|2✅|||96ms| +|[org.apache.pulsar.broker.service.MessagePublishBufferThrottleTest](#r0s16)|3✅|||14s| +|[org.apache.pulsar.broker.service.ReplicatorTest](#r0s17)|22✅|||40s| +|[org.apache.pulsar.broker.service.TopicOwnerTest](#r0s18)|8✅|||114s| +|[org.apache.pulsar.broker.SLAMonitoringTest](#r0s19)|4✅|||9s| +|[org.apache.pulsar.broker.stats.BookieClientsStatsGeneratorTest](#r0s20)|2✅|||49ms| +|[org.apache.pulsar.broker.stats.ConsumerStatsTest](#r0s21)|3✅|||21s| +|[org.apache.pulsar.broker.stats.ManagedCursorMetricsTest](#r0s22)|1✅|||281ms| +|[org.apache.pulsar.broker.stats.ManagedLedgerMetricsTest](#r0s23)|1✅|||285ms| +|[org.apache.pulsar.broker.stats.prometheus.AggregatedNamespaceStatsTest](#r0s24)|1✅|||40ms| +|[org.apache.pulsar.broker.stats.PrometheusMetricsTest](#r0s25)|15✅|||83s| +|[org.apache.pulsar.broker.stats.SubscriptionStatsTest](#r0s26)|2✅|||2s| +|[org.apache.pulsar.broker.systopic.NamespaceEventsSystemTopicServiceTest](#r0s27)|1✅|||1s| +|[org.apache.pulsar.broker.transaction.buffer.InMemTransactionBufferReaderTest](#r0s28)|3✅|||28ms| +|[org.apache.pulsar.broker.transaction.buffer.TransactionBufferClientTest](#r0s29)|4✅|||93ms| +|[org.apache.pulsar.broker.transaction.buffer.TransactionBufferTest](#r0s30)|7✅|||81ms| +|[org.apache.pulsar.broker.transaction.buffer.TransactionEntryImplTest](#r0s31)|1✅|||14ms| +|[org.apache.pulsar.broker.transaction.buffer.TransactionLowWaterMarkTest](#r0s32)|2✅|||38s| +|[org.apache.pulsar.broker.transaction.buffer.TransactionStablePositionTest](#r0s33)|2✅||1⚪|49s| +|[org.apache.pulsar.broker.transaction.coordinator.TransactionCoordinatorClientTest](#r0s34)|3✅|||95ms| +|[org.apache.pulsar.broker.transaction.coordinator.TransactionMetaStoreAssignmentTest](#r0s35)|1✅|||1s| +|[org.apache.pulsar.broker.transaction.pendingack.PendingAckInMemoryDeleteTest](#r0s36)|2✅||1⚪|57s| +|[org.apache.pulsar.broker.transaction.TransactionConsumeTest](#r0s37)|2✅|||30s| +|[org.apache.pulsar.broker.web.RestExceptionTest](#r0s38)|3✅|||37ms| +|[org.apache.pulsar.broker.web.WebServiceTest](#r0s39)|9✅|||27s| +|[org.apache.pulsar.client.impl.AdminApiKeyStoreTlsAuthTest](#r0s40)|4✅|||8s| +|[org.apache.pulsar.client.impl.BatchMessageIdImplSerializationTest](#r0s41)|4✅|||30ms| +|[org.apache.pulsar.client.impl.BatchMessageIndexAckDisableTest](#r0s42)|4✅|||14s| +|[org.apache.pulsar.client.impl.BatchMessageIndexAckTest](#r0s43)|5✅|||44s| +|[org.apache.pulsar.client.impl.BrokerClientIntegrationTest](#r0s44)|15✅|||148s| +|[org.apache.pulsar.client.impl.CompactedOutBatchMessageTest](#r0s45)|1✅|||1s| +|[org.apache.pulsar.client.impl.ConsumerAckResponseTest](#r0s46)|1✅|||549ms| +|[org.apache.pulsar.client.impl.ConsumerConfigurationTest](#r0s47)|4✅|||12s| +|[org.apache.pulsar.client.impl.ConsumerDedupPermitsUpdate](#r0s48)|7✅|||4s| +|[org.apache.pulsar.client.impl.ConsumerUnsubscribeTest](#r0s49)|1✅|||129ms| +|[org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithAuth](#r0s50)|3✅|||23s| +|[org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithoutAuth](#r0s51)|3✅|||8s| +|[org.apache.pulsar.client.impl.KeyStoreTlsTest](#r0s52)|1✅|||183ms| +|[org.apache.pulsar.client.impl.MessageChecksumTest](#r0s53)|3✅|||47s| +|[org.apache.pulsar.client.impl.MessageChunkingTest](#r0s54)|8✅||1⚪|73s| +|[org.apache.pulsar.client.impl.MessageParserTest](#r0s55)|2✅|||5s| +|[org.apache.pulsar.client.impl.MultiTopicsReaderTest](#r0s56)|8✅|||35s| +|[org.apache.pulsar.client.impl.NegativeAcksTest](#r0s57)|32✅|||11s| +|[org.apache.pulsar.client.impl.PatternTopicsConsumerImplTest](#r0s58)|11✅|||63s| +|[org.apache.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest](#r0s59)|5✅|||34s| +|[org.apache.pulsar.client.impl.PulsarMultiHostClientTest](#r0s60)|3✅|||15s| +|[org.apache.pulsar.client.impl.RawMessageSerDeserTest](#r0s61)|1✅|||10ms| +|[org.apache.pulsar.client.impl.SchemaDeleteTest](#r0s62)|1✅|||2s| +|[org.apache.pulsar.client.impl.SequenceIdWithErrorTest](#r0s63)|3✅||2⚪|18s| +|[org.apache.pulsar.client.impl.TopicDoesNotExistsTest](#r0s64)|2✅|||4s| +|[org.apache.pulsar.client.impl.TopicFromMessageTest](#r0s65)|5✅|||14s| +|[org.apache.pulsar.client.impl.TopicsConsumerImplTest](#r0s66)|17✅|||133s| +|[org.apache.pulsar.client.impl.UnAcknowledgedMessagesTimeoutTest](#r0s67)|7✅|||44s| +|[org.apache.pulsar.client.impl.ZeroQueueSizeTest](#r0s68)|14✅|||16s| +|[org.apache.pulsar.common.api.raw.RawMessageImplTest](#r0s69)|1✅|||316ms| +|[org.apache.pulsar.common.compression.CommandsTest](#r0s70)|1✅|||30ms| +|[org.apache.pulsar.common.compression.CompressorCodecBackwardCompatTest](#r0s71)|6✅|||223ms| +|[org.apache.pulsar.common.compression.CompressorCodecTest](#r0s72)|45✅|||737ms| +|[org.apache.pulsar.common.compression.Crc32cChecksumTest](#r0s73)|6✅|||5s| +|[org.apache.pulsar.common.lookup.data.LookupDataTest](#r0s74)|4✅|||2s| +|[org.apache.pulsar.common.naming.MetadataTests](#r0s75)|2✅|||161ms| +|[org.apache.pulsar.common.naming.NamespaceBundlesTest](#r0s76)|5✅|||99ms| +|[org.apache.pulsar.common.naming.NamespaceBundleTest](#r0s77)|6✅|||64ms| +|[org.apache.pulsar.common.naming.NamespaceNameTest](#r0s78)|2✅|||207ms| +|[org.apache.pulsar.common.naming.ServiceConfigurationTest](#r0s79)|4✅|||48ms| +|[org.apache.pulsar.common.naming.TopicNameTest](#r0s80)|4✅|||529ms| +|[org.apache.pulsar.common.net.ServiceURITest](#r0s81)|21✅|||237ms| +|[org.apache.pulsar.common.policies.data.AutoFailoverPolicyDataTest](#r0s82)|1✅|||15ms| +|[org.apache.pulsar.common.policies.data.AutoFailoverPolicyTypeTest](#r0s83)|1✅|||19ms| +|[org.apache.pulsar.common.policies.data.AutoTopicCreationOverrideTest](#r0s84)|6✅|||64ms| +|[org.apache.pulsar.common.policies.data.BacklogQuotaTest](#r0s85)|1✅|||12ms| +|[org.apache.pulsar.common.policies.data.ClusterDataTest](#r0s86)|1✅|||9ms| +|[org.apache.pulsar.common.policies.data.ConsumerStatsTest](#r0s87)|1✅|||8ms| +|[org.apache.pulsar.common.policies.data.EnsemblePlacementPolicyConfigTest](#r0s88)|2✅|||948ms| +|[org.apache.pulsar.common.policies.data.LocalPolicesTest](#r0s89)|1✅|||48ms| +|[org.apache.pulsar.common.policies.data.NamespaceIsolationDataTest](#r0s90)|1✅|||76ms| +|[org.apache.pulsar.common.policies.data.NamespaceOwnershipStatusTest](#r0s91)|1✅|||45ms| +|[org.apache.pulsar.common.policies.data.OffloadPoliciesTest](#r0s92)|6✅|||216ms| +|[org.apache.pulsar.common.policies.data.PartitionedTopicStatsTest](#r0s93)|1✅|||12ms| +|[org.apache.pulsar.common.policies.data.PersistencePoliciesTest](#r0s94)|1✅|||19ms| +|[org.apache.pulsar.common.policies.data.PersistentOfflineTopicStatsTest](#r0s95)|1✅|||29ms| +|[org.apache.pulsar.common.policies.data.PersistentTopicStatsTest](#r0s96)|2✅|||51ms| +|[org.apache.pulsar.common.policies.data.PoliciesDataTest](#r0s97)|4✅|||1s| +|[org.apache.pulsar.common.policies.data.PublisherStatsTest](#r0s98)|2✅|||37ms| +|[org.apache.pulsar.common.policies.data.ReplicatorStatsTest](#r0s99)|2✅|||30ms| +|[org.apache.pulsar.common.policies.data.ResourceQuotaTest](#r0s100)|2✅|||45ms| +|[org.apache.pulsar.common.policies.data.RetentionPolicesTest](#r0s101)|1✅|||8ms| +|[org.apache.pulsar.common.policies.impl.AutoFailoverPolicyFactoryTest](#r0s102)|1✅|||22ms| +|[org.apache.pulsar.common.policies.impl.MinAvailablePolicyTest](#r0s103)|1✅|||1ms| +|[org.apache.pulsar.common.policies.impl.NamespaceIsolationPoliciesTest](#r0s104)|7✅|||265ms| +|[org.apache.pulsar.common.policies.impl.NamespaceIsolationPolicyImplTest](#r0s105)|7✅|||309ms| +|[org.apache.pulsar.common.protocol.ByteBufPairTest](#r0s106)|2✅|||5s| +|[org.apache.pulsar.common.protocol.CommandUtilsTests](#r0s107)|7✅|||3s| +|[org.apache.pulsar.common.protocol.MarkersTest](#r0s108)|6✅|||3s| +|[org.apache.pulsar.common.protocol.PulsarDecoderTest](#r0s109)|1✅|||4s| +|[org.apache.pulsar.common.stats.JvmDefaultGCMetricsLoggerTest](#r0s110)|1✅|||82ms| +|[org.apache.pulsar.common.util.collections.BitSetRecyclableRecyclableTest](#r0s111)|2✅|||13ms| +|[org.apache.pulsar.common.util.collections.ConcurrentBitSetRecyclableTest](#r0s112)|2✅|||63ms| +|[org.apache.pulsar.common.util.collections.ConcurrentLongHashMapTest](#r0s113)|13✅|||28s| +|[org.apache.pulsar.common.util.collections.ConcurrentLongPairSetTest](#r0s114)|15✅|||2s| +|[org.apache.pulsar.common.util.collections.ConcurrentOpenHashMapTest](#r0s115)|12✅|||9s| +|[org.apache.pulsar.common.util.collections.ConcurrentOpenHashSetTest](#r0s116)|11✅|||7s| +|[org.apache.pulsar.common.util.collections.ConcurrentOpenLongPairRangeSetTest](#r0s117)|13✅|||1s| +|[org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSetTest](#r0s118)|9✅|||342ms| +|[org.apache.pulsar.common.util.collections.FieldParserTest](#r0s119)|2✅|||64ms| +|[org.apache.pulsar.common.util.collections.GrowableArrayBlockingQueueTest](#r0s120)|6✅|||350ms| +|[org.apache.pulsar.common.util.collections.GrowablePriorityLongPairQueueTest](#r0s121)|15✅|||3s| +|[org.apache.pulsar.common.util.collections.TripleLongPriorityQueueTest](#r0s122)|3✅|||238ms| +|[org.apache.pulsar.common.util.FieldParserTest](#r0s123)|1✅|||242ms| +|[org.apache.pulsar.common.util.FileModifiedTimeUpdaterTest](#r0s124)|6✅|||6s| +|[org.apache.pulsar.common.util.netty.ChannelFuturesTest](#r0s125)|5✅|||2s| +|[org.apache.pulsar.common.util.RateLimiterTest](#r0s126)|11✅|||7s| +|[org.apache.pulsar.common.util.ReflectionsTest](#r0s127)|12✅|||172ms| +|[org.apache.pulsar.common.util.RelativeTimeUtilTest](#r0s128)|1✅|||39ms| +|[org.apache.pulsar.discovery.service.web.DiscoveryServiceWebTest](#r0s129)|1✅|||5s| +|[org.apache.pulsar.functions.worker.PulsarFunctionE2ESecurityTest](#r0s130)|2✅|||28s| +|[org.apache.pulsar.functions.worker.PulsarFunctionPublishTest](#r0s131)|3✅|||42s| +|[org.apache.pulsar.functions.worker.PulsarFunctionTlsTest](#r0s132)|1✅|||12s| +|[org.apache.pulsar.io.PulsarFunctionTlsTest](#r0s133)|1✅|||30s| +|[org.apache.pulsar.proxy.server.AdminProxyHandlerTest](#r0s134)|1✅|||474ms| +|[org.apache.pulsar.proxy.server.AuthedAdminProxyHandlerTest](#r0s135)|1✅|||2s| +|[org.apache.pulsar.proxy.server.FunctionWorkerRoutingTest](#r0s136)|1✅|||10ms| +|[org.apache.pulsar.proxy.server.ProxyAdditionalServletTest](#r0s137)|1✅|||125ms| +|[org.apache.pulsar.proxy.server.ProxyAuthenticatedProducerConsumerTest](#r0s138)|1✅|||2s| +|[org.apache.pulsar.proxy.server.ProxyAuthenticationTest](#r0s139)|1✅|||17s| +|[org.apache.pulsar.proxy.server.ProxyConnectionThrottlingTest](#r0s140)|1✅|||2s| +|[org.apache.pulsar.proxy.server.ProxyEnableHAProxyProtocolTest](#r0s141)|1✅|||511ms| +|[org.apache.pulsar.proxy.server.ProxyForwardAuthDataTest](#r0s142)|1✅|||32s| +|[org.apache.pulsar.proxy.server.ProxyIsAHttpProxyTest](#r0s143)|10✅|||2s| +|[org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithAuth](#r0s144)|3✅|||7s| +|[org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithoutAuth](#r0s145)|3✅|||7s| +|[org.apache.pulsar.proxy.server.ProxyLookupThrottlingTest](#r0s146)|1✅|||3s| +|[org.apache.pulsar.proxy.server.ProxyParserTest](#r0s147)|5✅|||1s| +|[org.apache.pulsar.proxy.server.ProxyRolesEnforcementTest](#r0s148)|1✅|||10s| +|[org.apache.pulsar.proxy.server.ProxyStatsTest](#r0s149)|3✅|||533ms| +|[org.apache.pulsar.proxy.server.ProxyTest](#r0s150)|6✅|||3s| +|[org.apache.pulsar.proxy.server.ProxyTlsTest](#r0s151)|2✅|||414ms| +|[org.apache.pulsar.proxy.server.ProxyTlsTestWithAuth](#r0s152)|1✅|||4ms| +|[org.apache.pulsar.proxy.server.ProxyWithAuthorizationNegTest](#r0s153)|1✅|||2s| +|[org.apache.pulsar.proxy.server.ProxyWithAuthorizationTest](#r0s154)|13✅|||33s| +|[org.apache.pulsar.proxy.server.ProxyWithoutServiceDiscoveryTest](#r0s155)|1✅|||2s| +|[org.apache.pulsar.proxy.server.SuperUserAuthedAdminProxyHandlerTest](#r0s156)|3✅|||8s| +|[org.apache.pulsar.proxy.server.UnauthedAdminProxyHandlerTest](#r0s157)|2✅|||114ms| +|[org.apache.pulsar.PulsarBrokerStarterTest](#r0s158)|9✅|||591ms| +|[org.apache.pulsar.schema.compatibility.SchemaCompatibilityCheckTest](#r0s159)|23✅|||107s| +|[org.apache.pulsar.schema.PartitionedTopicSchemaTest](#r0s160)|1✅|||29s| +|[org.apache.pulsar.schema.SchemaTest](#r0s161)|3✅|||31s| +|[org.apache.pulsar.stats.client.PulsarBrokerStatsClientTest](#r0s162)|2✅|||41s| +|[org.apache.pulsar.tests.EnumValuesDataProviderTest](#r0s163)|6✅|||23ms| +|[org.apache.pulsar.tests.TestRetrySupportBeforeMethodRetryTest](#r0s164)|1✅||4⚪|36ms| +|[org.apache.pulsar.tests.TestRetrySupportRetryTest](#r0s165)|1✅||4⚪|27ms| +|[org.apache.pulsar.tests.TestRetrySupportSuccessTest](#r0s166)|3✅|||1ms| +|[org.apache.pulsar.tests.ThreadDumpUtilTest](#r0s167)|2✅|||17ms| +|[org.apache.pulsar.utils.SimpleTextOutputStreamTest](#r0s168)|4✅|||50ms| +|[org.apache.pulsar.utils.StatsOutputStreamTest](#r0s169)|6✅|||59ms| +|[org.apache.pulsar.websocket.proxy.ProxyAuthenticationTest](#r0s170)|4✅|||29s| +|[org.apache.pulsar.websocket.proxy.ProxyAuthorizationTest](#r0s171)|1✅|||1s| +|[org.apache.pulsar.websocket.proxy.ProxyConfigurationTest](#r0s172)|2✅|||9s| +|[org.apache.pulsar.websocket.proxy.ProxyPublishConsumeTlsTest](#r0s173)|1✅|||11s| +|[org.apache.pulsar.websocket.proxy.ProxyPublishConsumeWithoutZKTest](#r0s174)|1✅|||7s| +|[org.apache.pulsar.websocket.proxy.v1.V1_ProxyAuthenticationTest](#r0s175)|4✅|||30s| ### ❌ org.apache.pulsar.AddMissingPatchVersionTest ``` -✖️ testVersionStrings +⚪ testVersionStrings ❌ testVersionStrings java.lang.AssertionError: expected [1.2.1] but found [1.2.0] ``` -### ✔️ org.apache.pulsar.broker.admin.AdminApiOffloadTest +### ✅ org.apache.pulsar.broker.admin.AdminApiOffloadTest ``` -✔️ testOffloadPoliciesAppliedApi -✔️ testOffloadV2 -✔️ testTopicLevelOffloadNonPartitioned -✔️ testTopicLevelOffloadPartitioned -✔️ testOffloadV1 -✔️ testOffloadPolicies -✔️ testOffloadPoliciesApi +✅ testOffloadPoliciesAppliedApi +✅ testOffloadV2 +✅ testTopicLevelOffloadNonPartitioned +✅ testTopicLevelOffloadPartitioned +✅ testOffloadV1 +✅ testOffloadPolicies +✅ testOffloadPoliciesApi ``` -### ✔️ org.apache.pulsar.broker.auth.AuthenticationServiceTest +### ✅ org.apache.pulsar.broker.auth.AuthenticationServiceTest ``` -✔️ testAuthentication -✔️ testAuthenticationHttp +✅ testAuthentication +✅ testAuthenticationHttp ``` -### ✔️ org.apache.pulsar.broker.auth.AuthLogsTest +### ✅ org.apache.pulsar.broker.auth.AuthLogsTest ``` -✔️ httpEndpoint -✔️ binaryEndpoint +✅ httpEndpoint +✅ binaryEndpoint ``` -### ✔️ org.apache.pulsar.broker.auth.AuthorizationTest +### ✅ org.apache.pulsar.broker.auth.AuthorizationTest ``` -✔️ simple +✅ simple ``` -### ✔️ org.apache.pulsar.broker.lookup.http.HttpTopicLookupv2Test +### ✅ org.apache.pulsar.broker.lookup.http.HttpTopicLookupv2Test ``` -✔️ crossColoLookup -✔️ testNotEnoughLookupPermits -✔️ testValidateReplicationSettingsOnNamespace -✔️ testDataPojo +✅ crossColoLookup +✅ testNotEnoughLookupPermits +✅ testValidateReplicationSettingsOnNamespace +✅ testDataPojo ``` -### ✔️ org.apache.pulsar.broker.namespace.NamespaceCreateBundlesTest +### ✅ org.apache.pulsar.broker.namespace.NamespaceCreateBundlesTest ``` -✔️ testCreateNamespaceWithDefaultBundles -✔️ testSplitBundleUpdatesLocalPoliciesWithoutOverwriting +✅ testCreateNamespaceWithDefaultBundles +✅ testSplitBundleUpdatesLocalPoliciesWithoutOverwriting ``` -### ✔️ org.apache.pulsar.broker.namespace.NamespaceOwnershipListenerTests +### ✅ org.apache.pulsar.broker.namespace.NamespaceOwnershipListenerTests ``` -✔️ testGetAllPartitions -✔️ testNamespaceBundleOwnershipListener +✅ testGetAllPartitions +✅ testNamespaceBundleOwnershipListener ``` -### ✔️ org.apache.pulsar.broker.namespace.NamespaceServiceTest +### ✅ org.apache.pulsar.broker.namespace.NamespaceServiceTest ``` -✔️ testSplitMapWithRefreshedStatMap -✔️ testRemoveOwnershipNamespaceBundle -✔️ testIsServiceUnitDisabled -✔️ testLoadReportDeserialize -✔️ testCreateLookupResult -✔️ testUnloadNamespaceBundleWithStuckTopic -✔️ testUnloadNamespaceBundleFailure -✔️ testSplitAndOwnBundles -✔️ testCreateNamespaceWithDefaultNumberOfBundles -✔️ testRemoveOwnershipAndSplitBundle +✅ testSplitMapWithRefreshedStatMap +✅ testRemoveOwnershipNamespaceBundle +✅ testIsServiceUnitDisabled +✅ testLoadReportDeserialize +✅ testCreateLookupResult +✅ testUnloadNamespaceBundleWithStuckTopic +✅ testUnloadNamespaceBundleFailure +✅ testSplitAndOwnBundles +✅ testCreateNamespaceWithDefaultNumberOfBundles +✅ testRemoveOwnershipAndSplitBundle ``` -### ✔️ org.apache.pulsar.broker.namespace.NamespaceUnloadingTest +### ✅ org.apache.pulsar.broker.namespace.NamespaceUnloadingTest ``` -✔️ testUnloadNotLoadedNamespace -✔️ testUnloadPartiallyLoadedNamespace +✅ testUnloadNotLoadedNamespace +✅ testUnloadPartiallyLoadedNamespace ``` -### ✔️ org.apache.pulsar.broker.namespace.OwnerShipCacheForCurrentServerTest +### ✅ org.apache.pulsar.broker.namespace.OwnerShipCacheForCurrentServerTest ``` -✔️ testOwnershipForCurrentServer +✅ testOwnershipForCurrentServer ``` -### ✔️ org.apache.pulsar.broker.namespace.OwnershipCacheTest +### ✅ org.apache.pulsar.broker.namespace.OwnershipCacheTest ``` -✔️ testGetOwnedServiceUnits -✔️ testRemoveOwnership -✔️ testGetOwnedServiceUnit -✔️ testGetOrSetOwner -✔️ testConstructor -✔️ testGetOwner -✔️ testDisableOwnership -✔️ testReestablishOwnership +✅ testGetOwnedServiceUnits +✅ testRemoveOwnership +✅ testGetOwnedServiceUnit +✅ testGetOrSetOwner +✅ testConstructor +✅ testGetOwner +✅ testDisableOwnership +✅ testReestablishOwnership ``` -### ✔️ org.apache.pulsar.broker.protocol.ProtocolHandlersTest +### ✅ org.apache.pulsar.broker.protocol.ProtocolHandlersTest ``` -✔️ testStart -✔️ testGetProtocol -✔️ testNewChannelInitializersSuccess -✔️ testInitialize -✔️ testNewChannelInitializersOverlapped -✔️ testGetProtocolDataToAdvertise +✅ testStart +✅ testGetProtocol +✅ testNewChannelInitializersSuccess +✅ testInitialize +✅ testNewChannelInitializersOverlapped +✅ testGetProtocolDataToAdvertise ``` -### ✔️ org.apache.pulsar.broker.protocol.ProtocolHandlerUtilsTest +### ✅ org.apache.pulsar.broker.protocol.ProtocolHandlerUtilsTest ``` -✔️ testLoadProtocolHandler -✔️ testLoadProtocolHandlerBlankHandlerClass -✔️ testLoadProtocolHandlerWrongHandlerClass +✅ testLoadProtocolHandler +✅ testLoadProtocolHandlerBlankHandlerClass +✅ testLoadProtocolHandlerWrongHandlerClass ``` -### ✔️ org.apache.pulsar.broker.protocol.ProtocolHandlerWithClassLoaderTest +### ✅ org.apache.pulsar.broker.protocol.ProtocolHandlerWithClassLoaderTest ``` -✔️ testWrapper +✅ testWrapper ``` -### ✔️ org.apache.pulsar.broker.PulsarServiceTest +### ✅ org.apache.pulsar.broker.PulsarServiceTest ``` -✔️ testGetWorkerService -✔️ testGetWorkerServiceException +✅ testGetWorkerService +✅ testGetWorkerServiceException ``` -### ✔️ org.apache.pulsar.broker.service.MessagePublishBufferThrottleTest +### ✅ org.apache.pulsar.broker.service.MessagePublishBufferThrottleTest ``` -✔️ testMessagePublishBufferThrottleEnable -✔️ testBlockByPublishRateLimiting -✔️ testMessagePublishBufferThrottleDisabled +✅ testMessagePublishBufferThrottleEnable +✅ testBlockByPublishRateLimiting +✅ testMessagePublishBufferThrottleDisabled ``` -### ✔️ org.apache.pulsar.broker.service.ReplicatorTest +### ✅ org.apache.pulsar.broker.service.ReplicatorTest ``` -✔️ testResumptionAfterBacklogRelaxed -✔️ testReplicationOverrides -✔️ testResetCursorNotFail -✔️ testUpdateGlobalTopicPartition -✔️ testReplication -✔️ testReplicatorOnPartitionedTopic -✔️ testConcurrentReplicator -✔️ testTopicReplicatedAndProducerCreate -✔️ testDeleteReplicatorFailure -✔️ testReplicatorOnPartitionedTopic -✔️ testReplicationForBatchMessages -✔️ testReplicatorClearBacklog -✔️ verifyChecksumAfterReplication -✔️ testCloseReplicatorStartProducer -✔️ activeBrokerParse -✔️ testReplicatePeekAndSkip -✔️ testReplication -✔️ testReplicatedCluster -✔️ testTopicReplicatedAndProducerCreate -✔️ testConfigChange -✔️ testFailures -✔️ testReplicatorProducerClosing +✅ testResumptionAfterBacklogRelaxed +✅ testReplicationOverrides +✅ testResetCursorNotFail +✅ testUpdateGlobalTopicPartition +✅ testReplication +✅ testReplicatorOnPartitionedTopic +✅ testConcurrentReplicator +✅ testTopicReplicatedAndProducerCreate +✅ testDeleteReplicatorFailure +✅ testReplicatorOnPartitionedTopic +✅ testReplicationForBatchMessages +✅ testReplicatorClearBacklog +✅ verifyChecksumAfterReplication +✅ testCloseReplicatorStartProducer +✅ activeBrokerParse +✅ testReplicatePeekAndSkip +✅ testReplication +✅ testReplicatedCluster +✅ testTopicReplicatedAndProducerCreate +✅ testConfigChange +✅ testFailures +✅ testReplicatorProducerClosing ``` -### ✔️ org.apache.pulsar.broker.service.TopicOwnerTest +### ✅ org.apache.pulsar.broker.service.TopicOwnerTest ``` -✔️ testReleaseOwnershipWithZookeeperDisconnectedBeforeOwnershipNodeDeleted -✔️ testAcquireOwnershipWithZookeeperDisconnectedAfterOwnershipNodeCreated -✔️ testConnectToInvalidateBundleCacheBroker -✔️ testAcquireOwnershipWithZookeeperDisconnectedBeforeOwnershipNodeCreated -✔️ testLookupPartitionedTopic -✔️ testListNonPersistentTopic -✔️ testReleaseOwnershipWithZookeeperDisconnectedAfterOwnershipNodeDeleted -✔️ testReestablishOwnershipAfterInvalidateCache +✅ testReleaseOwnershipWithZookeeperDisconnectedBeforeOwnershipNodeDeleted +✅ testAcquireOwnershipWithZookeeperDisconnectedAfterOwnershipNodeCreated +✅ testConnectToInvalidateBundleCacheBroker +✅ testAcquireOwnershipWithZookeeperDisconnectedBeforeOwnershipNodeCreated +✅ testLookupPartitionedTopic +✅ testListNonPersistentTopic +✅ testReleaseOwnershipWithZookeeperDisconnectedAfterOwnershipNodeDeleted +✅ testReestablishOwnershipAfterInvalidateCache ``` -### ✔️ org.apache.pulsar.broker.SLAMonitoringTest +### ✅ org.apache.pulsar.broker.SLAMonitoringTest ``` -✔️ testOwnedNamespaces -✔️ testOwnershipAfterSetup -✔️ testUnloadIfBrokerCrashes -✔️ testOwnershipViaAdminAfterSetup +✅ testOwnedNamespaces +✅ testOwnershipAfterSetup +✅ testUnloadIfBrokerCrashes +✅ testOwnershipViaAdminAfterSetup ``` -### ✔️ org.apache.pulsar.broker.stats.BookieClientsStatsGeneratorTest +### ✅ org.apache.pulsar.broker.stats.BookieClientsStatsGeneratorTest ``` -✔️ testJvmDirectMemoryUsedMetric -✔️ testBookieClientStatsGenerator +✅ testJvmDirectMemoryUsedMetric +✅ testBookieClientStatsGenerator ``` -### ✔️ org.apache.pulsar.broker.stats.ConsumerStatsTest +### ✅ org.apache.pulsar.broker.stats.ConsumerStatsTest ``` -✔️ testAckStatsOnPartitionedTopicForExclusiveSubscription -✔️ testConsumerStatsOnZeroMaxUnackedMessagesPerConsumer -✔️ testUpdateStatsForActiveConsumerAndSubscription +✅ testAckStatsOnPartitionedTopicForExclusiveSubscription +✅ testConsumerStatsOnZeroMaxUnackedMessagesPerConsumer +✅ testUpdateStatsForActiveConsumerAndSubscription ``` -### ✔️ org.apache.pulsar.broker.stats.ManagedCursorMetricsTest +### ✅ org.apache.pulsar.broker.stats.ManagedCursorMetricsTest ``` -✔️ testManagedCursorMetrics +✅ testManagedCursorMetrics ``` -### ✔️ org.apache.pulsar.broker.stats.ManagedLedgerMetricsTest +### ✅ org.apache.pulsar.broker.stats.ManagedLedgerMetricsTest ``` -✔️ testManagedLedgerMetrics +✅ testManagedLedgerMetrics ``` -### ✔️ org.apache.pulsar.broker.stats.prometheus.AggregatedNamespaceStatsTest +### ✅ org.apache.pulsar.broker.stats.prometheus.AggregatedNamespaceStatsTest ``` -✔️ testSimpleAggregation +✅ testSimpleAggregation ``` -### ✔️ org.apache.pulsar.broker.stats.PrometheusMetricsTest +### ✅ org.apache.pulsar.broker.stats.PrometheusMetricsTest ``` -✔️ testPerTopicStats -✔️ testAuthMetrics -✔️ testPerTopicExpiredStat -✔️ testPerProducerStats -✔️ testMetricsTopicCount -✔️ testManagedLedgerBookieClientStats -✔️ testDuplicateMetricTypeDefinitions -✔️ testExpiringTokenMetrics -✔️ testPerConsumerStats -✔️ testPerNamespaceStats -✔️ testManagedCursorPersistStats -✔️ testDuplicateMetricTypeDefinitions -✔️ testExpiredTokenMetrics -✔️ testManagedLedgerCacheStats -✔️ testManagedLedgerStats +✅ testPerTopicStats +✅ testAuthMetrics +✅ testPerTopicExpiredStat +✅ testPerProducerStats +✅ testMetricsTopicCount +✅ testManagedLedgerBookieClientStats +✅ testDuplicateMetricTypeDefinitions +✅ testExpiringTokenMetrics +✅ testPerConsumerStats +✅ testPerNamespaceStats +✅ testManagedCursorPersistStats +✅ testDuplicateMetricTypeDefinitions +✅ testExpiredTokenMetrics +✅ testManagedLedgerCacheStats +✅ testManagedLedgerStats ``` -### ✔️ org.apache.pulsar.broker.stats.SubscriptionStatsTest +### ✅ org.apache.pulsar.broker.stats.SubscriptionStatsTest ``` -✔️ testConsumersAfterMarkDelete -✔️ testNonContiguousDeletedMessagesRanges +✅ testConsumersAfterMarkDelete +✅ testNonContiguousDeletedMessagesRanges ``` -### ✔️ org.apache.pulsar.broker.systopic.NamespaceEventsSystemTopicServiceTest +### ✅ org.apache.pulsar.broker.systopic.NamespaceEventsSystemTopicServiceTest ``` -✔️ testSendAndReceiveNamespaceEvents +✅ testSendAndReceiveNamespaceEvents ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.InMemTransactionBufferReaderTest +### ✅ org.apache.pulsar.broker.transaction.buffer.InMemTransactionBufferReaderTest ``` -✔️ testCloseReleaseAllEntries -✔️ testInvalidNumEntriesArgument -✔️ testEndOfTransactionException +✅ testCloseReleaseAllEntries +✅ testInvalidNumEntriesArgument +✅ testEndOfTransactionException ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.TransactionBufferClientTest +### ✅ org.apache.pulsar.broker.transaction.buffer.TransactionBufferClientTest ``` -✔️ testAbortOnTopic -✔️ testAbortOnSubscription -✔️ testCommitOnTopic -✔️ testCommitOnSubscription +✅ testAbortOnTopic +✅ testAbortOnSubscription +✅ testCommitOnTopic +✅ testCommitOnSubscription ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.TransactionBufferTest +### ✅ org.apache.pulsar.broker.transaction.buffer.TransactionBufferTest ``` -✔️ testOpenReaderOnNonExistentTxn -✔️ testAbortCommittedTxn -✔️ testAbortTxn -✔️ testAbortNonExistentTxn -✔️ testCommitNonExistentTxn -✔️ testCommitTxn -✔️ testOpenReaderOnAnOpenTxn +✅ testOpenReaderOnNonExistentTxn +✅ testAbortCommittedTxn +✅ testAbortTxn +✅ testAbortNonExistentTxn +✅ testCommitNonExistentTxn +✅ testCommitTxn +✅ testOpenReaderOnAnOpenTxn ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.TransactionEntryImplTest +### ✅ org.apache.pulsar.broker.transaction.buffer.TransactionEntryImplTest ``` -✔️ testCloseShouldReleaseBuffer +✅ testCloseShouldReleaseBuffer ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.TransactionLowWaterMarkTest +### ✅ org.apache.pulsar.broker.transaction.buffer.TransactionLowWaterMarkTest ``` -✔️ testTransactionBufferLowWaterMark -✔️ testPendingAckLowWaterMark +✅ testTransactionBufferLowWaterMark +✅ testPendingAckLowWaterMark ``` -### ✔️ org.apache.pulsar.broker.transaction.buffer.TransactionStablePositionTest +### ✅ org.apache.pulsar.broker.transaction.buffer.TransactionStablePositionTest ``` -✔️ commitTxnTest -✔️ abortTxnTest -✖️ commitTxnTest +✅ commitTxnTest +✅ abortTxnTest +⚪ commitTxnTest ``` -### ✔️ org.apache.pulsar.broker.transaction.coordinator.TransactionCoordinatorClientTest +### ✅ org.apache.pulsar.broker.transaction.coordinator.TransactionCoordinatorClientTest ``` -✔️ testClientStart -✔️ testCommitAndAbort -✔️ testNewTxn +✅ testClientStart +✅ testCommitAndAbort +✅ testNewTxn ``` -### ✔️ org.apache.pulsar.broker.transaction.coordinator.TransactionMetaStoreAssignmentTest +### ✅ org.apache.pulsar.broker.transaction.coordinator.TransactionMetaStoreAssignmentTest ``` -✔️ testTransactionMetaStoreAssignAndFailover +✅ testTransactionMetaStoreAssignAndFailover ``` -### ✔️ org.apache.pulsar.broker.transaction.pendingack.PendingAckInMemoryDeleteTest +### ✅ org.apache.pulsar.broker.transaction.pendingack.PendingAckInMemoryDeleteTest ``` -✖️ txnAckTestNoBatchAndSharedSubMemoryDeleteTest -✔️ txnAckTestNoBatchAndSharedSubMemoryDeleteTest -✔️ txnAckTestBatchAndSharedSubMemoryDeleteTest +⚪ txnAckTestNoBatchAndSharedSubMemoryDeleteTest +✅ txnAckTestNoBatchAndSharedSubMemoryDeleteTest +✅ txnAckTestBatchAndSharedSubMemoryDeleteTest ``` -### ✔️ org.apache.pulsar.broker.transaction.TransactionConsumeTest +### ✅ org.apache.pulsar.broker.transaction.TransactionConsumeTest ``` -✔️ noSortedTest -✔️ sortedTest +✅ noSortedTest +✅ sortedTest ``` -### ✔️ org.apache.pulsar.broker.web.RestExceptionTest +### ✅ org.apache.pulsar.broker.web.RestExceptionTest ``` -✔️ testRestException -✔️ testWebApplicationException -✔️ testOtherException +✅ testRestException +✅ testWebApplicationException +✅ testOtherException ``` -### ✔️ org.apache.pulsar.broker.web.WebServiceTest +### ✅ org.apache.pulsar.broker.web.WebServiceTest ``` -✔️ testTlsAuthDisallowInsecure -✔️ testBrokerReady -✔️ testDefaultClientVersion -✔️ testTlsEnabled -✔️ testTlsAuthAllowInsecure -✔️ testSplitPath -✔️ testMaxRequestSize -✔️ testTlsDisabled -✔️ testRateLimiting +✅ testTlsAuthDisallowInsecure +✅ testBrokerReady +✅ testDefaultClientVersion +✅ testTlsEnabled +✅ testTlsAuthAllowInsecure +✅ testSplitPath +✅ testMaxRequestSize +✅ testTlsDisabled +✅ testRateLimiting ``` -### ✔️ org.apache.pulsar.client.impl.AdminApiKeyStoreTlsAuthTest +### ✅ org.apache.pulsar.client.impl.AdminApiKeyStoreTlsAuthTest ``` -✔️ testAuthorizedUserAsOriginalPrincipal -✔️ testSuperUserCantListNamespaces -✔️ testPersistentList -✔️ testSuperUserCanListTenants +✅ testAuthorizedUserAsOriginalPrincipal +✅ testSuperUserCantListNamespaces +✅ testPersistentList +✅ testSuperUserCanListTenants ``` -### ✔️ org.apache.pulsar.client.impl.BatchMessageIdImplSerializationTest +### ✅ org.apache.pulsar.client.impl.BatchMessageIdImplSerializationTest ``` -✔️ testSerializationEmpty -✔️ testSerialization1 -✔️ testSerializationNull -✔️ testSerialization2 +✅ testSerializationEmpty +✅ testSerialization1 +✅ testSerializationNull +✅ testSerialization2 ``` -### ✔️ org.apache.pulsar.client.impl.BatchMessageIndexAckDisableTest +### ✅ org.apache.pulsar.client.impl.BatchMessageIndexAckDisableTest ``` -✔️ testBatchMessageIndexAckForExclusiveSubscription -✔️ testBatchMessageIndexAckForSharedSubscription -✔️ testBatchMessageIndexAckForExclusiveSubscription -✔️ testBatchMessageIndexAckForSharedSubscription +✅ testBatchMessageIndexAckForExclusiveSubscription +✅ testBatchMessageIndexAckForSharedSubscription +✅ testBatchMessageIndexAckForExclusiveSubscription +✅ testBatchMessageIndexAckForSharedSubscription ``` -### ✔️ org.apache.pulsar.client.impl.BatchMessageIndexAckTest +### ✅ org.apache.pulsar.client.impl.BatchMessageIndexAckTest ``` -✔️ testBatchMessageIndexAckForSharedSubscription -✔️ testBatchMessageIndexAckForSharedSubscription -✔️ testDoNotRecycleAckSetMultipleTimes -✔️ testBatchMessageIndexAckForExclusiveSubscription -✔️ testBatchMessageIndexAckForExclusiveSubscription +✅ testBatchMessageIndexAckForSharedSubscription +✅ testBatchMessageIndexAckForSharedSubscription +✅ testDoNotRecycleAckSetMultipleTimes +✅ testBatchMessageIndexAckForExclusiveSubscription +✅ testBatchMessageIndexAckForExclusiveSubscription ``` -### ✔️ org.apache.pulsar.client.impl.BrokerClientIntegrationTest +### ✅ org.apache.pulsar.client.impl.BrokerClientIntegrationTest ``` -✔️ testDisconnectClientWithoutClosingConnection -✔️ testResetCursor -✔️ testResetCursor -✔️ testCloseBrokerService -✔️ testUnsupportedBatchMessageConsumer -✔️ testAvroSchemaProducerConsumerWithSpecifiedReaderAndWriter -✔️ testJsonSchemaProducerConsumerWithSpecifiedReaderAndWriter -✔️ testOperationTimeout -✔️ testCleanProducer -✔️ testUnsupportedBatchMessageConsumer -✔️ testCloseConnectionOnBrokerRejectedRequest -✔️ testAddEntryOperationTimeout -✔️ testInvalidDynamicConfiguration -✔️ testMaxConcurrentTopicLoading -✔️ testCloseConnectionOnInternalServerError +✅ testDisconnectClientWithoutClosingConnection +✅ testResetCursor +✅ testResetCursor +✅ testCloseBrokerService +✅ testUnsupportedBatchMessageConsumer +✅ testAvroSchemaProducerConsumerWithSpecifiedReaderAndWriter +✅ testJsonSchemaProducerConsumerWithSpecifiedReaderAndWriter +✅ testOperationTimeout +✅ testCleanProducer +✅ testUnsupportedBatchMessageConsumer +✅ testCloseConnectionOnBrokerRejectedRequest +✅ testAddEntryOperationTimeout +✅ testInvalidDynamicConfiguration +✅ testMaxConcurrentTopicLoading +✅ testCloseConnectionOnInternalServerError ``` -### ✔️ org.apache.pulsar.client.impl.CompactedOutBatchMessageTest +### ✅ org.apache.pulsar.client.impl.CompactedOutBatchMessageTest ``` -✔️ testCompactedOutMessages +✅ testCompactedOutMessages ``` -### ✔️ org.apache.pulsar.client.impl.ConsumerAckResponseTest +### ✅ org.apache.pulsar.client.impl.ConsumerAckResponseTest ``` -✔️ testAckResponse +✅ testAckResponse ``` -### ✔️ org.apache.pulsar.client.impl.ConsumerConfigurationTest -``` -✔️ testReadCompactNonPersistentExclusive -✔️ testReadCompactPersistentExclusive -✔️ testReadCompactPersistentFailover -✔️ testReadCompactPersistentShared -``` -### ✔️ org.apache.pulsar.client.impl.ConsumerDedupPermitsUpdate -``` -✔️ testConsumerDedup -✔️ testConsumerDedup -✔️ testConsumerDedup -✔️ testConsumerDedup -✔️ testConsumerDedup -✔️ testConsumerDedup -✔️ testConsumerDedup -``` -### ✔️ org.apache.pulsar.client.impl.ConsumerUnsubscribeTest -``` -✔️ testConsumerUnsubscribeReference -``` -### ✔️ org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithAuth -``` -✔️ testTlsClientAuthOverHTTPProtocol -✔️ testTlsClientAuthOverBinaryProtocol -✔️ testTlsLargeSizeMessage -``` -### ✔️ org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithoutAuth -``` -✔️ testTlsClientAuthOverHTTPProtocol -✔️ testTlsClientAuthOverBinaryProtocol -✔️ testTlsLargeSizeMessage -``` -### ✔️ org.apache.pulsar.client.impl.KeyStoreTlsTest -``` -✔️ testValidate -``` -### ✔️ org.apache.pulsar.client.impl.MessageChecksumTest -``` -✔️ testChecksumCompatibilityInMixedVersionBrokerCluster -✔️ testTamperingMessageIsDetected -✔️ testChecksumCompatibilityInMixedVersionBrokerCluster -``` -### ✔️ org.apache.pulsar.client.impl.MessageChunkingTest -``` -✔️ testPublishWithFailure -✔️ testInvalidUseCaseForChunking -✔️ testLargeMessage -✔️ testExpireIncompleteChunkMessage -✔️ testInvalidConfig -✔️ testLargeMessageAckTimeOut -✔️ testLargeMessageAckTimeOut -✔️ testLargeMessage -✖️ testMaxPendingChunkMessages -``` -### ✔️ org.apache.pulsar.client.impl.MessageParserTest -``` -✔️ testWithoutBatches -✔️ testWithBatches -``` -### ✔️ org.apache.pulsar.client.impl.MultiTopicsReaderTest -``` -✔️ testReadMessageWithBatchingWithMessageInclusive -✔️ testKeyHashRangeReader -✔️ testRemoveSubscriptionForReaderNeedRemoveCursor -✔️ testReadMessageWithBatching -✔️ testReadMessageWithoutBatchingWithMessageInclusive -✔️ testMultiReaderSeek -✔️ testReadMessageWithoutBatching -✔️ testReaderWithTimeLong -``` -### ✔️ org.apache.pulsar.client.impl.NegativeAcksTest -``` -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -✔️ testNegativeAcks -``` -### ✔️ org.apache.pulsar.client.impl.PatternTopicsConsumerImplTest -``` -✔️ testStartEmptyPatternConsumer -✔️ testBinaryProtoToGetTopicsOfNamespaceAll -✔️ testPatternTopicsSubscribeWithBuilderFail -✔️ testPubRateOnNonPersistent -✔️ testTopicDeletion -✔️ testAutoUnbubscribePatternConsumer -✔️ testTopicsPatternFilter -✔️ testBinaryProtoToGetTopicsOfNamespaceNonPersistent -✔️ testBinaryProtoToGetTopicsOfNamespacePersistent -✔️ testTopicsListMinus -✔️ testAutoSubscribePatternConsumer -``` -### ✔️ org.apache.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest -``` -✔️ testSharedAckedNormalTopic -✔️ testUnAckedMessageTrackerSize -✔️ testSharedAckedPartitionedTopic -✔️ testExclusiveAckedNormalTopic -✔️ testFailoverAckedNormalTopic -``` -### ✔️ org.apache.pulsar.client.impl.PulsarMultiHostClientTest -``` -✔️ testMultiHostUrlRetrySuccess -✔️ testGetPartitionedTopicDataTimeout -✔️ testGetPartitionedTopicMetaData -``` -### ✔️ org.apache.pulsar.client.impl.RawMessageSerDeserTest -``` -✔️ testSerializationAndDeserialization -``` -### ✔️ org.apache.pulsar.client.impl.SchemaDeleteTest -``` -✔️ createTopicDeleteTopicCreateTopic -``` -### ✔️ org.apache.pulsar.client.impl.SequenceIdWithErrorTest -``` -✔️ testCheckSequenceId -✔️ testDeleteTopicWithMissingData -✔️ testTopicWithWildCardChar -✖️ testCrashBrokerWithoutCursorLedgerLeak -✖️ testSkipCorruptDataLedger -``` -### ✔️ org.apache.pulsar.client.impl.TopicDoesNotExistsTest -``` -✔️ testCreateConsumerOnNotExistsTopic -✔️ testCreateProducerOnNotExistsTopic -``` -### ✔️ org.apache.pulsar.client.impl.TopicFromMessageTest -``` -✔️ testSingleTopicConsumerNoBatchFullName -✔️ testMultiTopicConsumerBatchShortName -✔️ testSingleTopicConsumerNoBatchShortName -✔️ testMultiTopicConsumerNoBatchShortName -✔️ testSingleTopicConsumerBatchShortName -``` -### ✔️ org.apache.pulsar.client.impl.TopicsConsumerImplTest -``` -✔️ testTopicAutoUpdatePartitions -✔️ testDifferentTopicsNameSubscribe -✔️ testGetLastMessageId -✔️ testConsumerUnackedRedelivery -✔️ testSubscriptionMustCompleteWhenOperationTimeoutOnMultipleTopics -✔️ testConsumerDistributionInFailoverSubscriptionWhenUpdatePartitions -✔️ multiTopicsInDifferentNameSpace -✔️ testDefaultBacklogTTL -✔️ testGetConsumersAndGetTopics -✔️ testSubscribeUnsubscribeSingleTopic -✔️ testResubscribeSameTopic -✔️ testSyncProducerAndConsumer -✔️ testPartitionsUpdatesForMultipleTopics -✔️ testTopicsNameSubscribeWithBuilderFail -✔️ testMultiTopicsMessageListener -✔️ testTopicNameValid -✔️ testAsyncConsumer -``` -### ✔️ org.apache.pulsar.client.impl.UnAcknowledgedMessagesTimeoutTest -``` -✔️ testCheckUnAcknowledgedMessageTimer -✔️ testExclusiveSingleAckedNormalTopic -✔️ testFailoverSingleAckedPartitionedTopic -✔️ testSharedSingleAckedPartitionedTopic -✔️ testAckTimeoutMinValue -✔️ testExclusiveCumulativeAckedNormalTopic -✔️ testSingleMessageBatch -``` -### ✔️ org.apache.pulsar.client.impl.ZeroQueueSizeTest -``` -✔️ zeroQueueSizeSharedSubscription -✔️ testPauseAndResume -✔️ testZeroQueueSizeMessageRedeliveryForAsyncReceive -✔️ zeroQueueSizeConsumerListener -✔️ zeroQueueSizeFailoverSubscription -✔️ validQueueSizeConfig -✔️ zeroQueueSizeNormalConsumer -✔️ zeroQueueSizeReceieveAsyncInCompatibility -✔️ InvalidQueueSizeConfig -✔️ testZeroQueueSizeMessageRedeliveryForListener -✔️ testZeroQueueSizeMessageRedelivery -✔️ zeroQueueSizePartitionedTopicInCompatibility -✔️ testFailedZeroQueueSizeBatchMessage -✔️ testPauseAndResumeWithUnloading -``` -### ✔️ org.apache.pulsar.common.api.raw.RawMessageImplTest -``` -✔️ testGetProperties -``` -### ✔️ org.apache.pulsar.common.compression.CommandsTest -``` -✔️ testChecksumSendCommand -``` -### ✔️ org.apache.pulsar.common.compression.CompressorCodecBackwardCompatTest -``` -✔️ testCompressDecompress -✔️ testCompressDecompress -✔️ testCompressDecompress -✔️ testCompressDecompress -✔️ testCompressDecompress -✔️ testCompressDecompress -``` -### ✔️ org.apache.pulsar.common.compression.CompressorCodecTest -``` -✔️ testCompressDecompress -✔️ testMultpileUsages -✔️ testMultpileUsages -✔️ testCompressDecompress -✔️ testMultpileUsages -✔️ testCompressDecompress -✔️ testMultpileUsages -✔️ testCompressDecompress -✔️ testDecompressFromSampleBuffer -✔️ testDecompressReadonlyByteBuf -✔️ testDecompressReadonlyByteBuf -✔️ testCodecProvider -✔️ testEmptyInput -✔️ testEmptyInput -✔️ testCompressDecompress -✔️ testCodecProvider -✔️ testDecompressFromSampleBuffer -✔️ testMultpileUsages -✔️ testCodecProvider -✔️ testEmptyInput -✔️ testDecompressReadonlyByteBuf -✔️ testCompressDecompress -✔️ testDecompressReadonlyByteBuf -✔️ testCompressDecompress -✔️ testCompressDecompress -✔️ testMultpileUsages -✔️ testEmptyInput -✔️ testDecompressReadonlyByteBuf -✔️ testDecompressFromSampleBuffer -✔️ testDecompressFromSampleBuffer -✔️ testDecompressFromSampleBuffer -✔️ testDecompressReadonlyByteBuf -✔️ testDecompressReadonlyByteBuf -✔️ testMultpileUsages -✔️ testCompressDecompress -✔️ testCodecProvider -✔️ testMultpileUsages -✔️ testCompressDecompress -✔️ testMultpileUsages -✔️ testDecompressReadonlyByteBuf -✔️ testEmptyInput -✔️ testCodecProvider -✔️ testDecompressReadonlyByteBuf -✔️ testDecompressReadonlyByteBuf -✔️ testMultpileUsages -``` -### ✔️ org.apache.pulsar.common.compression.Crc32cChecksumTest -``` -✔️ testCrc32cHardware -✔️ testCrc32cDirectMemoryHardware -✔️ testCrc32c -✔️ testCrc32cSoftware -✔️ testCrc32cIncremental -✔️ testCrc32cIncrementalUsingProvider -``` -### ✔️ org.apache.pulsar.common.lookup.data.LookupDataTest -``` -✔️ testLoadReportSerialization -✔️ testUrlEncoder -✔️ serializeToJsonTest -✔️ withConstructor -``` -### ✔️ org.apache.pulsar.common.naming.MetadataTests -``` -✔️ testInvalidMetadata -✔️ testValidMetadata -``` -### ✔️ org.apache.pulsar.common.naming.NamespaceBundlesTest -``` -✔️ testConstructor -✔️ testSplitBundleInTwo -✔️ testsplitBundles -✔️ testFindBundle -✔️ testSplitBundleByFixBoundary -``` -### ✔️ org.apache.pulsar.common.naming.NamespaceBundleTest -``` -✔️ testIncludes -✔️ testGetBundle -✔️ testCompareTo -✔️ testConstructor -✔️ testToString -✔️ testEquals -``` -### ✔️ org.apache.pulsar.common.naming.NamespaceNameTest -``` -✔️ namespace -✔️ testNewScheme -``` -### ✔️ org.apache.pulsar.common.naming.ServiceConfigurationTest -``` -✔️ testOptionalSettingPresent -✔️ testOptionalSettingEmpty -✔️ testInit -✔️ testInitFailure +### ✅ org.apache.pulsar.client.impl.ConsumerConfigurationTest +``` +✅ testReadCompactNonPersistentExclusive +✅ testReadCompactPersistentExclusive +✅ testReadCompactPersistentFailover +✅ testReadCompactPersistentShared +``` +### ✅ org.apache.pulsar.client.impl.ConsumerDedupPermitsUpdate +``` +✅ testConsumerDedup +✅ testConsumerDedup +✅ testConsumerDedup +✅ testConsumerDedup +✅ testConsumerDedup +✅ testConsumerDedup +✅ testConsumerDedup +``` +### ✅ org.apache.pulsar.client.impl.ConsumerUnsubscribeTest +``` +✅ testConsumerUnsubscribeReference +``` +### ✅ org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithAuth +``` +✅ testTlsClientAuthOverHTTPProtocol +✅ testTlsClientAuthOverBinaryProtocol +✅ testTlsLargeSizeMessage +``` +### ✅ org.apache.pulsar.client.impl.KeyStoreTlsProducerConsumerTestWithoutAuth +``` +✅ testTlsClientAuthOverHTTPProtocol +✅ testTlsClientAuthOverBinaryProtocol +✅ testTlsLargeSizeMessage +``` +### ✅ org.apache.pulsar.client.impl.KeyStoreTlsTest +``` +✅ testValidate +``` +### ✅ org.apache.pulsar.client.impl.MessageChecksumTest +``` +✅ testChecksumCompatibilityInMixedVersionBrokerCluster +✅ testTamperingMessageIsDetected +✅ testChecksumCompatibilityInMixedVersionBrokerCluster +``` +### ✅ org.apache.pulsar.client.impl.MessageChunkingTest +``` +✅ testPublishWithFailure +✅ testInvalidUseCaseForChunking +✅ testLargeMessage +✅ testExpireIncompleteChunkMessage +✅ testInvalidConfig +✅ testLargeMessageAckTimeOut +✅ testLargeMessageAckTimeOut +✅ testLargeMessage +⚪ testMaxPendingChunkMessages +``` +### ✅ org.apache.pulsar.client.impl.MessageParserTest +``` +✅ testWithoutBatches +✅ testWithBatches +``` +### ✅ org.apache.pulsar.client.impl.MultiTopicsReaderTest +``` +✅ testReadMessageWithBatchingWithMessageInclusive +✅ testKeyHashRangeReader +✅ testRemoveSubscriptionForReaderNeedRemoveCursor +✅ testReadMessageWithBatching +✅ testReadMessageWithoutBatchingWithMessageInclusive +✅ testMultiReaderSeek +✅ testReadMessageWithoutBatching +✅ testReaderWithTimeLong +``` +### ✅ org.apache.pulsar.client.impl.NegativeAcksTest +``` +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +✅ testNegativeAcks +``` +### ✅ org.apache.pulsar.client.impl.PatternTopicsConsumerImplTest +``` +✅ testStartEmptyPatternConsumer +✅ testBinaryProtoToGetTopicsOfNamespaceAll +✅ testPatternTopicsSubscribeWithBuilderFail +✅ testPubRateOnNonPersistent +✅ testTopicDeletion +✅ testAutoUnbubscribePatternConsumer +✅ testTopicsPatternFilter +✅ testBinaryProtoToGetTopicsOfNamespaceNonPersistent +✅ testBinaryProtoToGetTopicsOfNamespacePersistent +✅ testTopicsListMinus +✅ testAutoSubscribePatternConsumer +``` +### ✅ org.apache.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest +``` +✅ testSharedAckedNormalTopic +✅ testUnAckedMessageTrackerSize +✅ testSharedAckedPartitionedTopic +✅ testExclusiveAckedNormalTopic +✅ testFailoverAckedNormalTopic +``` +### ✅ org.apache.pulsar.client.impl.PulsarMultiHostClientTest +``` +✅ testMultiHostUrlRetrySuccess +✅ testGetPartitionedTopicDataTimeout +✅ testGetPartitionedTopicMetaData +``` +### ✅ org.apache.pulsar.client.impl.RawMessageSerDeserTest +``` +✅ testSerializationAndDeserialization +``` +### ✅ org.apache.pulsar.client.impl.SchemaDeleteTest +``` +✅ createTopicDeleteTopicCreateTopic +``` +### ✅ org.apache.pulsar.client.impl.SequenceIdWithErrorTest +``` +✅ testCheckSequenceId +✅ testDeleteTopicWithMissingData +✅ testTopicWithWildCardChar +⚪ testCrashBrokerWithoutCursorLedgerLeak +⚪ testSkipCorruptDataLedger +``` +### ✅ org.apache.pulsar.client.impl.TopicDoesNotExistsTest +``` +✅ testCreateConsumerOnNotExistsTopic +✅ testCreateProducerOnNotExistsTopic +``` +### ✅ org.apache.pulsar.client.impl.TopicFromMessageTest +``` +✅ testSingleTopicConsumerNoBatchFullName +✅ testMultiTopicConsumerBatchShortName +✅ testSingleTopicConsumerNoBatchShortName +✅ testMultiTopicConsumerNoBatchShortName +✅ testSingleTopicConsumerBatchShortName +``` +### ✅ org.apache.pulsar.client.impl.TopicsConsumerImplTest +``` +✅ testTopicAutoUpdatePartitions +✅ testDifferentTopicsNameSubscribe +✅ testGetLastMessageId +✅ testConsumerUnackedRedelivery +✅ testSubscriptionMustCompleteWhenOperationTimeoutOnMultipleTopics +✅ testConsumerDistributionInFailoverSubscriptionWhenUpdatePartitions +✅ multiTopicsInDifferentNameSpace +✅ testDefaultBacklogTTL +✅ testGetConsumersAndGetTopics +✅ testSubscribeUnsubscribeSingleTopic +✅ testResubscribeSameTopic +✅ testSyncProducerAndConsumer +✅ testPartitionsUpdatesForMultipleTopics +✅ testTopicsNameSubscribeWithBuilderFail +✅ testMultiTopicsMessageListener +✅ testTopicNameValid +✅ testAsyncConsumer +``` +### ✅ org.apache.pulsar.client.impl.UnAcknowledgedMessagesTimeoutTest +``` +✅ testCheckUnAcknowledgedMessageTimer +✅ testExclusiveSingleAckedNormalTopic +✅ testFailoverSingleAckedPartitionedTopic +✅ testSharedSingleAckedPartitionedTopic +✅ testAckTimeoutMinValue +✅ testExclusiveCumulativeAckedNormalTopic +✅ testSingleMessageBatch +``` +### ✅ org.apache.pulsar.client.impl.ZeroQueueSizeTest +``` +✅ zeroQueueSizeSharedSubscription +✅ testPauseAndResume +✅ testZeroQueueSizeMessageRedeliveryForAsyncReceive +✅ zeroQueueSizeConsumerListener +✅ zeroQueueSizeFailoverSubscription +✅ validQueueSizeConfig +✅ zeroQueueSizeNormalConsumer +✅ zeroQueueSizeReceieveAsyncInCompatibility +✅ InvalidQueueSizeConfig +✅ testZeroQueueSizeMessageRedeliveryForListener +✅ testZeroQueueSizeMessageRedelivery +✅ zeroQueueSizePartitionedTopicInCompatibility +✅ testFailedZeroQueueSizeBatchMessage +✅ testPauseAndResumeWithUnloading +``` +### ✅ org.apache.pulsar.common.api.raw.RawMessageImplTest +``` +✅ testGetProperties +``` +### ✅ org.apache.pulsar.common.compression.CommandsTest +``` +✅ testChecksumSendCommand +``` +### ✅ org.apache.pulsar.common.compression.CompressorCodecBackwardCompatTest +``` +✅ testCompressDecompress +✅ testCompressDecompress +✅ testCompressDecompress +✅ testCompressDecompress +✅ testCompressDecompress +✅ testCompressDecompress +``` +### ✅ org.apache.pulsar.common.compression.CompressorCodecTest +``` +✅ testCompressDecompress +✅ testMultpileUsages +✅ testMultpileUsages +✅ testCompressDecompress +✅ testMultpileUsages +✅ testCompressDecompress +✅ testMultpileUsages +✅ testCompressDecompress +✅ testDecompressFromSampleBuffer +✅ testDecompressReadonlyByteBuf +✅ testDecompressReadonlyByteBuf +✅ testCodecProvider +✅ testEmptyInput +✅ testEmptyInput +✅ testCompressDecompress +✅ testCodecProvider +✅ testDecompressFromSampleBuffer +✅ testMultpileUsages +✅ testCodecProvider +✅ testEmptyInput +✅ testDecompressReadonlyByteBuf +✅ testCompressDecompress +✅ testDecompressReadonlyByteBuf +✅ testCompressDecompress +✅ testCompressDecompress +✅ testMultpileUsages +✅ testEmptyInput +✅ testDecompressReadonlyByteBuf +✅ testDecompressFromSampleBuffer +✅ testDecompressFromSampleBuffer +✅ testDecompressFromSampleBuffer +✅ testDecompressReadonlyByteBuf +✅ testDecompressReadonlyByteBuf +✅ testMultpileUsages +✅ testCompressDecompress +✅ testCodecProvider +✅ testMultpileUsages +✅ testCompressDecompress +✅ testMultpileUsages +✅ testDecompressReadonlyByteBuf +✅ testEmptyInput +✅ testCodecProvider +✅ testDecompressReadonlyByteBuf +✅ testDecompressReadonlyByteBuf +✅ testMultpileUsages +``` +### ✅ org.apache.pulsar.common.compression.Crc32cChecksumTest +``` +✅ testCrc32cHardware +✅ testCrc32cDirectMemoryHardware +✅ testCrc32c +✅ testCrc32cSoftware +✅ testCrc32cIncremental +✅ testCrc32cIncrementalUsingProvider +``` +### ✅ org.apache.pulsar.common.lookup.data.LookupDataTest +``` +✅ testLoadReportSerialization +✅ testUrlEncoder +✅ serializeToJsonTest +✅ withConstructor +``` +### ✅ org.apache.pulsar.common.naming.MetadataTests +``` +✅ testInvalidMetadata +✅ testValidMetadata +``` +### ✅ org.apache.pulsar.common.naming.NamespaceBundlesTest +``` +✅ testConstructor +✅ testSplitBundleInTwo +✅ testsplitBundles +✅ testFindBundle +✅ testSplitBundleByFixBoundary +``` +### ✅ org.apache.pulsar.common.naming.NamespaceBundleTest +``` +✅ testIncludes +✅ testGetBundle +✅ testCompareTo +✅ testConstructor +✅ testToString +✅ testEquals +``` +### ✅ org.apache.pulsar.common.naming.NamespaceNameTest +``` +✅ namespace +✅ testNewScheme +``` +### ✅ org.apache.pulsar.common.naming.ServiceConfigurationTest +``` +✅ testOptionalSettingPresent +✅ testOptionalSettingEmpty +✅ testInit +✅ testInitFailure ``` -### ✔️ org.apache.pulsar.common.naming.TopicNameTest +### ✅ org.apache.pulsar.common.naming.TopicNameTest ``` -✔️ testShortTopicName -✔️ topic -✔️ testTopicNameWithoutCluster -✔️ testDecodeEncode +✅ testShortTopicName +✅ topic +✅ testTopicNameWithoutCluster +✅ testDecodeEncode ``` -### ✔️ org.apache.pulsar.common.net.ServiceURITest +### ✅ org.apache.pulsar.common.net.ServiceURITest ``` -✔️ testEmptyServiceUriString -✔️ testMultipleHostsSemiColon -✔️ testInvalidServiceUris -✔️ testMultipleHostsWithoutHttpPorts -✔️ testRootPath -✔️ testMultipleHostsMixedPorts -✔️ testMultipleHostsWithoutPulsarTlsPorts -✔️ testUserInfoWithMultipleHosts -✔️ testMultipleHostsComma -✔️ testMultipleHostsMixed -✔️ testUserInfo -✔️ testIpv6UriWithoutPulsarPort -✔️ testMultiIpv6Uri -✔️ testMultiIpv6UriWithoutPulsarPort -✔️ testEmptyPath -✔️ testNullServiceUriString -✔️ testNullServiceUriInstance -✔️ testMissingServiceName -✔️ testMultipleHostsWithoutHttpsPorts -✔️ testMultipleHostsWithoutPulsarPorts -✔️ testIpv6Uri +✅ testEmptyServiceUriString +✅ testMultipleHostsSemiColon +✅ testInvalidServiceUris +✅ testMultipleHostsWithoutHttpPorts +✅ testRootPath +✅ testMultipleHostsMixedPorts +✅ testMultipleHostsWithoutPulsarTlsPorts +✅ testUserInfoWithMultipleHosts +✅ testMultipleHostsComma +✅ testMultipleHostsMixed +✅ testUserInfo +✅ testIpv6UriWithoutPulsarPort +✅ testMultiIpv6Uri +✅ testMultiIpv6UriWithoutPulsarPort +✅ testEmptyPath +✅ testNullServiceUriString +✅ testNullServiceUriInstance +✅ testMissingServiceName +✅ testMultipleHostsWithoutHttpsPorts +✅ testMultipleHostsWithoutPulsarPorts +✅ testIpv6Uri ``` -### ✔️ org.apache.pulsar.common.policies.data.AutoFailoverPolicyDataTest +### ✅ org.apache.pulsar.common.policies.data.AutoFailoverPolicyDataTest ``` -✔️ testAutoFailoverPolicyData +✅ testAutoFailoverPolicyData ``` -### ✔️ org.apache.pulsar.common.policies.data.AutoFailoverPolicyTypeTest +### ✅ org.apache.pulsar.common.policies.data.AutoFailoverPolicyTypeTest ``` -✔️ testAutoFailoverPolicyType +✅ testAutoFailoverPolicyType ``` -### ✔️ org.apache.pulsar.common.policies.data.AutoTopicCreationOverrideTest +### ✅ org.apache.pulsar.common.policies.data.AutoTopicCreationOverrideTest ``` -✔️ testInvalidTopicType -✔️ testNumPartitionsTooLow -✔️ testNumPartitionsNotSet -✔️ testValidOverrideNonPartitioned -✔️ testNumPartitionsOnNonPartitioned -✔️ testValidOverridePartitioned +✅ testInvalidTopicType +✅ testNumPartitionsTooLow +✅ testNumPartitionsNotSet +✅ testValidOverrideNonPartitioned +✅ testNumPartitionsOnNonPartitioned +✅ testValidOverridePartitioned ``` -### ✔️ org.apache.pulsar.common.policies.data.BacklogQuotaTest +### ✅ org.apache.pulsar.common.policies.data.BacklogQuotaTest ``` -✔️ testBacklogQuotaIdentity +✅ testBacklogQuotaIdentity ``` -### ✔️ org.apache.pulsar.common.policies.data.ClusterDataTest +### ✅ org.apache.pulsar.common.policies.data.ClusterDataTest ``` -✔️ simple +✅ simple ``` -### ✔️ org.apache.pulsar.common.policies.data.ConsumerStatsTest +### ✅ org.apache.pulsar.common.policies.data.ConsumerStatsTest ``` -✔️ testConsumerStats +✅ testConsumerStats ``` -### ✔️ org.apache.pulsar.common.policies.data.EnsemblePlacementPolicyConfigTest +### ✅ org.apache.pulsar.common.policies.data.EnsemblePlacementPolicyConfigTest ``` -✔️ testDecodeFailed -✔️ testEncodeDecodeSuccessfully +✅ testDecodeFailed +✅ testEncodeDecodeSuccessfully ``` -### ✔️ org.apache.pulsar.common.policies.data.LocalPolicesTest +### ✅ org.apache.pulsar.common.policies.data.LocalPolicesTest ``` -✔️ testLocalPolices +✅ testLocalPolices ``` -### ✔️ org.apache.pulsar.common.policies.data.NamespaceIsolationDataTest +### ✅ org.apache.pulsar.common.policies.data.NamespaceIsolationDataTest ``` -✔️ testNamespaceIsolationData +✅ testNamespaceIsolationData ``` -### ✔️ org.apache.pulsar.common.policies.data.NamespaceOwnershipStatusTest +### ✅ org.apache.pulsar.common.policies.data.NamespaceOwnershipStatusTest ``` -✔️ testSerialization +✅ testSerialization ``` -### ✔️ org.apache.pulsar.common.policies.data.OffloadPoliciesTest +### ✅ org.apache.pulsar.common.policies.data.OffloadPoliciesTest ``` -✔️ testGcsConfiguration -✔️ mergeTest -✔️ compatibleWithConfigFileTest -✔️ testCreateByProperties -✔️ testS3Configuration -✔️ oldPoliciesCompatibleTest +✅ testGcsConfiguration +✅ mergeTest +✅ compatibleWithConfigFileTest +✅ testCreateByProperties +✅ testS3Configuration +✅ oldPoliciesCompatibleTest ``` -### ✔️ org.apache.pulsar.common.policies.data.PartitionedTopicStatsTest +### ✅ org.apache.pulsar.common.policies.data.PartitionedTopicStatsTest ``` -✔️ testPartitionedTopicStats +✅ testPartitionedTopicStats ``` -### ✔️ org.apache.pulsar.common.policies.data.PersistencePoliciesTest +### ✅ org.apache.pulsar.common.policies.data.PersistencePoliciesTest ``` -✔️ testPersistencePolicies +✅ testPersistencePolicies ``` -### ✔️ org.apache.pulsar.common.policies.data.PersistentOfflineTopicStatsTest +### ✅ org.apache.pulsar.common.policies.data.PersistentOfflineTopicStatsTest ``` -✔️ testPersistentOfflineTopicStats +✅ testPersistentOfflineTopicStats ``` -### ✔️ org.apache.pulsar.common.policies.data.PersistentTopicStatsTest +### ✅ org.apache.pulsar.common.policies.data.PersistentTopicStatsTest ``` -✔️ testPersistentTopicStatsAggregation -✔️ testPersistentTopicStats +✅ testPersistentTopicStatsAggregation +✅ testPersistentTopicStats ``` -### ✔️ org.apache.pulsar.common.policies.data.PoliciesDataTest +### ✅ org.apache.pulsar.common.policies.data.PoliciesDataTest ``` -✔️ propertyAdmin -✔️ policies -✔️ bundlesData -✔️ bundlesPolicies +✅ propertyAdmin +✅ policies +✅ bundlesData +✅ bundlesPolicies ``` -### ✔️ org.apache.pulsar.common.policies.data.PublisherStatsTest +### ✅ org.apache.pulsar.common.policies.data.PublisherStatsTest ``` -✔️ testPublisherStats -✔️ testPublisherStatsAggregation +✅ testPublisherStats +✅ testPublisherStatsAggregation ``` -### ✔️ org.apache.pulsar.common.policies.data.ReplicatorStatsTest +### ✅ org.apache.pulsar.common.policies.data.ReplicatorStatsTest ``` -✔️ testReplicatorStatsAdd -✔️ testReplicatorStatsNull +✅ testReplicatorStatsAdd +✅ testReplicatorStatsNull ``` -### ✔️ org.apache.pulsar.common.policies.data.ResourceQuotaTest +### ✅ org.apache.pulsar.common.policies.data.ResourceQuotaTest ``` -✔️ testResourceQuotaDefault -✔️ testResourceQuotaEqual +✅ testResourceQuotaDefault +✅ testResourceQuotaEqual ``` -### ✔️ org.apache.pulsar.common.policies.data.RetentionPolicesTest +### ✅ org.apache.pulsar.common.policies.data.RetentionPolicesTest ``` -✔️ testRetentionPolices +✅ testRetentionPolices ``` -### ✔️ org.apache.pulsar.common.policies.impl.AutoFailoverPolicyFactoryTest +### ✅ org.apache.pulsar.common.policies.impl.AutoFailoverPolicyFactoryTest ``` -✔️ testAutoFailoverPolicyFactory +✅ testAutoFailoverPolicyFactory ``` -### ✔️ org.apache.pulsar.common.policies.impl.MinAvailablePolicyTest +### ✅ org.apache.pulsar.common.policies.impl.MinAvailablePolicyTest ``` -✔️ testMinAvailablePolicty +✅ testMinAvailablePolicty ``` -### ✔️ org.apache.pulsar.common.policies.impl.NamespaceIsolationPoliciesTest +### ✅ org.apache.pulsar.common.policies.impl.NamespaceIsolationPoliciesTest ``` -✔️ testBrokerAssignment -✔️ testGetNamespaceIsolationPolicyByName -✔️ testDeletePolicy -✔️ testSetPolicy -✔️ testJsonSerialization -✔️ testDefaultConstructor -✔️ testGetNamespaceIsolationPolicyByNamespace +✅ testBrokerAssignment +✅ testGetNamespaceIsolationPolicyByName +✅ testDeletePolicy +✅ testSetPolicy +✅ testJsonSerialization +✅ testDefaultConstructor +✅ testGetNamespaceIsolationPolicyByNamespace ``` -### ✔️ org.apache.pulsar.common.policies.impl.NamespaceIsolationPolicyImplTest +### ✅ org.apache.pulsar.common.policies.impl.NamespaceIsolationPolicyImplTest ``` -✔️ testFindBrokers -✔️ testGetSecondaryBrokers -✔️ testShouldFailover -✔️ testGetPrimaryBrokers -✔️ testGetAvailablePrimaryBrokers -✔️ testConstructor -✔️ testIsPrimaryOrSecondaryBroker +✅ testFindBrokers +✅ testGetSecondaryBrokers +✅ testShouldFailover +✅ testGetPrimaryBrokers +✅ testGetAvailablePrimaryBrokers +✅ testConstructor +✅ testIsPrimaryOrSecondaryBroker ``` -### ✔️ org.apache.pulsar.common.protocol.ByteBufPairTest +### ✅ org.apache.pulsar.common.protocol.ByteBufPairTest ``` -✔️ testEncoder -✔️ testDoubleByteBuf +✅ testEncoder +✅ testDoubleByteBuf ``` -### ✔️ org.apache.pulsar.common.protocol.CommandUtilsTests +### ✅ org.apache.pulsar.common.protocol.CommandUtilsTests ``` -✔️ testSkipBrokerEntryMetadata -✔️ testPeekBrokerEntryMetadata -✔️ testParseBrokerEntryMetadata -✔️ testMetadataFromCommandSubscribe -✔️ testMetadataFromCommandProducer -✔️ testAddBrokerEntryMetadata -✔️ testByteBufComposite +✅ testSkipBrokerEntryMetadata +✅ testPeekBrokerEntryMetadata +✅ testParseBrokerEntryMetadata +✅ testMetadataFromCommandSubscribe +✅ testMetadataFromCommandProducer +✅ testAddBrokerEntryMetadata +✅ testByteBufComposite ``` -### ✔️ org.apache.pulsar.common.protocol.MarkersTest +### ✅ org.apache.pulsar.common.protocol.MarkersTest ``` -✔️ testSnapshot -✔️ testTxnAbortMarker -✔️ testUpdate -✔️ testTxnCommitMarker -✔️ testSnapshotRequest -✔️ testSnapshotResponse +✅ testSnapshot +✅ testTxnAbortMarker +✅ testUpdate +✅ testTxnCommitMarker +✅ testSnapshotRequest +✅ testSnapshotResponse ``` -### ✔️ org.apache.pulsar.common.protocol.PulsarDecoderTest +### ✅ org.apache.pulsar.common.protocol.PulsarDecoderTest ``` -✔️ testChannelRead +✅ testChannelRead ``` -### ✔️ org.apache.pulsar.common.stats.JvmDefaultGCMetricsLoggerTest +### ✅ org.apache.pulsar.common.stats.JvmDefaultGCMetricsLoggerTest ``` -✔️ testInvokeJVMInternals +✅ testInvokeJVMInternals ``` -### ✔️ org.apache.pulsar.common.util.collections.BitSetRecyclableRecyclableTest +### ✅ org.apache.pulsar.common.util.collections.BitSetRecyclableRecyclableTest ``` -✔️ testResetWords -✔️ testRecycle +✅ testResetWords +✅ testRecycle ``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentBitSetRecyclableTest +### ✅ org.apache.pulsar.common.util.collections.ConcurrentBitSetRecyclableTest ``` -✔️ testRecycle -✔️ testGenerateByBitSet -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentLongHashMapTest -``` -✔️ testRehashingWithDeletes -✔️ concurrentInsertionsAndReads -✔️ testRemove -✔️ testRehashing -✔️ simpleInsertions -✔️ testComputeIfAbsent -✔️ testConstructor -✔️ testPutIfAbsent -✔️ testIteration -✔️ testHashConflictWithDeletion -✔️ concurrentInsertions -✔️ stressConcurrentInsertionsAndReads -✔️ testNegativeUsedBucketCount -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentLongPairSetTest -``` -✔️ concurrentInsertionsAndReads -✔️ testEqualsObjects -✔️ testIfRemoval -✔️ testRehashing -✔️ testToString -✔️ testRemove -✔️ testItems -✔️ testRehashingWithDeletes -✔️ testHashConflictWithDeletion -✔️ testIteration -✔️ simpleInsertions -✔️ testRehashingRemoval -✔️ testRemoval -✔️ testConstructor -✔️ concurrentInsertions -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentOpenHashMapTest -``` -✔️ testRemove -✔️ simpleInsertions -✔️ testPutIfAbsent -✔️ concurrentInsertions -✔️ testHashConflictWithDeletion -✔️ testRehashingWithDeletes -✔️ testComputeIfAbsent -✔️ testRehashing -✔️ testIteration -✔️ testEqualsKeys -✔️ concurrentInsertionsAndReads -✔️ testConstructor -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentOpenHashSetTest -``` -✔️ concurrentInsertions -✔️ testRehashing -✔️ testRemoval -✔️ testEqualsObjects -✔️ testHashConflictWithDeletion -✔️ testConstructor -✔️ concurrentInsertionsAndReads -✔️ testIteration -✔️ simpleInsertions -✔️ testRehashingWithDeletes -✔️ testRemove -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentOpenLongPairRangeSetTest -``` -✔️ testAddForDifferentKey -✔️ testToString -✔️ testCacheFlagConflict -✔️ testDeleteWithLeastMost -✔️ testDeleteForDifferentKey -✔️ testLastRange -✔️ testAddCompareCompareWithGuava -✔️ testSpanWithGuava -✔️ testDeleteCompareWithGuava -✔️ testFirstRange -✔️ testAddForSameKey -✔️ testDeleteWithAtMost -✔️ testRangeContaining -``` -### ✔️ org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSetTest -``` -✔️ concurrentInsertions -✔️ testIfRemoval -✔️ testRemoval -✔️ testRemove -✔️ testItems -✔️ testEqualsObjects -✔️ simpleInsertions -✔️ testIteration -✔️ testToString -``` -### ✔️ org.apache.pulsar.common.util.collections.FieldParserTest -``` -✔️ testUpdateObject -✔️ testConversion -``` -### ✔️ org.apache.pulsar.common.util.collections.GrowableArrayBlockingQueueTest -``` -✔️ removeTest -✔️ growArray -✔️ pollTimeout -✔️ simple -✔️ pollTimeout2 -✔️ blockingTake -``` -### ✔️ org.apache.pulsar.common.util.collections.GrowablePriorityLongPairQueueTest -``` -✔️ testItems -✔️ testRemove -✔️ testExpandQueue -✔️ testInsertAndRemove -✔️ testEqualsObjects -✔️ testExpandRemoval -✔️ testIteration -✔️ simpleInsertions -✔️ concurrentInsertions -✔️ testConstructor -✔️ testSetWithDuplicateInsert -✔️ testExpandWithDeletes -✔️ concurrentInsertionsAndReads -✔️ testRemoval -✔️ testIfRemoval -``` -### ✔️ org.apache.pulsar.common.util.collections.TripleLongPriorityQueueTest -``` -✔️ testQueue -✔️ testCheckForEmpty -✔️ testCompareWithSamePrefix +✅ testRecycle +✅ testGenerateByBitSet +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentLongHashMapTest +``` +✅ testRehashingWithDeletes +✅ concurrentInsertionsAndReads +✅ testRemove +✅ testRehashing +✅ simpleInsertions +✅ testComputeIfAbsent +✅ testConstructor +✅ testPutIfAbsent +✅ testIteration +✅ testHashConflictWithDeletion +✅ concurrentInsertions +✅ stressConcurrentInsertionsAndReads +✅ testNegativeUsedBucketCount +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentLongPairSetTest +``` +✅ concurrentInsertionsAndReads +✅ testEqualsObjects +✅ testIfRemoval +✅ testRehashing +✅ testToString +✅ testRemove +✅ testItems +✅ testRehashingWithDeletes +✅ testHashConflictWithDeletion +✅ testIteration +✅ simpleInsertions +✅ testRehashingRemoval +✅ testRemoval +✅ testConstructor +✅ concurrentInsertions +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentOpenHashMapTest +``` +✅ testRemove +✅ simpleInsertions +✅ testPutIfAbsent +✅ concurrentInsertions +✅ testHashConflictWithDeletion +✅ testRehashingWithDeletes +✅ testComputeIfAbsent +✅ testRehashing +✅ testIteration +✅ testEqualsKeys +✅ concurrentInsertionsAndReads +✅ testConstructor +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentOpenHashSetTest +``` +✅ concurrentInsertions +✅ testRehashing +✅ testRemoval +✅ testEqualsObjects +✅ testHashConflictWithDeletion +✅ testConstructor +✅ concurrentInsertionsAndReads +✅ testIteration +✅ simpleInsertions +✅ testRehashingWithDeletes +✅ testRemove +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentOpenLongPairRangeSetTest +``` +✅ testAddForDifferentKey +✅ testToString +✅ testCacheFlagConflict +✅ testDeleteWithLeastMost +✅ testDeleteForDifferentKey +✅ testLastRange +✅ testAddCompareCompareWithGuava +✅ testSpanWithGuava +✅ testDeleteCompareWithGuava +✅ testFirstRange +✅ testAddForSameKey +✅ testDeleteWithAtMost +✅ testRangeContaining +``` +### ✅ org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSetTest +``` +✅ concurrentInsertions +✅ testIfRemoval +✅ testRemoval +✅ testRemove +✅ testItems +✅ testEqualsObjects +✅ simpleInsertions +✅ testIteration +✅ testToString +``` +### ✅ org.apache.pulsar.common.util.collections.FieldParserTest +``` +✅ testUpdateObject +✅ testConversion +``` +### ✅ org.apache.pulsar.common.util.collections.GrowableArrayBlockingQueueTest +``` +✅ removeTest +✅ growArray +✅ pollTimeout +✅ simple +✅ pollTimeout2 +✅ blockingTake +``` +### ✅ org.apache.pulsar.common.util.collections.GrowablePriorityLongPairQueueTest +``` +✅ testItems +✅ testRemove +✅ testExpandQueue +✅ testInsertAndRemove +✅ testEqualsObjects +✅ testExpandRemoval +✅ testIteration +✅ simpleInsertions +✅ concurrentInsertions +✅ testConstructor +✅ testSetWithDuplicateInsert +✅ testExpandWithDeletes +✅ concurrentInsertionsAndReads +✅ testRemoval +✅ testIfRemoval +``` +### ✅ org.apache.pulsar.common.util.collections.TripleLongPriorityQueueTest +``` +✅ testQueue +✅ testCheckForEmpty +✅ testCompareWithSamePrefix ``` -### ✔️ org.apache.pulsar.common.util.FieldParserTest +### ✅ org.apache.pulsar.common.util.FieldParserTest ``` -✔️ testMap +✅ testMap ``` -### ✔️ org.apache.pulsar.common.util.FileModifiedTimeUpdaterTest +### ✅ org.apache.pulsar.common.util.FileModifiedTimeUpdaterTest ``` -✔️ testFileNotModified -✔️ testFileModified -✔️ testFileModified -✔️ testFileNotModified -✔️ testFileModified -✔️ testFileNotModified +✅ testFileNotModified +✅ testFileModified +✅ testFileModified +✅ testFileNotModified +✅ testFileModified +✅ testFileNotModified ``` -### ✔️ org.apache.pulsar.common.util.netty.ChannelFuturesTest +### ✅ org.apache.pulsar.common.util.netty.ChannelFuturesTest ``` -✔️ toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedAfter -✔️ toCompletableFuture_shouldCompleteSuccessfully_channelFutureCompletedAfter -✔️ toCompletableFuture_shouldCompleteSuccessfully_channelFutureCompletedBefore -✔️ toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedBefore -✔️ toCompletableFuture_shouldRequireNonNullArgument +✅ toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedAfter +✅ toCompletableFuture_shouldCompleteSuccessfully_channelFutureCompletedAfter +✅ toCompletableFuture_shouldCompleteSuccessfully_channelFutureCompletedBefore +✅ toCompletableFuture_shouldCompleteExceptionally_channelFutureCompletedBefore +✅ toCompletableFuture_shouldRequireNonNullArgument ``` -### ✔️ org.apache.pulsar.common.util.RateLimiterTest +### ✅ org.apache.pulsar.common.util.RateLimiterTest ``` -✔️ testMultipleTryAcquire -✔️ testRateLimiterWithPermitUpdater -✔️ testTryAcquire -✔️ testTryAcquireNoPermits -✔️ testClose -✔️ testResetRate -✔️ testMultipleAcquire -✔️ testAcquire -✔️ testInvalidRenewTime -✔️ testRateLimiterWithFunction -✔️ testAcquireBlock +✅ testMultipleTryAcquire +✅ testRateLimiterWithPermitUpdater +✅ testTryAcquire +✅ testTryAcquireNoPermits +✅ testClose +✅ testResetRate +✅ testMultipleAcquire +✅ testAcquire +✅ testInvalidRenewTime +✅ testRateLimiterWithFunction +✅ testAcquireBlock ``` -### ✔️ org.apache.pulsar.common.util.ReflectionsTest +### ✅ org.apache.pulsar.common.util.ReflectionsTest ``` -✔️ testCreateInstanceNoNoArgConstructor -✔️ testCreateInstanceConstructorThrowsException -✔️ testCreateInstanceAbstractClass -✔️ testCreateTypedInstanceUnassignableClass -✔️ testCreateInstanceClassNotFound -✔️ testCreateTypedInstanceConstructorThrowsException -✔️ testClassExists -✔️ testCreateTypedInstanceAbstractClass -✔️ testCreateTypedInstanceClassNotFound -✔️ testCreateTypedInstanceNoNoArgConstructor -✔️ testLoadClass -✔️ testClassInJarImplementsIface +✅ testCreateInstanceNoNoArgConstructor +✅ testCreateInstanceConstructorThrowsException +✅ testCreateInstanceAbstractClass +✅ testCreateTypedInstanceUnassignableClass +✅ testCreateInstanceClassNotFound +✅ testCreateTypedInstanceConstructorThrowsException +✅ testClassExists +✅ testCreateTypedInstanceAbstractClass +✅ testCreateTypedInstanceClassNotFound +✅ testCreateTypedInstanceNoNoArgConstructor +✅ testLoadClass +✅ testClassInJarImplementsIface ``` -### ✔️ org.apache.pulsar.common.util.RelativeTimeUtilTest +### ✅ org.apache.pulsar.common.util.RelativeTimeUtilTest ``` -✔️ testParseRelativeTime +✅ testParseRelativeTime ``` -### ✔️ org.apache.pulsar.discovery.service.web.DiscoveryServiceWebTest +### ✅ org.apache.pulsar.discovery.service.web.DiscoveryServiceWebTest ``` -✔️ testRedirectUrlWithServerStarted +✅ testRedirectUrlWithServerStarted ``` -### ✔️ org.apache.pulsar.functions.worker.PulsarFunctionE2ESecurityTest +### ✅ org.apache.pulsar.functions.worker.PulsarFunctionE2ESecurityTest ``` -✔️ testAuthorizationWithAnonymousUser -✔️ testAuthorization +✅ testAuthorizationWithAnonymousUser +✅ testAuthorization ``` -### ✔️ org.apache.pulsar.functions.worker.PulsarFunctionPublishTest +### ✅ org.apache.pulsar.functions.worker.PulsarFunctionPublishTest ``` -✔️ testPulsarFunctionState -✔️ testMultipleAddress -✔️ testPulsarFunctionBKCleanup +✅ testPulsarFunctionState +✅ testMultipleAddress +✅ testPulsarFunctionBKCleanup ``` -### ✔️ org.apache.pulsar.functions.worker.PulsarFunctionTlsTest +### ✅ org.apache.pulsar.functions.worker.PulsarFunctionTlsTest ``` -✔️ testFunctionsCreation +✅ testFunctionsCreation ``` -### ✔️ org.apache.pulsar.io.PulsarFunctionTlsTest +### ✅ org.apache.pulsar.io.PulsarFunctionTlsTest ``` -✔️ testAuthorization +✅ testAuthorization ``` -### ✔️ org.apache.pulsar.proxy.server.AdminProxyHandlerTest +### ✅ org.apache.pulsar.proxy.server.AdminProxyHandlerTest ``` -✔️ replayableProxyContentProviderTest +✅ replayableProxyContentProviderTest ``` -### ✔️ org.apache.pulsar.proxy.server.AuthedAdminProxyHandlerTest +### ✅ org.apache.pulsar.proxy.server.AuthedAdminProxyHandlerTest ``` -✔️ testAuthenticatedProxyAsNonAdmin +✅ testAuthenticatedProxyAsNonAdmin ``` -### ✔️ org.apache.pulsar.proxy.server.FunctionWorkerRoutingTest +### ✅ org.apache.pulsar.proxy.server.FunctionWorkerRoutingTest ``` -✔️ testFunctionWorkerRedirect +✅ testFunctionWorkerRedirect ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyAdditionalServletTest +### ✅ org.apache.pulsar.proxy.server.ProxyAdditionalServletTest ``` -✔️ test +✅ test ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyAuthenticatedProducerConsumerTest +### ✅ org.apache.pulsar.proxy.server.ProxyAuthenticatedProducerConsumerTest ``` -✔️ testTlsSyncProducerAndConsumer +✅ testTlsSyncProducerAndConsumer ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyAuthenticationTest +### ✅ org.apache.pulsar.proxy.server.ProxyAuthenticationTest ``` -✔️ testAuthentication +✅ testAuthentication ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyConnectionThrottlingTest +### ✅ org.apache.pulsar.proxy.server.ProxyConnectionThrottlingTest ``` -✔️ testInboundConnection +✅ testInboundConnection ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyEnableHAProxyProtocolTest +### ✅ org.apache.pulsar.proxy.server.ProxyEnableHAProxyProtocolTest ``` -✔️ testSimpleProduceAndConsume +✅ testSimpleProduceAndConsume ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyForwardAuthDataTest +### ✅ org.apache.pulsar.proxy.server.ProxyForwardAuthDataTest ``` -✔️ testForwardAuthData +✅ testForwardAuthData ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyIsAHttpProxyTest +### ✅ org.apache.pulsar.proxy.server.ProxyIsAHttpProxyTest ``` -✔️ testProxyToEndsInSlash -✔️ testStreaming -✔️ testLongPath -✔️ testLongPathInProxyTo -✔️ testPathEndsInSlash -✔️ testPathNotSpecified -✔️ testTryingToUseExistingPath -✔️ testMultipleRedirect -✔️ testSingleRedirect -✔️ testRedirectNotSpecified +✅ testProxyToEndsInSlash +✅ testStreaming +✅ testLongPath +✅ testLongPathInProxyTo +✅ testPathEndsInSlash +✅ testPathNotSpecified +✅ testTryingToUseExistingPath +✅ testMultipleRedirect +✅ testSingleRedirect +✅ testRedirectNotSpecified ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithAuth +### ✅ org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithAuth ``` -✔️ testProducerFailed -✔️ testPartitions -✔️ testProducer +✅ testProducerFailed +✅ testPartitions +✅ testProducer ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithoutAuth +### ✅ org.apache.pulsar.proxy.server.ProxyKeyStoreTlsTestWithoutAuth ``` -✔️ testPartitions -✔️ testProducerFailed -✔️ testProducer +✅ testPartitions +✅ testProducerFailed +✅ testProducer ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyLookupThrottlingTest +### ✅ org.apache.pulsar.proxy.server.ProxyLookupThrottlingTest ``` -✔️ testLookup +✅ testLookup ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyParserTest +### ✅ org.apache.pulsar.proxy.server.ProxyParserTest ``` -✔️ testRegexSubscription -✔️ testProducerConsumer -✔️ testProducer -✔️ testPartitions -✔️ testProtocolVersionAdvertisement +✅ testRegexSubscription +✅ testProducerConsumer +✅ testProducer +✅ testPartitions +✅ testProtocolVersionAdvertisement ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyRolesEnforcementTest +### ✅ org.apache.pulsar.proxy.server.ProxyRolesEnforcementTest ``` -✔️ testIncorrectRoles +✅ testIncorrectRoles ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyStatsTest +### ✅ org.apache.pulsar.proxy.server.ProxyStatsTest ``` -✔️ testChangeLogLevel -✔️ testConnectionsStats -✔️ testTopicStats +✅ testChangeLogLevel +✅ testConnectionsStats +✅ testTopicStats ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyTest +### ✅ org.apache.pulsar.proxy.server.ProxyTest ``` -✔️ testPartitions -✔️ testRegexSubscription -✔️ testProtocolVersionAdvertisement -✔️ testGetSchema -✔️ testProducer -✔️ testProducerConsumer +✅ testPartitions +✅ testRegexSubscription +✅ testProtocolVersionAdvertisement +✅ testGetSchema +✅ testProducer +✅ testProducerConsumer ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyTlsTest +### ✅ org.apache.pulsar.proxy.server.ProxyTlsTest ``` -✔️ testProducer -✔️ testPartitions +✅ testProducer +✅ testPartitions ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyTlsTestWithAuth +### ✅ org.apache.pulsar.proxy.server.ProxyTlsTestWithAuth ``` -✔️ testServiceStartup +✅ testServiceStartup ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyWithAuthorizationNegTest +### ✅ org.apache.pulsar.proxy.server.ProxyWithAuthorizationNegTest ``` -✔️ testProxyAuthorization +✅ testProxyAuthorization ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyWithAuthorizationTest +### ✅ org.apache.pulsar.proxy.server.ProxyWithAuthorizationTest ``` -✔️ tlsCiphersAndProtocols -✔️ testTlsHostVerificationProxyToClient -✔️ tlsCiphersAndProtocols -✔️ testProxyAuthorization -✔️ tlsCiphersAndProtocols -✔️ testTlsHostVerificationProxyToBroker -✔️ tlsCiphersAndProtocols -✔️ tlsCiphersAndProtocols -✔️ tlsCiphersAndProtocols -✔️ testTlsHostVerificationProxyToBroker -✔️ tlsCiphersAndProtocols -✔️ testTlsHostVerificationProxyToClient -✔️ tlsCiphersAndProtocols +✅ tlsCiphersAndProtocols +✅ testTlsHostVerificationProxyToClient +✅ tlsCiphersAndProtocols +✅ testProxyAuthorization +✅ tlsCiphersAndProtocols +✅ testTlsHostVerificationProxyToBroker +✅ tlsCiphersAndProtocols +✅ tlsCiphersAndProtocols +✅ tlsCiphersAndProtocols +✅ testTlsHostVerificationProxyToBroker +✅ tlsCiphersAndProtocols +✅ testTlsHostVerificationProxyToClient +✅ tlsCiphersAndProtocols ``` -### ✔️ org.apache.pulsar.proxy.server.ProxyWithoutServiceDiscoveryTest +### ✅ org.apache.pulsar.proxy.server.ProxyWithoutServiceDiscoveryTest ``` -✔️ testDiscoveryService +✅ testDiscoveryService ``` -### ✔️ org.apache.pulsar.proxy.server.SuperUserAuthedAdminProxyHandlerTest +### ✅ org.apache.pulsar.proxy.server.SuperUserAuthedAdminProxyHandlerTest ``` -✔️ testAuthWithRandoCert -✔️ testAuthenticatedProxyAsAdmin -✔️ testAuthenticatedProxyAsNonAdmin +✅ testAuthWithRandoCert +✅ testAuthenticatedProxyAsAdmin +✅ testAuthenticatedProxyAsNonAdmin ``` -### ✔️ org.apache.pulsar.proxy.server.UnauthedAdminProxyHandlerTest +### ✅ org.apache.pulsar.proxy.server.UnauthedAdminProxyHandlerTest ``` -✔️ testUnauthenticatedProxy -✔️ testVipStatus +✅ testUnauthenticatedProxy +✅ testVipStatus ``` -### ✔️ org.apache.pulsar.PulsarBrokerStarterTest +### ✅ org.apache.pulsar.PulsarBrokerStarterTest ``` -✔️ testMainRunBookieNoConfig -✔️ testLoadConfigWithException -✔️ testMainWithNoArgument -✔️ testLoadBalancerConfig -✔️ testGlobalZooKeeperConfig -✔️ testMainRunBookieRecoveryNoConfig -✔️ testLoadConfig -✔️ testMainEnableRunBookieThroughBrokerConfig -✔️ testMainRunBookieAndAutoRecoveryNoConfig +✅ testMainRunBookieNoConfig +✅ testLoadConfigWithException +✅ testMainWithNoArgument +✅ testLoadBalancerConfig +✅ testGlobalZooKeeperConfig +✅ testMainRunBookieRecoveryNoConfig +✅ testLoadConfig +✅ testMainEnableRunBookieThroughBrokerConfig +✅ testMainRunBookieAndAutoRecoveryNoConfig ``` -### ✔️ org.apache.pulsar.schema.compatibility.SchemaCompatibilityCheckTest +### ✅ org.apache.pulsar.schema.compatibility.SchemaCompatibilityCheckTest ``` -✔️ testConsumerCompatibilityCheckCanReadLastTest -✔️ testConsumerWithNotCompatibilitySchema -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testConsumerCompatibilityCheckCanReadLastTest -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testSchemaComparison -✔️ testConsumerCompatibilityCheckCanReadLastTest -✔️ testConsumerCompatibilityReadAllCheckTest -✔️ testConsumerWithNotCompatibilitySchema -✔️ testIsAutoUpdateSchema -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testConsumerCompatibilityReadAllCheckTest -✔️ testIsAutoUpdateSchema -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testConsumerWithNotCompatibilitySchema -✔️ testIsAutoUpdateSchema -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testConsumerWithNotCompatibilitySchema -✔️ testProducerSendWithOldSchemaAndConsumerCanRead -✔️ testIsAutoUpdateSchema -✔️ testIsAutoUpdateSchema -✔️ testConsumerCompatibilityCheckCanReadLastTest -✔️ testIsAutoUpdateSchema +✅ testConsumerCompatibilityCheckCanReadLastTest +✅ testConsumerWithNotCompatibilitySchema +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testConsumerCompatibilityCheckCanReadLastTest +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testSchemaComparison +✅ testConsumerCompatibilityCheckCanReadLastTest +✅ testConsumerCompatibilityReadAllCheckTest +✅ testConsumerWithNotCompatibilitySchema +✅ testIsAutoUpdateSchema +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testConsumerCompatibilityReadAllCheckTest +✅ testIsAutoUpdateSchema +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testConsumerWithNotCompatibilitySchema +✅ testIsAutoUpdateSchema +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testConsumerWithNotCompatibilitySchema +✅ testProducerSendWithOldSchemaAndConsumerCanRead +✅ testIsAutoUpdateSchema +✅ testIsAutoUpdateSchema +✅ testConsumerCompatibilityCheckCanReadLastTest +✅ testIsAutoUpdateSchema ``` -### ✔️ org.apache.pulsar.schema.PartitionedTopicSchemaTest +### ✅ org.apache.pulsar.schema.PartitionedTopicSchemaTest ``` -✔️ test +✅ test ``` -### ✔️ org.apache.pulsar.schema.SchemaTest +### ✅ org.apache.pulsar.schema.SchemaTest ``` -✔️ testIsUsingAvroSchemaParser -✔️ testBytesSchemaDeserialize -✔️ testMultiTopicSetSchemaProvider +✅ testIsUsingAvroSchemaParser +✅ testBytesSchemaDeserialize +✅ testMultiTopicSetSchemaProvider ``` -### ✔️ org.apache.pulsar.stats.client.PulsarBrokerStatsClientTest +### ✅ org.apache.pulsar.stats.client.PulsarBrokerStatsClientTest ``` -✔️ testServiceException -✔️ testTopicInternalStats +✅ testServiceException +✅ testTopicInternalStats ``` -### ✔️ org.apache.pulsar.tests.EnumValuesDataProviderTest +### ✅ org.apache.pulsar.tests.EnumValuesDataProviderTest ``` -✔️ shouldFailIfEnumParameterIsMissing -✔️ testEnumValuesProvider -✔️ testEnumValuesProvider -✔️ shouldDetermineEnumValuesFromMethod -✔️ shouldContainAllEnumValues -✔️ testEnumValuesProvider +✅ shouldFailIfEnumParameterIsMissing +✅ testEnumValuesProvider +✅ testEnumValuesProvider +✅ shouldDetermineEnumValuesFromMethod +✅ shouldContainAllEnumValues +✅ testEnumValuesProvider ``` -### ✔️ org.apache.pulsar.tests.TestRetrySupportBeforeMethodRetryTest +### ✅ org.apache.pulsar.tests.TestRetrySupportBeforeMethodRetryTest ``` -✔️ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod -✖️ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod -✖️ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod -✖️ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod -✖️ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod +✅ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod +⚪ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod +⚪ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod +⚪ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod +⚪ shouldNotDoAnythingWhenThereIsBeforeAndAfterMethod ``` -### ✔️ org.apache.pulsar.tests.TestRetrySupportRetryTest +### ✅ org.apache.pulsar.tests.TestRetrySupportRetryTest ``` -✖️ shouldCallSetupBeforeRetrying -✔️ shouldCallSetupBeforeRetrying -✖️ shouldCallSetupBeforeRetrying -✖️ shouldCallSetupBeforeRetrying -✖️ shouldCallSetupBeforeRetrying +⚪ shouldCallSetupBeforeRetrying +✅ shouldCallSetupBeforeRetrying +⚪ shouldCallSetupBeforeRetrying +⚪ shouldCallSetupBeforeRetrying +⚪ shouldCallSetupBeforeRetrying ``` -### ✔️ org.apache.pulsar.tests.TestRetrySupportSuccessTest +### ✅ org.apache.pulsar.tests.TestRetrySupportSuccessTest ``` -✔️ shouldCallSetupOnce1 -✔️ shouldCallSetupOnce3 -✔️ shouldCallSetupOnce2 +✅ shouldCallSetupOnce1 +✅ shouldCallSetupOnce3 +✅ shouldCallSetupOnce2 ``` -### ✔️ org.apache.pulsar.tests.ThreadDumpUtilTest +### ✅ org.apache.pulsar.tests.ThreadDumpUtilTest ``` -✔️ testHelp -✔️ testThreadDump +✅ testHelp +✅ testThreadDump ``` -### ✔️ org.apache.pulsar.utils.SimpleTextOutputStreamTest +### ✅ org.apache.pulsar.utils.SimpleTextOutputStreamTest ``` -✔️ testBooleanFormat -✔️ testDoubleFormat -✔️ testLongFormat -✔️ testString +✅ testBooleanFormat +✅ testDoubleFormat +✅ testLongFormat +✅ testString ``` -### ✔️ org.apache.pulsar.utils.StatsOutputStreamTest +### ✅ org.apache.pulsar.utils.StatsOutputStreamTest ``` -✔️ testLists -✔️ testNamedObjects -✔️ testNestedObjects -✔️ testNamedLists -✔️ testPairs -✔️ testObjects +✅ testLists +✅ testNamedObjects +✅ testNestedObjects +✅ testNamedLists +✅ testPairs +✅ testObjects ``` -### ✔️ org.apache.pulsar.websocket.proxy.ProxyAuthenticationTest +### ✅ org.apache.pulsar.websocket.proxy.ProxyAuthenticationTest ``` -✔️ unauthenticatedSocketTest -✔️ authenticatedSocketTest -✔️ statsTest -✔️ anonymousSocketTest +✅ unauthenticatedSocketTest +✅ authenticatedSocketTest +✅ statsTest +✅ anonymousSocketTest ``` -### ✔️ org.apache.pulsar.websocket.proxy.ProxyAuthorizationTest +### ✅ org.apache.pulsar.websocket.proxy.ProxyAuthorizationTest ``` -✔️ test +✅ test ``` -### ✔️ org.apache.pulsar.websocket.proxy.ProxyConfigurationTest +### ✅ org.apache.pulsar.websocket.proxy.ProxyConfigurationTest ``` -✔️ configTest -✔️ configTest +✅ configTest +✅ configTest ``` -### ✔️ org.apache.pulsar.websocket.proxy.ProxyPublishConsumeTlsTest +### ✅ org.apache.pulsar.websocket.proxy.ProxyPublishConsumeTlsTest ``` -✔️ socketTest +✅ socketTest ``` -### ✔️ org.apache.pulsar.websocket.proxy.ProxyPublishConsumeWithoutZKTest +### ✅ org.apache.pulsar.websocket.proxy.ProxyPublishConsumeWithoutZKTest ``` -✔️ socketTest +✅ socketTest ``` -### ✔️ org.apache.pulsar.websocket.proxy.v1.V1_ProxyAuthenticationTest +### ✅ org.apache.pulsar.websocket.proxy.v1.V1_ProxyAuthenticationTest ``` -✔️ anonymousSocketTest -✔️ authenticatedSocketTest -✔️ statsTest -✔️ unauthenticatedSocketTest +✅ anonymousSocketTest +✅ authenticatedSocketTest +✅ statsTest +✅ unauthenticatedSocketTest ``` \ No newline at end of file diff --git a/__tests__/__outputs__/silent-notes-test-results.md b/__tests__/__outputs__/silent-notes-test-results.md index de01928..7d4d4ac 100644 --- a/__tests__/__outputs__/silent-notes-test-results.md +++ b/__tests__/__outputs__/silent-notes-test-results.md @@ -1,136 +1,136 @@ ![Tests passed successfully](https://img.shields.io/badge/tests-67%20passed%2C%2012%20skipped-success) -## ✔️ fixtures/external/SilentNotes.trx +## ✅ fixtures/external/SilentNotes.trx **79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped. |Test suite|Passed|Failed|Skipped|Time| |:---|---:|---:|---:|---:| -|[VanillaCloudStorageClientTest.CloudStorageCredentialsTest](#r0s0)|6✔️|||30ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.DropboxCloudStorageClientTest](#r0s1)|2✔️||3✖️|101ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.FtpCloudStorageClientTest](#r0s2)|4✔️||3✖️|166ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.GmxCloudStorageClientTest](#r0s3)|2✔️|||7ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.GoogleCloudStorageClientTest](#r0s4)|1✔️||3✖️|40ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.OnedriveCloudStorageClientTest](#r0s5)|1✔️||3✖️|15ms| -|[VanillaCloudStorageClientTest.CloudStorageProviders.WebdavCloudStorageClientTest](#r0s6)|5✔️|||16ms| -|[VanillaCloudStorageClientTest.CloudStorageTokenTest](#r0s7)|9✔️|||0ms| -|[VanillaCloudStorageClientTest.OAuth2.AuthorizationResponseErrorTest](#r0s8)|3✔️|||3ms| -|[VanillaCloudStorageClientTest.OAuth2.OAuth2UtilsTest](#r0s9)|9✔️|||12ms| -|[VanillaCloudStorageClientTest.OAuth2CloudStorageClientTest](#r0s10)|5✔️|||13ms| -|[VanillaCloudStorageClientTest.SecureStringExtensionsTest](#r0s11)|7✔️|||0ms| -|[VanillaCloudStorageClientTest.SerializeableCloudStorageCredentialsTest](#r0s12)|13✔️|||43ms| -### ✔️ VanillaCloudStorageClientTest.CloudStorageCredentialsTest -``` -✔️ AreEqualWorksWithDifferentPassword -✔️ AreEqualWorksWithSameContent -✔️ CorrectlyConvertsSecureStringToString -✔️ CorrectlyConvertsStringToSecureString -✔️ ValidateAcceptsValidCredentials -✔️ ValidateRejectsInvalidCredentials -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.DropboxCloudStorageClientTest -``` -✔️ FileLifecycleWorks -✖️ ReallyDoFetchToken -✖️ ReallyDoOpenAuthorizationPageInBrowser -✖️ ReallyDoRefreshToken -✔️ ThrowsAccessDeniedExceptionWithInvalidToken -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.FtpCloudStorageClientTest -``` -✔️ FileLifecycleWorks -✔️ SanitizeCredentials_ChangesInvalidPrefix -✔️ SecureSslConnectionWorks -✔️ ThrowsWithHttpInsteadOfFtp -✖️ ThrowsWithInvalidPassword -✖️ ThrowsWithInvalidUrl -✖️ ThrowsWithInvalidUsername -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.GmxCloudStorageClientTest -``` -✔️ ChoosesCorrectUrlForGmxComEmail -✔️ ChoosesCorrectUrlForGmxNetEmail -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.GoogleCloudStorageClientTest -``` -✔️ FileLifecycleWorks -✖️ ReallyDoFetchToken -✖️ ReallyDoOpenAuthorizationPageInBrowser -✖️ ReallyDoRefreshToken -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.OnedriveCloudStorageClientTest -``` -✔️ FileLifecycleWorks -✖️ ReallyDoFetchToken -✖️ ReallyDoOpenAuthorizationPageInBrowser -✖️ ReallyDoRefreshToken -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageProviders.WebdavCloudStorageClientTest -``` -✔️ FileLifecycleWorks -✔️ ParseGmxWebdavResponseCorrectly -✔️ ParseStratoWebdavResponseCorrectly -✔️ ThrowsWithInvalidPath -✔️ ThrowsWithInvalidUsername -``` -### ✔️ VanillaCloudStorageClientTest.CloudStorageTokenTest -``` -✔️ AreEqualWorksWithNullDate -✔️ AreEqualWorksWithSameContent -✔️ NeedsRefreshReturnsFalseForTokenFlow -✔️ NeedsRefreshReturnsFalseIfNotExpired -✔️ NeedsRefreshReturnsTrueIfExpired -✔️ NeedsRefreshReturnsTrueIfNoExpirationDate -✔️ SetExpiryDateBySecondsWorks -✔️ SetExpiryDateBySecondsWorksWithNull -✔️ SetExpiryDateBySecondsWorksWithVeryShortPeriod -``` -### ✔️ VanillaCloudStorageClientTest.OAuth2.AuthorizationResponseErrorTest -``` -✔️ ParsesAllErrorCodesCorrectly -✔️ ParsesNullErrorCodeCorrectly -✔️ ParsesUnknownErrorCodeCorrectly -``` -### ✔️ VanillaCloudStorageClientTest.OAuth2.OAuth2UtilsTest -``` -✔️ BuildAuthorizationRequestUrlEscapesParameters -✔️ BuildAuthorizationRequestUrlLeavesOutOptionalParameters -✔️ BuildAuthorizationRequestUrlThrowsWithMissingRedirectUrlForTokenFlow -✔️ BuildAuthorizationRequestUrlUsesAllParameters -✔️ BuildAuthorizationRequestUrlUsesCodeVerifier -✔️ ParseRealWorldDropboxRejectResponse -✔️ ParseRealWorldDropboxSuccessResponse -✔️ ParseRealWorldGoogleRejectResponse -✔️ ParseRealWorldGoogleSuccessResponse -``` -### ✔️ VanillaCloudStorageClientTest.OAuth2CloudStorageClientTest -``` -✔️ BuildOAuth2AuthorizationRequestUrlWorks -✔️ FetchTokenCanInterpretGoogleResponse -✔️ FetchTokenReturnsNullForDeniedAccess -✔️ FetchTokenThrowsWithWrongState -✔️ RefreshTokenCanInterpretGoogleResponse -``` -### ✔️ VanillaCloudStorageClientTest.SecureStringExtensionsTest -``` -✔️ AreEqualsWorksCorrectly -✔️ CorrectlyConvertsSecureStringToString -✔️ CorrectlyConvertsSecureStringToUnicodeBytes -✔️ CorrectlyConvertsSecureStringToUtf8Bytes -✔️ CorrectlyConvertsStringToSecureString -✔️ CorrectlyConvertsUnicodeBytesToSecureString -✔️ CorrectlyConvertsUtf8BytesToSecureString -``` -### ✔️ VanillaCloudStorageClientTest.SerializeableCloudStorageCredentialsTest -``` -✔️ DecryptAfterDesrializationCanReadAllPropertiesBack -✔️ DecryptAfterDesrializationRespectsNullProperties -✔️ EncryptBeforeSerializationProtectsAllNecessaryProperties -✔️ EncryptBeforeSerializationRespectsNullProperties -✔️ SerializedDatacontractCanBeReadBack -✔️ SerializedDatacontractDoesNotContainNullProperties -✔️ SerializedDatacontractDoesNotContainPlaintextData -✔️ SerializedJsonCanBeReadBack -✔️ SerializedJsonDoesNotContainNullProperties -✔️ SerializedJsonDoesNotContainPlaintextData -✔️ SerializedXmlCanBeReadBack -✔️ SerializedXmlDoesNotContainNullProperties -✔️ SerializedXmlDoesNotContainPlaintextData +|[VanillaCloudStorageClientTest.CloudStorageCredentialsTest](#r0s0)|6✅|||30ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.DropboxCloudStorageClientTest](#r0s1)|2✅||3⚪|101ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.FtpCloudStorageClientTest](#r0s2)|4✅||3⚪|166ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.GmxCloudStorageClientTest](#r0s3)|2✅|||7ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.GoogleCloudStorageClientTest](#r0s4)|1✅||3⚪|40ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.OnedriveCloudStorageClientTest](#r0s5)|1✅||3⚪|15ms| +|[VanillaCloudStorageClientTest.CloudStorageProviders.WebdavCloudStorageClientTest](#r0s6)|5✅|||16ms| +|[VanillaCloudStorageClientTest.CloudStorageTokenTest](#r0s7)|9✅|||0ms| +|[VanillaCloudStorageClientTest.OAuth2.AuthorizationResponseErrorTest](#r0s8)|3✅|||3ms| +|[VanillaCloudStorageClientTest.OAuth2.OAuth2UtilsTest](#r0s9)|9✅|||12ms| +|[VanillaCloudStorageClientTest.OAuth2CloudStorageClientTest](#r0s10)|5✅|||13ms| +|[VanillaCloudStorageClientTest.SecureStringExtensionsTest](#r0s11)|7✅|||0ms| +|[VanillaCloudStorageClientTest.SerializeableCloudStorageCredentialsTest](#r0s12)|13✅|||43ms| +### ✅ VanillaCloudStorageClientTest.CloudStorageCredentialsTest +``` +✅ AreEqualWorksWithDifferentPassword +✅ AreEqualWorksWithSameContent +✅ CorrectlyConvertsSecureStringToString +✅ CorrectlyConvertsStringToSecureString +✅ ValidateAcceptsValidCredentials +✅ ValidateRejectsInvalidCredentials +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.DropboxCloudStorageClientTest +``` +✅ FileLifecycleWorks +⚪ ReallyDoFetchToken +⚪ ReallyDoOpenAuthorizationPageInBrowser +⚪ ReallyDoRefreshToken +✅ ThrowsAccessDeniedExceptionWithInvalidToken +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.FtpCloudStorageClientTest +``` +✅ FileLifecycleWorks +✅ SanitizeCredentials_ChangesInvalidPrefix +✅ SecureSslConnectionWorks +✅ ThrowsWithHttpInsteadOfFtp +⚪ ThrowsWithInvalidPassword +⚪ ThrowsWithInvalidUrl +⚪ ThrowsWithInvalidUsername +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.GmxCloudStorageClientTest +``` +✅ ChoosesCorrectUrlForGmxComEmail +✅ ChoosesCorrectUrlForGmxNetEmail +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.GoogleCloudStorageClientTest +``` +✅ FileLifecycleWorks +⚪ ReallyDoFetchToken +⚪ ReallyDoOpenAuthorizationPageInBrowser +⚪ ReallyDoRefreshToken +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.OnedriveCloudStorageClientTest +``` +✅ FileLifecycleWorks +⚪ ReallyDoFetchToken +⚪ ReallyDoOpenAuthorizationPageInBrowser +⚪ ReallyDoRefreshToken +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageProviders.WebdavCloudStorageClientTest +``` +✅ FileLifecycleWorks +✅ ParseGmxWebdavResponseCorrectly +✅ ParseStratoWebdavResponseCorrectly +✅ ThrowsWithInvalidPath +✅ ThrowsWithInvalidUsername +``` +### ✅ VanillaCloudStorageClientTest.CloudStorageTokenTest +``` +✅ AreEqualWorksWithNullDate +✅ AreEqualWorksWithSameContent +✅ NeedsRefreshReturnsFalseForTokenFlow +✅ NeedsRefreshReturnsFalseIfNotExpired +✅ NeedsRefreshReturnsTrueIfExpired +✅ NeedsRefreshReturnsTrueIfNoExpirationDate +✅ SetExpiryDateBySecondsWorks +✅ SetExpiryDateBySecondsWorksWithNull +✅ SetExpiryDateBySecondsWorksWithVeryShortPeriod +``` +### ✅ VanillaCloudStorageClientTest.OAuth2.AuthorizationResponseErrorTest +``` +✅ ParsesAllErrorCodesCorrectly +✅ ParsesNullErrorCodeCorrectly +✅ ParsesUnknownErrorCodeCorrectly +``` +### ✅ VanillaCloudStorageClientTest.OAuth2.OAuth2UtilsTest +``` +✅ BuildAuthorizationRequestUrlEscapesParameters +✅ BuildAuthorizationRequestUrlLeavesOutOptionalParameters +✅ BuildAuthorizationRequestUrlThrowsWithMissingRedirectUrlForTokenFlow +✅ BuildAuthorizationRequestUrlUsesAllParameters +✅ BuildAuthorizationRequestUrlUsesCodeVerifier +✅ ParseRealWorldDropboxRejectResponse +✅ ParseRealWorldDropboxSuccessResponse +✅ ParseRealWorldGoogleRejectResponse +✅ ParseRealWorldGoogleSuccessResponse +``` +### ✅ VanillaCloudStorageClientTest.OAuth2CloudStorageClientTest +``` +✅ BuildOAuth2AuthorizationRequestUrlWorks +✅ FetchTokenCanInterpretGoogleResponse +✅ FetchTokenReturnsNullForDeniedAccess +✅ FetchTokenThrowsWithWrongState +✅ RefreshTokenCanInterpretGoogleResponse +``` +### ✅ VanillaCloudStorageClientTest.SecureStringExtensionsTest +``` +✅ AreEqualsWorksCorrectly +✅ CorrectlyConvertsSecureStringToString +✅ CorrectlyConvertsSecureStringToUnicodeBytes +✅ CorrectlyConvertsSecureStringToUtf8Bytes +✅ CorrectlyConvertsStringToSecureString +✅ CorrectlyConvertsUnicodeBytesToSecureString +✅ CorrectlyConvertsUtf8BytesToSecureString +``` +### ✅ VanillaCloudStorageClientTest.SerializeableCloudStorageCredentialsTest +``` +✅ DecryptAfterDesrializationCanReadAllPropertiesBack +✅ DecryptAfterDesrializationRespectsNullProperties +✅ EncryptBeforeSerializationProtectsAllNecessaryProperties +✅ EncryptBeforeSerializationRespectsNullProperties +✅ SerializedDatacontractCanBeReadBack +✅ SerializedDatacontractDoesNotContainNullProperties +✅ SerializedDatacontractDoesNotContainPlaintextData +✅ SerializedJsonCanBeReadBack +✅ SerializedJsonDoesNotContainNullProperties +✅ SerializedJsonDoesNotContainPlaintextData +✅ SerializedXmlCanBeReadBack +✅ SerializedXmlDoesNotContainNullProperties +✅ SerializedXmlDoesNotContainPlaintextData ``` \ No newline at end of file diff --git a/__tests__/fixtures/empty/jest-junit-empty-testsuite.xml b/__tests__/fixtures/empty/jest-junit-empty-testsuite.xml new file mode 100644 index 0000000..ad54653 --- /dev/null +++ b/__tests__/fixtures/empty/jest-junit-empty-testsuite.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/__tests__/fixtures/external/java/empty_failures.xml b/__tests__/fixtures/external/java/empty_failures.xml new file mode 100644 index 0000000..c76ed0e --- /dev/null +++ b/__tests__/fixtures/external/java/empty_failures.xml @@ -0,0 +1,2 @@ + + diff --git a/__tests__/java-junit.test.ts b/__tests__/java-junit.test.ts index a2ee944..e8111d4 100644 --- a/__tests__/java-junit.test.ts +++ b/__tests__/java-junit.test.ts @@ -72,4 +72,22 @@ describe('java-junit tests', () => { fs.mkdirSync(path.dirname(outputPath), {recursive: true}) fs.writeFileSync(outputPath, report) }) + + it('parses empty failures in test results', async () => { + const fixturePath = path.join(__dirname, 'fixtures', 'external', 'java', 'empty_failures.xml') + const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) + const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) + + const trackedFiles: string[] = [] + const opts: ParseOptions = { + parseErrors: true, + trackedFiles + } + + const parser = new JavaJunitParser(opts) + const result = await parser.parse(filePath, fileContent) + + expect(result.result === 'failed') + expect(result.failed === 1) + }) }) diff --git a/__tests__/java-stack-trace-element-parser.test.ts b/__tests__/java-stack-trace-element-parser.test.ts new file mode 100644 index 0000000..6fe1ac2 --- /dev/null +++ b/__tests__/java-stack-trace-element-parser.test.ts @@ -0,0 +1,75 @@ +import {parseStackTraceElement} from '../src/parsers/java-junit/java-stack-trace-element-parser' + +describe('parseStackTraceLine tests', () => { + it('empty line is not parsed', async () => { + const line = '' + expect(parseStackTraceElement(line)).toBe(undefined) + }) + + describe('java class', () => { + it('simple', async () => { + const line = + 'at org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings(AddMissingPatchVersionTest.java:29)' + expect(parseStackTraceElement(line)).toEqual({ + tracePath: 'org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings', + fileName: 'AddMissingPatchVersionTest.java', + lineStr: '29' + }) + }) + + it('inner class', async () => { + const line = 'at com.foo.Main$Inner.run(Main.java:29)' + expect(parseStackTraceElement(line)).toEqual({ + tracePath: 'com.foo.Main$Inner.run', + fileName: 'Main.java', + lineStr: '29' + }) + }) + + it('starts with whitespaces', async () => { + const line = + ' \tat org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings(AddMissingPatchVersionTest.java:29)' + expect(parseStackTraceElement(line)).toEqual({ + tracePath: 'org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings', + fileName: 'AddMissingPatchVersionTest.java', + lineStr: '29' + }) + }) + + describe('since Java 9', () => { + it('with classloader and module', async () => { + // Based on Java 9 StackTraceElement.toString() Doc: https://docs.oracle.com/javase/9/docs/api/java/lang/StackTraceElement.html#toString-- + const line = 'at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101)' + expect(parseStackTraceElement(line)).toEqual({ + classLoader: 'com.foo.loader', + moduleNameAndVersion: 'foo@9.0', + tracePath: 'com.foo.Main.run', + fileName: 'Main.java', + lineStr: '101' + }) + }) + + it('with classloader', async () => { + const line = 'at com.foo.loader//com.foo.Main.run(Main.java:101)' + expect(parseStackTraceElement(line)).toEqual({ + classLoader: 'com.foo.loader', + moduleNameAndVersion: undefined, + tracePath: 'com.foo.Main.run', + fileName: 'Main.java', + lineStr: '101' + }) + }) + }) + }) + + describe('Kotlin class', () => { + it('method name containing whitespaces', async () => { + const line = 'at com.foo.Main.method with whitespaces(Main.kt:18)' + expect(parseStackTraceElement(line)).toEqual({ + tracePath: 'com.foo.Main.method with whitespaces', + fileName: 'Main.kt', + lineStr: '18' + }) + }) + }) +}) diff --git a/__tests__/jest-junit.test.ts b/__tests__/jest-junit.test.ts index 0a5703e..b6533e6 100644 --- a/__tests__/jest-junit.test.ts +++ b/__tests__/jest-junit.test.ts @@ -7,7 +7,7 @@ import {getReport} from '../src/report/get-report' import {normalizeFilePath} from '../src/utils/path-utils' describe('jest-junit tests', () => { - it('produces empty test run result when there are no test cases', async () => { + it('produces empty test run result when there are no test cases in the testsuites element', async () => { const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'jest-junit.xml') const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) @@ -23,6 +23,22 @@ describe('jest-junit tests', () => { expect(result.result).toBe('success') }) + it('produces empty test run result when there are no test cases in a nested testsuite element', async () => { + const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'jest-junit-empty-testsuite.xml') + const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) + const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) + + const opts: ParseOptions = { + parseErrors: true, + trackedFiles: [] + } + + const parser = new JestJunitParser(opts) + const result = await parser.parse(filePath, fileContent) + expect(result.tests).toBe(0) + expect(result.result).toBe('success') + }) + it('report from ./reports/jest test results matches snapshot', async () => { const fixturePath = path.join(__dirname, 'fixtures', 'jest-junit.xml') const outputPath = path.join(__dirname, '__outputs__', 'jest-junit.md') diff --git a/action.yml b/action.yml index f7025e1..325e2c4 100644 --- a/action.yml +++ b/action.yml @@ -86,7 +86,7 @@ outputs: time: description: Test execution time [ms] runs: - using: 'node12' + using: 'node16' main: 'dist/index.js' branding: color: blue diff --git a/dist/index.js b/dist/index.js index f5ea0e7..df75f07 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,3 @@ -require('./sourcemap-register.js');module.exports = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ @@ -9,7 +8,11 @@ require('./sourcemap-register.js');module.exports = var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -26,6 +29,15 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -67,61 +79,62 @@ class ArtifactProvider { this.artifactNameMatch = (str) => str === this.artifact; this.getReportName = () => this.name; } - this.fileNameMatch = picomatch_1.default(pattern); + this.fileNameMatch = (0, picomatch_1.default)(pattern); } - async load() { - const result = {}; - const resp = await this.octokit.actions.listWorkflowRunArtifacts({ - ...github.context.repo, - run_id: this.runId - }); - if (resp.data.artifacts.length === 0) { - core.warning(`No artifacts found in run ${this.runId}`); - return {}; - } - const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)); - if (artifacts.length === 0) { - core.warning(`No artifact matches ${this.artifact}`); - return {}; - } - for (const art of artifacts) { - const fileName = `${art.name}.zip`; - await github_utils_1.downloadArtifact(this.octokit, art.id, fileName, this.token); - core.startGroup(`Reading archive ${fileName}`); - try { - const reportName = this.getReportName(art.name); - core.info(`Report name: ${reportName}`); - const files = []; - const zip = new adm_zip_1.default(fileName); - for (const entry of zip.getEntries()) { - const file = entry.entryName; - if (entry.isDirectory) { - core.info(`Skipping ${file}: entry is a directory`); - continue; + load() { + return __awaiter(this, void 0, void 0, function* () { + const result = {}; + const resp = yield this.octokit.rest.actions.listWorkflowRunArtifacts(Object.assign(Object.assign({}, github.context.repo), { run_id: this.runId })); + if (resp.data.artifacts.length === 0) { + core.warning(`No artifacts found in run ${this.runId}`); + return {}; + } + const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)); + if (artifacts.length === 0) { + core.warning(`No artifact matches ${this.artifact}`); + return {}; + } + for (const art of artifacts) { + const fileName = `${art.name}.zip`; + yield (0, github_utils_1.downloadArtifact)(this.octokit, art.id, fileName, this.token); + core.startGroup(`Reading archive ${fileName}`); + try { + const reportName = this.getReportName(art.name); + core.info(`Report name: ${reportName}`); + const files = []; + const zip = new adm_zip_1.default(fileName); + for (const entry of zip.getEntries()) { + const file = entry.entryName; + if (entry.isDirectory) { + core.info(`Skipping ${file}: entry is a directory`); + continue; + } + if (!this.fileNameMatch(file)) { + core.info(`Skipping ${file}: filename does not match pattern`); + continue; + } + const content = zip.readAsText(entry); + files.push({ file, content }); + core.info(`Read ${file}: ${content.length} chars`); } - if (!this.fileNameMatch(file)) { - core.info(`Skipping ${file}: filename does not match pattern`); - continue; + if (result[reportName]) { + result[reportName].push(...files); + } + else { + result[reportName] = files; } - const content = zip.readAsText(entry); - files.push({ file, content }); - core.info(`Read ${file}: ${content.length} chars`); - } - if (result[reportName]) { - result[reportName].push(...files); } - else { - result[reportName] = files; + finally { + core.endGroup(); } } - finally { - core.endGroup(); - } - } - return result; + return result; + }); } - async listTrackedFiles() { - return github_utils_1.listFiles(this.octokit, this.sha); + listTrackedFiles() { + return __awaiter(this, void 0, void 0, function* () { + return (0, github_utils_1.listFiles)(this.octokit, this.sha); + }); } } exports.ArtifactProvider = ArtifactProvider; @@ -136,7 +149,11 @@ exports.ArtifactProvider = ArtifactProvider; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -153,12 +170,21 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LocalFileProvider = void 0; -const fs = __importStar(__nccwpck_require__(5747)); +const fs = __importStar(__nccwpck_require__(7147)); const fast_glob_1 = __importDefault(__nccwpck_require__(3664)); const git_1 = __nccwpck_require__(9844); class LocalFileProvider { @@ -166,19 +192,23 @@ class LocalFileProvider { this.name = name; this.pattern = pattern; } - async load() { - const result = []; - for (const pat of this.pattern) { - const paths = await fast_glob_1.default(pat, { dot: true }); - for (const file of paths) { - const content = await fs.promises.readFile(file, { encoding: 'utf8' }); - result.push({ file, content }); + load() { + return __awaiter(this, void 0, void 0, function* () { + const result = []; + for (const pat of this.pattern) { + const paths = yield (0, fast_glob_1.default)(pat, { dot: true }); + for (const file of paths) { + const content = yield fs.promises.readFile(file, { encoding: 'utf8' }); + result.push({ file, content }); + } } - } - return { [this.name]: result }; + return { [this.name]: result }; + }); } - async listTrackedFiles() { - return git_1.listFiles(); + listTrackedFiles() { + return __awaiter(this, void 0, void 0, function* () { + return (0, git_1.listFiles)(); + }); } } exports.LocalFileProvider = LocalFileProvider; @@ -193,7 +223,11 @@ exports.LocalFileProvider = LocalFileProvider; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -210,6 +244,15 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__nccwpck_require__(2186)); const github = __importStar(__nccwpck_require__(5438)); @@ -225,14 +268,19 @@ const mocha_json_parser_1 = __nccwpck_require__(6043); const path_utils_1 = __nccwpck_require__(4070); const github_utils_1 = __nccwpck_require__(3522); const markdown_utils_1 = __nccwpck_require__(6482); -async function main() { - try { - const testReporter = new TestReporter(); - await testReporter.run(); - } - catch (error) { - core.setFailed(error.message); - } +function main() { + return __awaiter(this, void 0, void 0, function* () { + try { + const testReporter = new TestReporter(); + yield testReporter.run(); + } + catch (error) { + if (error instanceof Error) + core.setFailed(error); + else + core.setFailed(JSON.stringify(error)); + } + }); } class TestReporter { constructor() { @@ -248,7 +296,7 @@ class TestReporter { this.workDirInput = core.getInput('working-directory', { required: false }); this.onlySummary = core.getInput('only-summary', { required: false }) === 'true'; this.token = core.getInput('token', { required: true }); - this.context = github_utils_1.getCheckRunContext(); + this.context = (0, github_utils_1.getCheckRunContext)(); this.octokit = github.getOctokit(this.token); if (this.listSuites !== 'all' && this.listSuites !== 'failed') { core.setFailed(`Input parameter 'list-suites' has invalid value`); @@ -263,109 +311,101 @@ class TestReporter { return; } } - async run() { - if (this.workDirInput) { - core.info(`Changing directory to '${this.workDirInput}'`); - process.chdir(this.workDirInput); - } - core.info(`Check runs will be created with SHA=${this.context.sha}`); - // Split path pattern by ',' and optionally convert all backslashes to forward slashes - // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators - const pathsList = this.path.split(','); - const pattern = this.pathReplaceBackslashes ? pathsList.map(path_utils_1.normalizeFilePath) : pathsList; - const inputProvider = this.artifact - ? new artifact_provider_1.ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) - : new local_file_provider_1.LocalFileProvider(this.name, pattern); - const parseErrors = this.maxAnnotations > 0; - const trackedFiles = await inputProvider.listTrackedFiles(); - const workDir = this.artifact ? undefined : path_utils_1.normalizeDirPath(process.cwd(), true); - core.info(`Found ${trackedFiles.length} files tracked by GitHub`); - const options = { - workDir, - trackedFiles, - parseErrors - }; - core.info(`Using test report parser '${this.reporter}'`); - const parser = this.getParser(this.reporter, options); - const results = []; - const input = await inputProvider.load(); - for (const [reportName, files] of Object.entries(input)) { - try { - core.startGroup(`Creating test report ${reportName}`); - const tr = await this.createReport(parser, reportName, files); - results.push(...tr); - } - finally { - core.endGroup(); - } - } - const isFailed = results.some(tr => tr.result === 'failed'); - const conclusion = isFailed ? 'failure' : 'success'; - const passed = results.reduce((sum, tr) => sum + tr.passed, 0); - const failed = results.reduce((sum, tr) => sum + tr.failed, 0); - const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const time = results.reduce((sum, tr) => sum + tr.time, 0); - core.setOutput('conclusion', conclusion); - core.setOutput('passed', passed); - core.setOutput('failed', failed); - core.setOutput('skipped', skipped); - core.setOutput('time', time); - if (this.failOnError && isFailed) { - core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); - return; - } - if (results.length === 0) { - core.setFailed(`No test report files were found`); - return; - } - } - async createReport(parser, name, files) { - if (files.length === 0) { - core.warning(`No file matches path ${this.path}`); - return []; - } - const results = []; - for (const { file, content } of files) { - core.info(`Processing test results from ${file}`); - const tr = await parser.parse(file, content); - results.push(tr); - } - core.info(`Creating check run ${name}`); - const createResp = await this.octokit.checks.create({ - head_sha: this.context.sha, - name, - status: 'in_progress', - output: { - title: name, - summary: '' - }, - ...github.context.repo + run() { + return __awaiter(this, void 0, void 0, function* () { + if (this.workDirInput) { + core.info(`Changing directory to '${this.workDirInput}'`); + process.chdir(this.workDirInput); + } + core.info(`Check runs will be created with SHA=${this.context.sha}`); + // Split path pattern by ',' and optionally convert all backslashes to forward slashes + // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators + const pathsList = this.path.split(','); + const pattern = this.pathReplaceBackslashes ? pathsList.map(path_utils_1.normalizeFilePath) : pathsList; + const inputProvider = this.artifact + ? new artifact_provider_1.ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) + : new local_file_provider_1.LocalFileProvider(this.name, pattern); + const parseErrors = this.maxAnnotations > 0; + const trackedFiles = yield inputProvider.listTrackedFiles(); + const workDir = this.artifact ? undefined : (0, path_utils_1.normalizeDirPath)(process.cwd(), true); + core.info(`Found ${trackedFiles.length} files tracked by GitHub`); + const options = { + workDir, + trackedFiles, + parseErrors + }; + core.info(`Using test report parser '${this.reporter}'`); + const parser = this.getParser(this.reporter, options); + const results = []; + const input = yield inputProvider.load(); + for (const [reportName, files] of Object.entries(input)) { + try { + core.startGroup(`Creating test report ${reportName}`); + const tr = yield this.createReport(parser, reportName, files); + results.push(...tr); + } + finally { + core.endGroup(); + } + } + const isFailed = results.some(tr => tr.result === 'failed'); + const conclusion = isFailed ? 'failure' : 'success'; + const passed = results.reduce((sum, tr) => sum + tr.passed, 0); + const failed = results.reduce((sum, tr) => sum + tr.failed, 0); + const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); + const time = results.reduce((sum, tr) => sum + tr.time, 0); + core.setOutput('conclusion', conclusion); + core.setOutput('passed', passed); + core.setOutput('failed', failed); + core.setOutput('skipped', skipped); + core.setOutput('time', time); + if (this.failOnError && isFailed) { + core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); + return; + } + if (results.length === 0) { + core.setFailed(`No test report files were found`); + return; + } }); - core.info('Creating report summary'); - const { listSuites, listTests, onlySummary } = this; - const baseUrl = createResp.data.html_url; - const summary = get_report_1.getReport(results, { listSuites, listTests, baseUrl, onlySummary }); - core.info('Creating annotations'); - const annotations = get_annotations_1.getAnnotations(results, this.maxAnnotations); - const isFailed = results.some(tr => tr.result === 'failed'); - const conclusion = isFailed ? 'failure' : 'success'; - const icon = isFailed ? markdown_utils_1.Icon.fail : markdown_utils_1.Icon.success; - core.info(`Updating check run conclusion (${conclusion}) and output`); - const resp = await this.octokit.checks.update({ - check_run_id: createResp.data.id, - conclusion, - status: 'completed', - output: { - title: `${name} ${icon}`, - summary, - annotations - }, - ...github.context.repo + } + createReport(parser, name, files) { + return __awaiter(this, void 0, void 0, function* () { + if (files.length === 0) { + core.warning(`No file matches path ${this.path}`); + return []; + } + const results = []; + for (const { file, content } of files) { + core.info(`Processing test results from ${file}`); + const tr = yield parser.parse(file, content); + results.push(tr); + } + core.info(`Creating check run ${name}`); + const createResp = yield this.octokit.rest.checks.create(Object.assign({ head_sha: this.context.sha, name, status: 'in_progress', output: { + title: name, + summary: '' + } }, github.context.repo)); + core.info('Creating report summary'); + const { listSuites, listTests, onlySummary } = this; + const baseUrl = createResp.data.html_url; + const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary }); + core.info('Creating annotations'); + const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations); + const isFailed = this.failOnError && results.some(tr => tr.result === 'failed'); + const conclusion = isFailed ? 'failure' : 'success'; + const icon = isFailed ? markdown_utils_1.Icon.fail : markdown_utils_1.Icon.success; + core.info(`Updating check run conclusion (${conclusion}) and output`); + const resp = yield this.octokit.rest.checks.update(Object.assign({ check_run_id: createResp.data.id, conclusion, status: 'completed', output: { + title: `${name} ${icon}`, + summary, + annotations + } }, github.context.repo)); + core.info(`Check run create response: ${resp.status}`); + core.info(`Check run URL: ${resp.data.url}`); + core.info(`Check run HTML: ${resp.data.html_url}`); + return results; }); - core.info(`Check run create response: ${resp.status}`); - core.info(`Check run URL: ${resp.data.url}`); - core.info(`Check run HTML: ${resp.data.html_url}`); - return results; } getParser(reporter, options) { switch (reporter) { @@ -392,10 +432,19 @@ main(); /***/ }), /***/ 4528: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DartJsonParser = void 0; const path_utils_1 = __nccwpck_require__(4070); @@ -449,10 +498,12 @@ class DartJsonParser { this.options = options; this.sdk = sdk; } - async parse(path, content) { - const tr = this.getTestRun(path, content); - const result = this.getTestRunResult(tr); - return Promise.resolve(result); + parse(path, content) { + return __awaiter(this, void 0, void 0, function* () { + const tr = this.getTestRun(path, content); + const result = this.getTestRunResult(tr); + return Promise.resolve(result); + }); } getTestRun(path, content) { const lines = content.split(/\n\r?/g); @@ -465,7 +516,8 @@ class DartJsonParser { return JSON.parse(str); } catch (e) { - const col = e.columnNumber !== undefined ? `:${e.columnNumber}` : ''; + const errWithCol = e; + const col = errWithCol.columnNumber !== undefined ? `:${errWithCol.columnNumber}` : ''; throw new Error(`Invalid JSON at ${path}:${i + 1}${col}\n\n${e}`); } }) @@ -475,29 +527,29 @@ class DartJsonParser { const suites = {}; const tests = {}; for (const evt of events) { - if (dart_json_types_1.isSuiteEvent(evt)) { + if ((0, dart_json_types_1.isSuiteEvent)(evt)) { suites[evt.suite.id] = new TestSuite(evt.suite); } - else if (dart_json_types_1.isGroupEvent(evt)) { + else if ((0, dart_json_types_1.isGroupEvent)(evt)) { suites[evt.group.suiteID].groups[evt.group.id] = new TestGroup(evt.group); } - else if (dart_json_types_1.isTestStartEvent(evt) && evt.test.url !== null) { + else if ((0, dart_json_types_1.isTestStartEvent)(evt) && evt.test.url !== null) { const test = new TestCase(evt); const suite = suites[evt.test.suiteID]; const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]; group.tests.push(test); tests[evt.test.id] = test; } - else if (dart_json_types_1.isTestDoneEvent(evt) && !evt.hidden && tests[evt.testID]) { + else if ((0, dart_json_types_1.isTestDoneEvent)(evt) && !evt.hidden && tests[evt.testID]) { tests[evt.testID].testDone = evt; } - else if (dart_json_types_1.isErrorEvent(evt) && tests[evt.testID]) { + else if ((0, dart_json_types_1.isErrorEvent)(evt) && tests[evt.testID]) { tests[evt.testID].error = evt; } - else if (dart_json_types_1.isMessageEvent(evt) && tests[evt.testID]) { + else if ((0, dart_json_types_1.isMessageEvent)(evt) && tests[evt.testID]) { tests[evt.testID].print.push(evt); } - else if (dart_json_types_1.isDoneEvent(evt)) { + else if ((0, dart_json_types_1.isDoneEvent)(evt)) { success = evt.success; totalTime = evt.time; } @@ -582,7 +634,7 @@ class DartJsonParser { const match = str.match(re); if (match !== null) { const [_, pathStr, lineStr] = match; - const path = path_utils_1.normalizeFilePath(this.getRelativePath(pathStr)); + const path = (0, path_utils_1.normalizeFilePath)(this.getRelativePath(pathStr)); if (trackedFiles.includes(path)) { const line = parseInt(lineStr); return { path, line }; @@ -595,7 +647,7 @@ class DartJsonParser { if (path.startsWith(prefix)) { path = path.substr(prefix.length); } - path = path_utils_1.normalizeFilePath(path); + path = (0, path_utils_1.normalizeFilePath)(path); const workDir = this.getWorkDir(path); if (workDir !== undefined && path.startsWith(workDir)) { path = path.substr(workDir.length); @@ -604,7 +656,7 @@ class DartJsonParser { } getWorkDir(path) { var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = path_utils_1.getBasePath(path, this.options.trackedFiles))); + return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.DartJsonParser = DartJsonParser; @@ -653,10 +705,19 @@ exports.isMessageEvent = isMessageEvent; /***/ }), /***/ 2664: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DotnetTrxParser = void 0; const xml2js_1 = __nccwpck_require__(6189); @@ -691,20 +752,24 @@ class DotnetTrxParser { constructor(options) { this.options = options; } - async parse(path, content) { - const trx = await this.getTrxReport(path, content); - const tc = this.getTestClasses(trx); - const tr = this.getTestRunResult(path, trx, tc); - tr.sort(true); - return tr; + parse(path, content) { + return __awaiter(this, void 0, void 0, function* () { + const trx = yield this.getTrxReport(path, content); + const tc = this.getTestClasses(trx); + const tr = this.getTestRunResult(path, trx, tc); + tr.sort(true); + return tr; + }); } - async getTrxReport(path, content) { - try { - return (await xml2js_1.parseStringPromise(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } + getTrxReport(path, content) { + return __awaiter(this, void 0, void 0, function* () { + try { + return (yield (0, xml2js_1.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + }); } getTestClasses(trx) { if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined) { @@ -730,7 +795,7 @@ class DotnetTrxParser { } const error = this.getErrorInfo(r.result); const durationAttr = r.result.$.duration; - const duration = durationAttr ? parse_utils_1.parseNetDuration(durationAttr) : 0; + const duration = durationAttr ? (0, parse_utils_1.parseNetDuration)(durationAttr) : 0; const resultTestName = r.result.$.testName; const testName = resultTestName.startsWith(className) && resultTestName[className.length] === '.' ? resultTestName.substr(className.length + 1) @@ -743,7 +808,7 @@ class DotnetTrxParser { } getTestRunResult(path, trx, testClasses) { const times = trx.TestRun.Times[0].$; - const totalTime = parse_utils_1.parseIsoDate(times.finish).getTime() - parse_utils_1.parseIsoDate(times.start).getTime(); + const totalTime = (0, parse_utils_1.parseIsoDate)(times.finish).getTime() - (0, parse_utils_1.parseIsoDate)(times.start).getTime(); const suites = testClasses.map(testClass => { const tests = testClass.tests.map(test => { const error = this.getError(test); @@ -798,7 +863,7 @@ class DotnetTrxParser { const match = str.match(re); if (match !== null) { const [_, fileStr, lineStr] = match; - const filePath = path_utils_1.normalizeFilePath(fileStr); + const filePath = (0, path_utils_1.normalizeFilePath)(fileStr); const workDir = this.getWorkDir(filePath); if (workDir) { const file = filePath.substr(workDir.length); @@ -812,7 +877,7 @@ class DotnetTrxParser { } getWorkDir(path) { var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = path_utils_1.getBasePath(path, this.options.trackedFiles))); + return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.DotnetTrxParser = DotnetTrxParser; @@ -827,7 +892,11 @@ exports.DotnetTrxParser = DotnetTrxParser; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -844,10 +913,20 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JavaJunitParser = void 0; -const path = __importStar(__nccwpck_require__(5622)); +const path = __importStar(__nccwpck_require__(1017)); const xml2js_1 = __nccwpck_require__(6189); +const java_stack_trace_element_parser_1 = __nccwpck_require__(5775); const path_utils_1 = __nccwpck_require__(4070); const test_results_1 = __nccwpck_require__(2768); class JavaJunitParser { @@ -859,38 +938,42 @@ class JavaJunitParser { for (const filePath of options.trackedFiles) { const fileName = path.basename(filePath); const files = (_a = this.trackedFiles[fileName]) !== null && _a !== void 0 ? _a : (this.trackedFiles[fileName] = []); - files.push(path_utils_1.normalizeFilePath(filePath)); + files.push((0, path_utils_1.normalizeFilePath)(filePath)); } } - async parse(filePath, content) { - const reportOrSuite = await this.getJunitReport(filePath, content); - const isReport = reportOrSuite.testsuites !== undefined; - // XML might contain: - // - multiple suites under root node - // - single as root node - let ju; - if (isReport) { - ju = reportOrSuite; - } - else { - // Make it behave the same way as if suite was inside root node - const suite = reportOrSuite.testsuite; - ju = { - testsuites: { - $: { time: suite.$.time }, - testsuite: [suite] - } - }; - } - return this.getTestRunResult(filePath, ju); + parse(filePath, content) { + return __awaiter(this, void 0, void 0, function* () { + const reportOrSuite = yield this.getJunitReport(filePath, content); + const isReport = reportOrSuite.testsuites !== undefined; + // XML might contain: + // - multiple suites under root node + // - single as root node + let ju; + if (isReport) { + ju = reportOrSuite; + } + else { + // Make it behave the same way as if suite was inside root node + const suite = reportOrSuite.testsuite; + ju = { + testsuites: { + $: { time: suite.$.time }, + testsuite: [suite] + } + }; + } + return this.getTestRunResult(filePath, ju); + }); } - async getJunitReport(filePath, content) { - try { - return await xml2js_1.parseStringPromise(content); - } - catch (e) { - throw new Error(`Invalid XML at ${filePath}\n\n${e}`); - } + getJunitReport(filePath, content) { + return __awaiter(this, void 0, void 0, function* () { + try { + return yield (0, xml2js_1.parseStringPromise)(content); + } + catch (e) { + throw new Error(`Invalid XML at ${filePath}\n\n${e}`); + } + }); } getTestRunResult(filePath, junit) { var _a; @@ -955,10 +1038,12 @@ class JavaJunitParser { const details = typeof failure === 'object' ? failure._ : failure; let filePath; let line; - const src = this.exceptionThrowSource(details); - if (src) { - filePath = src.filePath; - line = src.line; + if (details != null) { + const src = this.exceptionThrowSource(details); + if (src) { + filePath = src.filePath; + line = src.line; + } } return { path: filePath, @@ -969,11 +1054,10 @@ class JavaJunitParser { } exceptionThrowSource(stackTrace) { const lines = stackTrace.split(/\r?\n/); - const re = /^at (.*)\((.*):(\d+)\)$/; for (const str of lines) { - const match = str.match(re); - if (match !== null) { - const [_, tracePath, fileName, lineStr] = match; + const stackTraceElement = (0, java_stack_trace_element_parser_1.parseStackTraceElement)(str); + if (stackTraceElement) { + const { tracePath, fileName, lineStr } = stackTraceElement; const filePath = this.getFilePath(tracePath, fileName); if (filePath !== undefined) { const line = parseInt(lineStr); @@ -1026,13 +1110,65 @@ class JavaJunitParser { exports.JavaJunitParser = JavaJunitParser; +/***/ }), + +/***/ 5775: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseStackTraceElement = void 0; +// classloader and module name are optional: +// at //(:) +// https://github.com/eclipse-openj9/openj9/issues/11452#issuecomment-754946992 +const re = /^\s*at (\S+\/\S*\/)?(.*)\((.*):(\d+)\)$/; +function parseStackTraceElement(stackTraceLine) { + const match = stackTraceLine.match(re); + if (match !== null) { + const [_, maybeClassLoaderAndModuleNameAndVersion, tracePath, fileName, lineStr] = match; + const { classLoader, moduleNameAndVersion } = parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion); + return { + classLoader, + moduleNameAndVersion, + tracePath, + fileName, + lineStr + }; + } + return undefined; +} +exports.parseStackTraceElement = parseStackTraceElement; +function parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion) { + if (maybeClassLoaderAndModuleNameAndVersion) { + const res = maybeClassLoaderAndModuleNameAndVersion.split('/'); + const classLoader = res[0]; + let moduleNameAndVersion = res[1]; + if (moduleNameAndVersion === '') { + moduleNameAndVersion = undefined; + } + return { classLoader, moduleNameAndVersion }; + } + return { classLoader: undefined, moduleNameAndVersion: undefined }; +} + + /***/ }), /***/ 1113: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JestJunitParser = void 0; const xml2js_1 = __nccwpck_require__(6189); @@ -1043,17 +1179,21 @@ class JestJunitParser { constructor(options) { this.options = options; } - async parse(path, content) { - const ju = await this.getJunitReport(path, content); - return this.getTestRunResult(path, ju); + parse(path, content) { + return __awaiter(this, void 0, void 0, function* () { + const ju = yield this.getJunitReport(path, content); + return this.getTestRunResult(path, ju); + }); } - async getJunitReport(path, content) { - try { - return (await xml2js_1.parseStringPromise(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } + getJunitReport(path, content) { + return __awaiter(this, void 0, void 0, function* () { + try { + return (yield (0, xml2js_1.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + }); } getTestRunResult(path, junit) { const suites = junit.testsuites.testsuite === undefined @@ -1068,6 +1208,9 @@ class JestJunitParser { return new test_results_1.TestRunResult(path, suites, time); } getGroups(suite) { + if (!suite.testcase) { + return []; + } const groups = []; for (const tc of suite.testcase) { let grp = groups.find(g => g.describe === tc.$.classname); @@ -1102,7 +1245,7 @@ class JestJunitParser { const details = tc.failure[0]; let path; let line; - const src = node_utils_1.getExceptionSource(details, this.options.trackedFiles, file => this.getRelativePath(file)); + const src = (0, node_utils_1.getExceptionSource)(details, this.options.trackedFiles, file => this.getRelativePath(file)); if (src) { path = src.path; line = src.line; @@ -1114,7 +1257,7 @@ class JestJunitParser { }; } getRelativePath(path) { - path = path_utils_1.normalizeFilePath(path); + path = (0, path_utils_1.normalizeFilePath)(path); const workDir = this.getWorkDir(path); if (workDir !== undefined && path.startsWith(workDir)) { path = path.substr(workDir.length); @@ -1123,7 +1266,7 @@ class JestJunitParser { } getWorkDir(path) { var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = path_utils_1.getBasePath(path, this.options.trackedFiles))); + return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.JestJunitParser = JestJunitParser; @@ -1132,10 +1275,19 @@ exports.JestJunitParser = JestJunitParser; /***/ }), /***/ 6043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MochaJsonParser = void 0; const test_results_1 = __nccwpck_require__(2768); @@ -1145,11 +1297,13 @@ class MochaJsonParser { constructor(options) { this.options = options; } - async parse(path, content) { - const mocha = this.getMochaJson(path, content); - const result = this.getTestRunResult(path, mocha); - result.sort(true); - return Promise.resolve(result); + parse(path, content) { + return __awaiter(this, void 0, void 0, function* () { + const mocha = this.getMochaJson(path, content); + const result = this.getTestRunResult(path, mocha); + result.sort(true); + return Promise.resolve(result); + }); } getMochaJson(path, content) { try { @@ -1203,7 +1357,7 @@ class MochaJsonParser { } let path; let line; - const src = node_utils_1.getExceptionSource(details, this.options.trackedFiles, file => this.getRelativePath(file)); + const src = (0, node_utils_1.getExceptionSource)(details, this.options.trackedFiles, file => this.getRelativePath(file)); if (src) { path = src.path; line = src.line; @@ -1216,7 +1370,7 @@ class MochaJsonParser { }; } getRelativePath(path) { - path = path_utils_1.normalizeFilePath(path); + path = (0, path_utils_1.normalizeFilePath)(path); const workDir = this.getWorkDir(path); if (workDir !== undefined && path.startsWith(workDir)) { path = path.substr(workDir.length); @@ -1225,7 +1379,7 @@ class MochaJsonParser { } getWorkDir(path) { var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = path_utils_1.getBasePath(path, this.options.trackedFiles))); + return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.MochaJsonParser = MochaJsonParser; @@ -1273,7 +1427,7 @@ function getAnnotations(results, maxCount) { suiteName: ts.name, testName: tg.name ? `${tg.name} ► ${tc.name}` : tc.name, details: err.details, - message: (_d = (_c = err.message) !== null && _c !== void 0 ? _c : parse_utils_1.getFirstNonEmptyLine(err.details)) !== null && _d !== void 0 ? _d : 'Test failed', + message: (_d = (_c = err.message) !== null && _c !== void 0 ? _c : (0, parse_utils_1.getFirstNonEmptyLine)(err.details)) !== null && _d !== void 0 ? _d : 'Test failed', path, line }); @@ -1288,7 +1442,7 @@ function getAnnotations(results, maxCount) { 'Failed test found in:', e.testRunPaths.map(p => ` ${p}`).join('\n'), 'Error:', - ident(markdown_utils_1.fixEol(e.message), ' ') + ident((0, markdown_utils_1.fixEol)(e.message), ' ') ].join('\n'); return enforceCheckRunLimits({ path: e.path, @@ -1296,7 +1450,7 @@ function getAnnotations(results, maxCount) { end_line: e.line, annotation_level: 'failure', title: `${e.suiteName} ► ${e.testName}`, - raw_details: markdown_utils_1.fixEol(e.details), + raw_details: (0, markdown_utils_1.fixEol)(e.details), message }); }); @@ -1304,10 +1458,10 @@ function getAnnotations(results, maxCount) { } exports.getAnnotations = getAnnotations; function enforceCheckRunLimits(err) { - err.title = markdown_utils_1.ellipsis(err.title || '', 255); - err.message = markdown_utils_1.ellipsis(err.message, 65535); + err.title = (0, markdown_utils_1.ellipsis)(err.title || '', 255); + err.message = (0, markdown_utils_1.ellipsis)(err.message, 65535); if (err.raw_details) { - err.raw_details = markdown_utils_1.ellipsis(err.raw_details, 65535); + err.raw_details = (0, markdown_utils_1.ellipsis)(err.raw_details, 65535); } return err; } @@ -1328,7 +1482,11 @@ function ident(text, prefix) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1349,6 +1507,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getReport = void 0; const core = __importStar(__nccwpck_require__(2186)); const markdown_utils_1 = __nccwpck_require__(6482); +const node_utils_1 = __nccwpck_require__(5824); const parse_utils_1 = __nccwpck_require__(7811); const slugger_1 = __nccwpck_require__(3328); const MAX_REPORT_LENGTH = 65535; @@ -1361,7 +1520,7 @@ const defaultOptions = { function getReport(results, options = defaultOptions) { core.info('Generating check run summary'); applySort(results); - const opts = { ...options }; + const opts = Object.assign({}, options); let lines = renderReport(results, opts); let report = lines.join('\n'); if (getByteLength(report) <= MAX_REPORT_LENGTH) { @@ -1407,9 +1566,9 @@ function trimReport(lines) { return reportLines.join('\n'); } function applySort(results) { - results.sort((a, b) => a.path.localeCompare(b.path)); + results.sort((a, b) => a.path.localeCompare(b.path, node_utils_1.DEFAULT_LOCALE)); for (const res of results) { - res.suites.sort((a, b) => a.name.localeCompare(b.name)); + res.suites.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); } } function getByteLength(text) { @@ -1456,16 +1615,16 @@ function getTestRunsReport(testRuns, options) { const sections = []; if (testRuns.length > 1 || options.onlySummary) { const tableData = testRuns.map((tr, runIndex) => { - const time = markdown_utils_1.formatTime(tr.time); + const time = (0, markdown_utils_1.formatTime)(tr.time); const name = tr.path; const addr = options.baseUrl + makeRunSlug(runIndex).link; - const nameLink = markdown_utils_1.link(name, addr); + const nameLink = (0, markdown_utils_1.link)(name, addr); const passed = tr.passed > 0 ? `${tr.passed}${markdown_utils_1.Icon.success}` : ''; const failed = tr.failed > 0 ? `${tr.failed}${markdown_utils_1.Icon.fail}` : ''; const skipped = tr.skipped > 0 ? `${tr.skipped}${markdown_utils_1.Icon.skip}` : ''; return [nameLink, passed, failed, skipped, time]; }); - const resultsTable = markdown_utils_1.table(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData); + const resultsTable = (0, markdown_utils_1.table)(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData); sections.push(resultsTable); } if (options.onlySummary === false) { @@ -1480,19 +1639,19 @@ function getSuitesReport(tr, runIndex, options) { const nameLink = `${tr.path}`; const icon = getResultIcon(tr.result); sections.push(`## ${icon}\xa0${nameLink}`); - const time = markdown_utils_1.formatTime(tr.time); + const time = (0, markdown_utils_1.formatTime)(tr.time); const headingLine2 = tr.tests > 0 ? `**${tr.tests}** tests were completed in **${time}** with **${tr.passed}** passed, **${tr.failed}** failed and **${tr.skipped}** skipped.` : 'No tests found'; sections.push(headingLine2); const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites; if (suites.length > 0) { - const suitesTable = markdown_utils_1.table(['Test suite', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...suites.map((s, suiteIndex) => { - const tsTime = markdown_utils_1.formatTime(s.time); + const suitesTable = (0, markdown_utils_1.table)(['Test suite', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...suites.map((s, suiteIndex) => { + const tsTime = (0, markdown_utils_1.formatTime)(s.time); const tsName = s.name; const skipLink = options.listTests === 'none' || (options.listTests === 'failed' && s.result !== 'failed'); const tsAddr = options.baseUrl + makeSuiteSlug(runIndex, suiteIndex).link; - const tsNameLink = skipLink ? tsName : markdown_utils_1.link(tsName, tsAddr); + const tsNameLink = skipLink ? tsName : (0, markdown_utils_1.link)(tsName, tsAddr); const passed = s.passed > 0 ? `${s.passed}${markdown_utils_1.Icon.success}` : ''; const failed = s.failed > 0 ? `${s.failed}${markdown_utils_1.Icon.fail}` : ''; const skipped = s.skipped > 0 ? `${s.skipped}${markdown_utils_1.Icon.skip}` : ''; @@ -1533,7 +1692,7 @@ function getTestsReport(ts, runIndex, suiteIndex, options) { const result = getResultIcon(tc.result); sections.push(`${space}${result} ${tc.name}`); if (tc.error) { - const lines = (_c = ((_a = tc.error.message) !== null && _a !== void 0 ? _a : (_b = parse_utils_1.getFirstNonEmptyLine(tc.error.details)) === null || _b === void 0 ? void 0 : _b.trim())) === null || _c === void 0 ? void 0 : _c.split(/\r?\n/g).map(l => '\t' + l); + const lines = (_c = ((_a = tc.error.message) !== null && _a !== void 0 ? _a : (_b = (0, parse_utils_1.getFirstNonEmptyLine)(tc.error.details)) === null || _b === void 0 ? void 0 : _b.trim())) === null || _c === void 0 ? void 0 : _c.split(/\r?\n/g).map(l => '\t' + l); if (lines) { sections.push(...lines); } @@ -1545,11 +1704,11 @@ function getTestsReport(ts, runIndex, suiteIndex, options) { } function makeRunSlug(runIndex) { // use prefix to avoid slug conflicts after escaping the paths - return slugger_1.slug(`r${runIndex}`); + return (0, slugger_1.slug)(`r${runIndex}`); } function makeSuiteSlug(runIndex, suiteIndex) { // use prefix to avoid slug conflicts after escaping the paths - return slugger_1.slug(`r${runIndex}s${suiteIndex}`); + return (0, slugger_1.slug)(`r${runIndex}s${suiteIndex}`); } function getResultIcon(result) { switch (result) { @@ -1568,12 +1727,13 @@ function getResultIcon(result) { /***/ }), /***/ 2768: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TestCaseResult = exports.TestGroupResult = exports.TestSuiteResult = exports.TestRunResult = void 0; +const node_utils_1 = __nccwpck_require__(5824); class TestRunResult { constructor(path, suites, totalTime) { this.path = path; @@ -1603,7 +1763,7 @@ class TestRunResult { return this.suites.filter(s => s.result === 'failed'); } sort(deep) { - this.suites.sort((a, b) => a.name.localeCompare(b.name)); + this.suites.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); if (deep) { for (const suite of this.suites) { suite.sort(deep); @@ -1641,7 +1801,7 @@ class TestSuiteResult { return this.groups.filter(grp => grp.result === 'failed'); } sort(deep) { - this.groups.sort((a, b) => { var _a, _b; return ((_a = a.name) !== null && _a !== void 0 ? _a : '').localeCompare((_b = b.name) !== null && _b !== void 0 ? _b : ''); }); + this.groups.sort((a, b) => { var _a, _b; return ((_a = a.name) !== null && _a !== void 0 ? _a : '').localeCompare((_b = b.name) !== null && _b !== void 0 ? _b : '', node_utils_1.DEFAULT_LOCALE); }); if (deep) { for (const grp of this.groups) { grp.sort(); @@ -1674,7 +1834,7 @@ class TestGroupResult { return this.tests.filter(tc => tc.result === 'failed'); } sort() { - this.tests.sort((a, b) => a.name.localeCompare(b.name)); + this.tests.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); } } exports.TestGroupResult = TestGroupResult; @@ -1689,31 +1849,6 @@ class TestCaseResult { exports.TestCaseResult = TestCaseResult; -/***/ }), - -/***/ 6069: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const exec_1 = __nccwpck_require__(1514); -// Wraps original exec() function -// Returns exit code and whole stdout/stderr -async function exec(commandLine, args, options) { - options = options || {}; - let stdout = ''; - let stderr = ''; - options.listeners = { - stdout: (data) => (stdout += data.toString()), - stderr: (data) => (stderr += data.toString()) - }; - const code = await exec_1.exec(commandLine, args, options); - return { code, stdout, stderr }; -} -exports.default = exec; - - /***/ }), /***/ 9844: @@ -1723,7 +1858,11 @@ exports.default = exec; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1740,24 +1879,32 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.listFiles = void 0; -const core = __importStar(__nccwpck_require__(2186)); -const exec_1 = __importDefault(__nccwpck_require__(6069)); -async function listFiles() { - core.startGroup('Listing all files tracked by git'); - let output = ''; - try { - output = (await exec_1.default('git', ['ls-files', '-z'])).stdout; - } - finally { - fixStdOutNullTermination(); - core.endGroup(); - } - return output.split('\u0000').filter(s => s.length > 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.listFiles = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const exec_1 = __nccwpck_require__(1514); +function listFiles() { + return __awaiter(this, void 0, void 0, function* () { + core.startGroup('Listing all files tracked by git'); + let output = ''; + try { + output = (yield (0, exec_1.getExecOutput)('git', ['ls-files', '-z'])).stdout; + } + finally { + fixStdOutNullTermination(); + core.endGroup(); + } + return output.split('\u0000').filter(s => s.length > 0); + }); } exports.listFiles = listFiles; function fixStdOutNullTermination() { @@ -1777,7 +1924,11 @@ function fixStdOutNullTermination() { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1794,18 +1945,27 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.listFiles = exports.downloadArtifact = exports.getCheckRunContext = void 0; -const fs_1 = __nccwpck_require__(5747); +const fs_1 = __nccwpck_require__(7147); const core = __importStar(__nccwpck_require__(2186)); const github = __importStar(__nccwpck_require__(5438)); -const stream = __importStar(__nccwpck_require__(2413)); -const util_1 = __nccwpck_require__(1669); +const stream = __importStar(__nccwpck_require__(2781)); +const util_1 = __nccwpck_require__(3837); const got_1 = __importDefault(__nccwpck_require__(3061)); -const asyncStream = util_1.promisify(stream.pipeline); +const asyncStream = (0, util_1.promisify)(stream.pipeline); function getCheckRunContext() { if (github.context.eventName === 'workflow_run') { core.info('Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow'); @@ -1827,91 +1987,83 @@ function getCheckRunContext() { return { sha: github.context.sha, runId }; } exports.getCheckRunContext = getCheckRunContext; -async function downloadArtifact(octokit, artifactId, fileName, token) { - core.startGroup(`Downloading artifact ${fileName}`); - try { - core.info(`Artifact ID: ${artifactId}`); - const req = octokit.actions.downloadArtifact.endpoint({ - ...github.context.repo, - artifact_id: artifactId, - archive_format: 'zip' - }); - const headers = { - Authorization: `Bearer ${token}` - }; - const resp = await got_1.default(req.url, { - headers, - followRedirect: false - }); - core.info(`Fetch artifact URL: ${resp.statusCode} ${resp.statusMessage}`); - if (resp.statusCode !== 302) { - throw new Error('Fetch artifact URL failed: received unexpected status code'); - } - const url = resp.headers.location; - if (url === undefined) { - const receivedHeaders = Object.keys(resp.headers); - core.info(`Received headers: ${receivedHeaders.join(', ')}`); - throw new Error('Location header was not found in API response'); - } - if (typeof url !== 'string') { - throw new Error(`Location header has unexpected value: ${url}`); - } - const downloadStream = got_1.default.stream(url, { headers }); - const fileWriterStream = fs_1.createWriteStream(fileName); - core.info(`Downloading ${url}`); - downloadStream.on('downloadProgress', ({ transferred }) => { - core.info(`Progress: ${transferred} B`); - }); - await asyncStream(downloadStream, fileWriterStream); - } - finally { - core.endGroup(); - } +function downloadArtifact(octokit, artifactId, fileName, token) { + return __awaiter(this, void 0, void 0, function* () { + core.startGroup(`Downloading artifact ${fileName}`); + try { + core.info(`Artifact ID: ${artifactId}`); + const req = octokit.rest.actions.downloadArtifact.endpoint(Object.assign(Object.assign({}, github.context.repo), { artifact_id: artifactId, archive_format: 'zip' })); + const headers = { + Authorization: `Bearer ${token}` + }; + const resp = yield (0, got_1.default)(req.url, { + headers, + followRedirect: false + }); + core.info(`Fetch artifact URL: ${resp.statusCode} ${resp.statusMessage}`); + if (resp.statusCode !== 302) { + throw new Error('Fetch artifact URL failed: received unexpected status code'); + } + const url = resp.headers.location; + if (url === undefined) { + const receivedHeaders = Object.keys(resp.headers); + core.info(`Received headers: ${receivedHeaders.join(', ')}`); + throw new Error('Location header was not found in API response'); + } + if (typeof url !== 'string') { + throw new Error(`Location header has unexpected value: ${url}`); + } + const downloadStream = got_1.default.stream(url, { headers }); + const fileWriterStream = (0, fs_1.createWriteStream)(fileName); + core.info(`Downloading ${url}`); + downloadStream.on('downloadProgress', ({ transferred }) => { + core.info(`Progress: ${transferred} B`); + }); + yield asyncStream(downloadStream, fileWriterStream); + } + finally { + core.endGroup(); + } + }); } exports.downloadArtifact = downloadArtifact; -async function listFiles(octokit, sha) { - core.startGroup('Fetching list of tracked files from GitHub'); - try { - const commit = await octokit.git.getCommit({ - commit_sha: sha, - ...github.context.repo - }); - const files = await listGitTree(octokit, commit.data.tree.sha, ''); - return files; - } - finally { - core.endGroup(); - } +function listFiles(octokit, sha) { + return __awaiter(this, void 0, void 0, function* () { + core.startGroup('Fetching list of tracked files from GitHub'); + try { + const commit = yield octokit.rest.git.getCommit(Object.assign({ commit_sha: sha }, github.context.repo)); + const files = yield listGitTree(octokit, commit.data.tree.sha, ''); + return files; + } + finally { + core.endGroup(); + } + }); } exports.listFiles = listFiles; -async function listGitTree(octokit, sha, path) { - const pathLog = path ? ` at ${path}` : ''; - core.info(`Fetching tree ${sha}${pathLog}`); - let truncated = false; - let tree = await octokit.git.getTree({ - recursive: 'true', - tree_sha: sha, - ...github.context.repo - }); - if (tree.data.truncated) { - truncated = true; - tree = await octokit.git.getTree({ - tree_sha: sha, - ...github.context.repo - }); - } - const result = []; - for (const tr of tree.data.tree) { - const file = `${path}${tr.path}`; - if (tr.type === 'blob') { - result.push(file); +function listGitTree(octokit, sha, path) { + return __awaiter(this, void 0, void 0, function* () { + const pathLog = path ? ` at ${path}` : ''; + core.info(`Fetching tree ${sha}${pathLog}`); + let truncated = false; + let tree = yield octokit.rest.git.getTree(Object.assign({ recursive: 'true', tree_sha: sha }, github.context.repo)); + if (tree.data.truncated) { + truncated = true; + tree = yield octokit.rest.git.getTree(Object.assign({ tree_sha: sha }, github.context.repo)); } - else if (tr.type === 'tree' && truncated) { - const files = await listGitTree(octokit, tr.sha, `${file}/`); - result.push(...files); + const result = []; + for (const tr of tree.data.tree) { + const file = `${path}${tr.path}`; + if (tr.type === 'blob') { + result.push(file); + } + else if (tr.type === 'tree' && truncated) { + const files = yield listGitTree(octokit, tr.sha, `${file}/`); + result.push(...files); + } } - } - return result; + return result; + }); } @@ -1932,8 +2084,8 @@ var Align; Align["None"] = "---"; })(Align = exports.Align || (exports.Align = {})); exports.Icon = { - skip: '✖️', - success: '✔️', + skip: '⚪', + success: '✅', fail: '❌' // ':x:' }; function link(title, address) { @@ -1980,8 +2132,9 @@ exports.formatTime = formatTime; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExceptionSource = void 0; +exports.getExceptionSource = exports.DEFAULT_LOCALE = void 0; const path_utils_1 = __nccwpck_require__(4070); +exports.DEFAULT_LOCALE = 'en-US'; function getExceptionSource(stackTrace, trackedFiles, getRelativePath) { const lines = stackTrace.split(/\r?\n/); const re = /\((.*):(\d+):\d+\)$/; @@ -1989,7 +2142,7 @@ function getExceptionSource(stackTrace, trackedFiles, getRelativePath) { const match = str.match(re); if (match !== null) { const [_, fileStr, lineStr] = match; - const filePath = path_utils_1.normalizeFilePath(fileStr); + const filePath = (0, path_utils_1.normalizeFilePath)(fileStr); if (filePath.startsWith('internal/') || filePath.includes('/node_modules/')) { continue; } @@ -2119,15 +2272,28 @@ exports.slug = slug; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const os = __importStar(__nccwpck_require__(2087)); +exports.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -2205,6 +2371,25 @@ function escapeProperty(s) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -2214,19 +2399,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2087)); -const path = __importStar(__nccwpck_require__(5622)); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action */ @@ -2255,13 +2435,9 @@ function exportVariable(name, val) { process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); - } - else { - command_1.issueCommand('set-env', { name }, convertedVal); + return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); } + command_1.issueCommand('set-env', { name }, convertedVal); } exports.exportVariable = exportVariable; /** @@ -2279,7 +2455,7 @@ exports.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueCommand('PATH', inputPath); + file_command_1.issueFileCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); @@ -2288,7 +2464,9 @@ function addPath(inputPath) { } exports.addPath = addPath; /** - * Gets the value of an input. The value is also trimmed. + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. * * @param name name of the input to get * @param options optional. See InputOptions. @@ -2299,9 +2477,52 @@ function getInput(name, options) { if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } + if (options && options.trimWhitespace === false) { + return val; + } return val.trim(); } exports.getInput = getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map(input => input.trim()); +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; /** * Sets the value of an output. * @@ -2310,7 +2531,12 @@ exports.getInput = getInput; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { - command_1.issueCommand('set-output', { name }, value); + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + } + process.stdout.write(os.EOL); + command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); } exports.setOutput = setOutput; /** @@ -2356,19 +2582,30 @@ exports.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. */ -function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); +function error(message, properties = {}) { + command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } exports.error = error; /** - * Adds an warning issue + * Adds a warning issue * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. */ -function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); +function warning(message, properties = {}) { + command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } exports.warning = warning; +/** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function notice(message, properties = {}) { + command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.notice = notice; /** * Writes info to log with console.log. * @param message info message @@ -2428,7 +2665,11 @@ exports.group = group; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + } + command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); } exports.saveState = saveState; /** @@ -2441,6 +2682,29 @@ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; +function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); +} +exports.getIDToken = getIDToken; +/** + * Summary exports + */ +var summary_1 = __nccwpck_require__(1327); +Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); +/** + * @deprecated use core.summary + */ +var summary_2 = __nccwpck_require__(1327); +Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); +/** + * Path exports + */ +var path_utils_1 = __nccwpck_require__(2981); +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); //# sourceMappingURL=core.js.map /***/ }), @@ -2451,20 +2715,34 @@ exports.getState = getState; "use strict"; // For internal use, subject to change. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(5747)); -const os = __importStar(__nccwpck_require__(2087)); +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); +const uuid_1 = __nccwpck_require__(5840); const utils_1 = __nccwpck_require__(5278); -function issueCommand(command, message) { +function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); @@ -2476,38 +2754,27 @@ function issueCommand(command, message) { encoding: 'utf8' }); } -exports.issueCommand = issueCommand; -//# sourceMappingURL=file-command.js.map - -/***/ }), - -/***/ 5278: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; +exports.issueFileCommand = issueFileCommand; +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - else if (typeof input === 'string' || input instanceof String) { - return input; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return JSON.stringify(input); + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } -exports.toCommandValue = toCommandValue; -//# sourceMappingURL=utils.js.map +exports.prepareKeyValueMessage = prepareKeyValueMessage; +//# sourceMappingURL=file-command.js.map /***/ }), -/***/ 1514: +/***/ 8041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2521,708 +2788,479 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tr = __importStar(__nccwpck_require__(8159)); -/** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code - */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); +exports.OidcClient = void 0; +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); +const core_1 = __nccwpck_require__(2186); +class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient + .getJson(id_token_url) + .catch(error => { + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n + Error Message: ${error.result.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } + catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } } -exports.exec = exec; -//# sourceMappingURL=exec.js.map +exports.OidcClient = OidcClient; +//# sourceMappingURL=oidc-utils.js.map /***/ }), -/***/ 8159: +/***/ 2981: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const os = __importStar(__nccwpck_require__(2087)); -const events = __importStar(__nccwpck_require__(8614)); -const child = __importStar(__nccwpck_require__(3129)); -const path = __importStar(__nccwpck_require__(5622)); -const io = __importStar(__nccwpck_require__(7436)); -const ioUtil = __importStar(__nccwpck_require__(1962)); -/* eslint-disable @typescript-eslint/unbound-method */ -const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. +exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; +const path = __importStar(__nccwpck_require__(1017)); +/** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } +function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); +} +exports.toPosixPath = toPosixPath; +/** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ +function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); +} +exports.toWin32Path = toWin32Path; +/** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ +function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); +} +exports.toPlatformPath = toPlatformPath; +//# sourceMappingURL=path-utils.js.map + +/***/ }), + +/***/ 1327: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); +const { access, appendFile, writeFile } = fs_1.promises; +exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; +exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; +class Summary { + constructor() { + this._buffer = ''; } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } - // Windows (regular) - else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); } - } - else { - // OSX/Linux - this can likely be improved with some form of quoting. - // creating processes on Unix is fundamentally different than Windows. - // on Unix, execvp() takes an arg array. - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; + catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } - } - return cmd; + this._filePath = pathFromEnv; + return this._filePath; + }); } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); - } - strBuffer = s; - } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug(`error processing line. Failed with error ${err}`); + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; } + return `<${tag}${htmlAttrs}>${content}`; } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } - } - return this.toolPath; + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ''; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, (lang && { lang })); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map(item => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map(row => { + const cells = row + .map(cell => { + if (typeof cell === 'string') { + return this.wrap('td', cell); } - argline += '"'; - return [argline]; - } - } - return this.args; + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); } - _endsWith(str, end) { - return str.endsWith(end); + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; - } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', - "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; - break; - } - } - // short-circuit if quotes not needed - if (!needsQuotes) { - return arg; - } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; - } - } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + ? tag + : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { - // Need double quotation for empty argument - return '""'; - } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { - // No quotation needed - return arg; - } - if (!arg.includes('"') && !arg.includes('\\')) { - // No embedded double quotes or backslashes, so I can just wrap - // quote marks around the whole thing. - return `"${arg}"`; - } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; - } - else { - quoteHit = false; - } - } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = - options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, (cite && { cite })); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); } /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code + * Adds an HTML anchor tag to the summary buffer * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - // root the tool path if it is unrooted and contains relative pathing - if (!ioUtil.isRooted(this.toolPath) && - (this.toolPath.includes('/') || - (IS_WINDOWS && this.toolPath.includes('\\')))) { - // prefer options.cwd if it is specified, however options.cwd may also need to be rooted - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - // if the tool is only a file name, then resolve it from the PATH - // otherwise verify it exists (add extension on Windows if necessary) - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => { - this._debug(`exec tool: ${this.toolPath}`); - this._debug('arguments:'); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', (message) => { - this._debug(message); - }); - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - const stdbuffer = ''; - if (cp.stdout) { - cp.stdout.on('data', (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - const errbuffer = ''; - if (cp.stderr) { - cp.stderr.on('data', (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && - optionsNonNull.errStream && - optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr - ? optionsNonNull.errStream - : optionsNonNull.outStream; - s.write(data); - } - this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on('error', (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on('exit', (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on('close', (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on('done', (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } - else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error('child process missing stdin'); - } - cp.stdin.end(this.options.input); - } - }); - }); + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); } } -exports.ToolRunner = ToolRunner; +const _summary = new Summary(); /** - * Convert an arg string to an array of args. Handles escaping - * - * @param argString string of arguments - * @returns string[] array of arguments + * @deprecated use `core.summary` */ -function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ''; - function append(c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); - } - continue; - } - if (c === '\\' && escaped) { - append(c); - continue; - } - if (c === '\\' && inQuotes) { - escaped = true; - continue; - } - if (c === ' ' && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ''; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; -} -exports.argStringToArray = argStringToArray; -class ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; // tracks whether the process has exited and stdio is closed - this.processError = ''; - this.processExitCode = 0; - this.processExited = false; // tracks whether the process has exited - this.processStderr = false; // tracks whether stderr was written to - this.delay = 10000; // 10 seconds - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } - else if (this.processExited) { - this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit('debug', message); - } - _setResult() { - // determine whether there is an error - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } - else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - // clear the timeout - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit('done', error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / - 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); - } -} -//# sourceMappingURL=toolrunner.js.map +exports.markdownSummary = _summary; +exports.summary = _summary; +//# sourceMappingURL=summary.js.map /***/ }), -/***/ 4087: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5278: +/***/ ((__unused_webpack_module, exports) => { "use strict"; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Context = void 0; -const fs_1 = __nccwpck_require__(5747); -const os_1 = __nccwpck_require__(2087); -class Context { - /** - * Hydrate the context from the environment - */ - constructor() { - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); - } - else { - const path = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); - } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - this.job = process.env.GITHUB_JOB; - this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); - this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); +exports.toCommandProperties = exports.toCommandValue = void 0; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); + else if (typeof input === 'string' || input instanceof String) { + return input; } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +/** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; } -exports.Context = Context; -//# sourceMappingURL=context.js.map +exports.toCommandProperties = toCommandProperties; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 5438: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3242,80 +3280,97 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOctokit = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(4087)); -const utils_1 = __nccwpck_require__(3030); -exports.context = new Context.Context(); +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(1576); +const tr = __importStar(__nccwpck_require__(8159)); /** - * Returns a hydrated octokit ready to use for GitHub Actions + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code * - * @param token the repo PAT or GITHUB_TOKEN - * @param options other options to set + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code */ -function getOctokit(token, options) { - return new utils_1.GitHub(utils_1.getOctokitOptions(token, options)); +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); } -exports.getOctokit = getOctokit; -//# sourceMappingURL=github.js.map - -/***/ }), - -/***/ 7914: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(9925)); -function getAuthString(token, options) { - if (!token && !options.auth) { - throw new Error('Parameter token or opts.auth is required'); - } - else if (token && options.auth) { - throw new Error('Parameters token and opts.auth may not both be specified'); - } - return typeof options.auth === 'string' ? options.auth : `token ${token}`; -} -exports.getAuthString = getAuthString; -function getProxyAgent(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgent(destinationUrl); -} -exports.getProxyAgent = getProxyAgent; -function getApiBaseUrl() { - return process.env['GITHUB_API_URL'] || 'https://api.github.com'; +exports.exec = exec; +/** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); } -exports.getApiBaseUrl = getApiBaseUrl; -//# sourceMappingURL=utils.js.map +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map /***/ }), -/***/ 3030: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3335,3854 +3390,4814 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOctokitOptions = exports.GitHub = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(4087)); -const Utils = __importStar(__nccwpck_require__(7914)); -// octokit + plugins -const core_1 = __nccwpck_require__(6762); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044); -const plugin_paginate_rest_1 = __nccwpck_require__(4193); -exports.context = new Context.Context(); -const baseUrl = Utils.getApiBaseUrl(); -const defaults = { - baseUrl, - request: { - agent: Utils.getProxyAgent(baseUrl) - } +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; -exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults); -/** - * Convience function to correctly format Octokit Options to pass into the constructor. - * - * @param token the repo PAT or GITHUB_TOKEN - * @param options other options to set - */ -function getOctokitOptions(token, options) { - const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller - // Auth - const auth = Utils.getAuthString(token, opts); - if (auth) { - opts.auth = auth; - } - return opts; -} -exports.getOctokitOptions = getOctokitOptions; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 9925: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const pm = __nccwpck_require__(6443); -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com +exports.argStringToArray = exports.ToolRunner = void 0; +const os = __importStar(__nccwpck_require__(2037)); +const events = __importStar(__nccwpck_require__(2361)); +const child = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(9512); +/* eslint-disable @typescript-eslint/unbound-method */ +const IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ -function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; -} -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } -} -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; } - readBody() { - return new Promise(async (resolve, reject) => { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } + return cmd; } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - async getJson(requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - let res = await this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async postJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async putJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async patchJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - async request(verb, requestUrl, data, headers) { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - let parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - response = await this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - let parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol == 'https:' && - parsedUrl.protocol != parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - await response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (let header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = await this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - await response.readBody(); - await this._performExponentialBackoff(numTries); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; } - return response; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } } - this._disposed = true; + return this.toolPath; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof data === 'string') { - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); + argline += '"'; + return [argline]; } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); - }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); } + return this.args; } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - let parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); + _endsWith(str, end) { + return str.endsWith(end); } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - this.handlers.forEach(handler => { - handler.prepareRequest(info.options); - }); - } - return info; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - let proxyUrl = pm.getProxyUrl(parsedUrl); - let useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __nccwpck_require__(4294); + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`, - host: proxyUrl.hostname, - port: proxyUrl.port - } - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote } else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; } - return agent; - } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - async _processResponse(res, options) { - return new Promise(async (resolve, reject) => { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = await res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = 'Failed request: (' + statusCode + ')'; - } - let err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; } else { - resolve(response); + quoteHit = false; } - }); - } -} -exports.HttpClient = HttpClient; - - -/***/ }), - -/***/ 6443: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -function getProxyUrl(reqUrl) { - let usingSsl = reqUrl.protocol === 'https:'; - let proxyUrl; - if (checkBypass(reqUrl)) { - return proxyUrl; - } - let proxyVar; - if (usingSsl) { - proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; - } - else { - proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - if (proxyVar) { - proxyUrl = new URL(proxyVar); - } - return proxyUrl; -} -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; } - // Format the request hostname and hostname with port - let upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; } - // Compare request host against noproxy - for (let upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { - return true; - } - } - return false; -} -exports.checkBypass = checkBypass; - - -/***/ }), - -/***/ 1962: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var _a; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const assert_1 = __nccwpck_require__(2357); -const fs = __nccwpck_require__(5747); -const path = __nccwpck_require__(5622); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; -exports.IS_WINDOWS = process.platform === 'win32'; -function exists(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - try { - yield exports.stat(fsPath); - } - catch (err) { - if (err.code === 'ENOENT') { - return false; + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - throw err; - } - return true; - }); -} -exports.exists = exists; -function isDirectory(fsPath, useStat = false) { - return __awaiter(this, void 0, void 0, function* () { - const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); - return stats.isDirectory(); - }); -} -exports.isDirectory = isDirectory; -/** - * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: - * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). - */ -function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports.IS_WINDOWS) { - return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello - ); // e.g. C: or C:\hello - } - return p.startsWith('/'); -} -exports.isRooted = isRooted; -/** - * Recursively create a directory at `fsPath`. - * - * This implementation is optimistic, meaning it attempts to create the full - * path first, and backs up the path stack from there. - * - * @param fsPath The path to create - * @param maxDepth The maximum recursion depth - * @param depth The current recursion depth - */ -function mkdirP(fsPath, maxDepth = 1000, depth = 1) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, 'a path argument must be provided'); - fsPath = path.resolve(fsPath); - if (depth >= maxDepth) - return exports.mkdir(fsPath); - try { - yield exports.mkdir(fsPath); - return; - } - catch (err) { - switch (err.code) { - case 'ENOENT': { - yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); - yield exports.mkdir(fsPath); - return; + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); } - default: { - let stats; - try { - stats = yield exports.stat(fsPath); + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); } - catch (err2) { - throw err; + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); } - if (!stats.isDirectory()) - throw err; + cp.stdin.end(this.options.input); } - } - } - }); + })); + }); + } } -exports.mkdirP = mkdirP; +exports.ToolRunner = ToolRunner; /** - * Best effort attempt to determine whether a file exists and is executable. - * @param filePath file path to check - * @param extensions additional file extensions to try - * @return if file exists and is executable, returns the file path. otherwise empty string. + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments */ -function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = undefined; - try { - // test file exists - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // on Windows, test for valid extension - const upperExt = path.extname(filePath).toUpperCase(); - if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { - return filePath; - } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; } else { - if (isUnixExecutable(stats)) { - return filePath; - } + append(c); } + continue; } - // try each extension - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = undefined; - try { - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // preserve the case of the actual file (since an extension was appended) - try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); - for (const actualName of yield exports.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); - break; - } - } - } - catch (err) { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; - } - else { - if (isUnixExecutable(stats)) { - return filePath; - } - } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; } + continue; } - return ''; - }); -} -exports.tryGetExecutablePath = tryGetExecutablePath; -function normalizeSeparators(p) { - p = p || ''; - if (exports.IS_WINDOWS) { - // convert slashes on Windows - p = p.replace(/\//g, '\\'); - // remove redundant slashes - return p.replace(/\\\\+/g, '\\'); + append(c); } - // remove redundant slashes - return p.replace(/\/\/+/g, '/'); + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; } -// on Mac/Linux, test the execute bit -// R W X R W X R W X -// 256 128 64 32 16 8 4 2 1 -function isUnixExecutable(stats) { - return ((stats.mode & 1) > 0 || - ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || - ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } } -//# sourceMappingURL=io-util.js.map +//# sourceMappingURL=toolrunner.js.map /***/ }), -/***/ 7436: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 4087: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __nccwpck_require__(3129); -const path = __nccwpck_require__(5622); -const util_1 = __nccwpck_require__(1669); -const ioUtil = __nccwpck_require__(1962); -const exec = util_1.promisify(childProcess.exec); -/** - * Copies a file or folder. - * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js - * - * @param source source path - * @param dest destination path - * @param options optional. See CopyOptions. - */ -function cp(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - const { force, recursive } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - // Dest is an existing file, but not forcing - if (destStat && destStat.isFile() && !force) { - return; - } - // If dest is an existing directory, should copy inside. - const newDest = destStat && destStat.isDirectory() - ? path.join(dest, path.basename(source)) - : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); +exports.Context = void 0; +const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(2037); +class Context { + /** + * Hydrate the context from the environment + */ + constructor() { + var _a, _b, _c; + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) { + if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { + this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); } else { - yield cpDirRecursive(source, newDest, 0, force); + const path = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); } } - else { - if (path.relative(source, newDest) === '') { - // a file cannot be copied to itself - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); + this.eventName = process.env.GITHUB_EVENT_NAME; + this.sha = process.env.GITHUB_SHA; + this.ref = process.env.GITHUB_REF; + this.workflow = process.env.GITHUB_WORKFLOW; + this.action = process.env.GITHUB_ACTION; + this.actor = process.env.GITHUB_ACTOR; + this.job = process.env.GITHUB_JOB; + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; + this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; + } + get issue() { + const payload = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); + } + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); + return { owner, repo }; } - }); + if (this.payload.repository) { + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name + }; + } + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + } } -exports.cp = cp; +exports.Context = Context; +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 5438: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOctokit = exports.context = void 0; +const Context = __importStar(__nccwpck_require__(4087)); +const utils_1 = __nccwpck_require__(3030); +exports.context = new Context.Context(); /** - * Moves a path. + * Returns a hydrated octokit ready to use for GitHub Actions * - * @param source source path - * @param dest destination path - * @param options optional. See MoveOptions. - */ -function mv(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - // If dest is directory copy src into dest - dest = path.join(dest, path.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } - else { - throw new Error('Destination already exists'); - } - } - } - yield mkdirP(path.dirname(dest)); - yield ioUtil.rename(source, dest); - }); -} -exports.mv = mv; -/** - * Remove a path recursively with force - * - * @param inputPath path to remove - */ -function rmRF(inputPath) { - return __awaiter(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. - try { - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`rd /s /q "${inputPath}"`); - } - else { - yield exec(`del /f /a "${inputPath}"`); - } - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield exec(`rm -rf "${inputPath}"`); - } - else { - yield ioUtil.unlink(inputPath); - } - } - }); -} -exports.rmRF = rmRF; -/** - * Make a directory. Creates the full path with folders in between - * Will throw if it fails - * - * @param fsPath path to create - * @returns Promise - */ -function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - yield ioUtil.mkdirP(fsPath); - }); -} -exports.mkdirP = mkdirP; -/** - * Returns path of a tool had the tool actually been invoked. Resolves via paths. - * If you check and the tool does not exist, it will throw. - * - * @param tool name of the tool - * @param check whether to check if tool exists - * @returns Promise path to tool + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set */ -function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - // recursive when check=true - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } - else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } - } - } - try { - // build the list of extensions to try - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env.PATHEXT) { - for (const extension of process.env.PATHEXT.split(path.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - // if it's rooted, return it if exists. otherwise return empty. - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return filePath; - } - return ''; - } - // if any path separators, return empty - if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) { - return ''; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, - // it feels like we should not do this. Checking the current directory seems like more of a use - // case of a shell, and the which() function exposed by the toolkit should strive for consistency - // across platforms. - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } - } - } - // return the first match - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions); - if (filePath) { - return filePath; - } - } - return ''; - } - catch (err) { - throw new Error(`which failed with message ${err.message}`); - } - }); -} -exports.which = which; -function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - return { force, recursive }; -} -function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter(this, void 0, void 0, function* () { - // Ensure there is not a run away recursive copy - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - // Recurse - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } - else { - yield copyFile(srcFile, destFile, force); - } - } - // Change the mode for the newly created directory - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); -} -// Buffered file copy -function copyFile(srcFile, destFile, force) { - return __awaiter(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - // unlink/re-link it - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } - catch (e) { - // Try to override file permission - if (e.code === 'EPERM') { - yield ioUtil.chmod(destFile, '0666'); - yield ioUtil.unlink(destFile); - } - // other errors = it doesn't exist, no work to do - } - // Copy over symlink - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); - } - else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); - } - }); +function getOctokit(token, options) { + return new utils_1.GitHub(utils_1.getOctokitOptions(token, options)); } -//# sourceMappingURL=io.js.map +exports.getOctokit = getOctokit; +//# sourceMappingURL=github.js.map /***/ }), -/***/ 3803: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7914: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = __nccwpck_require__(5747); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; +const httpClient = __importStar(__nccwpck_require__(6255)); +function getAuthString(token, options) { + if (!token && !options.auth) { + throw new Error('Parameter token or opts.auth is required'); } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + else if (token && options.auth) { + throw new Error('Parameters token and opts.auth may not both be specified'); + } + return typeof options.auth === 'string' ? options.auth : `token ${token}`; } -exports.createFileSystemAdapter = createFileSystemAdapter; - +exports.getAuthString = getAuthString; +function getProxyAgent(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgent(destinationUrl); +} +exports.getProxyAgent = getProxyAgent; +function getApiBaseUrl() { + return process.env['GITHUB_API_URL'] || 'https://api.github.com'; +} +exports.getApiBaseUrl = getApiBaseUrl; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 8838: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; -const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); -const MAJOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); -const MINOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); -const SUPPORTED_MAJOR_VERSION = 10; -const SUPPORTED_MINOR_VERSION = 10; -const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; -const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; -/** - * IS `true` for Node.js 10.10 and greater. - */ -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; - - -/***/ }), - -/***/ 5667: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3030: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Settings = exports.scandirSync = exports.scandir = void 0; -const async = __nccwpck_require__(4507); -const sync = __nccwpck_require__(9560); -const settings_1 = __nccwpck_require__(8662); -exports.Settings = settings_1.default; -function scandir(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - return async.read(path, getSettings(), optionsOrSettingsOrCallback); +exports.getOctokitOptions = exports.GitHub = exports.context = void 0; +const Context = __importStar(__nccwpck_require__(4087)); +const Utils = __importStar(__nccwpck_require__(7914)); +// octokit + plugins +const core_1 = __nccwpck_require__(6762); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044); +const plugin_paginate_rest_1 = __nccwpck_require__(4193); +exports.context = new Context.Context(); +const baseUrl = Utils.getApiBaseUrl(); +const defaults = { + baseUrl, + request: { + agent: Utils.getProxyAgent(baseUrl) } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.scandir = scandir; -function scandirSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.scandirSync = scandirSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; +}; +exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults); +/** + * Convience function to correctly format Octokit Options to pass into the constructor. + * + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set + */ +function getOctokitOptions(token, options) { + const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller + // Auth + const auth = Utils.getAuthString(token, opts); + if (auth) { + opts.auth = auth; } - return new settings_1.default(settingsOrOptions); + return opts; } - +exports.getOctokitOptions = getOctokitOptions; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 4507: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5526: +/***/ (function(__unused_webpack_module, exports) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = __nccwpck_require__(109); -const rpl = __nccwpck_require__(5288); -const constants_1 = __nccwpck_require__(8838); -const utils = __nccwpck_require__(6297); -const common = __nccwpck_require__(3847); -function read(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings, callback); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; } - return readdir(directory, settings, callback); -} -exports.read = read; -function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - return callFailureCallback(callback, readdirError); - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - return callSuccessCallback(callback, entries); + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - return callFailureCallback(callback, rplError); - } - callSuccessCallback(callback, rplEntries); + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); }); - }); + } } -exports.readdirWithFileTypes = readdirWithFileTypes; -function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - return done(null, entry); +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - return done(statError); - } - return done(null, entry); - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - return done(null, entry); + options.headers['Authorization'] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); }); - }; + } } -function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - return callFailureCallback(callback, readdirError); +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); } - const filepaths = names.map((name) => common.joinPathSegments(directory, name, settings.pathSegmentSeparator)); - const tasks = filepaths.map((filepath) => { - return (done) => fsStat.stat(filepath, settings.fsStatSettings, done); - }); - rpl(tasks, (rplError, results) => { - if (rplError !== null) { - return callFailureCallback(callback, rplError); - } - const entries = []; - names.forEach((name, index) => { - const stats = results[index]; - const entry = { - name, - path: filepaths[index], - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - entries.push(entry); - }); - callSuccessCallback(callback, entries); + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); }); - }); -} -exports.readdir = readdir; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} - - -/***/ }), - -/***/ 3847: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.joinPathSegments = void 0; -function joinPathSegments(a, b, separator) { - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; } - return a + separator + b; } -exports.joinPathSegments = joinPathSegments; - +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map /***/ }), -/***/ 9560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6255: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = __nccwpck_require__(109); -const constants_1 = __nccwpck_require__(8838); -const utils = __nccwpck_require__(6297); -const common = __nccwpck_require__(3847); -function read(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); -} -exports.read = read; -function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } - catch (error) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error; - } - } - } - return entry; +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); -} -exports.readdir = readdir; - - -/***/ }), - -/***/ 8662: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(5622); -const fsStat = __nccwpck_require__(109); -const fs = __nccwpck_require__(3803); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; } -exports.default = Settings; - - -/***/ }), - -/***/ 883: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); } } -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; - - -/***/ }), - -/***/ 6297: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fs = void 0; -const fs = __nccwpck_require__(883); -exports.fs = fs; - - -/***/ }), - -/***/ 2987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = __nccwpck_require__(5747); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; - - -/***/ }), - -/***/ 109: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.statSync = exports.stat = exports.Settings = void 0; -const async = __nccwpck_require__(4147); -const sync = __nccwpck_require__(4527); -const settings_1 = __nccwpck_require__(2410); -exports.Settings = settings_1.default; -function stat(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - return async.read(path, getSettings(), optionsOrSettingsOrCallback); + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.stat = stat; -function statSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); } -exports.statSync = statSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; } - - -/***/ }), - -/***/ 4147: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.read = void 0; -function read(path, settings, callback) { - settings.fs.lstat(path, (lstatError, lstat) => { - if (lstatError !== null) { - return callFailureCallback(callback, lstatError); - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return callSuccessCallback(callback, lstat); - } - settings.fs.stat(path, (statError, stat) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - return callFailureCallback(callback, statError); - } - return callSuccessCallback(callback, lstat); +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } - callSuccessCallback(callback, stat); - }); - }); -} -exports.read = read; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} - - -/***/ }), - -/***/ 4527: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.read = void 0; -function read(path, settings) { - const lstat = settings.fs.lstatSync(path); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat = settings.fs.statSync(path); - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; } - return stat; } - catch (error) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error; + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); } -} -exports.read = read; - - -/***/ }), - -/***/ 2410: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __nccwpck_require__(2987); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); } -} -exports.default = Settings; - - -/***/ }), - -/***/ 6026: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; -const async_1 = __nccwpck_require__(7523); -const stream_1 = __nccwpck_require__(6737); -const sync_1 = __nccwpck_require__(3068); -const settings_1 = __nccwpck_require__(141); -exports.Settings = settings_1.default; -function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - return new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); -} -exports.walk = walk; -function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); -} -exports.walkSync = walkSync; -function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); -} -exports.walkStream = walkStream; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); } - return new settings_1.default(settingsOrOptions); -} - - -/***/ }), - -/***/ 7523: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __nccwpck_require__(5732); -class AsyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = new Set(); + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); } - read(callback) { - this._reader.onError((error) => { - callFailureCallback(callback, error); + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); }); - this._reader.onEntry((entry) => { - this._storage.add(entry); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); }); - this._reader.onEnd(() => { - callSuccessCallback(callback, [...this._storage]); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); }); - this._reader.read(); } -} -exports.default = AsyncProvider; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, entries) { - callback(null, entries); -} - - -/***/ }), - -/***/ 6737: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(2413); -const async_1 = __nccwpck_require__(5732); -class StreamProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); }); } - read() { - this._reader.onError((error) => { - this._stream.emit('error', error); + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); }); - this._reader.onEntry((entry) => { - this._stream.push(entry); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); }); - this._reader.onEnd(() => { - this._stream.push(null); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; }); - this._reader.read(); - return this._stream; } -} -exports.default = StreamProvider; - - -/***/ }), - -/***/ 3068: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __nccwpck_require__(3595); -class SyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - read() { - return this._reader.read(); + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); } -} -exports.default = SyncProvider; - - -/***/ }), - -/***/ 5732: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const events_1 = __nccwpck_require__(8614); -const fsScandir = __nccwpck_require__(5667); -const fastq = __nccwpck_require__(7340); -const common = __nccwpck_require__(7988); -const reader_1 = __nccwpck_require__(8311); -class AsyncReader extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit('end'); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error('The reader is already destroyed'); + let socket; + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on('entry', callback); - } - onError(callback) { - this._emitter.once('error', callback); } - onEnd(callback) { - this._emitter.once('end', callback); + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error) => { - if (error !== null) { - this._handleError(error); + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); } - }); + } + return info; } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { - if (error !== null) { - return done(error, undefined); - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, undefined); - }); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - _handleError(error) { - if (this._isDestroyed || !common.isFatalError(this._settings, error)) { - return; + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit('error', error); + return additionalHeaders[header] || clientHeader || _default; } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + if (this._keepAlive && !useProxy) { + agent = this._agent; } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); + // if agent is already assigned use that agent. + if (agent) { + return agent; } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, entry.path); + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } + return agent; } - _emitEntry(entry) { - this._emitter.emit('entry', entry); + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); } } -exports.default = AsyncReader; - +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 7988: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; -function isFatalError(settings, error) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error); -} -exports.isFatalError = isFatalError; -function isAppliedFilter(filter, value) { - return filter === null || filter(value); -} -exports.isAppliedFilter = isAppliedFilter; -function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); -} -exports.replacePathSegmentSeparator = replacePathSegmentSeparator; -function joinPathSegments(a, b, separator) { - if (a === '') { - return b; +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; } - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + return new URL(proxyVar); } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; - - -/***/ }), - -/***/ 8311: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const common = __nccwpck_require__(7988); -class Reader { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + else { + return undefined; } } -exports.default = Reader; - - -/***/ }), - -/***/ 3595: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsScandir = __nccwpck_require__(5667); -const common = __nccwpck_require__(7988); -const reader_1 = __nccwpck_require__(8311); -class SyncReader extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = new Set(); - this._queue = new Set(); +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return [...this._storage]; + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } - catch (error) { - this._handleError(error); - } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; } - _handleError(error) { - if (!common.isFatalError(this._settings, error)) { - return; - } - throw error; + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, entry.path); + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; } } - _pushToStorage(entry) { - this._storage.add(entry); - } + return false; } -exports.default = SyncReader; - +exports.checkBypass = checkBypass; +//# sourceMappingURL=proxy.js.map /***/ }), -/***/ 141: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(5622); -const fsScandir = __nccwpck_require__(5667); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, undefined); - this.concurrency = this._getValue(this._options.concurrency, Infinity); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(7147)); +const path = __importStar(__nccwpck_require__(1017)); +_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +exports.IS_WINDOWS = process.platform === 'win32'; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); } -exports.default = Settings; - - -/***/ }), - -/***/ 334: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -async function auth(token) { - const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; - return { - type: "token", - token: token, - tokenType - }; +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); } - +exports.isDirectory = isDirectory; /** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - - return `token ${token}`; -} - -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); } - -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); - } - - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; - -exports.createTokenAuth = createTokenAuth; -//# sourceMappingURL=index.js.map - +exports.isRooted = isRooted; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); +} +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +} +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map /***/ }), -/***/ 6762: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7436: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); - -var universalUserAgent = __nccwpck_require__(5030); -var beforeAfterHook = __nccwpck_require__(3682); -var request = __nccwpck_require__(6234); -var graphql = __nccwpck_require__(8467); -var authToken = __nccwpck_require__(334); - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(9491); +const childProcess = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const util_1 = __nccwpck_require__(3837); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const exec = util_1.promisify(childProcess.exec); +const execFile = util_1.promisify(childProcess.execFile); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); } - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another + // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + try { + const cmdPath = ioUtil.getCmdPath(); + if (yield ioUtil.isDirectory(inputPath, true)) { + yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath } + }); + } + else { + yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath } + }); + } + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } + // Shelling out fails to remove a symlink folder with missing source, this unlink catches that + try { + yield ioUtil.unlink(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } + } + else { + let isDir = false; + try { + isDir = yield ioUtil.isDirectory(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + return; + } + if (isDir) { + yield execFile(`rm`, [`-rf`, `${inputPath}`]); + } + else { + yield ioUtil.unlink(inputPath); + } + } + }); +} +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); +} +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); +} +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; +} +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); +} +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); +} +//# sourceMappingURL=io.js.map -const VERSION = "3.2.1"; - -class Octokit { - constructor(options = {}) { - const hook = new beforeAfterHook.Collection(); - const requestDefaults = { - baseUrl: request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; // prepend default user agent with `options.userAgent` if set +/***/ }), - requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); +/***/ 3803: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; - } +"use strict"; - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = __nccwpck_require__(7147); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; - } - this.request = request.request.defaults(requestDefaults); - this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); - this.log = Object.assign({ - debug: () => {}, - info: () => {}, - warn: console.warn.bind(console), - error: console.error.bind(console) - }, options.log); - this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. - // (2) If only `options.auth` is set, use the default token authentication strategy. - // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. - // TODO: type `options.auth` based on `options.authStrategy`. +/***/ }), - if (!options.authStrategy) { - if (!options.auth) { - // (1) - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - // (2) - const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ +/***/ 8838: +/***/ ((__unused_webpack_module, exports) => { - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, ["authStrategy"]); +"use strict"; - const auth = authStrategy(Object.assign({ - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } // apply plugins - // https://stackoverflow.com/a/16345172 - - - const classConstructor = this.constructor; - classConstructor.plugins.forEach(plugin => { - Object.assign(this, plugin(this, options)); - }); - } - - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - - if (typeof defaults === "function") { - super(defaults(options)); - return; - } - - super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null)); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; - }; - return OctokitWithDefaults; - } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ +/***/ }), - static plugin(...newPlugins) { - var _a; +/***/ 5667: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); - return NewOctokit; - } +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = __nccwpck_require__(4507); +const sync = __nccwpck_require__(9560); +const settings_1 = __nccwpck_require__(8662); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); } -Octokit.VERSION = VERSION; -Octokit.plugins = []; - -exports.Octokit = Octokit; -//# sourceMappingURL=index.js.map /***/ }), -/***/ 9440: +/***/ 4507: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var isPlainObject = __nccwpck_require__(558); -var universalUserAgent = __nccwpck_require__(5030); - -function lowercaseKeys(object) { - if (!object) { - return {}; - } - - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} - -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach(key => { - if (isPlainObject.isPlainObject(options[key])) { - if (!(key in defaults)) Object.assign(result, { - [key]: options[key] - });else result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { - [key]: options[key] - }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = __nccwpck_require__(109); +const rpl = __nccwpck_require__(5288); +const constants_1 = __nccwpck_require__(8838); +const utils = __nccwpck_require__(6297); +const common = __nccwpck_require__(3847); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; } - }); - return result; + readdir(directory, settings, callback); } - -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === undefined) { - delete obj[key]; - } - } - - return obj; +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); } - -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { - method, - url - } : { - url: method - }, options); - } else { - options = Object.assign({}, route); - } // lowercase header names before merging with defaults to avoid duplicates - options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging +/***/ }), - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten +/***/ 3847: +/***/ ((__unused_webpack_module, exports) => { - if (defaults && defaults.mediaType.previews.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); - } +"use strict"; - mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); - return mergedOptions; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; } +exports.joinPathSegments = joinPathSegments; -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; - } +/***/ }), - return url + separator + names.map(name => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } +/***/ 9560: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = __nccwpck_require__(109); +const constants_1 = __nccwpck_require__(8838); +const utils = __nccwpck_require__(6297); +const common = __nccwpck_require__(3847); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); } +exports.readdir = readdir; -const urlVariableRegex = /\{[^}]+\}/g; -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); -} +/***/ }), -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); +/***/ 8662: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (!matches) { - return []; - } +"use strict"; - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(1017); +const fsStat = __nccwpck_require__(109); +const fs = __nccwpck_require__(3803); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } } +exports["default"] = Settings; -function omit(object, keysToOmit) { - return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { - obj[key] = object[key]; - return obj; - }, {}); -} -// Based on https://github.com/bramstein/url-template, licensed under BSD -// TODO: create separate package. -// -// Copyright (c) 2012-2014, Bram Stein -// All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/***/ }), -/* istanbul ignore file */ -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } +/***/ 883: +/***/ ((__unused_webpack_module, exports) => { - return part; - }).join(""); -} +"use strict"; -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } } +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} +/***/ }), -function isDefined(value) { - return value !== undefined && value !== null; -} +/***/ 6297: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} +"use strict"; -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fs = void 0; +const fs = __nccwpck_require__(883); +exports.fs = fs; - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } +/***/ }), - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; +/***/ 2987: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - tmp.push(encodeValue(operator, value)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } +"use strict"; - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = __nccwpck_require__(7147); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; } - } - - return result; + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } +exports.createFileSystemAdapter = createFileSystemAdapter; -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} - -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); +/***/ }), - if (operator && operator !== "+") { - var separator = ","; +/***/ 109: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } +"use strict"; - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = __nccwpck_require__(4147); +const sync = __nccwpck_require__(4527); +const settings_1 = __nccwpck_require__(2410); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; } - }); + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); } - -function parse(options) { - // https://fetch.spec.whatwg.org/#methods - let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible - - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later - - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); - - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } - - const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - - if (!isBinaryRequest) { - if (options.mediaType.format) { - // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw - headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); - } - - if (options.mediaType.previews.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } // for GET/HEAD requests, set URL query parameters from remaining parameters - // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters - - - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } else { - headers["content-length"] = 0; - } +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } - } // default content-type for JSON if body is set - + return new settings_1.default(settingsOrOptions); +} - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. - // fetch does not allow to set `content-length` header, but we can set body to an empty string +/***/ }), - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } // Only return body/request keys if present +/***/ 4147: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; - return Object.assign({ - method, - url, - headers - }, typeof body !== "undefined" ? { - body - } : null, options.request ? { - request: options.request - } : null); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); } - -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); } - -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS = merge(oldDefaults, newDefaults); - const endpoint = endpointWithDefaults.bind(null, DEFAULTS); - return Object.assign(endpoint, { - DEFAULTS, - defaults: withDefaults.bind(null, DEFAULTS), - merge: merge.bind(null, DEFAULTS), - parse - }); +function callSuccessCallback(callback, result) { + callback(null, result); } -const VERSION = "6.0.9"; - -const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. -// So we use RequestParameters and add method as additional required property. - -const DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "", - previews: [] - } -}; - -const endpoint = withDefaults(null, DEFAULTS); - -exports.endpoint = endpoint; -//# sourceMappingURL=index.js.map - /***/ }), -/***/ 558: +/***/ 4527: /***/ ((__unused_webpack_module, exports) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } } - -exports.isPlainObject = isPlainObject; +exports.read = read; /***/ }), -/***/ 8467: +/***/ 2410: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +const fs = __nccwpck_require__(2987); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports["default"] = Settings; -var request = __nccwpck_require__(6234); -var universalUserAgent = __nccwpck_require__(5030); - -const VERSION = "4.5.7"; - -class GraphqlError extends Error { - constructor(request, response) { - const message = response.data.errors[0].message; - super(message); - Object.assign(this, response.data); - Object.assign(this, { - headers: response.headers - }); - this.name = "GraphqlError"; - this.request = request; // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } +/***/ }), -} +/***/ 6026: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; -const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request, query, options) { - if (typeof query === "string" && options && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); - } +"use strict"; - const parsedOptions = typeof query === "string" ? Object.assign({ - query - }, options) : query; - const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = __nccwpck_require__(7523); +const stream_1 = __nccwpck_require__(6737); +const sync_1 = __nccwpck_require__(3068); +const settings_1 = __nccwpck_require__(141); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; } - - if (!result.variables) { - result.variables = {}; + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } + return new settings_1.default(settingsOrOptions); +} - result.variables[key] = parsedOptions[key]; - return result; - }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix - // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - - const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } +/***/ }), - return request(requestOptions).then(response => { - if (response.data.errors) { - const headers = {}; +/***/ 7523: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } +"use strict"; - throw new GraphqlError(requestOptions, { - headers, - data: response.data - }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const async_1 = __nccwpck_require__(5732); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); } - - return response.data.data; - }); } - -function withDefaults(request$1, newDefaults) { - const newRequest = request$1.defaults(newDefaults); - - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: request.request.endpoint - }); +exports["default"] = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); } - -const graphql$1 = withDefaults(request.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); +function callSuccessCallback(callback, entries) { + callback(null, entries); } -exports.graphql = graphql$1; -exports.withCustomRequest = withCustomRequest; -//# sourceMappingURL=index.js.map - /***/ }), -/***/ 4193: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6737: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(2781); +const async_1 = __nccwpck_require__(5732); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports["default"] = StreamProvider; -const VERSION = "2.6.0"; - -/** - * Some “list” response that can be paginated have a different response structure - * - * They have a `total_count` key in the response (search also has `incomplete_results`, - * /installation/repositories also has `repository_selection`), as well as a key with - * the list of the items which name varies from endpoint to endpoint. - * - * Octokit normalizes these responses so that paginated results are always returned following - * the same structure. One challenge is that if the list response has only one page, no Link - * header is provided, so this header alone is not sufficient to check wether a response is - * paginated or not. - * - * We check if a "total_count" key is present in the response data, but also make sure that - * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would - * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref - */ -function normalizePaginatedListResponse(response) { - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way - // to retrieve the same information. - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; +/***/ }), - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } +/***/ 3068: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } +"use strict"; - response.data.total_count = totalCount; - return response; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const sync_1 = __nccwpck_require__(3595); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } } +exports["default"] = SyncProvider; -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) return { - done: true - }; - const response = await requestMethod({ - method, - url, - headers - }); - const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: - // '; rel="next", ; rel="last"' - // sets `url` to undefined if "next" URL is not present or `link` header is not set - url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { - value: normalizedResponse - }; - } +/***/ }), - }) - }; -} +/***/ 5732: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = undefined; - } +"use strict"; - return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const events_1 = __nccwpck_require__(2361); +const fsScandir = __nccwpck_require__(5667); +const fastq = __nccwpck_require__(7340); +const common = __nccwpck_require__(7988); +const reader_1 = __nccwpck_require__(8311); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } } +exports["default"] = AsyncReader; -function gather(octokit, results, iterator, mapFn) { - return iterator.next().then(result => { - if (result.done) { - return results; - } - let earlyExit = false; +/***/ }), - function done() { - earlyExit = true; - } +/***/ 7988: +/***/ ((__unused_webpack_module, exports) => { - results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); +"use strict"; - if (earlyExit) { - return results; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; } - - return gather(octokit, results, iterator, mapFn); - }); + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; } +exports.joinPathSegments = joinPathSegments; -const composePaginateRest = Object.assign(paginate, { - iterator -}); -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ +/***/ }), -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; -} -paginateRest.VERSION = VERSION; +/***/ 8311: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports.composePaginateRest = composePaginateRest; -exports.paginateRest = paginateRest; -//# sourceMappingURL=index.js.map +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const common = __nccwpck_require__(7988); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports["default"] = Reader; /***/ }), -/***/ 3044: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +const fsScandir = __nccwpck_require__(5667); +const common = __nccwpck_require__(7988); +const reader_1 = __nccwpck_require__(8311); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports["default"] = SyncReader; -const Endpoints = { - actions: { - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], - createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], - createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], - deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], - deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], - downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], - downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], - getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], - listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], - listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], - checkToken: ["POST /applications/{client_id}/token"], - createContentAttachment: ["POST /content_references/{content_reference_id}/attachments", { - mediaType: { - previews: ["corsair"] - } - }], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], - getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], - getUserInstallation: ["GET /users/{username}/installation"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], - listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], - removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], - getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], - getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - createSuite: ["POST /repos/{owner}/{repo}/check-suites", { + +/***/ }), + +/***/ 141: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(1017); +const fsScandir = __nccwpck_require__(5667); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports["default"] = Settings; + + +/***/ }), + +/***/ 334: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +const REGEX_IS_INSTALLATION = /^ghs_/; +const REGEX_IS_USER_TO_SERVER = /^ghu_/; +async function auth(token) { + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; + return { + type: "token", + token: token, + tokenType + }; +} + +/** + * Prefix token for usage in the Authorization header + * + * @param token OAuth token or JSON Web Token + */ +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } + + return `token ${token}`; +} + +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge(route, parameters); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); +} + +const createTokenAuth = function createTokenAuth(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } + + if (typeof token !== "string") { + throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); + } + + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); +}; + +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 6762: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var universalUserAgent = __nccwpck_require__(5030); +var beforeAfterHook = __nccwpck_require__(3682); +var request = __nccwpck_require__(6234); +var graphql = __nccwpck_require__(8467); +var authToken = __nccwpck_require__(334); + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; +} + +const VERSION = "3.6.0"; + +const _excluded = ["authStrategy"]; +class Octokit { + constructor(options = {}) { + const hook = new beforeAfterHook.Collection(); + const requestDefaults = { + baseUrl: request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type + hook: hook.bind(null, "request") + }), mediaType: { - previews: ["antiope"] + previews: [], + format: "" } - }], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}", { - mediaType: { - previews: ["antiope"] - } - }], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", { - mediaType: { - previews: ["antiope"] - } - }], - listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", { - mediaType: { - previews: ["antiope"] - } - }], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites", { - mediaType: { - previews: ["antiope"] - } - }], - rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", { - mediaType: { - previews: ["antiope"] - } - }], - setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences", { - mediaType: { - previews: ["antiope"] - } - }], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", { - mediaType: { - previews: ["antiope"] - } - }] - }, - codeScanning: { - getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { - renamedParameters: { - alert_id: "alert_number" - } - }], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct", { - mediaType: { - previews: ["scarlet-witch"] - } - }], - getConductCode: ["GET /codes_of_conduct/{key}", { - mediaType: { - previews: ["scarlet-witch"] - } - }], - getForRepo: ["GET /repos/{owner}/{repo}/community/code_of_conduct", { - mediaType: { - previews: ["scarlet-witch"] - } - }] - }, - emojis: { - get: ["GET /emojis"] - }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - interactions: { - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }] - }, - issues: { - addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", { - mediaType: { - previews: ["mockingbird"] + }; // prepend default user agent with `options.userAgent` if set + + requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); + + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; + } + + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; + } + + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; + } + + this.request = request.request.defaults(requestDefaults); + this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); + this.log = Object.assign({ + debug: () => {}, + info: () => {}, + warn: console.warn.bind(console), + error: console.error.bind(console) + }, options.log); + this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. + // (2) If only `options.auth` is set, use the default token authentication strategy. + // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. + // TODO: type `options.auth` based on `options.authStrategy`. + + if (!options.authStrategy) { + if (!options.auth) { + // (1) + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + // (2) + const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; } - }], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], - removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: ["POST /markdown/raw", { - headers: { - "content-type": "text/plain; charset=utf-8" + } else { + const { + authStrategy + } = options, + otherOptions = _objectWithoutProperties(options, _excluded); + + const auth = authStrategy(Object.assign({ + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions + }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } // apply plugins + // https://stackoverflow.com/a/16345172 + + + const classConstructor = this.constructor; + classConstructor.plugins.forEach(plugin => { + Object.assign(this, plugin(this, options)); + }); + } + + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null)); } - }] - }, - meta: { - get: ["GET /meta"] - }, - migrations: { - cancelImport: ["DELETE /repos/{owner}/{repo}/import"], - deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive", { - mediaType: { - previews: ["wyandotte"] + + }; + return OctokitWithDefaults; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + + + static plugin(...newPlugins) { + var _a; + + const currentPlugins = this.plugins; + const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); + return NewOctokit; + } + +} +Octokit.VERSION = VERSION; +Octokit.plugins = []; + +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 9440: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var isPlainObject = __nccwpck_require__(3287); +var universalUserAgent = __nccwpck_require__(5030); + +function lowercaseKeys(object) { + if (!object) { + return {}; + } + + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} + +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach(key => { + if (isPlainObject.isPlainObject(options[key])) { + if (!(key in defaults)) Object.assign(result, { + [key]: options[key] + });else result[key] = mergeDeep(defaults[key], options[key]); + } else { + Object.assign(result, { + [key]: options[key] + }); + } + }); + return result; +} + +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === undefined) { + delete obj[key]; + } + } + + return obj; +} + +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { + method, + url + } : { + url: method + }, options); + } else { + options = Object.assign({}, route); + } // lowercase header names before merging with defaults to avoid duplicates + + + options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging + + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); + } + + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} + +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + + if (names.length === 0) { + return url; + } + + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); +} + +const urlVariableRegex = /\{[^}]+\}/g; + +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +} + +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + + if (!matches) { + return []; + } + + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} + +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); +} + +// Based on https://github.com/bramstein/url-template, licensed under BSD +// TODO: create separate package. +// +// Copyright (c) 2012-2014, Bram Stein +// All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* istanbul ignore file */ +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } + + return part; + }).join(""); +} + +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} + +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } +} + +function isDefined(value) { + return value !== undefined && value !== null; +} + +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} + +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; + + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); } - }], - deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive", { - mediaType: { - previews: ["wyandotte"] + + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + tmp.push(encodeValue(operator, value)); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); + } + + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); + } } - }], - downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive", { - mediaType: { - previews: ["wyandotte"] - } - }], - getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive", { - mediaType: { - previews: ["wyandotte"] - } - }], - getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], - getImportStatus: ["GET /repos/{owner}/{repo}/import"], - getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}", { - mediaType: { - previews: ["wyandotte"] - } - }], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}", { - mediaType: { - previews: ["wyandotte"] - } - }], - listForAuthenticatedUser: ["GET /user/migrations", { - mediaType: { - previews: ["wyandotte"] - } - }], - listForOrg: ["GET /orgs/{org}/migrations", { - mediaType: { - previews: ["wyandotte"] - } - }], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories", { - mediaType: { - previews: ["wyandotte"] + } + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); } - }], - listReposForUser: ["GET /user/migrations/{migration_id}/repositories", { - mediaType: { - previews: ["wyandotte"] + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } + } + + return result; +} + +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; +} + +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); } - }], - mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], - setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: ["PUT /repos/{owner}/{repo}/import"], - unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock", { - mediaType: { - previews: ["wyandotte"] + + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + + if (operator && operator !== "+") { + var separator = ","; + + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; + } + + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); } - }], - unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", { - mediaType: { - previews: ["wyandotte"] + } else { + return encodeReserved(literal); + } + }); +} + +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible + + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later + + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } + + const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); + + if (!isBinaryRequest) { + if (options.mediaType.format) { + // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw + headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); + } + + if (options.mediaType.previews.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); + } + } // for GET/HEAD requests, set URL query parameters from remaining parameters + // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters + + + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; + } else { + headers["content-length"] = 0; } - }], - updateImport: ["PATCH /repos/{owner}/{repo}/import"] - }, - orgs: { - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], - createInvitation: ["POST /orgs/{org}/invitations"], - createWebhook: ["POST /orgs/{org}/hooks"], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - get: ["GET /orgs/{org}"], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], - removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"] + } + } // default content-type for JSON if body is set + + + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. + // fetch does not allow to set `content-length` header, but we can set body to an empty string + + + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present + + + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); +} + +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} + +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS = merge(oldDefaults, newDefaults); + const endpoint = endpointWithDefaults.bind(null, DEFAULTS); + return Object.assign(endpoint, { + DEFAULTS, + defaults: withDefaults.bind(null, DEFAULTS), + merge: merge.bind(null, DEFAULTS), + parse + }); +} + +const VERSION = "6.0.12"; + +const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. +// So we use RequestParameters and add method as additional required property. + +const DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent }, - projects: { - addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}", { - mediaType: { - previews: ["inertia"] - } - }], - createCard: ["POST /projects/columns/{column_id}/cards", { - mediaType: { - previews: ["inertia"] - } - }], - createColumn: ["POST /projects/{project_id}/columns", { - mediaType: { - previews: ["inertia"] - } - }], - createForAuthenticatedUser: ["POST /user/projects", { - mediaType: { - previews: ["inertia"] - } - }], - createForOrg: ["POST /orgs/{org}/projects", { - mediaType: { - previews: ["inertia"] - } - }], - createForRepo: ["POST /repos/{owner}/{repo}/projects", { - mediaType: { - previews: ["inertia"] - } - }], - delete: ["DELETE /projects/{project_id}", { - mediaType: { - previews: ["inertia"] - } - }], - deleteCard: ["DELETE /projects/columns/cards/{card_id}", { - mediaType: { - previews: ["inertia"] - } - }], - deleteColumn: ["DELETE /projects/columns/{column_id}", { - mediaType: { - previews: ["inertia"] - } - }], - get: ["GET /projects/{project_id}", { - mediaType: { - previews: ["inertia"] - } - }], - getCard: ["GET /projects/columns/cards/{card_id}", { - mediaType: { - previews: ["inertia"] - } - }], - getColumn: ["GET /projects/columns/{column_id}", { - mediaType: { - previews: ["inertia"] - } - }], - getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission", { - mediaType: { - previews: ["inertia"] - } - }], - listCards: ["GET /projects/columns/{column_id}/cards", { - mediaType: { - previews: ["inertia"] - } - }], - listCollaborators: ["GET /projects/{project_id}/collaborators", { - mediaType: { - previews: ["inertia"] - } - }], - listColumns: ["GET /projects/{project_id}/columns", { - mediaType: { - previews: ["inertia"] - } - }], - listForOrg: ["GET /orgs/{org}/projects", { - mediaType: { - previews: ["inertia"] - } - }], - listForRepo: ["GET /repos/{owner}/{repo}/projects", { - mediaType: { - previews: ["inertia"] - } - }], - listForUser: ["GET /users/{username}/projects", { - mediaType: { - previews: ["inertia"] - } - }], - moveCard: ["POST /projects/columns/cards/{card_id}/moves", { - mediaType: { - previews: ["inertia"] - } - }], - moveColumn: ["POST /projects/columns/{column_id}/moves", { - mediaType: { - previews: ["inertia"] - } - }], - removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}", { - mediaType: { - previews: ["inertia"] - } - }], - update: ["PATCH /projects/{project_id}", { - mediaType: { - previews: ["inertia"] - } - }], - updateCard: ["PATCH /projects/columns/cards/{card_id}", { - mediaType: { - previews: ["inertia"] - } - }], - updateColumn: ["PATCH /projects/columns/{column_id}", { - mediaType: { - previews: ["inertia"] - } - }] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch", { - mediaType: { - previews: ["lydian"] - } - }], - updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] - }, - rateLimit: { - get: ["GET /rate_limit"] - }, - reactions: { - createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - deleteLegacy: ["DELETE /reactions/{reaction_id}", { - mediaType: { - previews: ["squirrel-girl"] - } - }, { - deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy" - }], - listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] - } - }], - listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { - mediaType: { - previews: ["squirrel-girl"] + mediaType: { + format: "", + previews: [] + } +}; + +const endpoint = withDefaults(null, DEFAULTS); + +exports.endpoint = endpoint; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 8467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var request = __nccwpck_require__(6234); +var universalUserAgent = __nccwpck_require__(5030); + +const VERSION = "4.8.0"; + +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); +} + +class GraphqlResponseError extends Error { + constructor(request, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; // Expose the errors and response data in their shorthand properties. + + this.errors = response.errors; + this.data = response.data; // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + +} + +const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } + + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } + } + + const parsedOptions = typeof query === "string" ? Object.assign({ + query + }, options) : query; + const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; + } + + if (!result.variables) { + result.variables = {}; + } + + result.variables[key] = parsedOptions[key]; + return result; + }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix + // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 + + const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; + + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + + return request(requestOptions).then(response => { + if (response.data.errors) { + const headers = {}; + + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; } - }] + + throw new GraphqlResponseError(requestOptions, headers, response.data); + } + + return response.data.data; + }); +} + +function withDefaults(request$1, newDefaults) { + const newRequest = request$1.defaults(newDefaults); + + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: request.request.endpoint + }); +} + +const graphql$1 = withDefaults(request.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` }, - repos: { - acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}"], - addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts", { - mediaType: { - previews: ["dorian"] - } - }], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { - mediaType: { - previews: ["zzzax"] - } - }], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages", { - mediaType: { - previews: ["switcheroo"] + method: "POST", + url: "/graphql" +}); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} + +exports.GraphqlResponseError = GraphqlResponseError; +exports.graphql = graphql$1; +exports.withCustomRequest = withCustomRequest; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 4193: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const VERSION = "2.21.3"; + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + + return target; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +/** + * Some “list” response that can be paginated have a different response structure + * + * They have a `total_count` key in the response (search also has `incomplete_results`, + * /installation/repositories also has `repository_selection`), as well as a key with + * the list of the items which name varies from endpoint to endpoint. + * + * Octokit normalizes these responses so that paginated results are always returned following + * the same structure. One challenge is that if the list response has only one page, no Link + * header is provided, so this header alone is not sufficient to check wether a response is + * paginated or not. + * + * We check if a "total_count" key is present in the response data, but also make sure that + * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would + * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + */ +function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return _objectSpread2(_objectSpread2({}, response), {}, { + data: [] + }); + } + + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); + if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way + // to retrieve the same information. + + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + const namespaceKey = Object.keys(response.data)[0]; + const data = response.data[namespaceKey]; + response.data = data; + + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; + } + + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } + + response.data.total_count = totalCount; + return response; +} + +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) return { + done: true + }; + + try { + const response = await requestMethod({ + method, + url, + headers + }); + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: + // '; rel="next", ; rel="last"' + // sets `url` to undefined if "next" URL is not present or `link` header is not set + + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { + value: normalizedResponse + }; + } catch (error) { + if (error.status !== 409) throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] + } + }; + } } + + }) + }; +} + +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = undefined; + } + + return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +} + +function gather(octokit, results, iterator, mapFn) { + return iterator.next().then(result => { + if (result.done) { + return results; + } + + let earlyExit = false; + + function done() { + earlyExit = true; + } + + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); + + if (earlyExit) { + return results; + } + + return gather(octokit, results, iterator, mapFn); + }); +} + +const composePaginateRest = Object.assign(paginate, { + iterator +}); + +const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/audit-log", "GET /enterprises/{enterprise}/secret-scanning/alerts", "GET /enterprises/{enterprise}/settings/billing/advanced-security", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /licenses", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/cache/usage-by-repository", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/audit-log", "GET /orgs/{org}/blocks", "GET /orgs/{org}/code-scanning/alerts", "GET /orgs/{org}/codespaces", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/dependabot/secrets", "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", "GET /orgs/{org}/events", "GET /orgs/{org}/external-groups", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/settings/billing/advanced-security", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/caches", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/codespaces", "GET /repos/{owner}/{repo}/codespaces/devcontainers", "GET /repos/{owner}/{repo}/codespaces/secrets", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/status", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/dependabot/secrets", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/environments", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repos/{owner}/{repo}/topics", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/codespaces", "GET /user/codespaces/secrets", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/packages/{package_type}/{package_name}/versions", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; + +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } +} + +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ + +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) + }; +} +paginateRest.VERSION = VERSION; + +exports.composePaginateRest = composePaginateRest; +exports.isPaginatingEndpoint = isPaginatingEndpoint; +exports.paginateRest = paginateRest; +exports.paginatingEndpoints = paginatingEndpoints; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 3044: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +const Endpoints = { + actions: { + addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], + addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], + cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], + createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], + createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], + createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], + deleteActionsCacheById: ["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"], + deleteActionsCacheByKey: ["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"], + deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], + deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], + deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], + disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], + downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], + downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], + downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], + downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], + enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], + getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], + getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], + getActionsCacheUsageByRepoForOrg: ["GET /orgs/{org}/actions/cache/usage-by-repository"], + getActionsCacheUsageForEnterprise: ["GET /enterprises/{enterprise}/actions/cache/usage"], + getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], + getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], + getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], + getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + getGithubActionsDefaultWorkflowPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsOrganization: ["GET /orgs/{org}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/workflow"], + getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], + getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { + renamed: ["actions", "getGithubActionsPermissionsRepository"] }], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate", { - mediaType: { - previews: ["baptiste"] - } + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowAccessToRepository: ["GET /repos/{owner}/{repo}/actions/permissions/access"], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], + getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], + getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], + listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], + listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], + listLabelsForSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}/labels"], + listLabelsForSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], + listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], + listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + reRunJobForWorkflowRun: ["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + reRunWorkflowFailedJobs: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"], + removeAllCustomLabelsFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"], + removeAllCustomLabelsFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"], + removeCustomLabelFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], + setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], + setCustomLabelsForSelfHostedRunnerForOrg: ["PUT /orgs/{org}/actions/runners/{runner_id}/labels"], + setCustomLabelsForSelfHostedRunnerForRepo: ["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + setGithubActionsDefaultWorkflowPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/workflow"], + setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], + setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], + setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"], + setWorkflowAccessToRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/access"] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}"], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { - mediaType: { - previews: ["zzzax"] - } + addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], + checkToken: ["POST /applications/{client_id}/token"], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}"], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app"], + getBySlug: ["GET /apps/{app_slug}"], + getInstallation: ["GET /app/installations/{installation_id}"], + getOrgInstallation: ["GET /orgs/{org}/installation"], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], + getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], + getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], + getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], + listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], + listInstallations: ["GET /app/installations"], + listInstallationsForAuthenticatedUser: ["GET /user/installations"], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories"], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], + removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages", { - mediaType: { - previews: ["switcheroo"] + removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] + }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], + getGithubAdvancedSecurityBillingGhe: ["GET /enterprises/{enterprise}/settings/billing/advanced-security"], + getGithubAdvancedSecurityBillingOrg: ["GET /orgs/{org}/settings/billing/advanced-security"], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], + getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], + getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], + rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], + setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] + }, + codeScanning: { + deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], + getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { + renamedParameters: { + alert_id: "alert_number" } }], - deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes", { - mediaType: { - previews: ["london"] - } + getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], + listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { + renamed: ["codeScanning", "listAlertInstances"] }], - disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts", { - mediaType: { - previews: ["dorian"] + listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], + updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], + uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] + }, + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"] + }, + codespaces: { + addRepositoryForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + codespaceMachinesForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/machines"], + createForAuthenticatedUser: ["POST /user/codespaces"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + createOrUpdateSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}"], + createWithPrForAuthenticatedUser: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"], + createWithRepoForAuthenticatedUser: ["POST /repos/{owner}/{repo}/codespaces"], + deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], + deleteFromOrganization: ["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + deleteSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}"], + exportForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/exports"], + getExportDetailsForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/exports/{export_id}"], + getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], + getPublicKeyForAuthenticatedUser: ["GET /user/codespaces/secrets/public-key"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + getSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}"], + listDevcontainersInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/devcontainers"], + listForAuthenticatedUser: ["GET /user/codespaces"], + listInOrganization: ["GET /orgs/{org}/codespaces", {}, { + renamedParameters: { + org_id: "org" } }], - downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], - enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes", { - mediaType: { - previews: ["london"] - } + listInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], + listRepositoriesForSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}/repositories"], + listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], + removeRepositoryForSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + repoMachinesForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/machines"], + setRepositoriesForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories"], + startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], + stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], + stopInOrganization: ["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"], + updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] + }, + dependabot: { + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"] + }, + dependencyGraph: { + createRepositorySnapshot: ["POST /repos/{owner}/{repo}/dependency-graph/snapshots"], + diffRange: ["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"] + }, + emojis: { + get: ["GET /emojis"] + }, + enterpriseAdmin: { + addCustomLabelsToSelfHostedRunnerForEnterprise: ["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], + getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], + getServerStatistics: ["GET /enterprise-installation/{enterprise_or_org}/server-statistics"], + listLabelsForSelfHostedRunnerForEnterprise: ["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], + removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}"], + setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], + setCustomLabelsForSelfHostedRunnerForEnterprise: ["PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], + setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] + }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] + }, + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] + }, + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] + }, + interactions: { + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { + renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }], - enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts", { - mediaType: { - previews: ["dorian"] - } + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], + removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { + renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], - getAllTopics: ["GET /repos/{owner}/{repo}/topics", { - mediaType: { - previews: ["mercy"] + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { + renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] + }] + }, + issues: { + addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], + removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: ["POST /markdown/raw", { + headers: { + "content-type": "text/plain; charset=utf-8" } + }] + }, + meta: { + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] + }, + migrations: { + cancelImport: ["DELETE /repos/{owner}/{repo}/import"], + deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], + deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], + downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], + getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], + getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], + getImportStatus: ["GET /repos/{owner}/{repo}/import"], + getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], + listForAuthenticatedUser: ["GET /user/migrations"], + listForOrg: ["GET /orgs/{org}/migrations"], + listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], + listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { + renamed: ["migrations", "listReposForAuthenticatedUser"] }], - getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { - mediaType: { - previews: ["zzzax"] - } + mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], + setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: ["PUT /repos/{owner}/{repo}/import"], + unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], + unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], + updateImport: ["PATCH /repos/{owner}/{repo}/import"] + }, + orgs: { + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], + createInvitation: ["POST /orgs/{org}/invitations"], + createWebhook: ["POST /orgs/{org}/hooks"], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + get: ["GET /orgs/{org}"], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listCustomRoles: ["GET /organizations/{organization_id}/custom_roles"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], + removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] + }, + packages: { + deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], + deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], + deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], + deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile", { - mediaType: { - previews: ["black-panther"] - } + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] + }], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], + getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], + getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], + getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], + getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + listPackagesForAuthenticatedUser: ["GET /user/packages"], + listPackagesForOrganization: ["GET /orgs/{org}/packages"], + listPackagesForUser: ["GET /users/{username}/packages"], + restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] + }, + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], + createCard: ["POST /projects/columns/{column_id}/cards"], + createColumn: ["POST /projects/{project_id}/columns"], + createForAuthenticatedUser: ["POST /user/projects"], + createForOrg: ["POST /orgs/{org}/projects"], + createForRepo: ["POST /repos/{owner}/{repo}/projects"], + delete: ["DELETE /projects/{project_id}"], + deleteCard: ["DELETE /projects/columns/cards/{card_id}"], + deleteColumn: ["DELETE /projects/columns/{column_id}"], + get: ["GET /projects/{project_id}"], + getCard: ["GET /projects/columns/cards/{card_id}"], + getColumn: ["GET /projects/columns/{column_id}"], + getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], + listCards: ["GET /projects/columns/{column_id}/cards"], + listCollaborators: ["GET /projects/{project_id}/collaborators"], + listColumns: ["GET /projects/{project_id}/columns"], + listForOrg: ["GET /orgs/{org}/projects"], + listForRepo: ["GET /repos/{owner}/{repo}/projects"], + listForUser: ["GET /users/{username}/projects"], + moveCard: ["POST /projects/columns/cards/{card_id}/moves"], + moveColumn: ["POST /projects/columns/{column_id}/moves"], + removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], + update: ["PATCH /projects/{project_id}"], + updateCard: ["PATCH /projects/columns/cards/{card_id}"], + updateColumn: ["PATCH /projects/columns/{column_id}"] + }, + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], + updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] + }, + rateLimit: { + get: ["GET /rate_limit"] + }, + reactions: { + createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], + createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], + deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], + deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], + deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], + deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], + deleteForRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"], + deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], + deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], + listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + listForRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"], + listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] + }, + repos: { + acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "acceptInvitationForAuthenticatedUser"] + }], + acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], + addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], + codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], + createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages"], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], + createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "declineInvitationForAuthenticatedUser"] + }], + declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], + deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], + deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], + deleteTagProtection: ["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], + disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], + disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], + downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { + renamed: ["repos", "downloadZipballArchive"] }], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], + enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], + enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], + enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], + generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], + getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], + getAllTopics: ["GET /repos/{owner}/{repo}/topics"], + getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], + getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], @@ -7193,12 +8208,11 @@ const Endpoints = { getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", { - mediaType: { - previews: ["groot"] - } - }], + listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], @@ -7217,18 +8231,18 @@ const Endpoints = { listLanguages: ["GET /repos/{owner}/{repo}/languages"], listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", { - mediaType: { - previews: ["groot"] - } - }], + listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], + mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" }], @@ -7243,11 +8257,8 @@ const Endpoints = { removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" }], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { - mediaType: { - previews: ["mercy"] - } - }], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { @@ -7272,42 +8283,38 @@ const Endpoints = { updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], - updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { + renamed: ["repos", "updateStatusCheckProtection"] + }], + updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" }] }, search: { code: ["GET /search/code"], - commits: ["GET /search/commits", { - mediaType: { - previews: ["cloak"] - } - }], + commits: ["GET /search/commits"], issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], - topics: ["GET /search/topics", { - mediaType: { - previews: ["mercy"] - } - }], + topics: ["GET /search/topics"], users: ["GET /search/users"] }, + secretScanning: { + getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + listAlertsForEnterprise: ["GET /enterprises/{enterprise}/secret-scanning/alerts"], + listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + listLocationsForAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"], + updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] + }, teams: { addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], - addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}", { - mediaType: { - previews: ["inertia"] - } - }], + addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}", { - mediaType: { - previews: ["inertia"] - } - }], + checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], create: ["POST /orgs/{org}/teams"], createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], @@ -7326,11 +8333,7 @@ const Endpoints = { listForAuthenticatedUser: ["GET /user/teams"], listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], - listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects", { - mediaType: { - previews: ["inertia"] - } - }], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], @@ -7340,42 +8343,87 @@ const Endpoints = { updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, users: { - addEmailForAuthenticated: ["POST /user/emails"], + addEmailForAuthenticated: ["POST /user/emails", {}, { + renamed: ["users", "addEmailForAuthenticatedUser"] + }], + addEmailForAuthenticatedUser: ["POST /user/emails"], block: ["PUT /user/blocks/{username}"], checkBlocked: ["GET /user/blocks/{username}"], checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: ["POST /user/keys"], - deleteEmailForAuthenticated: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}"], + createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { + renamed: ["users", "createGpgKeyForAuthenticatedUser"] + }], + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { + renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] + }], + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { + renamed: ["users", "deleteEmailForAuthenticatedUser"] + }], + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] + }], + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { + renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] + }], + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], follow: ["PUT /user/following/{username}"], getAuthenticated: ["GET /user"], getByUsername: ["GET /users/{username}"], getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}"], + getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "getGpgKeyForAuthenticatedUser"] + }], + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { + renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] + }], + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], list: ["GET /users"], - listBlockedByAuthenticated: ["GET /user/blocks"], - listEmailsForAuthenticated: ["GET /user/emails"], - listFollowedByAuthenticated: ["GET /user/following"], + listBlockedByAuthenticated: ["GET /user/blocks", {}, { + renamed: ["users", "listBlockedByAuthenticatedUser"] + }], + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: ["GET /user/emails", {}, { + renamed: ["users", "listEmailsForAuthenticatedUser"] + }], + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: ["GET /user/following", {}, { + renamed: ["users", "listFollowedByAuthenticatedUser"] + }], + listFollowedByAuthenticatedUser: ["GET /user/following"], listFollowersForAuthenticatedUser: ["GET /user/followers"], listFollowersForUser: ["GET /users/{username}/followers"], listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: ["GET /user/gpg_keys"], + listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { + renamed: ["users", "listGpgKeysForAuthenticatedUser"] + }], + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: ["GET /user/public_emails"], + listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { + renamed: ["users", "listPublicEmailsForAuthenticatedUser"] + }], + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: ["GET /user/keys"], - setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility"], + listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { + renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] + }], + listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], + setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { + renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] + }], + setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], unblock: ["DELETE /user/blocks/{username}"], unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] } }; -const VERSION = "4.2.1"; +const VERSION = "5.16.2"; function endpointsToMethods(octokit, endpointsMap) { const newMethods = {}; @@ -7458,22 +8506,22 @@ function decorate(octokit, scope, methodName, defaults, decorations) { return Object.assign(withDecorations, requestWithDefaults); } -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ - function restEndpointMethods(octokit) { - return endpointsToMethods(octokit, Endpoints); + const api = endpointsToMethods(octokit, Endpoints); + return { + rest: api + }; } restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return _objectSpread2(_objectSpread2({}, api), {}, { + rest: api + }); +} +legacyRestEndpointMethods.VERSION = VERSION; +exports.legacyRestEndpointMethods = legacyRestEndpointMethods; exports.restEndpointMethods = restEndpointMethods; //# sourceMappingURL=index.js.map @@ -7493,7 +8541,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var deprecation = __nccwpck_require__(8932); var once = _interopDefault(__nccwpck_require__(1223)); -const logOnce = once(deprecation => console.warn(deprecation)); +const logOnceCode = once(deprecation => console.warn(deprecation)); +const logOnceHeaders = once(deprecation => console.warn(deprecation)); /** * Error with extra properties to help with debugging */ @@ -7510,14 +8559,17 @@ class RequestError extends Error { this.name = "HttpError"; this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } + let headers; + + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options - }); - this.headers = options.headers || {}; // redact request credentials without mutating original request options const requestCopy = Object.assign({}, options.request); @@ -7532,7 +8584,22 @@ class RequestError extends Error { .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; + this.request = requestCopy; // deprecations + + Object.defineProperty(this, "code", { + get() { + logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + } + + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + } + + }); } } @@ -7555,17 +8622,19 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var endpoint = __nccwpck_require__(9440); var universalUserAgent = __nccwpck_require__(5030); -var isPlainObject = __nccwpck_require__(9062); +var isPlainObject = __nccwpck_require__(3287); var nodeFetch = _interopDefault(__nccwpck_require__(467)); var requestError = __nccwpck_require__(537); -const VERSION = "5.4.10"; +const VERSION = "5.6.3"; function getBufferResponse(response) { return response.arrayBuffer(); } function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); } @@ -7579,7 +8648,9 @@ function fetchWrapper(requestOptions) { body: requestOptions.body, headers: requestOptions.headers, redirect: requestOptions.redirect - }, requestOptions.request)).then(response => { + }, // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)).then(async response => { url = response.url; status = response.status; @@ -7587,6 +8658,12 @@ function fetchWrapper(requestOptions) { headers[keyAndValue[0]] = keyAndValue[1]; } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } + if (status === 204 || status === 205) { return; } // GitHub API returns 200 for HEAD requests @@ -7598,49 +8675,43 @@ function fetchWrapper(requestOptions) { } throw new requestError.RequestError(response.statusText, status, { - headers, + response: { + url, + status, + headers, + data: undefined + }, request: requestOptions }); } if (status === 304) { throw new requestError.RequestError("Not modified", status, { - headers, + response: { + url, + status, + headers, + data: await getResponseData(response) + }, request: requestOptions }); } if (status >= 400) { - return response.text().then(message => { - const error = new requestError.RequestError(message, status, { + const data = await getResponseData(response); + const error = new requestError.RequestError(toErrorMessage(data), status, { + response: { + url, + status, headers, - request: requestOptions - }); - - try { - let responseBody = JSON.parse(error.message); - Object.assign(error, responseBody); - let errors = responseBody.errors; // Assumption `errors` would always be in Array format - - error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); - } catch (e) {// ignore, see octokit/rest.js#684 - } - - throw error; + data + }, + request: requestOptions }); + throw error; } - const contentType = response.headers.get("content-type"); - - if (/application\/json/.test(contentType)) { - return response.json(); - } - - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - - return getBufferResponse(response); + return getResponseData(response); }).then(data => { return { status, @@ -7649,17 +8720,42 @@ function fetchWrapper(requestOptions) { data }; }).catch(error => { - if (error instanceof requestError.RequestError) { - throw error; - } - + if (error instanceof requestError.RequestError) throw error; throw new requestError.RequestError(error.message, 500, { - headers, request: requestOptions }); }); } +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + + if (/application\/json/.test(contentType)) { + return response.json(); + } + + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + + return getBufferResponse(response); +} + +function toErrorMessage(data) { + if (typeof data === "string") return data; // istanbul ignore else - just in case + + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } + + return data.message; + } // istanbul ignore next - just in case + + + return `Unknown error: ${JSON.stringify(data)}`; +} + function withDefaults(oldEndpoint, newDefaults) { const endpoint = oldEndpoint.defaults(newDefaults); @@ -7699,54 +8795,8 @@ exports.request = request; /***/ }), -/***/ 9062: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -} - -exports.isPlainObject = isPlainObject; - - -/***/ }), - -/***/ 7678: -/***/ ((module, exports) => { +/***/ 7678: +/***/ ((module, exports) => { "use strict"; @@ -7780,6 +8830,7 @@ const objectTypeNames = [ 'Observable', 'Array', 'Buffer', + 'Blob', 'Object', 'RegExp', 'Date', @@ -7793,6 +8844,8 @@ const objectTypeNames = [ 'DataView', 'Promise', 'URL', + 'FormData', + 'URLSearchParams', 'HTMLElement', ...typedArrayTypeNames ]; @@ -7888,11 +8941,12 @@ is.array = (value, assertion) => { return value.every(assertion); }; is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; }; +is.blob = (value) => isObjectOfType('Blob')(value); is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value)); is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); }; is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); }; -is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); +is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); }; is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); is.nativePromise = (value) => isObjectOfType('Promise')(value); const hasPromiseAPI = (value) => { @@ -7927,6 +8981,7 @@ is.bigUint64Array = isObjectOfType('BigUint64Array'); is.arrayBuffer = isObjectOfType('ArrayBuffer'); is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer'); is.dataView = isObjectOfType('DataView'); +is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value); is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; is.urlInstance = (value) => isObjectOfType('URL')(value); is.urlString = (value) => { @@ -7941,7 +8996,6 @@ is.urlString = (value) => { return false; } }; -// TODO: Use the `not` operator with a type guard here when it's available. // Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` is.truthy = (value) => Boolean(value); // Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` @@ -7951,7 +9005,7 @@ is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value); is.integer = (value) => Number.isInteger(value); is.safeInteger = (value) => Number.isSafeInteger(value); is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js + // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js if (toString.call(value) !== '[object Object]') { return false; } @@ -8007,10 +9061,12 @@ is.oddInteger = isAbsoluteMod2(1); is.emptyArray = (value) => is.array(value) && value.length === 0; is.nonEmptyArray = (value) => is.array(value) && value.length > 0; is.emptyString = (value) => is.string(value) && value.length === 0; -// TODO: Use `not ''` when the `not` operator is available. -is.nonEmptyString = (value) => is.string(value) && value.length > 0; const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); +// TODO: Use `not ''` when the `not` operator is available. +is.nonEmptyString = (value) => is.string(value) && value.length > 0; +// TODO: Use `not ''` when the `not` operator is available. +is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value); is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; // TODO: Use `not` operator here to remove `Map` and `Set` from type guard: // - https://github.com/Microsoft/TypeScript/pull/29317 @@ -8019,6 +9075,10 @@ is.emptySet = (value) => is.set(value) && value.size === 0; is.nonEmptySet = (value) => is.set(value) && value.size > 0; is.emptyMap = (value) => is.map(value) && value.size === 0; is.nonEmptyMap = (value) => is.map(value) && value.size > 0; +// `PropertyKey` is any value that can be used as an object key (string, number, or symbol) +is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value); +is.formData = (value) => isObjectOfType('FormData')(value); +is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value); const predicateOnArray = (method, predicate, values) => { if (!is.function_(predicate)) { throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); @@ -8033,9 +9093,15 @@ is.any = (predicate, ...values) => { return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values)); }; is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); -const assertType = (condition, description, value) => { +const assertType = (condition, description, value, options = {}) => { if (!condition) { - throw new TypeError(`Expected value which is \`${description}\`, received value of type \`${is(value)}\`.`); + const { multipleValues } = options; + const valuesMessage = multipleValues ? + `received values of types ${[ + ...new Set(value.map(singleValue => `\`${is(singleValue)}\``)) + ].join(', ')}` : + `received value of type \`${is(value)}\``; + throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); } }; exports.assert = { @@ -8059,6 +9125,7 @@ exports.assert = { } }, buffer: (value) => assertType(is.buffer(value), 'Buffer', value), + blob: (value) => assertType(is.blob(value), 'Blob', value), nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value), object: (value) => assertType(is.object(value), 'Object', value), iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value), @@ -8094,6 +9161,7 @@ exports.assert = { arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value), sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value), dataView: (value) => assertType(is.dataView(value), 'DataView', value), + enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value), urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value), urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value), truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value), @@ -8112,14 +9180,18 @@ exports.assert = { emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value), nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value), emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value), - nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value), + nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), + nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value), emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value), nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value), emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value), nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value), emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value), nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value), + propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value), + formData: (value) => assertType(is.formData(value), 'FormData', value), + urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value), // Numbers. evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value), oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value), @@ -8127,8 +9199,10 @@ exports.assert = { directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance), inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value), // Variadic functions. - any: (predicate, ...values) => assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values), - all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values) + any: (predicate, ...values) => { + return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true }); + }, + all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true }) }; // Some few keywords are reserved, but we'll populate them for Node.js users // See https://github.com/Microsoft/TypeScript/issues/2536 @@ -8154,10 +9228,10 @@ Object.defineProperties(exports.assert, { value: exports.assert.null_ } }); -exports.default = is; +exports["default"] = is; // For CommonJS default export support module.exports = is; -module.exports.default = is; +module.exports["default"] = is; module.exports.assert = exports.assert; @@ -8170,8 +9244,12 @@ module.exports.assert = exports.assert; Object.defineProperty(exports, "__esModule", ({ value: true })); const defer_to_connect_1 = __nccwpck_require__(6214); +const util_1 = __nccwpck_require__(3837); const nodejsMajorVersion = Number(process.versions.node.split('.')[0]); const timer = (request) => { + if (request.timings) { + return request.timings; + } const timings = { start: Date.now(), socket: undefined, @@ -8209,17 +9287,21 @@ const timer = (request) => { }; }; handleError(request); - request.prependOnceListener('abort', () => { + const onAbort = () => { timings.abort = Date.now(); // Let the `end` response event be responsible for setting the total phase, // unless the Node.js major version is >= 13. if (!timings.response || nodejsMajorVersion >= 13) { timings.phases.total = Date.now() - timings.start; } - }); + }; + request.prependOnceListener('abort', onAbort); const onSocket = (socket) => { timings.socket = Date.now(); timings.phases.wait = timings.socket - timings.start; + if (util_1.types.isProxy(socket)) { + return; + } const lookupListener = () => { timings.lookup = Date.now(); timings.phases.dns = timings.lookup - timings.socket; @@ -8252,7 +9334,7 @@ const timer = (request) => { const onUpload = () => { var _a; timings.upload = Date.now(); - timings.phases.request = timings.upload - (_a = timings.secureConnect, (_a !== null && _a !== void 0 ? _a : timings.connect)); + timings.phases.request = timings.upload - ((_a = timings.secureConnect) !== null && _a !== void 0 ? _a : timings.connect); }; const writableFinished = () => { if (typeof request.writableFinished === 'boolean') { @@ -8277,13 +9359,14 @@ const timer = (request) => { timings.phases.download = timings.end - timings.response; timings.phases.total = timings.end - timings.start; }); + response.prependOnceListener('aborted', onAbort); }); return timings; }; -exports.default = timer; +exports["default"] = timer; // For CommonJS default export support module.exports = timer; -module.exports.default = timer; +module.exports["default"] = timer; /***/ }), @@ -8291,292 +9374,310 @@ module.exports.default = timer; /***/ 6761: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Utils = __nccwpck_require__(5182); -var fs = Utils.FileSystem.require(), - pth = __nccwpck_require__(5622); +const Utils = __nccwpck_require__(5182); +const pth = __nccwpck_require__(1017); +const ZipEntry = __nccwpck_require__(4057); +const ZipFile = __nccwpck_require__(7744); -fs.existsSync = fs.existsSync || pth.existsSync; +const get_Bool = (val, def) => (typeof val === "boolean" ? val : def); +const get_Str = (val, def) => (typeof val === "string" ? val : def); -var ZipEntry = __nccwpck_require__(4057), - ZipFile = __nccwpck_require__(7744); +const defaultOptions = { + // option "noSort" : if true it disables files sorting + noSort: false, + // read entries during load (initial loading may be slower) + readEntries: false, + // default method is none + method: Utils.Constants.NONE, + // file system + fs: null +}; -var isWin = /^win/.test(process.platform); +module.exports = function (/**String*/ input, /** object */ options) { + let inBuffer = null; -function canonical(p) { - var safeSuffix = pth.normalize(p).replace(/^(\.\.(\/|\\|$))+/, ''); - return pth.join('./', safeSuffix); -} + // create object based default options, allowing them to be overwritten + const opts = Object.assign(Object.create(null), defaultOptions); -module.exports = function (/**String*/input) { - var _zip = undefined, - _filename = ""; + // test input variable + if (input && "object" === typeof input) { + // if value is not buffer we accept it to be object with options + if (!(input instanceof Uint8Array)) { + Object.assign(opts, input); + input = opts.input ? opts.input : undefined; + if (opts.input) delete opts.input; + } - if (input && typeof input === "string") { // load zip file - if (fs.existsSync(input)) { - _filename = input; - _zip = new ZipFile(input, Utils.Constants.FILE); - } else { - throw new Error(Utils.Errors.INVALID_FILENAME); - } - } else if (input && Buffer.isBuffer(input)) { // load buffer - _zip = new ZipFile(input, Utils.Constants.BUFFER); - } else { // create new zip file - _zip = new ZipFile(null, Utils.Constants.NONE); - } + // if input is buffer + if (Buffer.isBuffer(input)) { + inBuffer = input; + opts.method = Utils.Constants.BUFFER; + input = undefined; + } + } - function sanitize(prefix, name) { - prefix = pth.resolve(pth.normalize(prefix)); - var parts = name.split('/'); - for (var i = 0, l = parts.length; i < l; i++) { - var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep))); - if (path.indexOf(prefix) === 0) { - return path; - } - } - return pth.normalize(pth.join(prefix, pth.basename(name))); - } + // assign options + Object.assign(opts, options); - function getEntry(/**Object*/entry) { - if (entry && _zip) { - var item; - // If entry was given as a file name - if (typeof entry === "string") - item = _zip.getEntry(entry); - // if entry was given as a ZipEntry object - if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined") - item = _zip.getEntry(entry.entryName); - - if (item) { - return item; - } - } - return null; - } + // instanciate utils filesystem + const filetools = new Utils(opts); - function fixPath(zipPath){ - // convert windows file separators - zipPath = zipPath.split("\\").join("/"); - // add separator if it wasnt given - if (zipPath.charAt(zipPath.length - 1) !== "/") { - zipPath += "/"; - } - return zipPath; + // if input is file name we retrieve its content + if (input && "string" === typeof input) { + // load zip file + if (filetools.fs.existsSync(input)) { + opts.method = Utils.Constants.FILE; + opts.filename = input; + inBuffer = filetools.fs.readFileSync(input); + } else { + throw new Error(Utils.Errors.INVALID_FILENAME); + } } - return { - /** - * Extracts the given entry from the archive and returns the content as a Buffer object - * @param entry ZipEntry object or String with the full path of the entry - * - * @return Buffer or Null in case of error - */ - readFile: function (/**Object*/entry, /*String, Buffer*/pass) { - var item = getEntry(entry); - return item && item.getData(pass) || null; - }, + // create variable + const _zip = new ZipFile(inBuffer, opts); - /** - * Asynchronous readFile - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * - * @return Buffer or Null in case of error - */ - readFileAsync: function (/**Object*/entry, /**Function*/callback) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(callback); - } else { - callback(null, "getEntry failed for:" + entry) - } - }, + const { canonical, sanitize } = Utils; - /** - * Extracts the given entry from the archive and returns the content as plain text in the given encoding - * @param entry ZipEntry object or String with the full path of the entry - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsText: function (/**Object*/entry, /**String=*/encoding) { - var item = getEntry(entry); - if (item) { - var data = item.getData(); - if (data && data.length) { - return data.toString(encoding || "utf8"); - } - } - return ""; - }, + function getEntry(/**Object*/ entry) { + if (entry && _zip) { + var item; + // If entry was given as a file name + if (typeof entry === "string") item = _zip.getEntry(entry); + // if entry was given as a ZipEntry object + if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined") item = _zip.getEntry(entry.entryName); - /** - * Asynchronous readAsText - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsTextAsync: function (/**Object*/entry, /**Function*/callback, /**String=*/encoding) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(function (data, err) { - if (err) { - callback(data, err); - return; - } + if (item) { + return item; + } + } + return null; + } - if (data && data.length) { - callback(data.toString(encoding || "utf8")); - } else { - callback(""); - } - }) - } else { - callback(""); - } - }, + function fixPath(zipPath) { + const { join, normalize, sep } = pth.posix; + // convert windows file separators and normalize + return join(".", normalize(sep + zipPath.split("\\").join(sep) + sep)); + } - /** - * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory - * - * @param entry - */ - deleteFile: function (/**Object*/entry) { // @TODO: test deleteFile - var item = getEntry(entry); - if (item) { - _zip.deleteEntry(item.entryName); - } - }, + return { + /** + * Extracts the given entry from the archive and returns the content as a Buffer object + * @param entry ZipEntry object or String with the full path of the entry + * + * @return Buffer or Null in case of error + */ + readFile: function (/**Object*/ entry, /*String, Buffer*/ pass) { + var item = getEntry(entry); + return (item && item.getData(pass)) || null; + }, - /** - * Adds a comment to the zip. The zip must be rewritten after adding the comment. - * - * @param comment - */ - addZipComment: function (/**String*/comment) { // @TODO: test addZipComment - _zip.comment = comment; - }, + /** + * Asynchronous readFile + * @param entry ZipEntry object or String with the full path of the entry + * @param callback + * + * @return Buffer or Null in case of error + */ + readFileAsync: function (/**Object*/ entry, /**Function*/ callback) { + var item = getEntry(entry); + if (item) { + item.getDataAsync(callback); + } else { + callback(null, "getEntry failed for:" + entry); + } + }, - /** - * Returns the zip comment - * - * @return String - */ - getZipComment: function () { - return _zip.comment || ''; - }, + /** + * Extracts the given entry from the archive and returns the content as plain text in the given encoding + * @param entry ZipEntry object or String with the full path of the entry + * @param encoding Optional. If no encoding is specified utf8 is used + * + * @return String + */ + readAsText: function (/**Object*/ entry, /**String=*/ encoding) { + var item = getEntry(entry); + if (item) { + var data = item.getData(); + if (data && data.length) { + return data.toString(encoding || "utf8"); + } + } + return ""; + }, - /** - * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment - * The comment cannot exceed 65535 characters in length - * - * @param entry - * @param comment - */ - addZipEntryComment: function (/**Object*/entry, /**String*/comment) { - var item = getEntry(entry); - if (item) { - item.comment = comment; - } - }, + /** + * Asynchronous readAsText + * @param entry ZipEntry object or String with the full path of the entry + * @param callback + * @param encoding Optional. If no encoding is specified utf8 is used + * + * @return String + */ + readAsTextAsync: function (/**Object*/ entry, /**Function*/ callback, /**String=*/ encoding) { + var item = getEntry(entry); + if (item) { + item.getDataAsync(function (data, err) { + if (err) { + callback(data, err); + return; + } - /** - * Returns the comment of the specified entry - * - * @param entry - * @return String - */ - getZipEntryComment: function (/**Object*/entry) { - var item = getEntry(entry); - if (item) { - return item.comment || ''; - } - return '' - }, + if (data && data.length) { + callback(data.toString(encoding || "utf8")); + } else { + callback(""); + } + }); + } else { + callback(""); + } + }, - /** - * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content - * - * @param entry - * @param content - */ - updateFile: function (/**Object*/entry, /**Buffer*/content) { - var item = getEntry(entry); - if (item) { - item.setData(content); - } - }, + /** + * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory + * + * @param entry + */ + deleteFile: function (/**Object*/ entry) { + // @TODO: test deleteFile + var item = getEntry(entry); + if (item) { + _zip.deleteEntry(item.entryName); + } + }, - /** - * Adds a file from the disk to the archive - * - * @param localPath File to add to zip - * @param zipPath Optional path inside the zip - * @param zipName Optional name for the file - */ - addLocalFile: function (/**String*/localPath, /**String=*/zipPath, /**String=*/zipName, /**String*/comment) { - if (fs.existsSync(localPath)) { - // fix ZipPath - zipPath = (zipPath) ? fixPath(zipPath) : ""; - - // p - local file name - var p = localPath.split("\\").join("/").split("/").pop(); - - // add file name into zippath - zipPath += (zipName) ? zipName : p; - - // read file attributes - const _attr = fs.statSync(localPath); - - // add file into zip file - this.addFile(zipPath, fs.readFileSync(localPath), comment, _attr) - } else { - throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); - } - }, + /** + * Adds a comment to the zip. The zip must be rewritten after adding the comment. + * + * @param comment + */ + addZipComment: function (/**String*/ comment) { + // @TODO: test addZipComment + _zip.comment = comment; + }, + + /** + * Returns the zip comment + * + * @return String + */ + getZipComment: function () { + return _zip.comment || ""; + }, + + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment + * The comment cannot exceed 65535 characters in length + * + * @param entry + * @param comment + */ + addZipEntryComment: function (/**Object*/ entry, /**String*/ comment) { + var item = getEntry(entry); + if (item) { + item.comment = comment; + } + }, + + /** + * Returns the comment of the specified entry + * + * @param entry + * @return String + */ + getZipEntryComment: function (/**Object*/ entry) { + var item = getEntry(entry); + if (item) { + return item.comment || ""; + } + return ""; + }, + + /** + * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content + * + * @param entry + * @param content + */ + updateFile: function (/**Object*/ entry, /**Buffer*/ content) { + var item = getEntry(entry); + if (item) { + item.setData(content); + } + }, + + /** + * Adds a file from the disk to the archive + * + * @param localPath File to add to zip + * @param zipPath Optional path inside the zip + * @param zipName Optional name for the file + */ + addLocalFile: function (/**String*/ localPath, /**String=*/ zipPath, /**String=*/ zipName, /**String*/ comment) { + if (filetools.fs.existsSync(localPath)) { + // fix ZipPath + zipPath = zipPath ? fixPath(zipPath) : ""; + + // p - local file name + var p = localPath.split("\\").join("/").split("/").pop(); + + // add file name into zippath + zipPath += zipName ? zipName : p; + + // read file attributes + const _attr = filetools.fs.statSync(localPath); + + // add file into zip file + this.addFile(zipPath, filetools.fs.readFileSync(localPath), comment, _attr); + } else { + throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); + } + }, - /** - * Adds a local directory and all its nested files and directories to the archive - * - * @param localPath - * @param zipPath optional path inside zip - * @param filter optional RegExp or Function if files match will - * be included. - */ - addLocalFolder: function (/**String*/localPath, /**String=*/zipPath, /**=RegExp|Function*/filter) { + /** + * Adds a local directory and all its nested files and directories to the archive + * + * @param localPath + * @param zipPath optional path inside zip + * @param filter optional RegExp or Function if files match will + * be included. + */ + addLocalFolder: function (/**String*/ localPath, /**String=*/ zipPath, /**=RegExp|Function*/ filter) { // Prepare filter - if (filter instanceof RegExp) { // if filter is RegExp wrap it - filter = (function (rx){ + if (filter instanceof RegExp) { + // if filter is RegExp wrap it + filter = (function (rx) { return function (filename) { return rx.test(filename); - } + }; })(filter); - } else if ('function' !== typeof filter) { // if filter is not function we will replace it + } else if ("function" !== typeof filter) { + // if filter is not function we will replace it filter = function () { return true; }; } // fix ZipPath - zipPath = (zipPath) ? fixPath(zipPath) : ""; + zipPath = zipPath ? fixPath(zipPath) : ""; // normalize the path first localPath = pth.normalize(localPath); - if (fs.existsSync(localPath)) { - - var items = Utils.findFiles(localPath), - self = this; + if (filetools.fs.existsSync(localPath)) { + const items = filetools.findFiles(localPath); + const self = this; if (items.length) { items.forEach(function (filepath) { var p = pth.relative(localPath, filepath).split("\\").join("/"); //windows fix if (filter(p)) { - if (filepath.charAt(filepath.length - 1) !== pth.sep) { - self.addFile(zipPath + p, fs.readFileSync(filepath), "", fs.statSync(filepath)); + var stats = filetools.fs.statSync(filepath); + if (stats.isFile()) { + self.addFile(zipPath + p, filetools.fs.readFileSync(filepath), "", stats); } else { - self.addFile(zipPath + p + '/', Buffer.alloc(0), "", 0); + self.addFile(zipPath + p + "/", Buffer.alloc(0), "", stats); } } }); @@ -8586,376 +9687,475 @@ module.exports = function (/**String*/input) { } }, - /** - * Asynchronous addLocalFile - * @param localPath - * @param callback - * @param zipPath optional path inside zip - * @param filter optional RegExp or Function if files match will - * be included. - */ - addLocalFolderAsync: function (/*String*/localPath, /*Function*/callback, /*String*/zipPath, /*RegExp|Function*/filter) { - if (filter === undefined) { - filter = function () { - return true; - }; - } else if (filter instanceof RegExp) { - filter = function (filter) { - return function (filename) { - return filter.test(filename); - } - }(filter); - } - - if (zipPath) { - zipPath = zipPath.split("\\").join("/"); - if (zipPath.charAt(zipPath.length - 1) !== "/") { - zipPath += "/"; - } - } else { - zipPath = ""; - } - // normalize the path first - localPath = pth.normalize(localPath); - localPath = localPath.split("\\").join("/"); //windows fix - if (localPath.charAt(localPath.length - 1) !== "/") - localPath += "/"; - - var self = this; - fs.open(localPath, 'r', function (err, fd) { - if (err && err.code === 'ENOENT') { - callback(undefined, Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); - } else if (err) { - callback(undefined, err); - } else { - var items = Utils.findFiles(localPath); - var i = -1; - - var next = function () { - i += 1; - if (i < items.length) { - var p = items[i].split("\\").join("/").replace(new RegExp(localPath.replace(/(\(|\))/g, '\\$1'), 'i'), ""); //windows fix - p = p.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/[^\x20-\x7E]/g, '') // accent fix - if (filter(p)) { - if (p.charAt(p.length - 1) !== "/") { - fs.readFile(items[i], function (err, data) { - if (err) { - callback(undefined, err); - } else { - self.addFile(zipPath + p, data, '', 0); - next(); - } - }) - } else { - self.addFile(zipPath + p, Buffer.alloc(0), "", 0); - next(); - } - } else { - next(); - } - - } else { - callback(true, undefined); - } - } + /** + * Asynchronous addLocalFile + * @param localPath + * @param callback + * @param zipPath optional path inside zip + * @param filter optional RegExp or Function if files match will + * be included. + */ + addLocalFolderAsync: function (/*String*/ localPath, /*Function*/ callback, /*String*/ zipPath, /*RegExp|Function*/ filter) { + if (filter instanceof RegExp) { + filter = (function (rx) { + return function (filename) { + return rx.test(filename); + }; + })(filter); + } else if ("function" !== typeof filter) { + filter = function () { + return true; + }; + } - next(); - } - }); - }, + // fix ZipPath + zipPath = zipPath ? fixPath(zipPath) : ""; - /** - * Allows you to create a entry (file or directory) in the zip file. - * If you want to create a directory the entryName must end in / and a null buffer should be provided. - * Comment and attributes are optional - * - * @param entryName - * @param content - * @param comment - * @param attr - */ - addFile: function (/**String*/entryName, /**Buffer*/content, /**String*/comment, /**Number*/attr) { - // prepare new entry - var entry = new ZipEntry(); - entry.entryName = entryName; - entry.comment = comment || ""; - - var isStat = ('object' === typeof attr) && (attr instanceof fs.Stats); - - // last modification time from file stats - if (isStat){ - entry.header.time = attr.mtime; - } + // normalize the path first + localPath = pth.normalize(localPath); - // Set file attribute - var fileattr = (entry.isDirectory) ? 0x10 : 0; // (MS-DOS directory flag) + var self = this; + filetools.fs.open(localPath, "r", function (err) { + if (err && err.code === "ENOENT") { + callback(undefined, Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); + } else if (err) { + callback(undefined, err); + } else { + var items = filetools.findFiles(localPath); + var i = -1; + + var next = function () { + i += 1; + if (i < items.length) { + var filepath = items[i]; + var p = pth.relative(localPath, filepath).split("\\").join("/"); //windows fix + p = p + .normalize("NFD") + .replace(/[\u0300-\u036f]/g, "") + .replace(/[^\x20-\x7E]/g, ""); // accent fix + if (filter(p)) { + filetools.fs.stat(filepath, function (er0, stats) { + if (er0) callback(undefined, er0); + if (stats.isFile()) { + filetools.fs.readFile(filepath, function (er1, data) { + if (er1) { + callback(undefined, er1); + } else { + self.addFile(zipPath + p, data, "", stats); + next(); + } + }); + } else { + self.addFile(zipPath + p + "/", Buffer.alloc(0), "", stats); + next(); + } + }); + } else { + next(); + } + } else { + callback(true, undefined); + } + }; - // extended attributes field for Unix - if('win32' !== process.platform){ - // set file type either S_IFDIR / S_IFREG - var unix = (entry.isDirectory) ? 0x4000 : 0x8000; + next(); + } + }); + }, - if (isStat) { // File attributes from file stats - unix |= (0xfff & attr.mode) - }else if ('number' === typeof attr){ // attr from given attr values - unix |= (0xfff & attr); - }else{ // Default values: - unix |= (entry.isDirectory) ? 0o755 : 0o644; // permissions (drwxr-xr-x) or (-r-wr--r--) - } + /** + * + * @param {string} localPath - path where files will be extracted + * @param {object} props - optional properties + * @param {string} props.zipPath - optional path inside zip + * @param {regexp, function} props.filter - RegExp or Function if files match will be included. + */ + addLocalFolderPromise: function (/*String*/ localPath, /* object */ props) { + return new Promise((resolve, reject) => { + const { filter, zipPath } = Object.assign({}, props); + this.addLocalFolderAsync( + localPath, + (done, err) => { + if (err) reject(err); + if (done) resolve(this); + }, + zipPath, + filter + ); + }); + }, - fileattr = (fileattr | (unix << 16)) >>> 0; // add attributes - } + /** + * Allows you to create a entry (file or directory) in the zip file. + * If you want to create a directory the entryName must end in / and a null buffer should be provided. + * Comment and attributes are optional + * + * @param {string} entryName + * @param {Buffer | string} content - file content as buffer or utf8 coded string + * @param {string} comment - file comment + * @param {number | object} attr - number as unix file permissions, object as filesystem Stats object + */ + addFile: function (/**String*/ entryName, /**Buffer*/ content, /**String*/ comment, /**Number*/ attr) { + let entry = getEntry(entryName); + const update = entry != null; - entry.attr = fileattr; + // prepare new entry + if (!update) { + entry = new ZipEntry(); + entry.entryName = entryName; + } + entry.comment = comment || ""; - entry.setData(content); - _zip.setEntry(entry); - }, + const isStat = "object" === typeof attr && attr instanceof filetools.fs.Stats; - /** - * Returns an array of ZipEntry objects representing the files and folders inside the archive - * - * @return Array - */ - getEntries: function () { - if (_zip) { - return _zip.entries; - } else { - return []; - } - }, + // last modification time from file stats + if (isStat) { + entry.header.time = attr.mtime; + } - /** - * Returns a ZipEntry object representing the file or folder specified by ``name``. - * - * @param name - * @return ZipEntry - */ - getEntry: function (/**String*/name) { - return getEntry(name); - }, + // Set file attribute + var fileattr = entry.isDirectory ? 0x10 : 0; // (MS-DOS directory flag) - getEntryCount: function() { - return _zip.getEntryCount(); - }, + // extended attributes field for Unix + if (!Utils.isWin) { + // set file type either S_IFDIR / S_IFREG + let unix = entry.isDirectory ? 0x4000 : 0x8000; - forEach: function(callback) { - return _zip.forEach(callback); - }, + if (isStat) { + // File attributes from file stats + unix |= 0xfff & attr.mode; + } else if ("number" === typeof attr) { + // attr from given attr values + unix |= 0xfff & attr; + } else { + // Default values: + unix |= entry.isDirectory ? 0o755 : 0o644; // permissions (drwxr-xr-x) or (-r-wr--r--) + } - /** - * Extracts the given entry to the given targetPath - * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted - * - * @param entry ZipEntry object or String with the full path of the entry - * @param targetPath Target folder where to write the file - * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder - * will be created in targetPath as well. Default is TRUE - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * @param outFileName String If set will override the filename of the extracted file (Only works if the entry is a file) - * - * @return Boolean - */ - extractEntryTo: function (/**Object*/entry, /**String*/targetPath, /**Boolean*/maintainEntryPath, /**Boolean*/overwrite, /**String**/outFileName) { - overwrite = overwrite || false; - maintainEntryPath = typeof maintainEntryPath === "undefined" ? true : maintainEntryPath; - - var item = getEntry(entry); - if (!item) { - throw new Error(Utils.Errors.NO_ENTRY); - } + fileattr = (fileattr | (unix << 16)) >>> 0; // add attributes + } - var entryName = canonical(item.entryName); + entry.attr = fileattr; - var target = sanitize(targetPath,outFileName && !item.isDirectory ? outFileName : (maintainEntryPath ? entryName : pth.basename(entryName))); + entry.setData(content); + if (!update) _zip.setEntry(entry); + }, - if (item.isDirectory) { - target = pth.resolve(target, ".."); - var children = _zip.getEntryChildren(item); - children.forEach(function (child) { - if (child.isDirectory) return; - var content = child.getData(); - if (!content) { - throw new Error(Utils.Errors.CANT_EXTRACT_FILE); - } - var name = canonical(child.entryName) - var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name)); + /** + * Returns an array of ZipEntry objects representing the files and folders inside the archive + * + * @return Array + */ + getEntries: function () { + return _zip ? _zip.entries : []; + }, - Utils.writeFileTo(childName, content, overwrite); - }); - return true; - } + /** + * Returns a ZipEntry object representing the file or folder specified by ``name``. + * + * @param name + * @return ZipEntry + */ + getEntry: function (/**String*/ name) { + return getEntry(name); + }, - var content = item.getData(); - if (!content) throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + getEntryCount: function () { + return _zip.getEntryCount(); + }, - if (fs.existsSync(target) && !overwrite) { - throw new Error(Utils.Errors.CANT_OVERRIDE); - } - Utils.writeFileTo(target, content, overwrite); + forEach: function (callback) { + return _zip.forEach(callback); + }, - return true; - }, + /** + * Extracts the given entry to the given targetPath + * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted + * + * @param entry ZipEntry object or String with the full path of the entry + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder + * will be created in targetPath as well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. + * Default is FALSE + * @param outFileName String If set will override the filename of the extracted file (Only works if the entry is a file) + * + * @return Boolean + */ + extractEntryTo: function ( + /**Object*/ entry, + /**String*/ targetPath, + /**Boolean*/ maintainEntryPath, + /**Boolean*/ overwrite, + /**Boolean*/ keepOriginalPermission, + /**String**/ outFileName + ) { + overwrite = get_Bool(overwrite, false); + keepOriginalPermission = get_Bool(keepOriginalPermission, false); + maintainEntryPath = get_Bool(maintainEntryPath, true); + outFileName = get_Str(outFileName, get_Str(keepOriginalPermission, undefined)); - /** - * Test the archive - * - */ - test: function (pass) { - if (!_zip) { - return false; - } + var item = getEntry(entry); + if (!item) { + throw new Error(Utils.Errors.NO_ENTRY); + } - for (var entry in _zip.entries) { - try { - if (entry.isDirectory) { - continue; - } - var content = _zip.entries[entry].getData(pass); - if (!content) { - return false; - } - } catch (err) { - return false; - } - } - return true; - }, + var entryName = canonical(item.entryName); - /** - * Extracts the entire archive to the given location - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - */ - extractAllTo: function (/**String*/targetPath, /**Boolean*/overwrite, /*String, Buffer*/pass) { - overwrite = overwrite || false; - if (!_zip) { - throw new Error(Utils.Errors.NO_ZIP); - } - _zip.entries.forEach(function (entry) { - var entryName = sanitize(targetPath, canonical(entry.entryName.toString())); - if (entry.isDirectory) { - Utils.makeDir(entryName); - return; - } - var content = entry.getData(pass); - if (!content) { - throw new Error(Utils.Errors.CANT_EXTRACT_FILE); - } - Utils.writeFileTo(entryName, content, overwrite); - try { - fs.utimesSync(entryName, entry.header.time, entry.header.time) - } catch (err) { - throw new Error(Utils.Errors.CANT_EXTRACT_FILE); - } - }) - }, + var target = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName)); - /** - * Asynchronous extractAllTo - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * @param callback - */ - extractAllToAsync: function (/**String*/targetPath, /**Boolean*/overwrite, /**Function*/callback) { - if (!callback) { - callback = function() {} - } - overwrite = overwrite || false; - if (!_zip) { - callback(new Error(Utils.Errors.NO_ZIP)); - return; - } + if (item.isDirectory) { + var children = _zip.getEntryChildren(item); + children.forEach(function (child) { + if (child.isDirectory) return; + var content = child.getData(); + if (!content) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + var name = canonical(child.entryName); + var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name)); + // The reverse operation for attr depend on method addFile() + const fileAttr = keepOriginalPermission ? child.header.fileAttr : undefined; + filetools.writeFileTo(childName, content, overwrite, fileAttr); + }); + return true; + } - var entries = _zip.entries; - var i = entries.length; - entries.forEach(function (entry) { - if (i <= 0) return; // Had an error already + var content = item.getData(); + if (!content) throw new Error(Utils.Errors.CANT_EXTRACT_FILE); - var entryName = pth.normalize(canonical(entry.entryName.toString())); + if (filetools.fs.existsSync(target) && !overwrite) { + throw new Error(Utils.Errors.CANT_OVERRIDE); + } + // The reverse operation for attr depend on method addFile() + const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; + filetools.writeFileTo(target, content, overwrite, fileAttr); - if (entry.isDirectory) { - Utils.makeDir(sanitize(targetPath, entryName)); - if (--i === 0) - callback(undefined); - return; - } - entry.getDataAsync(function (content, err) { - if (i <= 0) return; - if (err) { - callback(new Error(err)); - return; - } - if (!content) { - i = 0; - callback(new Error(Utils.Errors.CANT_EXTRACT_FILE)); - return; - } + return true; + }, - Utils.writeFileToAsync(sanitize(targetPath, entryName), content, overwrite, function (succ) { - try { - fs.utimesSync(pth.resolve(targetPath, entryName), entry.header.time, entry.header.time); - } catch (err) { - callback(new Error('Unable to set utimes')); - } - if (i <= 0) return; - if (!succ) { - i = 0; - callback(new Error('Unable to write')); - return; - } - if (--i === 0) - callback(undefined); - }); - }); - }) - }, + /** + * Test the archive + * + */ + test: function (pass) { + if (!_zip) { + return false; + } - /** - * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip - * - * @param targetFileName - * @param callback - */ - writeZip: function (/**String*/targetFileName, /**Function*/callback) { - if (arguments.length === 1) { - if (typeof targetFileName === "function") { - callback = targetFileName; - targetFileName = ""; - } - } + for (var entry in _zip.entries) { + try { + if (entry.isDirectory) { + continue; + } + var content = _zip.entries[entry].getData(pass); + if (!content) { + return false; + } + } catch (err) { + return false; + } + } + return true; + }, - if (!targetFileName && _filename) { - targetFileName = _filename; - } - if (!targetFileName) return; + /** + * Extracts the entire archive to the given location + * + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. + * Default is FALSE + */ + extractAllTo: function (/**String*/ targetPath, /**Boolean*/ overwrite, /**Boolean*/ keepOriginalPermission, /*String, Buffer*/ pass) { + overwrite = get_Bool(overwrite, false); + pass = get_Str(keepOriginalPermission, pass); + keepOriginalPermission = get_Bool(keepOriginalPermission, false); + if (!_zip) { + throw new Error(Utils.Errors.NO_ZIP); + } + _zip.entries.forEach(function (entry) { + var entryName = sanitize(targetPath, canonical(entry.entryName.toString())); + if (entry.isDirectory) { + filetools.makeDir(entryName); + return; + } + var content = entry.getData(pass); + if (!content) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + // The reverse operation for attr depend on method addFile() + const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; + filetools.writeFileTo(entryName, content, overwrite, fileAttr); + try { + filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time); + } catch (err) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + }); + }, - var zipData = _zip.compressToBuffer(); - if (zipData) { - var ok = Utils.writeFileTo(targetFileName, zipData, true); - if (typeof callback === 'function') callback(!ok ? new Error("failed") : null, ""); - } - }, + /** + * Asynchronous extractAllTo + * + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. + * Default is FALSE + * @param callback The callback will be executed when all entries are extracted successfully or any error is thrown. + */ + extractAllToAsync: function (/**String*/ targetPath, /**Boolean*/ overwrite, /**Boolean*/ keepOriginalPermission, /**Function*/ callback) { + if (!callback) { + callback = function () {}; + } + overwrite = get_Bool(overwrite, false); + if (typeof keepOriginalPermission === "function" && !callback) callback = keepOriginalPermission; + keepOriginalPermission = get_Bool(keepOriginalPermission, false); + if (!_zip) { + callback(new Error(Utils.Errors.NO_ZIP)); + return; + } - /** - * Returns the content of the entire zip file as a Buffer object - * - * @return Buffer - */ - toBuffer: function (/**Function=*/onSuccess, /**Function=*/onFail, /**Function=*/onItemStart, /**Function=*/onItemEnd) { - this.valueOf = 2; - if (typeof onSuccess === "function") { - _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd); - return null; - } - return _zip.compressToBuffer() - } - } + targetPath = pth.resolve(targetPath); + // convert entryName to + const getPath = (entry) => sanitize(targetPath, pth.normalize(canonical(entry.entryName.toString()))); + const getError = (msg, file) => new Error(msg + ': "' + file + '"'); + + // separate directories from files + const dirEntries = []; + const fileEntries = new Set(); + _zip.entries.forEach((e) => { + if (e.isDirectory) { + dirEntries.push(e); + } else { + fileEntries.add(e); + } + }); + + // Create directory entries first synchronously + // this prevents race condition and assures folders are there before writing files + for (const entry of dirEntries) { + const dirPath = getPath(entry); + // The reverse operation for attr depend on method addFile() + const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; + try { + filetools.makeDir(dirPath); + if (dirAttr) filetools.fs.chmodSync(dirPath, dirAttr); + // in unix timestamp will change if files are later added to folder, but still + filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); + } catch (er) { + callback(getError("Unable to create folder", dirPath)); + } + } + + // callback wrapper, for some house keeping + const done = () => { + if (fileEntries.size === 0) { + callback(); + } + }; + + // Extract file entries asynchronously + for (const entry of fileEntries.values()) { + const entryName = pth.normalize(canonical(entry.entryName.toString())); + const filePath = sanitize(targetPath, entryName); + entry.getDataAsync(function (content, err_1) { + if (err_1) { + callback(new Error(err_1)); + return; + } + if (!content) { + callback(new Error(Utils.Errors.CANT_EXTRACT_FILE)); + } else { + // The reverse operation for attr depend on method addFile() + const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; + filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function (succ) { + if (!succ) { + callback(getError("Unable to write file", filePath)); + return; + } + filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function (err_2) { + if (err_2) { + callback(getError("Unable to set times", filePath)); + return; + } + fileEntries.delete(entry); + // call the callback if it was last entry + done(); + }); + }); + } + }); + } + // call the callback if fileEntries was empty + done(); + }, + + /** + * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip + * + * @param targetFileName + * @param callback + */ + writeZip: function (/**String*/ targetFileName, /**Function*/ callback) { + if (arguments.length === 1) { + if (typeof targetFileName === "function") { + callback = targetFileName; + targetFileName = ""; + } + } + + if (!targetFileName && opts.filename) { + targetFileName = opts.filename; + } + if (!targetFileName) return; + + var zipData = _zip.compressToBuffer(); + if (zipData) { + var ok = filetools.writeFileTo(targetFileName, zipData, true); + if (typeof callback === "function") callback(!ok ? new Error("failed") : null, ""); + } + }, + + writeZipPromise: function (/**String*/ targetFileName, /* object */ props) { + const { overwrite, perm } = Object.assign({ overwrite: true }, props); + + return new Promise((resolve, reject) => { + // find file name + if (!targetFileName && opts.filename) targetFileName = opts.filename; + if (!targetFileName) reject("ADM-ZIP: ZIP File Name Missing"); + + this.toBufferPromise().then((zipData) => { + const ret = (done) => (done ? resolve(done) : reject("ADM-ZIP: Wasn't able to write zip file")); + filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret); + }, reject); + }); + }, + + toBufferPromise: function () { + return new Promise((resolve, reject) => { + _zip.toAsyncBuffer(resolve, reject); + }); + }, + + /** + * Returns the content of the entire zip file as a Buffer object + * + * @return Buffer + */ + toBuffer: function (/**Function=*/ onSuccess, /**Function=*/ onFail, /**Function=*/ onItemStart, /**Function=*/ onItemEnd) { + this.valueOf = 2; + if (typeof onSuccess === "function") { + _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd); + return null; + } + return _zip.compressToBuffer(); + } + }; }; @@ -8969,8 +10169,8 @@ var Utils = __nccwpck_require__(5182), /* The central directory file header */ module.exports = function () { - var _verMade = 0x14, - _version = 0x0A, + var _verMade = 20, // v2.0 + _version = 10, // v1.0 _flags = 0, _method = 0, _time = 0, @@ -8979,51 +10179,61 @@ module.exports = function () { _size = 0, _fnameLen = 0, _extraLen = 0, - _comLen = 0, _diskStart = 0, _inattr = 0, _attr = 0, _offset = 0; - switch(process.platform){ - case 'win32': - _verMade |= 0x0A00; - case 'darwin': - _verMade |= 0x1300; - default: - _verMade |= 0x0300; - } + _verMade |= Utils.isWin ? 0x0a00 : 0x0300; + + // Set EFS flag since filename and comment fields are all by default encoded using UTF-8. + // Without it file names may be corrupted for other apps when file names use unicode chars + _flags |= Constants.FLG_EFS; var _dataHeader = {}; function setTime(val) { val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980 - | (val.getMonth() + 1) << 21 // b05-08 month - | val.getDate() << 16 // b00-04 hour - + _time = + (((val.getFullYear() - 1980) & 0x7f) << 25) | // b09-16 years from 1980 + ((val.getMonth() + 1) << 21) | // b05-08 month + (val.getDate() << 16) | // b00-04 hour // 2 bytes time - | val.getHours() << 11 // b11-15 hour - | val.getMinutes() << 5 // b05-10 minute - | val.getSeconds() >> 1; // b00-04 seconds divided by 2 + (val.getHours() << 11) | // b11-15 hour + (val.getMinutes() << 5) | // b05-10 minute + (val.getSeconds() >> 1); // b00-04 seconds divided by 2 } setTime(+new Date()); return { - get made () { return _verMade; }, - set made (val) { _verMade = val; }, + get made() { + return _verMade; + }, + set made(val) { + _verMade = val; + }, - get version () { return _version; }, - set version (val) { _version = val }, + get version() { + return _version; + }, + set version(val) { + _version = val; + }, - get flags () { return _flags }, - set flags (val) { _flags = val; }, + get flags() { + return _flags; + }, + set flags(val) { + _flags = val; + }, - get method () { return _method; }, - set method (val) { - switch (val){ + get method() { + return _method; + }, + set method(val) { + switch (val) { case Constants.STORED: this.version = 10; case Constants.DEFLATED: @@ -9031,66 +10241,107 @@ module.exports = function () { this.version = 20; } _method = val; - }, + }, - get time () { return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); + get time() { + return new Date(((_time >> 25) & 0x7f) + 1980, ((_time >> 21) & 0x0f) - 1, (_time >> 16) & 0x1f, (_time >> 11) & 0x1f, (_time >> 5) & 0x3f, (_time & 0x1f) << 1); }, - set time (val) { + set time(val) { setTime(val); }, - get crc () { return _crc; }, - set crc (val) { _crc = val; }, + get crc() { + return _crc; + }, + set crc(val) { + _crc = Math.max(0, val) >>> 0; + }, + + get compressedSize() { + return _compressedSize; + }, + set compressedSize(val) { + _compressedSize = Math.max(0, val) >>> 0; + }, - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, + get size() { + return _size; + }, + set size(val) { + _size = Math.max(0, val) >>> 0; + }, - get size () { return _size; }, - set size (val) { _size = val; }, + get fileNameLength() { + return _fnameLen; + }, + set fileNameLength(val) { + _fnameLen = val; + }, - get fileNameLength () { return _fnameLen; }, - set fileNameLength (val) { _fnameLen = val; }, + get extraLength() { + return _extraLen; + }, + set extraLength(val) { + _extraLen = val; + }, - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, + get commentLength() { + return _comLen; + }, + set commentLength(val) { + _comLen = val; + }, - get commentLength () { return _comLen }, - set commentLength (val) { _comLen = val }, + get diskNumStart() { + return _diskStart; + }, + set diskNumStart(val) { + _diskStart = Math.max(0, val) >>> 0; + }, - get diskNumStart () { return _diskStart }, - set diskNumStart (val) { _diskStart = val }, + get inAttr() { + return _inattr; + }, + set inAttr(val) { + _inattr = Math.max(0, val) >>> 0; + }, - get inAttr () { return _inattr }, - set inAttr (val) { _inattr = val }, + get attr() { + return _attr; + }, + set attr(val) { + _attr = Math.max(0, val) >>> 0; + }, - get attr () { return _attr }, - set attr (val) { _attr = val }, + // get Unix file permissions + get fileAttr() { + return _attr ? (((_attr >>> 0) | 0) >> 16) & 0xfff : 0; + }, - get offset () { return _offset }, - set offset (val) { _offset = val }, + get offset() { + return _offset; + }, + set offset(val) { + _offset = Math.max(0, val) >>> 0; + }, - get encripted () { return (_flags & 1) === 1 }, + get encripted() { + return (_flags & 1) === 1; + }, - get entryHeaderSize () { + get entryHeaderSize() { return Constants.CENHDR + _fnameLen + _extraLen + _comLen; }, - get realDataOffset () { + get realDataOffset() { return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; }, - get dataHeader () { + get dataHeader() { return _dataHeader; }, - loadDataHeaderFromBinary : function(/*Buffer*/input) { + loadDataHeaderFromBinary: function (/*Buffer*/ input) { var data = input.slice(_offset, _offset + Constants.LOCHDR); // 30 bytes and should start with "PK\003\004" if (data.readUInt32LE(0) !== Constants.LOCSIG) { @@ -9098,27 +10349,27 @@ module.exports = function () { } _dataHeader = { // version needed to extract - version : data.readUInt16LE(Constants.LOCVER), + version: data.readUInt16LE(Constants.LOCVER), // general purpose bit flag - flags : data.readUInt16LE(Constants.LOCFLG), + flags: data.readUInt16LE(Constants.LOCFLG), // compression method - method : data.readUInt16LE(Constants.LOCHOW), + method: data.readUInt16LE(Constants.LOCHOW), // modification time (2 bytes time, 2 bytes date) - time : data.readUInt32LE(Constants.LOCTIM), + time: data.readUInt32LE(Constants.LOCTIM), // uncompressed file crc-32 value - crc : data.readUInt32LE(Constants.LOCCRC), + crc: data.readUInt32LE(Constants.LOCCRC), // compressed size - compressedSize : data.readUInt32LE(Constants.LOCSIZ), + compressedSize: data.readUInt32LE(Constants.LOCSIZ), // uncompressed size - size : data.readUInt32LE(Constants.LOCLEN), + size: data.readUInt32LE(Constants.LOCLEN), // filename length - fnameLen : data.readUInt16LE(Constants.LOCNAM), + fnameLen: data.readUInt16LE(Constants.LOCNAM), // extra field length - extraLen : data.readUInt16LE(Constants.LOCEXT) - } + extraLen: data.readUInt16LE(Constants.LOCEXT) + }; }, - loadFromBinary : function(/*Buffer*/data) { + loadFromBinary: function (/*Buffer*/ data) { // data should be 46 bytes and start with "PK 01 02" if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) { throw new Error(Utils.Errors.INVALID_CEN); @@ -9155,7 +10406,7 @@ module.exports = function () { _offset = data.readUInt32LE(Constants.CENOFF); }, - dataHeaderToBinary : function() { + dataHeaderToBinary: function () { // LOC header size (30 bytes) var data = Buffer.alloc(Constants.LOCHDR); // "PK\003\004" @@ -9181,7 +10432,7 @@ module.exports = function () { return data; }, - entryHeaderToBinary : function() { + entryHeaderToBinary: function () { // CEN header size (46 bytes) var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen); // "PK\001\002" @@ -9221,27 +10472,35 @@ module.exports = function () { return data; }, - toString : function() { - return '{\n' + - '\t"made" : ' + _verMade + ",\n" + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + this.time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fileNameLength" : ' + _fnameLen + ",\n" + - '\t"extraLength" : ' + _extraLen + " bytes,\n" + - '\t"commentLength" : ' + _comLen + " bytes,\n" + - '\t"diskNumStart" : ' + _diskStart + ",\n" + - '\t"inAttr" : ' + _inattr + ",\n" + - '\t"attr" : ' + _attr + ",\n" + - '\t"offset" : ' + _offset + ",\n" + - '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + - '}'; + toJSON: function () { + const bytes = function (nr) { + return nr + " bytes"; + }; + + return { + made: _verMade, + version: _version, + flags: _flags, + method: Utils.methodToString(_method), + time: this.time, + crc: "0x" + _crc.toString(16).toUpperCase(), + compressedSize: bytes(_compressedSize), + size: bytes(_size), + fileNameLength: bytes(_fnameLen), + extraLength: bytes(_extraLen), + commentLength: bytes(_comLen), + diskNumStart: _diskStart, + inAttr: _inattr, + attr: _attr, + offset: _offset, + entryHeaderSize: bytes(Constants.CENHDR + _fnameLen + _extraLen + _comLen) + }; + }, + + toString: function () { + return JSON.stringify(this.toJSON(), null, "\t"); } - } + }; }; @@ -9271,31 +10530,52 @@ module.exports = function () { _commentLength = 0; return { - get diskEntries () { return _volumeEntries }, - set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, + get diskEntries() { + return _volumeEntries; + }, + set diskEntries(/*Number*/ val) { + _volumeEntries = _totalEntries = val; + }, - get totalEntries () { return _totalEntries }, - set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, + get totalEntries() { + return _totalEntries; + }, + set totalEntries(/*Number*/ val) { + _totalEntries = _volumeEntries = val; + }, - get size () { return _size }, - set size (/*Number*/val) { _size = val; }, + get size() { + return _size; + }, + set size(/*Number*/ val) { + _size = val; + }, - get offset () { return _offset }, - set offset (/*Number*/val) { _offset = val; }, + get offset() { + return _offset; + }, + set offset(/*Number*/ val) { + _offset = val; + }, - get commentLength () { return _commentLength }, - set commentLength (/*Number*/val) { _commentLength = val; }, + get commentLength() { + return _commentLength; + }, + set commentLength(/*Number*/ val) { + _commentLength = val; + }, - get mainHeaderSize () { + get mainHeaderSize() { return Constants.ENDHDR + _commentLength; }, - loadFromBinary : function(/*Buffer*/data) { + loadFromBinary: function (/*Buffer*/ data) { // data should be 22 bytes and start with "PK 05 06" // or be 56+ bytes and start with "PK 06 06" for Zip64 - if ((data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) && - (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)) { - + if ( + (data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) && + (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG) + ) { throw new Error(Utils.Errors.INVALID_END); } @@ -9322,11 +10602,10 @@ module.exports = function () { _commentLength = 0; } - }, - toBinary : function() { - var b = Buffer.alloc(Constants.ENDHDR + _commentLength); + toBinary: function () { + var b = Buffer.alloc(Constants.ENDHDR + _commentLength); // "PK 05 06" signature b.writeUInt32LE(Constants.ENDSIG, 0); b.writeUInt32LE(0, 4); @@ -9346,53 +10625,67 @@ module.exports = function () { return b; }, - toString : function() { - return '{\n' + - '\t"diskEntries" : ' + _volumeEntries + ",\n" + - '\t"totalEntries" : ' + _totalEntries + ",\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + - '\t"commentLength" : 0x' + _commentLength + "\n" + - '}'; + toJSON: function () { + // creates 0x0000 style output + const offset = function (nr, len) { + let offs = nr.toString(16).toUpperCase(); + while (offs.length < len) offs = "0" + offs; + return "0x" + offs; + }; + + return { + diskEntries: _volumeEntries, + totalEntries: _totalEntries, + size: _size + " bytes", + offset: offset(_offset, 4), + commentLength: _commentLength + }; + }, + + toString: function () { + return JSON.stringify(this.toJSON(), null, "\t"); } - } + }; }; + /***/ }), /***/ 7686: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = function (/*Buffer*/inbuf) { +module.exports = function (/*Buffer*/ inbuf) { + var zlib = __nccwpck_require__(9796); - var zlib = __nccwpck_require__(8761); - - var opts = {chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024}; - - return { - deflate: function () { - return zlib.deflateRawSync(inbuf, opts); - }, + var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 }; - deflateAsync: function (/*Function*/callback) { - var tmp = zlib.createDeflateRaw(opts), parts = [], total = 0; - tmp.on('data', function (data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function () { - var buf = Buffer.alloc(total), written = 0; - buf.fill(0); - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf); - } - } + return { + deflate: function () { + return zlib.deflateRawSync(inbuf, opts); + }, + + deflateAsync: function (/*Function*/ callback) { + var tmp = zlib.createDeflateRaw(opts), + parts = [], + total = 0; + tmp.on("data", function (data) { + parts.push(data); + total += data.length; + }); + tmp.on("end", function () { + var buf = Buffer.alloc(total), + written = 0; + buf.fill(0); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + part.copy(buf, written); + written += part.length; + } + callback && callback(buf); + }); + tmp.end(inbuf); + } + }; }; @@ -9405,124 +10698,221 @@ exports.Deflater = __nccwpck_require__(7686); exports.Inflater = __nccwpck_require__(2153); exports.ZipCrypto = __nccwpck_require__(3228); + /***/ }), /***/ 2153: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = function (/*Buffer*/inbuf) { +module.exports = function (/*Buffer*/ inbuf) { + var zlib = __nccwpck_require__(9796); - var zlib = __nccwpck_require__(8761); - - return { - inflate: function () { - return zlib.inflateRawSync(inbuf); - }, + return { + inflate: function () { + return zlib.inflateRawSync(inbuf); + }, - inflateAsync: function (/*Function*/callback) { - var tmp = zlib.createInflateRaw(), parts = [], total = 0; - tmp.on('data', function (data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function () { - var buf = Buffer.alloc(total), written = 0; - buf.fill(0); - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf); - } - } + inflateAsync: function (/*Function*/ callback) { + var tmp = zlib.createInflateRaw(), + parts = [], + total = 0; + tmp.on("data", function (data) { + parts.push(data); + total += data.length; + }); + tmp.on("end", function () { + var buf = Buffer.alloc(total), + written = 0; + buf.fill(0); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + part.copy(buf, written); + written += part.length; + } + callback && callback(buf); + }); + tmp.end(inbuf); + } + }; }; /***/ }), /***/ 3228: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +// node crypt, we use it for generate salt +// eslint-disable-next-line node/no-unsupported-features/node-builtins +const { randomFillSync } = __nccwpck_require__(6113); // generate CRC32 lookup table -const crctable = (new Uint32Array(256)).map((t,crc)=>{ - for(let j=0;j<8;j++){ - if (0 !== (crc & 1)){ - crc = (crc >>> 1) ^ 0xEDB88320 - }else{ - crc >>>= 1 +const crctable = new Uint32Array(256).map((t, crc) => { + for (let j = 0; j < 8; j++) { + if (0 !== (crc & 1)) { + crc = (crc >>> 1) ^ 0xedb88320; + } else { + crc >>>= 1; } } - return crc>>>0; + return crc >>> 0; }); -function make_decrypter(/*Buffer*/pwd){ - // C-style uInt32 Multiply - const uMul = (a,b) => Math.imul(a, b) >>> 0; - // Initialize keys with default values - const keys = new Uint32Array([0x12345678, 0x23456789, 0x34567890]); - // crc32 byte update - const crc32update = (pCrc32, bval) => { - return crctable[(pCrc32 ^ bval) & 0xff] ^ (pCrc32 >>> 8); +// C-style uInt32 Multiply (discards higher bits, when JS multiply discards lower bits) +const uMul = (a, b) => Math.imul(a, b) >>> 0; + +// crc32 byte single update (actually same function is part of utils.crc32 function :) ) +const crc32update = (pCrc32, bval) => { + return crctable[(pCrc32 ^ bval) & 0xff] ^ (pCrc32 >>> 8); +}; + +// function for generating salt for encrytion header +const genSalt = () => { + if ("function" === typeof randomFillSync) { + return randomFillSync(Buffer.alloc(12)); + } else { + // fallback if function is not defined + return genSalt.node(); } - // update keys with byteValues - const updateKeys = (byteValue) => { - keys[0] = crc32update(keys[0], byteValue); - keys[1] += keys[0] & 0xff; - keys[1] = uMul(keys[1], 134775813) + 1; - keys[2] = crc32update(keys[2], keys[1] >>> 24); +}; + +// salt generation with node random function (mainly as fallback) +genSalt.node = () => { + const salt = Buffer.alloc(12); + const len = salt.length; + for (let i = 0; i < len; i++) salt[i] = (Math.random() * 256) & 0xff; + return salt; +}; + +// general config +const config = { + genSalt +}; + +// Class Initkeys handles same basic ops with keys +function Initkeys(pw) { + const pass = Buffer.isBuffer(pw) ? pw : Buffer.from(pw); + this.keys = new Uint32Array([0x12345678, 0x23456789, 0x34567890]); + for (let i = 0; i < pass.length; i++) { + this.updateKeys(pass[i]); } +} + +Initkeys.prototype.updateKeys = function (byteValue) { + const keys = this.keys; + keys[0] = crc32update(keys[0], byteValue); + keys[1] += keys[0] & 0xff; + keys[1] = uMul(keys[1], 134775813) + 1; + keys[2] = crc32update(keys[2], keys[1] >>> 24); + return byteValue; +}; +Initkeys.prototype.next = function () { + const k = (this.keys[2] | 2) >>> 0; // key + return (uMul(k, k ^ 1) >> 8) & 0xff; // decode +}; + +function make_decrypter(/*Buffer*/ pwd) { // 1. Stage initialize key - const pass = (Buffer.isBuffer(pwd)) ? pwd : Buffer.from(pwd); - for(let i=0; i< pass.length; i++){ - updateKeys(pass[i]); - } + const keys = new Initkeys(pwd); // return decrypter function - return function (/*Buffer*/data){ - if (!Buffer.isBuffer(data)){ - throw 'decrypter needs Buffer' - } + return function (/*Buffer*/ data) { // result - we create new Buffer for results const result = Buffer.alloc(data.length); let pos = 0; // process input data - for(let c of data){ - const k = (keys[2] | 2) >>> 0; // key - c ^= (uMul(k, k^1) >> 8) & 0xff; // decode - result[pos++] = c; // Save Value - updateKeys(c); // update keys with decoded byte + for (let c of data) { + //c ^= keys.next(); + //result[pos++] = c; // decode & Save Value + result[pos++] = keys.updateKeys(c ^ keys.next()); // update keys with decoded byte } return result; - } + }; +} + +function make_encrypter(/*Buffer*/ pwd) { + // 1. Stage initialize key + const keys = new Initkeys(pwd); + + // return encrypting function, result and pos is here so we dont have to merge buffers later + return function (/*Buffer*/ data, /*Buffer*/ result, /* Number */ pos = 0) { + // result - we create new Buffer for results + if (!result) result = Buffer.alloc(data.length); + // process input data + for (let c of data) { + const k = keys.next(); // save key byte + result[pos++] = c ^ k; // save val + keys.updateKeys(c); // update keys with decoded byte + } + return result; + }; } -function decrypt(/*Buffer*/ data, /*Object*/header, /*String, Buffer*/ pwd){ +function decrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd) { if (!data || !Buffer.isBuffer(data) || data.length < 12) { return Buffer.alloc(0); } - - // We Initialize and generate decrypting function + + // 1. We Initialize and generate decrypting function const decrypter = make_decrypter(pwd); - // check - for testing password - const check = header.crc >>> 24; - // decrypt salt what is always 12 bytes and is a part of file content - const testbyte = decrypter(data.slice(0, 12))[11]; + // 2. decrypt salt what is always 12 bytes and is a part of file content + const salt = decrypter(data.slice(0, 12)); - // does password meet expectations - if (check !== testbyte){ - throw 'ADM-ZIP: Wrong Password'; + // 3. does password meet expectations + if (salt[11] !== header.crc >>> 24) { + throw "ADM-ZIP: Wrong Password"; } - // decode content + // 4. decode content return decrypter(data.slice(12)); } -module.exports = {decrypt}; +// lets add way to populate salt, NOT RECOMMENDED for production but maybe useful for testing general functionality +function _salter(data) { + if (Buffer.isBuffer(data) && data.length >= 12) { + // be aware - currently salting buffer data is modified + config.genSalt = function () { + return data.slice(0, 12); + }; + } else if (data === "node") { + // test salt generation with node random function + config.genSalt = genSalt.node; + } else { + // if value is not acceptable config gets reset. + config.genSalt = genSalt; + } +} + +function encrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd, /*Boolean*/ oldlike = false) { + // 1. test data if data is not Buffer we make buffer from it + if (data == null) data = Buffer.alloc(0); + // if data is not buffer be make buffer from it + if (!Buffer.isBuffer(data)) data = Buffer.from(data.toString()); + + // 2. We Initialize and generate encrypting function + const encrypter = make_encrypter(pwd); + + // 3. generate salt (12-bytes of random data) + const salt = config.genSalt(); + salt[11] = (header.crc >>> 24) & 0xff; + + // old implementations (before PKZip 2.04g) used two byte check + if (oldlike) salt[10] = (header.crc >>> 16) & 0xff; + + // 4. create output + const result = Buffer.alloc(data.length + 12); + encrypter(salt, result); + + // finally encode content + return encrypter(data, result, 12); +} + +module.exports = { decrypt, encrypt, _salter }; /***/ }), @@ -9607,32 +10997,39 @@ module.exports = { REDUCED3 : 4, // reduced with compression factor 3 REDUCED4 : 5, // reduced with compression factor 4 IMPLODED : 6, // imploded - // 7 reserved + // 7 reserved for Tokenizing compression algorithm DEFLATED : 8, // deflated ENHANCED_DEFLATED: 9, // enhanced deflated PKWARE : 10,// PKWare DCL imploded - // 11 reserved + // 11 reserved by PKWARE BZIP2 : 12, // compressed using BZIP2 - // 13 reserved + // 13 reserved by PKWARE LZMA : 14, // LZMA - // 15-17 reserved + // 15-17 reserved by PKWARE IBM_TERSE : 18, // compressed using IBM TERSE - IBM_LZ77 : 19, //IBM LZ77 z + IBM_LZ77 : 19, // IBM LZ77 z + AES_ENCRYPT : 99, // WinZIP AES encryption method /* General purpose bit flag */ - FLG_ENC : 0, // encripted file - FLG_COMP1 : 1, // compression option - FLG_COMP2 : 2, // compression option - FLG_DESC : 4, // data descriptor - FLG_ENH : 8, // enhanced deflation - FLG_STR : 16, // strong encryption - FLG_LNG : 1024, // language encoding + // values can obtained with expression 2**bitnr + FLG_ENC : 1, // Bit 0: encrypted file + FLG_COMP1 : 2, // Bit 1, compression option + FLG_COMP2 : 4, // Bit 2, compression option + FLG_DESC : 8, // Bit 3, data descriptor + FLG_ENH : 16, // Bit 4, enhanced deflating + FLG_PATCH : 32, // Bit 5, indicates that the file is compressed patched data. + FLG_STR : 64, // Bit 6, strong encryption (patented) + // Bits 7-10: Currently unused. + FLG_EFS : 2048, // Bit 11: Language encoding flag (EFS) + // Bit 12: Reserved by PKWARE for enhanced compression. + // Bit 13: encrypted the Central Directory (patented). + // Bits 14-15: Reserved by PKWARE. FLG_MSK : 4096, // mask header values /* Load type */ - FILE : 0, + FILE : 2, BUFFER : 1, - NONE : 2, + NONE : 0, /* 4.5 Extensible data fields */ EF_ID : 0, @@ -9674,66 +11071,65 @@ module.exports = { module.exports = { /* Header error messages */ - "INVALID_LOC" : "Invalid LOC header (bad signature)", - "INVALID_CEN" : "Invalid CEN header (bad signature)", - "INVALID_END" : "Invalid END header (bad signature)", + INVALID_LOC: "Invalid LOC header (bad signature)", + INVALID_CEN: "Invalid CEN header (bad signature)", + INVALID_END: "Invalid END header (bad signature)", /* ZipEntry error messages*/ - "NO_DATA" : "Nothing to decompress", - "BAD_CRC" : "CRC32 checksum failed", - "FILE_IN_THE_WAY" : "There is a file in the way: %s", - "UNKNOWN_METHOD" : "Invalid/unsupported compression method", + NO_DATA: "Nothing to decompress", + BAD_CRC: "CRC32 checksum failed", + FILE_IN_THE_WAY: "There is a file in the way: %s", + UNKNOWN_METHOD: "Invalid/unsupported compression method", /* Inflater error messages */ - "AVAIL_DATA" : "inflate::Available inflate data did not terminate", - "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", - "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", - "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", - "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", - "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", - "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", - "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", - "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", - "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", + AVAIL_DATA: "inflate::Available inflate data did not terminate", + INVALID_DISTANCE: "inflate::Invalid literal/length or distance code in fixed or dynamic block", + TO_MANY_CODES: "inflate::Dynamic block code description: too many length or distance codes", + INVALID_REPEAT_LEN: "inflate::Dynamic block code description: repeat more than specified lengths", + INVALID_REPEAT_FIRST: "inflate::Dynamic block code description: repeat lengths with no first length", + INCOMPLETE_CODES: "inflate::Dynamic block code description: code lengths codes incomplete", + INVALID_DYN_DISTANCE: "inflate::Dynamic block code description: invalid distance code lengths", + INVALID_CODES_LEN: "inflate::Dynamic block code description: invalid literal/length code lengths", + INVALID_STORE_BLOCK: "inflate::Stored block length did not match one's complement", + INVALID_BLOCK_TYPE: "inflate::Invalid block type (type == 3)", /* ADM-ZIP error messages */ - "CANT_EXTRACT_FILE" : "Could not extract the file", - "CANT_OVERRIDE" : "Target file already exists", - "NO_ZIP" : "No zip file was loaded", - "NO_ENTRY" : "Entry doesn't exist", - "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", - "FILE_NOT_FOUND" : "File not found: %s", - "NOT_IMPLEMENTED" : "Not implemented", - "INVALID_FILENAME" : "Invalid filename", - "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" + CANT_EXTRACT_FILE: "Could not extract the file", + CANT_OVERRIDE: "Target file already exists", + NO_ZIP: "No zip file was loaded", + NO_ENTRY: "Entry doesn't exist", + DIRECTORY_CONTENT_ERROR: "A directory cannot have content", + FILE_NOT_FOUND: "File not found: %s", + NOT_IMPLEMENTED: "Not implemented", + INVALID_FILENAME: "Invalid filename", + INVALID_FORMAT: "Invalid or unsupported zip format. No END header found" }; + /***/ }), /***/ 8321: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __nccwpck_require__(2895).require(), - pth = __nccwpck_require__(5622); - -fs.existsSync = fs.existsSync || pth.existsSync; +const fs = (__nccwpck_require__(2895).require)(); +const pth = __nccwpck_require__(1017); -module.exports = function(/*String*/path) { +fs.existsSync = fs.existsSync || pth.existsSync; +module.exports = function (/*String*/ path) { var _path = path || "", - _permissions = 0, _obj = newAttr(), _stat = null; function newAttr() { return { - directory : false, - readonly : false, - hidden : false, - executable : false, - mtime : 0, - atime : 0 - } + directory: false, + readonly: false, + hidden: false, + executable: false, + mtime: 0, + atime: 0 + }; } if (_path && fs.existsSync(_path)) { @@ -9741,61 +11137,58 @@ module.exports = function(/*String*/path) { _obj.directory = _stat.isDirectory(); _obj.mtime = _stat.mtime; _obj.atime = _stat.atime; - _obj.executable = (0o111 & _stat.mode) != 0; // file is executable who ever har right not just owner - _obj.readonly = (0o200 & _stat.mode) == 0; // readonly if owner has no write right + _obj.executable = (0o111 & _stat.mode) !== 0; // file is executable who ever har right not just owner + _obj.readonly = (0o200 & _stat.mode) === 0; // readonly if owner has no write right _obj.hidden = pth.basename(_path)[0] === "."; } else { - console.warn("Invalid path: " + _path) + console.warn("Invalid path: " + _path); } return { - - get directory () { + get directory() { return _obj.directory; }, - get readOnly () { + get readOnly() { return _obj.readonly; }, - get hidden () { + get hidden() { return _obj.hidden; }, - get mtime () { + get mtime() { return _obj.mtime; }, - get atime () { - return _obj.atime; + get atime() { + return _obj.atime; }, - - get executable () { + get executable() { return _obj.executable; }, - decodeAttributes : function(val) { - - }, + decodeAttributes: function () {}, - encodeAttributes : function (val) { + encodeAttributes: function () {}, + toJSON: function () { + return { + path: _path, + isDirectory: _obj.directory, + isReadOnly: _obj.readonly, + isHidden: _obj.hidden, + isExecutable: _obj.executable, + mTime: _obj.mtime, + aTime: _obj.atime + }; }, - toString : function() { - return '{\n' + - '\t"path" : "' + _path + ",\n" + - '\t"isDirectory" : ' + _obj.directory + ",\n" + - '\t"isReadOnly" : ' + _obj.readonly + ",\n" + - '\t"isHidden" : ' + _obj.hidden + ",\n" + - '\t"isExecutable" : ' + _obj.executable + ",\n" + - '\t"mTime" : ' + _obj.mtime + "\n" + - '\t"aTime" : ' + _obj.atime + "\n" + - '}'; + toString: function () { + return JSON.stringify(this.toJSON(), null, "\t"); } - } - + }; }; @@ -9804,17 +11197,16 @@ module.exports = function(/*String*/path) { /***/ 2895: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports.require = function() { - var fs = __nccwpck_require__(5747); - if (process && process.versions && process.versions['electron']) { - try { - originalFs = __nccwpck_require__(2941); - if (Object.keys(originalFs).length > 0) { - fs = originalFs; - } - } catch (e) {} - } - return fs +exports.require = function () { + if (typeof process === "object" && process.versions && process.versions["electron"]) { + try { + const originalFs = __nccwpck_require__(2941); + if (Object.keys(originalFs).length > 0) { + return originalFs; + } + } catch (e) {} + } + return __nccwpck_require__(7147); }; @@ -9824,234 +11216,262 @@ exports.require = function() { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(1291); -module.exports.FileSystem = __nccwpck_require__(2895); module.exports.Constants = __nccwpck_require__(4522); module.exports.Errors = __nccwpck_require__(1255); module.exports.FileAttr = __nccwpck_require__(8321); + /***/ }), /***/ 1291: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __nccwpck_require__(2895).require(), - pth = __nccwpck_require__(5622); +const fsystem = (__nccwpck_require__(2895).require)(); +const pth = __nccwpck_require__(1017); +const Constants = __nccwpck_require__(4522); +const isWin = typeof process === "object" && "win32" === process.platform; -fs.existsSync = fs.existsSync || pth.existsSync; +const is_Obj = (obj) => obj && typeof obj === "object"; + +// generate CRC32 lookup table +const crcTable = new Uint32Array(256).map((t, c) => { + for (let k = 0; k < 8; k++) { + if ((c & 1) !== 0) { + c = 0xedb88320 ^ (c >>> 1); + } else { + c >>>= 1; + } + } + return c >>> 0; +}); + +// UTILS functions -module.exports = (function() { +function Utils(opts) { + this.sep = pth.sep; + this.fs = fsystem; + + if (is_Obj(opts)) { + // custom filesystem + if (is_Obj(opts.fs) && typeof opts.fs.statSync === "function") { + this.fs = opts.fs; + } + } +} - var crcTable = [], - Constants = __nccwpck_require__(4522), - Errors = __nccwpck_require__(1255), +module.exports = Utils; - PATH_SEPARATOR = pth.sep; +// INSTANCED functions +Utils.prototype.makeDir = function (/*String*/ folder) { + const self = this; - function mkdirSync(/*String*/path) { - var resolvedPath = path.split(PATH_SEPARATOR)[0]; - path.split(PATH_SEPARATOR).forEach(function(name) { - if (!name || name.substr(-1,1) === ":") return; - resolvedPath += PATH_SEPARATOR + name; + // Sync - make directories tree + function mkdirSync(/*String*/ fpath) { + let resolvedPath = fpath.split(self.sep)[0]; + fpath.split(self.sep).forEach(function (name) { + if (!name || name.substr(-1, 1) === ":") return; + resolvedPath += self.sep + name; var stat; try { - stat = fs.statSync(resolvedPath); + stat = self.fs.statSync(resolvedPath); } catch (e) { - fs.mkdirSync(resolvedPath); + self.fs.mkdirSync(resolvedPath); } - if (stat && stat.isFile()) - throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); + if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); }); } - function findSync(/*String*/dir, /*RegExp*/pattern, /*Boolean*/recoursive) { - if (typeof pattern === 'boolean') { - recoursive = pattern; - pattern = undefined; - } - var files = []; - fs.readdirSync(dir).forEach(function(file) { - var path = pth.join(dir, file); - - if (fs.statSync(path).isDirectory() && recoursive) - files = files.concat(findSync(path, pattern, recoursive)); + mkdirSync(folder); +}; - if (!pattern || pattern.test(path)) { - files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); - } +Utils.prototype.writeFileTo = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr) { + const self = this; + if (self.fs.existsSync(path)) { + if (!overwrite) return false; // cannot overwrite - }); - return files; + var stat = self.fs.statSync(path); + if (stat.isDirectory()) { + return false; + } + } + var folder = pth.dirname(path); + if (!self.fs.existsSync(folder)) { + self.makeDir(folder); } - function readBigUInt64LE(/*Buffer*/buffer, /*int*/index) { - var slice = Buffer.from(buffer.slice(index, index + 8)); - slice.swap64(); + var fd; + try { + fd = self.fs.openSync(path, "w", 438); // 0666 + } catch (e) { + self.fs.chmodSync(path, 438); + fd = self.fs.openSync(path, "w", 438); + } + if (fd) { + try { + self.fs.writeSync(fd, content, 0, content.length, 0); + } finally { + self.fs.closeSync(fd); + } + } + self.fs.chmodSync(path, attr || 438); + return true; +}; - return parseInt(`0x${ slice.toString('hex') }`); +Utils.prototype.writeFileToAsync = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr, /*Function*/ callback) { + if (typeof attr === "function") { + callback = attr; + attr = undefined; } - return { - makeDir : function(/*String*/path) { - mkdirSync(path); - }, + const self = this; - crc32 : function(buf) { - if (typeof buf === 'string') { - buf = Buffer.alloc(buf.length, buf); - } - var b = Buffer.alloc(4); - if (!crcTable.length) { - for (var n = 0; n < 256; n++) { - var c = n; - for (var k = 8; --k >= 0;) // - if ((c & 1) !== 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } - if (c < 0) { - b.writeInt32LE(c, 0); - c = b.readUInt32LE(0); - } - crcTable[n] = c; - } - } - var crc = 0, off = 0, len = buf.length, c1 = ~crc; - while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); - crc = ~c1; - b.writeInt32LE(crc & 0xffffffff, 0); - return b.readUInt32LE(0); - }, + self.fs.exists(path, function (exist) { + if (exist && !overwrite) return callback(false); - methodToString : function(/*Number*/method) { - switch (method) { - case Constants.STORED: - return 'STORED (' + method + ')'; - case Constants.DEFLATED: - return 'DEFLATED (' + method + ')'; - default: - return 'UNSUPPORTED (' + method + ')'; + self.fs.stat(path, function (err, stat) { + if (exist && stat.isDirectory()) { + return callback(false); } - }, + var folder = pth.dirname(path); + self.fs.exists(folder, function (exists) { + if (!exists) self.makeDir(folder); + + self.fs.open(path, "w", 438, function (err, fd) { + if (err) { + self.fs.chmod(path, 438, function () { + self.fs.open(path, "w", 438, function (err, fd) { + self.fs.write(fd, content, 0, content.length, 0, function () { + self.fs.close(fd, function () { + self.fs.chmod(path, attr || 438, function () { + callback(true); + }); + }); + }); + }); + }); + } else if (fd) { + self.fs.write(fd, content, 0, content.length, 0, function () { + self.fs.close(fd, function () { + self.fs.chmod(path, attr || 438, function () { + callback(true); + }); + }); + }); + } else { + self.fs.chmod(path, attr || 438, function () { + callback(true); + }); + } + }); + }); + }); + }); +}; - writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { - if (fs.existsSync(path)) { - if (!overwrite) - return false; // cannot overwrite +Utils.prototype.findFiles = function (/*String*/ path) { + const self = this; - var stat = fs.statSync(path); - if (stat.isDirectory()) { - return false; - } - } - var folder = pth.dirname(path); - if (!fs.existsSync(folder)) { - mkdirSync(folder); - } + function findSync(/*String*/ dir, /*RegExp*/ pattern, /*Boolean*/ recursive) { + if (typeof pattern === "boolean") { + recursive = pattern; + pattern = undefined; + } + let files = []; + self.fs.readdirSync(dir).forEach(function (file) { + var path = pth.join(dir, file); - var fd; - try { - fd = fs.openSync(path, 'w', 438); // 0666 - } catch(e) { - fs.chmodSync(path, 438); - fd = fs.openSync(path, 'w', 438); - } - if (fd) { - try { - fs.writeSync(fd, content, 0, content.length, 0); - } - catch (e){ - throw e; - } - finally { - fs.closeSync(fd); - } - } - fs.chmodSync(path, attr || 438); - return true; - }, + if (self.fs.statSync(path).isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive)); - writeFileToAsync : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr, /*Function*/callback) { - if(typeof attr === 'function') { - callback = attr; - attr = undefined; + if (!pattern || pattern.test(path)) { + files.push(pth.normalize(path) + (self.fs.statSync(path).isDirectory() ? self.sep : "")); } + }); + return files; + } - fs.exists(path, function(exists) { - if(exists && !overwrite) - return callback(false); + return findSync(path, undefined, true); +}; - fs.stat(path, function(err, stat) { - if(exists &&stat.isDirectory()) { - return callback(false); - } +Utils.prototype.getAttributes = function () {}; - var folder = pth.dirname(path); - fs.exists(folder, function(exists) { - if(!exists) - mkdirSync(folder); - - fs.open(path, 'w', 438, function(err, fd) { - if(err) { - fs.chmod(path, 438, function() { - fs.open(path, 'w', 438, function(err, fd) { - fs.write(fd, content, 0, content.length, 0, function() { - fs.close(fd, function() { - fs.chmod(path, attr || 438, function() { - callback(true); - }) - }); - }); - }); - }) - } else { - if(fd) { - fs.write(fd, content, 0, content.length, 0, function() { - fs.close(fd, function() { - fs.chmod(path, attr || 438, function() { - callback(true); - }) - }); - }); - } else { - fs.chmod(path, attr || 438, function() { - callback(true); - }) - } - } - }); - }) - }) - }) - }, +Utils.prototype.setAttributes = function () {}; - findFiles : function(/*String*/path) { - return findSync(path, true); - }, +// STATIC functions - getAttributes : function(/*String*/path) { +// crc32 single update (it is part of crc32) +Utils.crc32update = function (crc, byte) { + return crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8); +}; - }, +Utils.crc32 = function (buf) { + if (typeof buf === "string") { + buf = Buffer.from(buf, "utf8"); + } + // Generate crcTable + if (!crcTable.length) genCRCTable(); - setAttributes : function(/*String*/path) { + let len = buf.length; + let crc = ~0; + for (let off = 0; off < len; ) crc = Utils.crc32update(crc, buf[off++]); + // xor and cast as uint32 number + return ~crc >>> 0; +}; - }, +Utils.methodToString = function (/*Number*/ method) { + switch (method) { + case Constants.STORED: + return "STORED (" + method + ")"; + case Constants.DEFLATED: + return "DEFLATED (" + method + ")"; + default: + return "UNSUPPORTED (" + method + ")"; + } +}; - toBuffer : function(input) { - if (Buffer.isBuffer(input)) { - return input; - } else { - if (input.length === 0) { - return Buffer.alloc(0) - } - return Buffer.from(input, 'utf8'); - } - }, +// removes ".." style path elements +Utils.canonical = function (/*string*/ path) { + if (!path) return ""; + // trick normalize think path is absolute + var safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/")); + return pth.join(".", safeSuffix); +}; - readBigUInt64LE, +// make abolute paths taking prefix as root folder +Utils.sanitize = function (/*string*/ prefix, /*string*/ name) { + prefix = pth.resolve(pth.normalize(prefix)); + var parts = name.split("/"); + for (var i = 0, l = parts.length; i < l; i++) { + var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep))); + if (path.indexOf(prefix) === 0) { + return path; + } + } + return pth.normalize(pth.join(prefix, pth.basename(name))); +}; - Constants : Constants, - Errors : Errors +// converts buffer, Uint8Array, string types to buffer +Utils.toBuffer = function toBuffer(/*buffer, Uint8Array, string*/ input) { + if (Buffer.isBuffer(input)) { + return input; + } else if (input instanceof Uint8Array) { + return Buffer.from(input); + } else { + // expect string all other values are invalid and return empty buffer + return typeof input === "string" ? Buffer.from(input, "utf8") : Buffer.alloc(0); } -})(); +}; + +Utils.readBigUInt64LE = function (/*Buffer*/ buffer, /*int*/ index) { + var slice = Buffer.from(buffer.slice(index, index + 8)); + slice.swap64(); + + return parseInt(`0x${slice.toString("hex")}`); +}; + +Utils.isWin = isWin; // Do we have windows system +Utils.crcTable = crcTable; /***/ }), @@ -10064,8 +11484,7 @@ var Utils = __nccwpck_require__(5182), Constants = Utils.Constants, Methods = __nccwpck_require__(3928); -module.exports = function (/*Buffer*/input) { - +module.exports = function (/*Buffer*/ input) { var _entryHeader = new Headers.EntryHeader(), _entryName = Buffer.alloc(0), _comment = Buffer.alloc(0), @@ -10078,15 +11497,15 @@ module.exports = function (/*Buffer*/input) { return Buffer.alloc(0); } _entryHeader.loadDataHeaderFromBinary(input); - return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize) + return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize); } function crc32OK(data) { // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written if ((_entryHeader.flags & 0x8) !== 0x8) { - if (Utils.crc32(data) !== _entryHeader.dataHeader.crc) { - return false; - } + if (Utils.crc32(data) !== _entryHeader.dataHeader.crc) { + return false; + } } else { // @TODO: load and check data descriptor header // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure @@ -10095,10 +11514,10 @@ module.exports = function (/*Buffer*/input) { return true; } - function decompress(/*Boolean*/async, /*Function*/callback, /*String, Buffer*/pass) { - if(typeof callback === 'undefined' && typeof async === 'string') { - pass=async; - async=void 0; + function decompress(/*Boolean*/ async, /*Function*/ callback, /*String, Buffer*/ pass) { + if (typeof callback === "undefined" && typeof async === "string") { + pass = async; + async = void 0; } if (_isDirectory) { if (async && callback) { @@ -10115,9 +11534,9 @@ module.exports = function (/*Buffer*/input) { return compressedData; } - if (_entryHeader.encripted){ - if ('string' !== typeof pass && !Buffer.isBuffer(pass)){ - throw new Error('ADM-ZIP: Incompatible password parameter'); + if (_entryHeader.encripted) { + if ("string" !== typeof pass && !Buffer.isBuffer(pass)) { + throw new Error("ADM-ZIP: Incompatible password parameter"); } compressedData = Methods.ZipCrypto.decrypt(compressedData, _entryHeader, pass); } @@ -10128,30 +11547,33 @@ module.exports = function (/*Buffer*/input) { case Utils.Constants.STORED: compressedData.copy(data); if (!crc32OK(data)) { - if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error + if (async && callback) callback(data, Utils.Errors.BAD_CRC); //si added error throw new Error(Utils.Errors.BAD_CRC); - } else {//si added otherwise did not seem to return data. + } else { + //si added otherwise did not seem to return data. if (async && callback) callback(data); return data; } case Utils.Constants.DEFLATED: var inflater = new Methods.Inflater(compressedData); if (!async) { - var result = inflater.inflate(data); + const result = inflater.inflate(data); result.copy(data, 0); if (!crc32OK(data)) { throw new Error(Utils.Errors.BAD_CRC + " " + _entryName.toString()); } return data; } else { - inflater.inflateAsync(function(result) { - result.copy(data, 0); - if (!crc32OK(data)) { - if (callback) callback(data, Utils.Errors.BAD_CRC); //si added error - } else { //si added otherwise did not seem to return data. - if (callback) callback(data); + inflater.inflateAsync(function (result) { + result.copy(result, 0); + if (callback) { + if (!crc32OK(result)) { + callback(result, Utils.Errors.BAD_CRC); //si added error + } else { + callback(result); + } } - }) + }); } break; default: @@ -10160,7 +11582,7 @@ module.exports = function (/*Buffer*/input) { } } - function compress(/*Boolean*/async, /*Function*/callback) { + function compress(/*Boolean*/ async, /*Function*/ callback) { if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { // no data set or the data wasn't changed to require recompression if (async && callback) callback(getCompressedDataFromZip()); @@ -10181,29 +11603,26 @@ module.exports = function (/*Buffer*/input) { return compressedData; default: case Utils.Constants.DEFLATED: - var deflater = new Methods.Deflater(uncompressedData); if (!async) { var deflated = deflater.deflate(); _entryHeader.compressedSize = deflated.length; return deflated; } else { - deflater.deflateAsync(function(data) { + deflater.deflateAsync(function (data) { compressedData = Buffer.alloc(data.length); _entryHeader.compressedSize = data.length; data.copy(compressedData); callback && callback(compressedData); - }) + }); } deflater = null; break; } + } else if (async && callback) { + callback(Buffer.alloc(0)); } else { - if (async && callback) { - callback(Buffer.alloc(0)); - } else { - return Buffer.alloc(0); - } + return Buffer.alloc(0); } } @@ -10214,14 +11633,14 @@ module.exports = function (/*Buffer*/input) { function parseExtra(data) { var offset = 0; var signature, size, part; - while(offset= Constants.EF_ZIP64_SCOMP) { + if (data.length >= Constants.EF_ZIP64_SCOMP) { size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP); - if(_entryHeader.size === Constants.EF_ZIP64_OR_32) { + if (_entryHeader.size === Constants.EF_ZIP64_OR_32) { _entryHeader.size = size; } } - if(data.length >= Constants.EF_ZIP64_RHO) { + if (data.length >= Constants.EF_ZIP64_RHO) { compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP); - if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) { + if (_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) { _entryHeader.compressedSize = compressedSize; } } - if(data.length >= Constants.EF_ZIP64_DSN) { + if (data.length >= Constants.EF_ZIP64_DSN) { offset = readUInt64LE(data, Constants.EF_ZIP64_RHO); - if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) { + if (_entryHeader.offset === Constants.EF_ZIP64_OR_32) { _entryHeader.offset = offset; } } - if(data.length >= Constants.EF_ZIP64_DSN+4) { + if (data.length >= Constants.EF_ZIP64_DSN + 4) { diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN); - if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) { + if (_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) { _entryHeader.diskNumStart = diskNumStart; } } } - return { - get entryName () { return _entryName.toString(); }, - get rawEntryName() { return _entryName; }, - set entryName (val) { + get entryName() { + return _entryName.toString(); + }, + get rawEntryName() { + return _entryName; + }, + set entryName(val) { _entryName = Utils.toBuffer(val); var lastChar = _entryName[_entryName.length - 1]; - _isDirectory = (lastChar === 47) || (lastChar === 92); + _isDirectory = lastChar === 47 || lastChar === 92; _entryHeader.fileNameLength = _entryName.length; }, - get extra () { return _extra; }, - set extra (val) { + get extra() { + return _extra; + }, + set extra(val) { _extra = val; _entryHeader.extraLength = val.length; parseExtra(val); }, - get comment () { return _comment.toString(); }, - set comment (val) { + get comment() { + return _comment.toString(); + }, + set comment(val) { _comment = Utils.toBuffer(val); _entryHeader.commentLength = _comment.length; }, - get name () { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, - get isDirectory () { return _isDirectory }, + get name() { + var n = _entryName.toString(); + return _isDirectory + ? n + .substr(n.length - 1) + .split("/") + .pop() + : n.split("/").pop(); + }, + get isDirectory() { + return _isDirectory; + }, - getCompressedData : function() { - return compress(false, null) + getCompressedData: function () { + return compress(false, null); }, - getCompressedDataAsync : function(/*Function*/callback) { - compress(true, callback) + getCompressedDataAsync: function (/*Function*/ callback) { + compress(true, callback); }, - setData : function(value) { + setData: function (value) { uncompressedData = Utils.toBuffer(value); if (!_isDirectory && uncompressedData.length) { _entryHeader.size = uncompressedData.length; _entryHeader.method = Utils.Constants.DEFLATED; _entryHeader.crc = Utils.crc32(value); _entryHeader.changed = true; - } else { // folders and blank files should be stored + } else { + // folders and blank files should be stored _entryHeader.method = Utils.Constants.STORED; } }, - getData : function(pass) { + getData: function (pass) { if (_entryHeader.changed) { - return uncompressedData; - } else { - return decompress(false, null, pass); + return uncompressedData; + } else { + return decompress(false, null, pass); } }, - getDataAsync : function(/*Function*/callback, pass) { - if (_entryHeader.changed) { - callback(uncompressedData) - } else { - decompress(true, callback, pass) + getDataAsync: function (/*Function*/ callback, pass) { + if (_entryHeader.changed) { + callback(uncompressedData); + } else { + decompress(true, callback, pass); } }, - set attr(attr) { _entryHeader.attr = attr; }, - get attr() { return _entryHeader.attr; }, + set attr(attr) { + _entryHeader.attr = attr; + }, + get attr() { + return _entryHeader.attr; + }, - set header(/*Buffer*/data) { + set header(/*Buffer*/ data) { _entryHeader.loadFromBinary(data); }, @@ -10331,31 +11772,45 @@ module.exports = function (/*Buffer*/input) { return _entryHeader; }, - packHeader : function() { + packHeader: function () { + // 1. create header (buffer) var header = _entryHeader.entryHeaderToBinary(); - // add - _entryName.copy(header, Utils.Constants.CENHDR); + var addpos = Utils.Constants.CENHDR; + // 2. add file name + _entryName.copy(header, addpos); + addpos += _entryName.length; + // 3. add extra data if (_entryHeader.extraLength) { - _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) + _extra.copy(header, addpos); + addpos += _entryHeader.extraLength; } + // 4. add file comment if (_entryHeader.commentLength) { - _comment.copy(header, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length); + _comment.copy(header, addpos); } return header; }, - toString : function() { - return '{\n' + - '\t"entryName" : "' + _entryName.toString() + "\",\n" + - '\t"name" : "' + (_isDirectory ? _entryName.toString().replace(/\/$/, '').split("/").pop() : _entryName.toString().split("/").pop()) + "\",\n" + - '\t"comment" : "' + _comment.toString() + "\",\n" + - '\t"isDirectory" : ' + _isDirectory + ",\n" + - '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t").replace(/}/mg, "\t}") + ",\n" + - '\t"compressedData" : <' + (input && input.length + " bytes buffer" || "null") + ">\n" + - '\t"data" : <' + (uncompressedData && uncompressedData.length + " bytes buffer" || "null") + ">\n" + - '}'; + toJSON: function () { + const bytes = function (nr) { + return "<" + ((nr && nr.length + " bytes buffer") || "null") + ">"; + }; + + return { + entryName: this.entryName, + name: this.name, + comment: this.comment, + isDirectory: this.isDirectory, + header: _entryHeader.toJSON(), + compressedData: bytes(input), + data: bytes(uncompressedData) + }; + }, + + toString: function () { + return JSON.stringify(this.toJSON(), null, "\t"); } - } + }; }; @@ -10364,413 +11819,389 @@ module.exports = function (/*Buffer*/input) { /***/ 7744: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var ZipEntry = __nccwpck_require__(4057), - Headers = __nccwpck_require__(4958), - Utils = __nccwpck_require__(5182); - -module.exports = function (/*String|Buffer*/input, /*Number*/inputType) { - var entryList = [], - entryTable = {}, - _comment = Buffer.alloc(0), - filename = "", - fs = Utils.FileSystem.require(), - inBuffer = null, - mainHeader = new Headers.MainHeader(), - loadedEntries = false; - - if (inputType === Utils.Constants.FILE) { - // is a filename - filename = input; - inBuffer = fs.readFileSync(filename); - readMainHeader(); - } else if (inputType === Utils.Constants.BUFFER) { - // is a memory buffer - inBuffer = input; - readMainHeader(); - } else { - // none. is a new file - loadedEntries = true; - } +const ZipEntry = __nccwpck_require__(4057); +const Headers = __nccwpck_require__(4958); +const Utils = __nccwpck_require__(5182); - function iterateEntries(callback) { - const totalEntries = mainHeader.diskEntries; // total number of entries - let index = mainHeader.offset; // offset of first CEN header +module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) { + var entryList = [], + entryTable = {}, + _comment = Buffer.alloc(0), + mainHeader = new Headers.MainHeader(), + loadedEntries = false; - for (let i = 0; i < totalEntries; i++) { - let tmp = index; - const entry = new ZipEntry(inBuffer); + // assign options + const opts = Object.assign(Object.create(null), options); - entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); - entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); + const { noSort } = opts; - index += entry.header.entryHeaderSize; + if (inBuffer) { + // is a memory buffer + readMainHeader(opts.readEntries); + } else { + // none. is a new file + loadedEntries = true; + } - callback(entry); - } - } + function iterateEntries(callback) { + const totalEntries = mainHeader.diskEntries; // total number of entries + let index = mainHeader.offset; // offset of first CEN header - function readEntries() { - loadedEntries = true; - entryTable = {}; - entryList = new Array(mainHeader.diskEntries); // total number of entries - var index = mainHeader.offset; // offset of first CEN header - for (var i = 0; i < entryList.length; i++) { + for (let i = 0; i < totalEntries; i++) { + let tmp = index; + const entry = new ZipEntry(inBuffer); - var tmp = index, - entry = new ZipEntry(inBuffer); - entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); + entry.header = inBuffer.slice(tmp, (tmp += Utils.Constants.CENHDR)); + entry.entryName = inBuffer.slice(tmp, (tmp += entry.header.fileNameLength)); - entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); + index += entry.header.entryHeaderSize; - if (entry.header.extraLength) { - entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); - } + callback(entry); + } + } - if (entry.header.commentLength) - entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); + function readEntries() { + loadedEntries = true; + entryTable = {}; + entryList = new Array(mainHeader.diskEntries); // total number of entries + var index = mainHeader.offset; // offset of first CEN header + for (var i = 0; i < entryList.length; i++) { + var tmp = index, + entry = new ZipEntry(inBuffer); + entry.header = inBuffer.slice(tmp, (tmp += Utils.Constants.CENHDR)); - index += entry.header.entryHeaderSize; + entry.entryName = inBuffer.slice(tmp, (tmp += entry.header.fileNameLength)); - entryList[i] = entry; - entryTable[entry.entryName] = entry; - } - } + if (entry.header.extraLength) { + entry.extra = inBuffer.slice(tmp, (tmp += entry.header.extraLength)); + } - function readMainHeader() { - var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size - max = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length - n = max, - endStart = inBuffer.length, - endOffset = -1, // Start offset of the END header - commentEnd = 0; - - for (i; i >= n; i--) { - if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P' - if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) { // "PK\005\006" - endOffset = i; - commentEnd = i; - endStart = i + Utils.Constants.ENDHDR; - // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature - n = i - Utils.Constants.END64HDR; - continue; - } + if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); - if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) { - // Found a zip64 signature, let's continue reading the whole zip64 record - n = max; - continue; - } + index += entry.header.entryHeaderSize; - if (inBuffer.readUInt32LE(i) == Utils.Constants.ZIP64SIG) { - // Found the zip64 record, let's determine it's size - endOffset = i; - endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD; - break; - } - } + entryList[i] = entry; + entryTable[entry.entryName] = entry; + } + } - if (!~endOffset) - throw new Error(Utils.Errors.INVALID_FORMAT); + function readMainHeader(/*Boolean*/ readNow) { + var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size + max = Math.max(0, i - 0xffff), // 0xFFFF is the max zip file comment length + n = max, + endStart = inBuffer.length, + endOffset = -1, // Start offset of the END header + commentEnd = 0; - mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart)); - if (mainHeader.commentLength) { - _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR); - } - // readEntries(); - } + for (i; i >= n; i--) { + if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P' + if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) { + // "PK\005\006" + endOffset = i; + commentEnd = i; + endStart = i + Utils.Constants.ENDHDR; + // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature + n = i - Utils.Constants.END64HDR; + continue; + } - return { - /** - * Returns an array of ZipEntry objects existent in the current opened archive - * @return Array - */ - get entries() { - if (!loadedEntries) { - readEntries(); - } - return entryList; - }, + if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) { + // Found a zip64 signature, let's continue reading the whole zip64 record + n = max; + continue; + } - /** - * Archive comment - * @return {String} - */ - get comment() { - return _comment.toString(); - }, - set comment(val) { - _comment = Utils.toBuffer(val); - mainHeader.commentLength = _comment.length; - }, + if (inBuffer.readUInt32LE(i) === Utils.Constants.ZIP64SIG) { + // Found the zip64 record, let's determine it's size + endOffset = i; + endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD; + break; + } + } - getEntryCount: function() { - if (!loadedEntries) { - return mainHeader.diskEntries; - } + if (!~endOffset) throw new Error(Utils.Errors.INVALID_FORMAT); - return entryList.length; - }, + mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart)); + if (mainHeader.commentLength) { + _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR); + } + if (readNow) readEntries(); + } - forEach: function(callback) { - if (!loadedEntries) { - iterateEntries(callback); - return; - } + function sortEntries() { + if (entryList.length > 1 && !noSort) { + entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase())); + } + } - entryList.forEach(callback); - }, + return { + /** + * Returns an array of ZipEntry objects existent in the current opened archive + * @return Array + */ + get entries() { + if (!loadedEntries) { + readEntries(); + } + return entryList; + }, - /** - * Returns a reference to the entry with the given name or null if entry is inexistent - * - * @param entryName - * @return ZipEntry - */ - getEntry: function (/*String*/entryName) { - if (!loadedEntries) { - readEntries(); - } - return entryTable[entryName] || null; - }, + /** + * Archive comment + * @return {String} + */ + get comment() { + return _comment.toString(); + }, + set comment(val) { + _comment = Utils.toBuffer(val); + mainHeader.commentLength = _comment.length; + }, - /** - * Adds the given entry to the entry list - * - * @param entry - */ - setEntry: function (/*ZipEntry*/entry) { - if (!loadedEntries) { - readEntries(); - } - entryList.push(entry); - entryTable[entry.entryName] = entry; - mainHeader.totalEntries = entryList.length; - }, + getEntryCount: function () { + if (!loadedEntries) { + return mainHeader.diskEntries; + } - /** - * Removes the entry with the given name from the entry list. - * - * If the entry is a directory, then all nested files and directories will be removed - * @param entryName - */ - deleteEntry: function (/*String*/entryName) { - if (!loadedEntries) { - readEntries(); - } - var entry = entryTable[entryName]; - if (entry && entry.isDirectory) { - var _self = this; - this.getEntryChildren(entry).forEach(function (child) { - if (child.entryName !== entryName) { - _self.deleteEntry(child.entryName) - } - }) - } - entryList.splice(entryList.indexOf(entry), 1); - delete(entryTable[entryName]); - mainHeader.totalEntries = entryList.length; - }, - - /** - * Iterates and returns all nested files and directories of the given entry - * - * @param entry - * @return Array - */ - getEntryChildren: function (/*ZipEntry*/entry) { - if (!loadedEntries) { - readEntries(); - } - if (entry.isDirectory) { - var list = [], - name = entry.entryName, - len = name.length; - - entryList.forEach(function (zipEntry) { - if (zipEntry.entryName.substr(0, len) === name) { - list.push(zipEntry); - } - }); - return list; - } - return [] - }, - - /** - * Returns the zip file - * - * @return Buffer - */ - compressToBuffer: function () { - if (!loadedEntries) { - readEntries(); - } - if (entryList.length > 1) { - entryList.sort(function (a, b) { - var nameA = a.entryName.toLowerCase(); - var nameB = b.entryName.toLowerCase(); - if (nameA < nameB) { - return -1 - } - if (nameA > nameB) { - return 1 - } - return 0; - }); - } - - var totalSize = 0, - dataBlock = [], - entryHeaders = [], - dindex = 0; - - mainHeader.size = 0; - mainHeader.offset = 0; - - entryList.forEach(function (entry) { - // compress data and set local and entry header accordingly. Reason why is called first - var compressedData = entry.getCompressedData(); - // data header - entry.header.offset = dindex; - var dataHeader = entry.header.dataHeaderToBinary(); - var entryNameLen = entry.rawEntryName.length; - var extra = entry.extra.toString(); - var postHeader = Buffer.alloc(entryNameLen + extra.length); - entry.rawEntryName.copy(postHeader, 0); - postHeader.fill(extra, entryNameLen); - - var dataLength = dataHeader.length + postHeader.length + compressedData.length; - - dindex += dataLength; - - dataBlock.push(dataHeader); - dataBlock.push(postHeader); - dataBlock.push(compressedData); - - var entryHeader = entry.packHeader(); - entryHeaders.push(entryHeader); - mainHeader.size += entryHeader.length; - totalSize += (dataLength + entryHeader.length); - }); - - totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length - // point to end of data and beginning of central directory first record - mainHeader.offset = dindex; - - dindex = 0; - var outBuffer = Buffer.alloc(totalSize); - dataBlock.forEach(function (content) { - content.copy(outBuffer, dindex); // write data blocks - dindex += content.length; - }); - entryHeaders.forEach(function (content) { - content.copy(outBuffer, dindex); // write central directory entries - dindex += content.length; - }); - - var mh = mainHeader.toBinary(); - if (_comment) { - Buffer.from(_comment).copy(mh, Utils.Constants.ENDHDR); // add zip file comment - } - - mh.copy(outBuffer, dindex); // write main header + return entryList.length; + }, - return outBuffer - }, + forEach: function (callback) { + if (!loadedEntries) { + iterateEntries(callback); + return; + } - toAsyncBuffer: function (/*Function*/onSuccess, /*Function*/onFail, /*Function*/onItemStart, /*Function*/onItemEnd) { - if (!loadedEntries) { - readEntries(); - } - if (entryList.length > 1) { - entryList.sort(function (a, b) { - var nameA = a.entryName.toLowerCase(); - var nameB = b.entryName.toLowerCase(); - if (nameA > nameB) { - return -1 - } - if (nameA < nameB) { - return 1 - } - return 0; - }); - } + entryList.forEach(callback); + }, - var totalSize = 0, - dataBlock = [], - entryHeaders = [], - dindex = 0; - - mainHeader.size = 0; - mainHeader.offset = 0; - - var compress = function (entryList) { - var self = arguments.callee; - if (entryList.length) { - var entry = entryList.pop(); - var name = entry.entryName + entry.extra.toString(); - if (onItemStart) onItemStart(name); - entry.getCompressedDataAsync(function (compressedData) { - if (onItemEnd) onItemEnd(name); - - entry.header.offset = dindex; - // data header - var dataHeader = entry.header.dataHeaderToBinary(); - var postHeader; - try { - postHeader = Buffer.alloc(name.length, name); // using alloc will work on node 5.x+ - } catch(e){ - postHeader = new Buffer(name); // use deprecated method if alloc fails... - } - var dataLength = dataHeader.length + postHeader.length + compressedData.length; + /** + * Returns a reference to the entry with the given name or null if entry is inexistent + * + * @param entryName + * @return ZipEntry + */ + getEntry: function (/*String*/ entryName) { + if (!loadedEntries) { + readEntries(); + } + return entryTable[entryName] || null; + }, - dindex += dataLength; + /** + * Adds the given entry to the entry list + * + * @param entry + */ + setEntry: function (/*ZipEntry*/ entry) { + if (!loadedEntries) { + readEntries(); + } + entryList.push(entry); + entryTable[entry.entryName] = entry; + mainHeader.totalEntries = entryList.length; + }, - dataBlock.push(dataHeader); - dataBlock.push(postHeader); - dataBlock.push(compressedData); + /** + * Removes the entry with the given name from the entry list. + * + * If the entry is a directory, then all nested files and directories will be removed + * @param entryName + */ + deleteEntry: function (/*String*/ entryName) { + if (!loadedEntries) { + readEntries(); + } + var entry = entryTable[entryName]; + if (entry && entry.isDirectory) { + var _self = this; + this.getEntryChildren(entry).forEach(function (child) { + if (child.entryName !== entryName) { + _self.deleteEntry(child.entryName); + } + }); + } + entryList.splice(entryList.indexOf(entry), 1); + delete entryTable[entryName]; + mainHeader.totalEntries = entryList.length; + }, - var entryHeader = entry.packHeader(); - entryHeaders.push(entryHeader); - mainHeader.size += entryHeader.length; - totalSize += (dataLength + entryHeader.length); + /** + * Iterates and returns all nested files and directories of the given entry + * + * @param entry + * @return Array + */ + getEntryChildren: function (/*ZipEntry*/ entry) { + if (!loadedEntries) { + readEntries(); + } + if (entry && entry.isDirectory) { + const list = []; + const name = entry.entryName; + const len = name.length; + + entryList.forEach(function (zipEntry) { + if (zipEntry.entryName.substr(0, len) === name) { + list.push(zipEntry); + } + }); + return list; + } + return []; + }, - if (entryList.length) { - self(entryList); - } else { + /** + * Returns the zip file + * + * @return Buffer + */ + compressToBuffer: function () { + if (!loadedEntries) { + readEntries(); + } + sortEntries(); + + const dataBlock = []; + const entryHeaders = []; + let totalSize = 0; + let dindex = 0; + + mainHeader.size = 0; + mainHeader.offset = 0; + + for (const entry of entryList) { + // compress data and set local and entry header accordingly. Reason why is called first + const compressedData = entry.getCompressedData(); + // 1. construct data header + entry.header.offset = dindex; + const dataHeader = entry.header.dataHeaderToBinary(); + const entryNameLen = entry.rawEntryName.length; + // 1.2. postheader - data after data header + const postHeader = Buffer.alloc(entryNameLen + entry.extra.length); + entry.rawEntryName.copy(postHeader, 0); + postHeader.copy(entry.extra, entryNameLen); + + // 2. offsets + const dataLength = dataHeader.length + postHeader.length + compressedData.length; + dindex += dataLength; + + // 3. store values in sequence + dataBlock.push(dataHeader); + dataBlock.push(postHeader); + dataBlock.push(compressedData); + + // 4. construct entry header + const entryHeader = entry.packHeader(); + entryHeaders.push(entryHeader); + // 5. update main header + mainHeader.size += entryHeader.length; + totalSize += dataLength + entryHeader.length; + } + + totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length + // point to end of data and beginning of central directory first record + mainHeader.offset = dindex; + + dindex = 0; + const outBuffer = Buffer.alloc(totalSize); + // write data blocks + for (const content of dataBlock) { + content.copy(outBuffer, dindex); + dindex += content.length; + } + + // write central directory entries + for (const content of entryHeaders) { + content.copy(outBuffer, dindex); + dindex += content.length; + } + + // write main header + const mh = mainHeader.toBinary(); + if (_comment) { + _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment + } + mh.copy(outBuffer, dindex); + + return outBuffer; + }, + toAsyncBuffer: function (/*Function*/ onSuccess, /*Function*/ onFail, /*Function*/ onItemStart, /*Function*/ onItemEnd) { + try { + if (!loadedEntries) { + readEntries(); + } + sortEntries(); + + const dataBlock = []; + const entryHeaders = []; + let totalSize = 0; + let dindex = 0; + + mainHeader.size = 0; + mainHeader.offset = 0; + + const compress2Buffer = function (entryLists) { + if (entryLists.length) { + const entry = entryLists.pop(); + const name = entry.entryName + entry.extra.toString(); + if (onItemStart) onItemStart(name); + entry.getCompressedDataAsync(function (compressedData) { + if (onItemEnd) onItemEnd(name); + + entry.header.offset = dindex; + // data header + const dataHeader = entry.header.dataHeaderToBinary(); + const postHeader = Buffer.alloc(name.length, name); + const dataLength = dataHeader.length + postHeader.length + compressedData.length; + + dindex += dataLength; + + dataBlock.push(dataHeader); + dataBlock.push(postHeader); + dataBlock.push(compressedData); + + const entryHeader = entry.packHeader(); + entryHeaders.push(entryHeader); + mainHeader.size += entryHeader.length; + totalSize += dataLength + entryHeader.length; + + compress2Buffer(entryLists); + }); + } else { + totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length + // point to end of data and beginning of central directory first record + mainHeader.offset = dindex; + + dindex = 0; + const outBuffer = Buffer.alloc(totalSize); + dataBlock.forEach(function (content) { + content.copy(outBuffer, dindex); // write data blocks + dindex += content.length; + }); + entryHeaders.forEach(function (content) { + content.copy(outBuffer, dindex); // write central directory entries + dindex += content.length; + }); - totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length - // point to end of data and beginning of central directory first record - mainHeader.offset = dindex; - - dindex = 0; - var outBuffer = Buffer.alloc(totalSize); - dataBlock.forEach(function (content) { - content.copy(outBuffer, dindex); // write data blocks - dindex += content.length; - }); - entryHeaders.forEach(function (content) { - content.copy(outBuffer, dindex); // write central directory entries - dindex += content.length; - }); - - var mh = mainHeader.toBinary(); - if (_comment) { - _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment - } + const mh = mainHeader.toBinary(); + if (_comment) { + _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment + } - mh.copy(outBuffer, dindex); // write main header + mh.copy(outBuffer, dindex); // write main header - onSuccess(outBuffer); - } - }); - } - }; + onSuccess(outBuffer); + } + }; - compress(entryList); - } - } + compress2Buffer(entryList); + } catch (e) { + onFail(e); + } + } + }; }; @@ -10843,51 +12274,51 @@ module.exports.Collection = Hook.Collection /***/ 5549: /***/ ((module) => { -module.exports = addHook +module.exports = addHook; -function addHook (state, kind, name, hook) { - var orig = hook +function addHook(state, kind, name, hook) { + var orig = hook; if (!state.registry[name]) { - state.registry[name] = [] + state.registry[name] = []; } - if (kind === 'before') { + if (kind === "before") { hook = function (method, options) { return Promise.resolve() .then(orig.bind(null, options)) - .then(method.bind(null, options)) - } + .then(method.bind(null, options)); + }; } - if (kind === 'after') { + if (kind === "after") { hook = function (method, options) { - var result + var result; return Promise.resolve() .then(method.bind(null, options)) .then(function (result_) { - result = result_ - return orig(result, options) + result = result_; + return orig(result, options); }) .then(function () { - return result - }) - } + return result; + }); + }; } - if (kind === 'error') { + if (kind === "error") { hook = function (method, options) { return Promise.resolve() .then(method.bind(null, options)) .catch(function (error) { - return orig(error, options) - }) - } + return orig(error, options); + }); + }; } state.registry[name].push({ hook: hook, - orig: orig - }) + orig: orig, + }); } @@ -10896,33 +12327,32 @@ function addHook (state, kind, name, hook) { /***/ 4670: /***/ ((module) => { -module.exports = register +module.exports = register; -function register (state, name, method, options) { - if (typeof method !== 'function') { - throw new Error('method for before hook must be a function') +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); } if (!options) { - options = {} + options = {}; } if (Array.isArray(name)) { return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options) - }, method)() + return register.bind(null, state, name, callback, options); + }, method)(); } - return Promise.resolve() - .then(function () { - if (!state.registry[name]) { - return method(options) - } + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } - return (state.registry[name]).reduce(function (method, registered) { - return registered.hook.bind(null, method, options) - }, method)() - }) + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); } @@ -10931,4662 +12361,4115 @@ function register (state, name, method, options) { /***/ 6819: /***/ ((module) => { -module.exports = removeHook +module.exports = removeHook; -function removeHook (state, name, method) { +function removeHook(state, name, method) { if (!state.registry[name]) { - return + return; } var index = state.registry[name] - .map(function (registered) { return registered.orig }) - .indexOf(method) + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); if (index === -1) { - return + return; } - state.registry[name].splice(index, 1) + state.registry[name].splice(index, 1); } /***/ }), -/***/ 2286: +/***/ 610: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { - V4MAPPED, - ADDRCONFIG, - ALL, - promises: { - Resolver: AsyncResolver - }, - lookup: dnsLookup -} = __nccwpck_require__(881); -const {promisify} = __nccwpck_require__(1669); -const os = __nccwpck_require__(2087); -const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); -const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); -const kExpires = Symbol('expires'); +const stringify = __nccwpck_require__(8750); +const compile = __nccwpck_require__(9434); +const expand = __nccwpck_require__(5873); +const parse = __nccwpck_require__(6477); -const supportsALL = typeof ALL === 'number'; +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ -const verifyAgent = agent => { - if (!(agent && typeof agent.createConnection === 'function')) { - throw new Error('Expected an Agent instance as the first argument'); - } -}; +const braces = (input, options = {}) => { + let output = []; -const map4to6 = entries => { - for (const entry of entries) { - if (entry.family === 6) { - continue; - } + if (Array.isArray(input)) { + for (let pattern of input) { + let result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } - entry.address = `::ffff:${entry.address}`; - entry.family = 6; - } + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; }; -const getIfaceInfo = () => { - let has4 = false; - let has6 = false; - - for (const device of Object.values(os.networkInterfaces())) { - for (const iface of device) { - if (iface.internal) { - continue; - } +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ - if (iface.family === 'IPv6') { - has6 = true; - } else { - has4 = true; - } +braces.parse = (input, options = {}) => parse(input, options); - if (has4 && has6) { - return {has4, has6}; - } - } - } +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ - return {has4, has6}; +braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); }; -const isIterable = map => { - return Symbol.iterator in map; +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); }; -const ttl = {ttl: true}; -const all = {all: true}; +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ -class CacheableLookup { - constructor({ - cache = new Map(), - maxTtl = Infinity, - fallbackDuration = 3600, - errorTtl = 0.15, - resolver = new AsyncResolver(), - lookup = dnsLookup - } = {}) { - this.maxTtl = maxTtl; - this.errorTtl = errorTtl; - - this._cache = cache; - this._resolver = resolver; - this._dnsLookup = promisify(lookup); - - if (this._resolver instanceof AsyncResolver) { - this._resolve4 = this._resolver.resolve4.bind(this._resolver); - this._resolve6 = this._resolver.resolve6.bind(this._resolver); - } else { - this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver)); - this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver)); - } +braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } - this._iface = getIfaceInfo(); + let result = expand(input, options); - this._pending = {}; - this._nextRemovalTime = false; - this._hostnamesToFallback = new Set(); + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } - if (fallbackDuration < 1) { - this._fallback = false; - } else { - this._fallback = true; + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } - const interval = setInterval(() => { - this._hostnamesToFallback.clear(); - }, fallbackDuration * 1000); + return result; +}; - /* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */ - if (interval.unref) { - interval.unref(); - } - } +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ - this.lookup = this.lookup.bind(this); - this.lookupAsync = this.lookupAsync.bind(this); - } +braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } - set servers(servers) { - this.clear(); + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; - this._resolver.setServers(servers); - } +/** + * Expose "braces" + */ - get servers() { - return this._resolver.getServers(); - } +module.exports = braces; - lookup(hostname, options, callback) { - if (typeof options === 'function') { - callback = options; - options = {}; - } else if (typeof options === 'number') { - options = { - family: options - }; - } - if (!callback) { - throw new Error('Callback must be a function.'); - } +/***/ }), - // eslint-disable-next-line promise/prefer-await-to-then - this.lookupAsync(hostname, options).then(result => { - if (options.all) { - callback(null, result); - } else { - callback(null, result.address, result.family, result.expires, result.ttl); - } - }, callback); - } +/***/ 9434: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - async lookupAsync(hostname, options = {}) { - if (typeof options === 'number') { - options = { - family: options - }; - } +"use strict"; - let cached = await this.query(hostname); - if (options.family === 6) { - const filtered = cached.filter(entry => entry.family === 6); +const fill = __nccwpck_require__(6330); +const utils = __nccwpck_require__(5207); - if (options.hints & V4MAPPED) { - if ((supportsALL && options.hints & ALL) || filtered.length === 0) { - map4to6(cached); - } else { - cached = filtered; - } - } else { - cached = filtered; - } - } else if (options.family === 4) { - cached = cached.filter(entry => entry.family === 4); - } +const compile = (ast, options = {}) => { + let walk = (node, parent = {}) => { + let invalidBlock = utils.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let invalid = invalidBlock === true || invalidNode === true; + let prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; - if (options.hints & ADDRCONFIG) { - const {_iface} = this; - cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4); - } + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + return prefix + node.value; + } - if (cached.length === 0) { - const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`); - error.code = 'ENOTFOUND'; - error.hostname = hostname; + if (node.type === 'open') { + return invalid ? (prefix + node.value) : '('; + } - throw error; - } + if (node.type === 'close') { + return invalid ? (prefix + node.value) : ')'; + } - if (options.all) { - return cached; - } + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); + } - return cached[0]; - } + if (node.value) { + return node.value; + } - async query(hostname) { - let cached = await this._cache.get(hostname); + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); + let range = fill(...args, { ...options, wrap: false, toRegex: true }); - if (!cached) { - const pending = this._pending[hostname]; + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } - if (pending) { - cached = await pending; - } else { - const newPromise = this.queryAndCache(hostname); - this._pending[hostname] = newPromise; + if (node.nodes) { + for (let child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; - try { - cached = await newPromise; - } finally { - delete this._pending[hostname]; - } - } - } + return walk(ast); +}; - cached = cached.map(entry => { - return {...entry}; - }); +module.exports = compile; - return cached; - } - async _resolve(hostname) { - const wrap = async promise => { - try { - return await promise; - } catch (error) { - if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') { - return []; - } +/***/ }), - throw error; - } - }; +/***/ 8774: +/***/ ((module) => { - // ANY is unsafe as it doesn't trigger new queries in the underlying server. - const [A, AAAA] = await Promise.all([ - this._resolve4(hostname, ttl), - this._resolve6(hostname, ttl) - ].map(promise => wrap(promise))); +"use strict"; - let aTtl = 0; - let aaaaTtl = 0; - let cacheTtl = 0; - const now = Date.now(); +module.exports = { + MAX_LENGTH: 1024 * 64, - for (const entry of A) { - entry.family = 4; - entry.expires = now + (entry.ttl * 1000); + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ - aTtl = Math.max(aTtl, entry.ttl); - } + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ - for (const entry of AAAA) { - entry.family = 6; - entry.expires = now + (entry.ttl * 1000); + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ - aaaaTtl = Math.max(aaaaTtl, entry.ttl); - } + CHAR_ASTERISK: '*', /* * */ - if (A.length > 0) { - if (AAAA.length > 0) { - cacheTtl = Math.min(aTtl, aaaaTtl); - } else { - cacheTtl = aTtl; - } - } else { - cacheTtl = aaaaTtl; - } + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; - return { - entries: [ - ...A, - ...AAAA - ], - cacheTtl - }; - } - async _lookup(hostname) { - try { - const entries = await this._dnsLookup(hostname, { - all: true - }); +/***/ }), - return { - entries, - cacheTtl: 0 - }; - } catch (_) { - return { - entries: [], - cacheTtl: 0 - }; - } - } +/***/ 5873: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - async _set(hostname, data, cacheTtl) { - if (this.maxTtl > 0 && cacheTtl > 0) { - cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000; - data[kExpires] = Date.now() + cacheTtl; +"use strict"; - try { - await this._cache.set(hostname, data, cacheTtl); - } catch (error) { - this.lookupAsync = async () => { - const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.'); - cacheError.cause = error; - throw cacheError; - }; - } +const fill = __nccwpck_require__(6330); +const stringify = __nccwpck_require__(8750); +const utils = __nccwpck_require__(5207); - if (isIterable(this._cache)) { - this._tick(cacheTtl); - } - } - } +const append = (queue = '', stash = '', enclose = false) => { + let result = []; - async queryAndCache(hostname) { - if (this._hostnamesToFallback.has(hostname)) { - return this._dnsLookup(hostname, all); - } + queue = [].concat(queue); + stash = [].concat(stash); - let query = await this._resolve(hostname); + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } - if (query.entries.length === 0 && this._fallback) { - query = await this._lookup(hostname); + for (let item of queue) { + if (Array.isArray(item)) { + for (let value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); + } + } + } + return utils.flatten(result); +}; - if (query.entries.length !== 0) { - // Use `dns.lookup(...)` for that particular hostname - this._hostnamesToFallback.add(hostname); - } - } +const expand = (ast, options = {}) => { + let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; - const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; - await this._set(hostname, query.entries, cacheTtl); + let walk = (node, parent = {}) => { + node.queue = []; - return query.entries; - } + let p = parent; + let q = parent.queue; - _tick(ms) { - const nextRemovalTime = this._nextRemovalTime; + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } - if (!nextRemovalTime || ms < nextRemovalTime) { - clearTimeout(this._removalTimeout); + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } - this._nextRemovalTime = ms; + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } - this._removalTimeout = setTimeout(() => { - this._nextRemovalTime = false; + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); - let nextExpiry = Infinity; + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } - const now = Date.now(); + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } - for (const [hostname, entries] of this._cache) { - const expires = entries[kExpires]; + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } - if (now >= expires) { - this._cache.delete(hostname); - } else if (expires < nextExpiry) { - nextExpiry = expires; - } - } + let enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; - if (nextExpiry !== Infinity) { - this._tick(nextExpiry - now); - } - }, ms); + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } - /* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */ - if (this._removalTimeout.unref) { - this._removalTimeout.unref(); - } - } - } + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; - install(agent) { - verifyAgent(agent); + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } - if (kCacheableLookupCreateConnection in agent) { - throw new Error('CacheableLookup has been already installed'); - } + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } - agent[kCacheableLookupCreateConnection] = agent.createConnection; - agent[kCacheableLookupInstance] = this; + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } - agent.createConnection = (options, callback) => { - if (!('lookup' in options)) { - options.lookup = this.lookup; - } + if (child.nodes) { + walk(child, node); + } + } - return agent[kCacheableLookupCreateConnection](options, callback); - }; - } + return queue; + }; - uninstall(agent) { - verifyAgent(agent); + return utils.flatten(walk(ast)); +}; - if (agent[kCacheableLookupCreateConnection]) { - if (agent[kCacheableLookupInstance] !== this) { - throw new Error('The agent is not owned by this CacheableLookup instance'); - } +module.exports = expand; - agent.createConnection = agent[kCacheableLookupCreateConnection]; - delete agent[kCacheableLookupCreateConnection]; - delete agent[kCacheableLookupInstance]; - } - } +/***/ }), - updateInterfaceInfo() { - const {_iface} = this; +/***/ 6477: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this._iface = getIfaceInfo(); +"use strict"; - if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) { - this._cache.clear(); - } - } - clear(hostname) { - if (hostname) { - this._cache.delete(hostname); - return; - } +const stringify = __nccwpck_require__(8750); - this._cache.clear(); - } -} - -module.exports = CacheableLookup; -module.exports.default = CacheableLookup; +/** + * Constants + */ +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = __nccwpck_require__(8774); -/***/ }), +/** + * parse + */ -/***/ 4340: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } -"use strict"; + let opts = options || {}; + let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } -const {PassThrough: PassThroughStream} = __nccwpck_require__(2413); + let ast = { type: 'root', input, nodes: [] }; + let stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + let length = input.length; + let index = 0; + let depth = 0; + let value; + let memo = {}; -module.exports = options => { - options = {...options}; + /** + * Helpers + */ - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } - if (isBuffer) { - encoding = null; - } + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; - const stream = new PassThroughStream({objectMode}); + push({ type: 'bos' }); - if (encoding) { - stream.setEncoding(encoding); - } + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); - let length = 0; - const chunks = []; + /** + * Invalid chars + */ - stream.on('data', chunk => { - chunks.push(chunk); + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); + /** + * Escaped chars + */ - stream.getBufferedValue = () => { - if (array) { - return chunks; - } + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; + /** + * Right square bracket (literal): ']' + */ - stream.getBufferedLength = () => length; + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } - return stream; -}; + /** + * Left square bracket: '[' + */ + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; -/***/ }), + let closed = true; + let next; -/***/ 7040: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + while (index < length && (next = advance())) { + value += next; -"use strict"; + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } -const {constants: BufferConstants} = __nccwpck_require__(4293); -const pump = __nccwpck_require__(8341); -const bufferStream = __nccwpck_require__(4340); + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } + if (brackets === 0) { + break; + } + } + } - options = { - maxBuffer: Infinity, - ...options - }; + push({ type: 'text', value }); + continue; + } - const {maxBuffer} = options; + /** + * Parentheses + */ - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } - reject(error); - }; + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } + /** + * Quotes: '|"|` + */ - resolve(); - }); + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + let open = value; + let next; - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); + if (options.keepQuotes !== true) { + value = ''; + } - return stream.getBufferedValue(); -} + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + value += next; + } -/***/ }), + push({ type: 'text', value }); + continue; + } -/***/ 8116: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Left curly brace: '{' + */ -"use strict"; + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + let brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; -const EventEmitter = __nccwpck_require__(8614); -const urlLib = __nccwpck_require__(8835); -const normalizeUrl = __nccwpck_require__(7952); -const getStream = __nccwpck_require__(7040); -const CachePolicy = __nccwpck_require__(1002); -const Response = __nccwpck_require__(9004); -const lowercaseKeys = __nccwpck_require__(9662); -const cloneResponse = __nccwpck_require__(1312); -const Keyv = __nccwpck_require__(1531); + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } -class CacheableRequest { - constructor(request, cacheAdapter) { - if (typeof request !== 'function') { - throw new TypeError('Parameter `request` must be a function'); - } + /** + * Right curly brace: '}' + */ - this.cache = new Keyv({ - uri: typeof cacheAdapter === 'string' && cacheAdapter, - store: typeof cacheAdapter !== 'string' && cacheAdapter, - namespace: 'cacheable-request' - }); + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } - return this.createCacheableRequest(request); - } + let type = 'close'; + block = stack.pop(); + block.close = true; - createCacheableRequest(request) { - return (opts, cb) => { - let url; - if (typeof opts === 'string') { - url = normalizeUrlObject(urlLib.parse(opts)); - opts = {}; - } else if (opts instanceof urlLib.URL) { - url = normalizeUrlObject(urlLib.parse(opts.toString())); - opts = {}; - } else { - const [pathname, ...searchParts] = (opts.path || '').split('?'); - const search = searchParts.length > 0 ? - `?${searchParts.join('?')}` : - ''; - url = normalizeUrlObject({ ...opts, pathname, search }); - } + push({ type, value }); + depth--; - opts = { - headers: {}, - method: 'GET', - cache: true, - strictTtl: false, - automaticFailover: false, - ...opts, - ...urlObjectToRequestOptions(url) - }; - opts.headers = lowercaseKeys(opts.headers); + block = stack[stack.length - 1]; + continue; + } - const ee = new EventEmitter(); - const normalizedUrlString = normalizeUrl( - urlLib.format(url), - { - stripWWW: false, - removeTrailingSlash: false, - stripAuthentication: false - } - ); - const key = `${opts.method}:${normalizedUrlString}`; - let revalidate = false; - let madeRequest = false; + /** + * Comma: ',' + */ - const makeRequest = opts => { - madeRequest = true; - let requestErrored = false; - let requestErrorCallback; + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + let open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } - const requestErrorPromise = new Promise(resolve => { - requestErrorCallback = () => { - if (!requestErrored) { - requestErrored = true; - resolve(); - } - }; - }); + push({ type: 'comma', value }); + block.commas++; + continue; + } - const handler = response => { - if (revalidate && !opts.forceRefresh) { - response.status = response.statusCode; - const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); - if (!revalidatedPolicy.modified) { - const headers = revalidatedPolicy.policy.responseHeaders(); - response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); - response.cachePolicy = revalidatedPolicy.policy; - response.fromCache = true; - } - } + /** + * Dot: '.' + */ - if (!response.fromCache) { - response.cachePolicy = new CachePolicy(opts, response, opts); - response.fromCache = false; - } + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + let siblings = block.nodes; - let clonedResponse; - if (opts.cache && response.cachePolicy.storable()) { - clonedResponse = cloneResponse(response); + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } - (async () => { - try { - const bodyPromise = getStream.buffer(response); + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; - await Promise.race([ - requestErrorPromise, - new Promise(resolve => response.once('end', resolve)) - ]); + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } - if (requestErrored) { - return; - } + block.ranges++; + block.args = []; + continue; + } - const body = await bodyPromise; + if (prev.type === 'range') { + siblings.pop(); - const value = { - cachePolicy: response.cachePolicy.toObject(), - url: response.url, - statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, - body - }; + let before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } - let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; - if (opts.maxTtl) { - ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; - } + push({ type: 'dot', value }); + continue; + } - await this.cache.set(key, value, ttl); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } else if (opts.cache && revalidate) { - (async () => { - try { - await this.cache.delete(key); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } + /** + * Text + */ - ee.emit('response', clonedResponse || response); - if (typeof cb === 'function') { - cb(clonedResponse || response); - } - }; + push({ type: 'text', value }); + } - try { - const req = request(opts, handler); - req.once('error', requestErrorCallback); - req.once('abort', requestErrorCallback); - ee.emit('request', req); - } catch (error) { - ee.emit('error', new CacheableRequest.RequestError(error)); - } - }; + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); - (async () => { - const get = async opts => { - await Promise.resolve(); + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); - const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; - if (typeof cacheEntry === 'undefined') { - return makeRequest(opts); - } + // get the location of the block on parent.nodes (block's siblings) + let parent = stack[stack.length - 1]; + let index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); - const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); - if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { - const headers = policy.responseHeaders(); - const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); - response.cachePolicy = policy; - response.fromCache = true; + push({ type: 'eos' }); + return ast; +}; - ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); - } - } else { - revalidate = cacheEntry; - opts.headers = policy.revalidationHeaders(opts); - makeRequest(opts); - } - }; +module.exports = parse; - const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); - this.cache.once('error', errorHandler); - ee.on('response', () => this.cache.removeListener('error', errorHandler)); - try { - await get(opts); - } catch (error) { - if (opts.automaticFailover && !madeRequest) { - makeRequest(opts); - } +/***/ }), - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); +/***/ 8750: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return ee; - }; - } -} +"use strict"; -function urlObjectToRequestOptions(url) { - const options = { ...url }; - options.path = `${url.pathname || '/'}${url.search || ''}`; - delete options.pathname; - delete options.search; - return options; -} -function normalizeUrlObject(url) { - // If url was parsed by url.parse or new URL: - // - hostname will be set - // - host will be hostname[:port] - // - port will be set if it was explicit in the parsed string - // Otherwise, url was from request options: - // - hostname or host may be set - // - host shall not have port encoded - return { - protocol: url.protocol, - auth: url.auth, - hostname: url.hostname || url.host || 'localhost', - port: url.port, - pathname: url.pathname, - search: url.search - }; -} +const utils = __nccwpck_require__(5207); -CacheableRequest.RequestError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'RequestError'; - Object.assign(this, error); - } -}; +module.exports = (ast, options = {}) => { + let stringify = (node, parent = {}) => { + let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; -CacheableRequest.CacheError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'CacheError'; - Object.assign(this, error); - } -}; + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } -module.exports = CacheableRequest; + if (node.value) { + return node.value; + } + if (node.nodes) { + for (let child of node.nodes) { + output += stringify(child); + } + } + return output; + }; -/***/ }), + return stringify(ast); +}; -/***/ 1312: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/***/ }), -const PassThrough = __nccwpck_require__(2413).PassThrough; -const mimicResponse = __nccwpck_require__(2610); +/***/ 5207: +/***/ ((__unused_webpack_module, exports) => { -const cloneResponse = response => { - if (!(response && response.pipe)) { - throw new TypeError('Parameter `response` must be a response stream.'); - } +"use strict"; - const clone = new PassThrough(); - mimicResponse(response, clone); - return response.pipe(clone); +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; }; -module.exports = cloneResponse; - - -/***/ }), - -/***/ 2391: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Find a node of the given type + */ -"use strict"; +exports.find = (node, type) => node.nodes.find(node => node.type === type); -const {Transform, PassThrough} = __nccwpck_require__(2413); -const zlib = __nccwpck_require__(8761); -const mimicResponse = __nccwpck_require__(3877); +/** + * Find a node of the given type + */ -module.exports = response => { - const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; - if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { - return response; - } +/** + * Escape the given node with '\\' before node.value + */ - // TODO: Remove this when targeting Node.js 12. - const isBrotli = contentEncoding === 'br'; - if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { - response.destroy(new Error('Brotli is not supported on Node.js < 12')); - return response; - } +exports.escapeNode = (block, n = 0, type) => { + let node = block.nodes[n]; + if (!node) return; - let isEmpty = true; + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; - const checker = new Transform({ - transform(data, _encoding, callback) { - isEmpty = false; +/** + * Returns true if the given brace node should be enclosed in literal braces + */ - callback(null, data); - }, +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; - flush(callback) { - callback(); - } - }); +/** + * Returns true if a brace node is invalid. + */ - const finalStream = new PassThrough({ - autoDestroy: false, - destroy(error, callback) { - response.destroy(); +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; - callback(error); - } - }); +/** + * Returns true if a node is an open or close node + */ - const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; - decompressStream.once('error', error => { - if (isEmpty && !response.readable) { - finalStream.end(); - return; - } +/** + * Reduce an array of text nodes. + */ - finalStream.destroy(error); - }); +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); - mimicResponse(response, finalStream); - response.pipe(checker).pipe(decompressStream).pipe(finalStream); +/** + * Flatten an array + */ - return finalStream; +exports.flatten = (...args) => { + const result = []; + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + let ele = arr[i]; + Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); + } + return result; + }; + flat(args); + return result; }; /***/ }), -/***/ 3877: -/***/ ((module) => { +/***/ 2286: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const { + V4MAPPED, + ADDRCONFIG, + ALL, + promises: { + Resolver: AsyncResolver + }, + lookup: dnsLookup +} = __nccwpck_require__(9523); +const {promisify} = __nccwpck_require__(3837); +const os = __nccwpck_require__(2037); -// We define these manually to ensure they're always copied -// even if they would move up the prototype chain -// https://nodejs.org/api/http.html#http_class_http_incomingmessage -const knownProperties = [ - 'aborted', - 'complete', - 'headers', - 'httpVersion', - 'httpVersionMinor', - 'httpVersionMajor', - 'method', - 'rawHeaders', - 'rawTrailers', - 'setTimeout', - 'socket', - 'statusCode', - 'statusMessage', - 'trailers', - 'url' -]; - -module.exports = (fromStream, toStream) => { - if (toStream._readableState.autoDestroy) { - throw new Error('The second stream must have the `autoDestroy` option set to `false`'); - } +const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); +const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); +const kExpires = Symbol('expires'); - const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties)); +const supportsALL = typeof ALL === 'number'; - const properties = {}; +const verifyAgent = agent => { + if (!(agent && typeof agent.createConnection === 'function')) { + throw new Error('Expected an Agent instance as the first argument'); + } +}; - for (const property of fromProperties) { - // Don't overwrite existing properties. - if (property in toStream) { +const map4to6 = entries => { + for (const entry of entries) { + if (entry.family === 6) { continue; } - properties[property] = { - get() { - const value = fromStream[property]; - const isFunction = typeof value === 'function'; - - return isFunction ? value.bind(fromStream) : value; - }, - set(value) { - fromStream[property] = value; - }, - enumerable: true, - configurable: false - }; + entry.address = `::ffff:${entry.address}`; + entry.family = 6; } +}; - Object.defineProperties(toStream, properties); - - fromStream.once('aborted', () => { - toStream.destroy(); +const getIfaceInfo = () => { + let has4 = false; + let has6 = false; - toStream.emit('aborted'); - }); + for (const device of Object.values(os.networkInterfaces())) { + for (const iface of device) { + if (iface.internal) { + continue; + } - fromStream.once('close', () => { - if (fromStream.complete) { - if (toStream.readable) { - toStream.once('end', () => { - toStream.emit('close'); - }); + if (iface.family === 'IPv6') { + has6 = true; } else { - toStream.emit('close'); + has4 = true; + } + + if (has4 && has6) { + return {has4, has6}; } - } else { - toStream.emit('close'); } - }); + } - return toStream; + return {has4, has6}; }; +const isIterable = map => { + return Symbol.iterator in map; +}; -/***/ }), +const ttl = {ttl: true}; +const all = {all: true}; -/***/ 6214: -/***/ ((module, exports, __nccwpck_require__) => { +class CacheableLookup { + constructor({ + cache = new Map(), + maxTtl = Infinity, + fallbackDuration = 3600, + errorTtl = 0.15, + resolver = new AsyncResolver(), + lookup = dnsLookup + } = {}) { + this.maxTtl = maxTtl; + this.errorTtl = errorTtl; -"use strict"; + this._cache = cache; + this._resolver = resolver; + this._dnsLookup = promisify(lookup); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tls_1 = __nccwpck_require__(4016); -const deferToConnect = (socket, fn) => { - let listeners; - if (typeof fn === 'function') { - const connect = fn; - listeners = { connect }; - } - else { - listeners = fn; - } - const hasConnectListener = typeof listeners.connect === 'function'; - const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; - const hasCloseListener = typeof listeners.close === 'function'; - const onConnect = () => { - if (hasConnectListener) { - listeners.connect(); - } - if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { - if (socket.authorized) { - listeners.secureConnect(); - } - else if (!socket.authorizationError) { - socket.once('secureConnect', listeners.secureConnect); - } - } - if (hasCloseListener) { - socket.once('close', listeners.close); - } - }; - if (socket.writable && !socket.connecting) { - onConnect(); - } - else if (socket.connecting) { - socket.once('connect', onConnect); - } - else if (socket.destroyed && hasCloseListener) { - listeners.close(socket._hadError); - } -}; -exports.default = deferToConnect; -// For CommonJS default export support -module.exports = deferToConnect; -module.exports.default = deferToConnect; + if (this._resolver instanceof AsyncResolver) { + this._resolve4 = this._resolver.resolve4.bind(this._resolver); + this._resolve6 = this._resolver.resolve6.bind(this._resolver); + } else { + this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver)); + this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver)); + } + this._iface = getIfaceInfo(); -/***/ }), + this._pending = {}; + this._nextRemovalTime = false; + this._hostnamesToFallback = new Set(); -/***/ 8932: -/***/ ((__unused_webpack_module, exports) => { + if (fallbackDuration < 1) { + this._fallback = false; + } else { + this._fallback = true; -"use strict"; + const interval = setInterval(() => { + this._hostnamesToFallback.clear(); + }, fallbackDuration * 1000); + /* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */ + if (interval.unref) { + interval.unref(); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + this.lookup = this.lookup.bind(this); + this.lookupAsync = this.lookupAsync.bind(this); + } -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) + set servers(servers) { + this.clear(); - /* istanbul ignore next */ + this._resolver.setServers(servers); + } - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } + get servers() { + return this._resolver.getServers(); + } - this.name = 'Deprecation'; - } + lookup(hostname, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } else if (typeof options === 'number') { + options = { + family: options + }; + } -} + if (!callback) { + throw new Error('Callback must be a function.'); + } -exports.Deprecation = Deprecation; + // eslint-disable-next-line promise/prefer-await-to-then + this.lookupAsync(hostname, options).then(result => { + if (options.all) { + callback(null, result); + } else { + callback(null, result.address, result.family, result.expires, result.ttl); + } + }, callback); + } + async lookupAsync(hostname, options = {}) { + if (typeof options === 'number') { + options = { + family: options + }; + } -/***/ }), + let cached = await this.query(hostname); -/***/ 1205: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (options.family === 6) { + const filtered = cached.filter(entry => entry.family === 6); -var once = __nccwpck_require__(1223); + if (options.hints & V4MAPPED) { + if ((supportsALL && options.hints & ALL) || filtered.length === 0) { + map4to6(cached); + } else { + cached = filtered; + } + } else { + cached = filtered; + } + } else if (options.family === 4) { + cached = cached.filter(entry => entry.family === 4); + } -var noop = function() {}; + if (options.hints & ADDRCONFIG) { + const {_iface} = this; + cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4); + } -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; + if (cached.length === 0) { + const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`); + error.code = 'ENOTFOUND'; + error.hostname = hostname; -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; + throw error; + } -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; + if (options.all) { + return cached; + } - callback = once(callback || noop); + return cached[0]; + } - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; + async query(hostname) { + let cached = await this._cache.get(hostname); - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; + if (!cached) { + const pending = this._pending[hostname]; - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; + if (pending) { + cached = await pending; + } else { + const newPromise = this.queryAndCache(hostname); + this._pending[hostname] = newPromise; - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; + try { + cached = await newPromise; + } finally { + delete this._pending[hostname]; + } + } + } - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; + cached = cached.map(entry => { + return {...entry}; + }); - var onerror = function(err) { - callback.call(stream, err); - }; + return cached; + } - var onclose = function() { - process.nextTick(onclosenexttick); - }; + async _resolve(hostname) { + const wrap = async promise => { + try { + return await promise; + } catch (error) { + if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') { + return []; + } - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; + throw error; + } + }; - var onrequest = function() { - stream.req.on('finish', onfinish); - }; + // ANY is unsafe as it doesn't trigger new queries in the underlying server. + const [A, AAAA] = await Promise.all([ + this._resolve4(hostname, ttl), + this._resolve6(hostname, ttl) + ].map(promise => wrap(promise))); - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } + let aTtl = 0; + let aaaaTtl = 0; + let cacheTtl = 0; - if (isChildProcess(stream)) stream.on('exit', onexit); + const now = Date.now(); - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); + for (const entry of A) { + entry.family = 4; + entry.expires = now + (entry.ttl * 1000); - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; + aTtl = Math.max(aTtl, entry.ttl); + } -module.exports = eos; + for (const entry of AAAA) { + entry.family = 6; + entry.expires = now + (entry.ttl * 1000); + aaaaTtl = Math.max(aaaaTtl, entry.ttl); + } -/***/ }), + if (A.length > 0) { + if (AAAA.length > 0) { + cacheTtl = Math.min(aTtl, aaaaTtl); + } else { + cacheTtl = aTtl; + } + } else { + cacheTtl = aaaaTtl; + } -/***/ 5582: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return { + entries: [ + ...A, + ...AAAA + ], + cacheTtl + }; + } -"use strict"; + async _lookup(hostname) { + try { + const entries = await this._dnsLookup(hostname, { + all: true + }); + return { + entries, + cacheTtl: 0 + }; + } catch (_) { + return { + entries: [], + cacheTtl: 0 + }; + } + } -const stringify = __nccwpck_require__(4810); -const compile = __nccwpck_require__(7123); -const expand = __nccwpck_require__(6944); -const parse = __nccwpck_require__(9889); + async _set(hostname, data, cacheTtl) { + if (this.maxTtl > 0 && cacheTtl > 0) { + cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000; + data[kExpires] = Date.now() + cacheTtl; -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ + try { + await this._cache.set(hostname, data, cacheTtl); + } catch (error) { + this.lookupAsync = async () => { + const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.'); + cacheError.cause = error; -const braces = (input, options = {}) => { - let output = []; + throw cacheError; + }; + } - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } + if (isIterable(this._cache)) { + this._tick(cacheTtl); + } + } + } - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; + async queryAndCache(hostname) { + if (this._hostnamesToFallback.has(hostname)) { + return this._dnsLookup(hostname, all); + } -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ + let query = await this._resolve(hostname); -braces.parse = (input, options = {}) => parse(input, options); + if (query.entries.length === 0 && this._fallback) { + query = await this._lookup(hostname); -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + if (query.entries.length !== 0) { + // Use `dns.lookup(...)` for that particular hostname + this._hostnamesToFallback.add(hostname); + } + } -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; + const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; + await this._set(hostname, query.entries, cacheTtl); -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + return query.entries; + } -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); -}; + _tick(ms) { + const nextRemovalTime = this._nextRemovalTime; -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + if (!nextRemovalTime || ms < nextRemovalTime) { + clearTimeout(this._removalTimeout); -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } + this._nextRemovalTime = ms; - let result = expand(input, options); + this._removalTimeout = setTimeout(() => { + this._nextRemovalTime = false; - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } + let nextExpiry = Infinity; - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } + const now = Date.now(); - return result; -}; + for (const [hostname, entries] of this._cache) { + const expires = entries[kExpires]; -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + if (now >= expires) { + this._cache.delete(hostname); + } else if (expires < nextExpiry) { + nextExpiry = expires; + } + } -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } + if (nextExpiry !== Infinity) { + this._tick(nextExpiry - now); + } + }, ms); - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; + /* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */ + if (this._removalTimeout.unref) { + this._removalTimeout.unref(); + } + } + } -/** - * Expose "braces" - */ + install(agent) { + verifyAgent(agent); -module.exports = braces; + if (kCacheableLookupCreateConnection in agent) { + throw new Error('CacheableLookup has been already installed'); + } + agent[kCacheableLookupCreateConnection] = agent.createConnection; + agent[kCacheableLookupInstance] = this; -/***/ }), + agent.createConnection = (options, callback) => { + if (!('lookup' in options)) { + options.lookup = this.lookup; + } -/***/ 7123: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return agent[kCacheableLookupCreateConnection](options, callback); + }; + } -"use strict"; + uninstall(agent) { + verifyAgent(agent); + if (agent[kCacheableLookupCreateConnection]) { + if (agent[kCacheableLookupInstance] !== this) { + throw new Error('The agent is not owned by this CacheableLookup instance'); + } -const fill = __nccwpck_require__(791); -const utils = __nccwpck_require__(7691); + agent.createConnection = agent[kCacheableLookupCreateConnection]; -const compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; + delete agent[kCacheableLookupCreateConnection]; + delete agent[kCacheableLookupInstance]; + } + } - if (node.isOpen === true) { - return prefix + node.value; - } - if (node.isClose === true) { - return prefix + node.value; - } + updateInterfaceInfo() { + const {_iface} = this; - if (node.type === 'open') { - return invalid ? (prefix + node.value) : '('; - } + this._iface = getIfaceInfo(); - if (node.type === 'close') { - return invalid ? (prefix + node.value) : ')'; - } + if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) { + this._cache.clear(); + } + } - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); - } + clear(hostname) { + if (hostname) { + this._cache.delete(hostname); + return; + } - if (node.value) { - return node.value; - } + this._cache.clear(); + } +} - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fill(...args, { ...options, wrap: false, toRegex: true }); +module.exports = CacheableLookup; +module.exports["default"] = CacheableLookup; - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } - } - return output; - }; +/***/ }), - return walk(ast); -}; +/***/ 4340: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = compile; +"use strict"; +const {PassThrough: PassThroughStream} = __nccwpck_require__(2781); -/***/ }), +module.exports = options => { + options = {...options}; -/***/ 5412: -/***/ ((module) => { + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; -"use strict"; + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } + if (isBuffer) { + encoding = null; + } -module.exports = { - MAX_LENGTH: 1024 * 64, + const stream = new PassThroughStream({objectMode}); - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ + if (encoding) { + stream.setEncoding(encoding); + } - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ + let length = 0; + const chunks = []; - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ + stream.on('data', chunk => { + chunks.push(chunk); - CHAR_ASTERISK: '*', /* * */ + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ + stream.getBufferedValue = () => { + if (array) { + return chunks; + } + + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; + + stream.getBufferedLength = () => length; + + return stream; }; /***/ }), -/***/ 6944: +/***/ 7040: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const {constants: BufferConstants} = __nccwpck_require__(4300); +const pump = __nccwpck_require__(8341); +const bufferStream = __nccwpck_require__(4340); -const fill = __nccwpck_require__(791); -const stringify = __nccwpck_require__(4810); -const utils = __nccwpck_require__(7691); - -const append = (queue = '', stash = '', enclose = false) => { - let result = []; - - queue = [].concat(queue); - stash = [].concat(stash); - - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); - } - } - } - return utils.flatten(result); -}; +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} -const expand = (ast, options = {}) => { - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; +async function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } - let walk = (node, parent = {}) => { - node.queue = []; + options = { + maxBuffer: Infinity, + ...options + }; - let p = parent; - let q = parent.queue; + const {maxBuffer} = options; - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } + let stream; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } + reject(error); + }; - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); + resolve(); + }); - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } + return stream.getBufferedValue(); +} - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } +module.exports = getStream; +// TODO: Remove this for the next major release +module.exports["default"] = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } +/***/ }), - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; +/***/ 8116: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } +"use strict"; - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } +const EventEmitter = __nccwpck_require__(2361); +const urlLib = __nccwpck_require__(7310); +const normalizeUrl = __nccwpck_require__(7952); +const getStream = __nccwpck_require__(7040); +const CachePolicy = __nccwpck_require__(1002); +const Response = __nccwpck_require__(9004); +const lowercaseKeys = __nccwpck_require__(9662); +const cloneResponse = __nccwpck_require__(1312); +const Keyv = __nccwpck_require__(1531); - if (child.nodes) { - walk(child, node); - } - } +class CacheableRequest { + constructor(request, cacheAdapter) { + if (typeof request !== 'function') { + throw new TypeError('Parameter `request` must be a function'); + } - return queue; - }; + this.cache = new Keyv({ + uri: typeof cacheAdapter === 'string' && cacheAdapter, + store: typeof cacheAdapter !== 'string' && cacheAdapter, + namespace: 'cacheable-request' + }); - return utils.flatten(walk(ast)); -}; + return this.createCacheableRequest(request); + } -module.exports = expand; + createCacheableRequest(request) { + return (opts, cb) => { + let url; + if (typeof opts === 'string') { + url = normalizeUrlObject(urlLib.parse(opts)); + opts = {}; + } else if (opts instanceof urlLib.URL) { + url = normalizeUrlObject(urlLib.parse(opts.toString())); + opts = {}; + } else { + const [pathname, ...searchParts] = (opts.path || '').split('?'); + const search = searchParts.length > 0 ? + `?${searchParts.join('?')}` : + ''; + url = normalizeUrlObject({ ...opts, pathname, search }); + } + opts = { + headers: {}, + method: 'GET', + cache: true, + strictTtl: false, + automaticFailover: false, + ...opts, + ...urlObjectToRequestOptions(url) + }; + opts.headers = lowercaseKeys(opts.headers); -/***/ }), + const ee = new EventEmitter(); + const normalizedUrlString = normalizeUrl( + urlLib.format(url), + { + stripWWW: false, + removeTrailingSlash: false, + stripAuthentication: false + } + ); + const key = `${opts.method}:${normalizedUrlString}`; + let revalidate = false; + let madeRequest = false; -/***/ 9889: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const makeRequest = opts => { + madeRequest = true; + let requestErrored = false; + let requestErrorCallback; -"use strict"; + const requestErrorPromise = new Promise(resolve => { + requestErrorCallback = () => { + if (!requestErrored) { + requestErrored = true; + resolve(); + } + }; + }); + const handler = response => { + if (revalidate && !opts.forceRefresh) { + response.status = response.statusCode; + const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); + if (!revalidatedPolicy.modified) { + const headers = revalidatedPolicy.policy.responseHeaders(); + response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); + response.cachePolicy = revalidatedPolicy.policy; + response.fromCache = true; + } + } -const stringify = __nccwpck_require__(4810); + if (!response.fromCache) { + response.cachePolicy = new CachePolicy(opts, response, opts); + response.fromCache = false; + } -/** - * Constants - */ + let clonedResponse; + if (opts.cache && response.cachePolicy.storable()) { + clonedResponse = cloneResponse(response); -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __nccwpck_require__(5412); + (async () => { + try { + const bodyPromise = getStream.buffer(response); -/** - * parse - */ + await Promise.race([ + requestErrorPromise, + new Promise(resolve => response.once('end', resolve)) + ]); -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } + if (requestErrored) { + return; + } - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } + const body = await bodyPromise; - let ast = { type: 'root', input, nodes: [] }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; - let memo = {}; + const value = { + cachePolicy: response.cachePolicy.toObject(), + url: response.url, + statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, + body + }; - /** - * Helpers - */ + let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; + if (opts.maxTtl) { + ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; + } - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } + await this.cache.set(key, value, ttl); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } else if (opts.cache && revalidate) { + (async () => { + try { + await this.cache.delete(key); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } + ee.emit('response', clonedResponse || response); + if (typeof cb === 'function') { + cb(clonedResponse || response); + } + }; - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; + try { + const req = request(opts, handler); + req.once('error', requestErrorCallback); + req.once('abort', requestErrorCallback); + ee.emit('request', req); + } catch (error) { + ee.emit('error', new CacheableRequest.RequestError(error)); + } + }; - push({ type: 'bos' }); + (async () => { + const get = async opts => { + await Promise.resolve(); - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); + const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; + if (typeof cacheEntry === 'undefined') { + return makeRequest(opts); + } - /** - * Invalid chars - */ + const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); + if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { + const headers = policy.responseHeaders(); + const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); + response.cachePolicy = policy; + response.fromCache = true; - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } + ee.emit('response', response); + if (typeof cb === 'function') { + cb(response); + } + } else { + revalidate = cacheEntry; + opts.headers = policy.revalidationHeaders(opts); + makeRequest(opts); + } + }; - /** - * Escaped chars - */ + const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); + this.cache.once('error', errorHandler); + ee.on('response', () => this.cache.removeListener('error', errorHandler)); - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } + try { + await get(opts); + } catch (error) { + if (opts.automaticFailover && !madeRequest) { + makeRequest(opts); + } - /** - * Right square bracket (literal): ']' - */ + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } + return ee; + }; + } +} - /** - * Left square bracket: '[' - */ +function urlObjectToRequestOptions(url) { + const options = { ...url }; + options.path = `${url.pathname || '/'}${url.search || ''}`; + delete options.pathname; + delete options.search; + return options; +} - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; +function normalizeUrlObject(url) { + // If url was parsed by url.parse or new URL: + // - hostname will be set + // - host will be hostname[:port] + // - port will be set if it was explicit in the parsed string + // Otherwise, url was from request options: + // - hostname or host may be set + // - host shall not have port encoded + return { + protocol: url.protocol, + auth: url.auth, + hostname: url.hostname || url.host || 'localhost', + port: url.port, + pathname: url.pathname, + search: url.search + }; +} - let closed = true; - let next; +CacheableRequest.RequestError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'RequestError'; + Object.assign(this, error); + } +}; - while (index < length && (next = advance())) { - value += next; +CacheableRequest.CacheError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'CacheError'; + Object.assign(this, error); + } +}; - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } +module.exports = CacheableRequest; - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; +/***/ }), - if (brackets === 0) { - break; - } - } - } +/***/ 1312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - push({ type: 'text', value }); - continue; - } - - /** - * Parentheses - */ +"use strict"; - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } +const PassThrough = (__nccwpck_require__(2781).PassThrough); +const mimicResponse = __nccwpck_require__(2610); - /** - * Quotes: '|"|` - */ +const cloneResponse = response => { + if (!(response && response.pipe)) { + throw new TypeError('Parameter `response` must be a response stream.'); + } - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; + const clone = new PassThrough(); + mimicResponse(response, clone); - if (options.keepQuotes !== true) { - value = ''; - } + return response.pipe(clone); +}; - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } +module.exports = cloneResponse; - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - value += next; - } +/***/ }), - push({ type: 'text', value }); - continue; - } +/***/ 5728: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Left curly brace: '{' - */ +"use strict"; - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; +const { promisify } = __nccwpck_require__(3837) +const JSONB = __nccwpck_require__(2820) +const zlib = __nccwpck_require__(9796) - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } +const mergeOptions = __nccwpck_require__(4968) - /** - * Right curly brace: '}' - */ +const compress = promisify(zlib.brotliCompress) - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } +const decompress = promisify(zlib.brotliDecompress) - let type = 'close'; - block = stack.pop(); - block.close = true; +const identity = val => val - push({ type, value }); - depth--; +const createCompress = ({ + enable = true, + serialize = JSONB.stringify, + deserialize = JSONB.parse, + compressOptions, + decompressOptions +} = {}) => { + if (!enable) { + return { serialize, deserialize, decompress: identity, compress: identity } + } - block = stack[stack.length - 1]; - continue; + return { + serialize, + deserialize, + compress: async (data, options = {}) => { + if (data === undefined) return data + const serializedData = serialize(data) + return compress(serializedData, mergeOptions(compressOptions, options)) + }, + decompress: async (data, options = {}) => { + if (data === undefined) return data + return deserialize( + await decompress(data, mergeOptions(decompressOptions, options)) + ) } + } +} - /** - * Comma: ',' - */ +module.exports = createCompress +module.exports.stringify = JSONB.stringify +module.exports.parse = JSONB.parse - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } - push({ type: 'comma', value }); - block.commas++; - continue; - } +/***/ }), - /** - * Dot: '.' - */ +/***/ 4968: +/***/ ((module) => { - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; +"use strict"; - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; - } - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; +module.exports = (defaultOptions = {}, options = {}) => { + const params = { + ...(defaultOptions.params || {}), + ...(options.params || {}) + } - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; + return { + ...defaultOptions, + ...options, + ...(Object.keys(params).length + ? { + params } + : {}) + } +} - block.ranges++; - block.args = []; - continue; - } - if (prev.type === 'range') { - siblings.pop(); +/***/ }), - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } +/***/ 2391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - push({ type: 'dot', value }); - continue; - } +"use strict"; - /** - * Text - */ +const {Transform, PassThrough} = __nccwpck_require__(2781); +const zlib = __nccwpck_require__(9796); +const mimicResponse = __nccwpck_require__(3877); - push({ type: 'text', value }); - } +module.exports = response => { + const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); + if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { + return response; + } - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); + // TODO: Remove this when targeting Node.js 12. + const isBrotli = contentEncoding === 'br'; + if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { + response.destroy(new Error('Brotli is not supported on Node.js < 12')); + return response; + } - // get the location of the block on parent.nodes (block's siblings) - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); + let isEmpty = true; - push({ type: 'eos' }); - return ast; -}; + const checker = new Transform({ + transform(data, _encoding, callback) { + isEmpty = false; -module.exports = parse; + callback(null, data); + }, + flush(callback) { + callback(); + } + }); -/***/ }), + const finalStream = new PassThrough({ + autoDestroy: false, + destroy(error, callback) { + response.destroy(); -/***/ 4810: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + callback(error); + } + }); -"use strict"; + const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); + decompressStream.once('error', error => { + if (isEmpty && !response.readable) { + finalStream.end(); + return; + } -const utils = __nccwpck_require__(7691); + finalStream.destroy(error); + }); -module.exports = (ast, options = {}) => { - let stringify = (node, parent = {}) => { - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; + mimicResponse(response, finalStream); + response.pipe(checker).pipe(decompressStream).pipe(finalStream); - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } + return finalStream; +}; - if (node.value) { - return node.value; - } - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); - } - } - return output; - }; +/***/ }), - return stringify(ast); -}; +/***/ 3877: +/***/ ((module) => { +"use strict"; -/***/ }), +// We define these manually to ensure they're always copied +// even if they would move up the prototype chain +// https://nodejs.org/api/http.html#http_class_http_incomingmessage +const knownProperties = [ + 'aborted', + 'complete', + 'headers', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'method', + 'rawHeaders', + 'rawTrailers', + 'setTimeout', + 'socket', + 'statusCode', + 'statusMessage', + 'trailers', + 'url' +]; -/***/ 7691: -/***/ ((__unused_webpack_module, exports) => { +module.exports = (fromStream, toStream) => { + if (toStream._readableState.autoDestroy) { + throw new Error('The second stream must have the `autoDestroy` option set to `false`'); + } -"use strict"; + const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties)); + const properties = {}; -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; -}; + for (const property of fromProperties) { + // Don't overwrite existing properties. + if (property in toStream) { + continue; + } -/** - * Find a node of the given type - */ + properties[property] = { + get() { + const value = fromStream[property]; + const isFunction = typeof value === 'function'; -exports.find = (node, type) => node.nodes.find(node => node.type === type); + return isFunction ? value.bind(fromStream) : value; + }, + set(value) { + fromStream[property] = value; + }, + enumerable: true, + configurable: false + }; + } -/** - * Find a node of the given type - */ + Object.defineProperties(toStream, properties); -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; -}; + fromStream.once('aborted', () => { + toStream.destroy(); -/** - * Escape the given node with '\\' before node.value - */ + toStream.emit('aborted'); + }); -exports.escapeNode = (block, n = 0, type) => { - let node = block.nodes[n]; - if (!node) return; + fromStream.once('close', () => { + if (fromStream.complete) { + if (toStream.readable) { + toStream.once('end', () => { + toStream.emit('close'); + }); + } else { + toStream.emit('close'); + } + } else { + toStream.emit('close'); + } + }); - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } + return toStream; }; -/** - * Returns true if the given brace node should be enclosed in literal braces - */ -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; -}; +/***/ }), -/** - * Returns true if a brace node is invalid. - */ +/***/ 6214: +/***/ ((module, exports) => { -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function isTLSSocket(socket) { + return socket.encrypted; +} +const deferToConnect = (socket, fn) => { + let listeners; + if (typeof fn === 'function') { + const connect = fn; + listeners = { connect }; + } + else { + listeners = fn; + } + const hasConnectListener = typeof listeners.connect === 'function'; + const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; + const hasCloseListener = typeof listeners.close === 'function'; + const onConnect = () => { + if (hasConnectListener) { + listeners.connect(); + } + if (isTLSSocket(socket) && hasSecureConnectListener) { + if (socket.authorized) { + listeners.secureConnect(); + } + else if (!socket.authorizationError) { + socket.once('secureConnect', listeners.secureConnect); + } + } + if (hasCloseListener) { + socket.once('close', listeners.close); + } + }; + if (socket.writable && !socket.connecting) { + onConnect(); + } + else if (socket.connecting) { + socket.once('connect', onConnect); + } + else if (socket.destroyed && hasCloseListener) { + listeners.close(socket._hadError); + } }; +exports["default"] = deferToConnect; +// For CommonJS default export support +module.exports = deferToConnect; +module.exports["default"] = deferToConnect; -/** - * Returns true if a node is an open or close node - */ -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; -}; +/***/ }), -/** - * Reduce an array of text nodes. - */ +/***/ 8932: +/***/ ((__unused_webpack_module, exports) => { -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); +"use strict"; -/** - * Flatten an array - */ -exports.flatten = (...args) => { - const result = []; - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); - } - return result; - }; - flat(args); - return result; -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) -/***/ }), + /* istanbul ignore next */ -/***/ 791: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } -"use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ + this.name = 'Deprecation'; + } +} +exports.Deprecation = Deprecation; -const util = __nccwpck_require__(1669); -const toRegexRange = __nccwpck_require__(6867); -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +/***/ }), -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; +/***/ 1205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; +var once = __nccwpck_require__(1223); -const isNumber = num => Number.isInteger(+num); +var noop = function() {}; -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; }; -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - return options.stringify === true; +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); - } - if (toNumber === false) { - return String(input); - } - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; - } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; -}; +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + callback = once(callback || noop); - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; - if (parts.positives.length) { - positives = parts.positives.join('|'); - } + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; - } + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; - if (options.wrap) { - return `(${prefix}${result})`; - } + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; - return result; -}; + var onerror = function(err) { + callback.call(stream, err); + }; -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); - } + var onclose = function() { + process.nextTick(onclosenexttick); + }; - let start = String.fromCharCode(a); - if (a === b) return start; + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; + var onrequest = function() { + stream.req.on('finish', onfinish); + }; -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange(start, end, options); -}; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); -}; + if (isChildProcess(stream)) stream.on('exit', onexit); -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - return []; + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; }; -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } +module.exports = eos; - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); +/***/ }), - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); +/***/ 4460: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } +"use strict"; - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - a = descending ? a - step : a + step; - index++; - } +var isGlob = __nccwpck_require__(4466); +var pathPosixDirname = (__nccwpck_require__(1017).posix.dirname); +var isWin32 = (__nccwpck_require__(2037).platform)() === 'win32'; - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options) - : toRegex(range, null, { wrap: false, ...options }); - } +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - return range; -}; +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { - return invalidRange(start, end, options); + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); } - - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); - - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; } - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } + // preserves full path in case of trailing path separator + str += 'a'; - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); - } + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); - return range; + // remove escape chars and return result + return str.replace(escaped, '$1'); }; -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; - } - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } +/***/ }), - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); - } +/***/ 3664: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (isObject(step)) { - return fill(start, end, 0, step); - } +"use strict"; - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } - - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } - - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; - -module.exports = fill; +const taskManager = __nccwpck_require__(2708); +const patternManager = __nccwpck_require__(8306); +const async_1 = __nccwpck_require__(5679); +const stream_1 = __nccwpck_require__(4630); +const sync_1 = __nccwpck_require__(2405); +const settings_1 = __nccwpck_require__(952); +const utils = __nccwpck_require__(5444); +async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); +} +// https://github.com/typescript-eslint/typescript-eslint/issues/60 +// eslint-disable-next-line no-redeclare +(function (FastGlob) { + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); + } + FastGlob.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + /** + * The stream returned by the provider cannot work with an asynchronous iterator. + * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. + * This affects performance (+25%). I don't see best solution right now. + */ + return utils.stream.merge(works); + } + FastGlob.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = patternManager.transform([].concat(source)); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); + } + FastGlob.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); + } + FastGlob.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); + } + FastGlob.escapePath = escapePath; +})(FastGlob || (FastGlob = {})); +function getWorks(source, _Provider, options) { + const patterns = patternManager.transform([].concat(source)); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); +} +function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError('Patterns must be a string (non empty) or an array of strings'); + } +} +module.exports = FastGlob; /***/ }), -/***/ 2840: -/***/ ((module) => { +/***/ 8306: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - - -module.exports = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - return false; -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.removeDuplicateSlashes = exports.transform = void 0; +/** + * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. + * The latter is due to the presence of the device path at the beginning of the UNC path. + * @todo rewrite to negative lookbehind with the next major release. + */ +const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; +function transform(patterns) { + return patterns.map((pattern) => removeDuplicateSlashes(pattern)); +} +exports.transform = transform; +/** + * This package only works with forward slashes as a path separator. + * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. + */ +function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, '/'); +} +exports.removeDuplicateSlashes = removeDuplicateSlashes; /***/ }), -/***/ 3913: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 2708: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -const util = __nccwpck_require__(1669); -const braces = __nccwpck_require__(5582); -const picomatch = __nccwpck_require__(8569); -const utils = __nccwpck_require__(479); -const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); - +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; +const utils = __nccwpck_require__(5444); +function generate(patterns, settings) { + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; /** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); + * Returns tasks grouped by basic pattern directories. * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} list List of strings to match. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} options See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. */ - -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); - - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; - - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); +function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + /* + * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory + * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. + */ + if ('.' in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); } - }; - - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; + else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; +} +exports.convertPatternsToTasks = convertPatternsToTasks; +function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, group); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; - for (let item of list) { - let matched = isMatch(item, true); - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; +/***/ }), - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } +/***/ 5679: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); +"use strict"; - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(2083); +const provider_1 = __nccwpck_require__(257); +class ProviderAsync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_1.default(this._settings); } - - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = []; + return new Promise((resolve, reject) => { + const stream = this.api(root, task, options); + stream.once('error', reject); + stream.on('data', (entry) => entries.push(options.transform(entry))); + stream.once('end', () => resolve(entries)); + }); } - } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderAsync; - return matches; -}; -/** - * Backwards compatibility - */ +/***/ }), -micromatch.match = micromatch; +/***/ 6983: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ +"use strict"; -micromatch.matcher = (pattern, options) => picomatch(pattern, options); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(5444); +const partial_1 = __nccwpck_require__(5295); +class DeepFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split('/').length; + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } +} +exports["default"] = DeepFilter; -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); +/***/ }), -/** - * Backwards compatibility - */ +/***/ 1343: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -micromatch.any = micromatch.isMatch; +"use strict"; -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(5444); +class EntryFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + if (this._settings.unique && this._isDuplicateEntry(entry)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { + return false; + } + const filepath = this._settings.baseNameMatch ? entry.name : entry.path; + const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); + if (this._settings.unique && isMatched) { + this._createIndexRecord(entry); + } + return isMatched; + } + _isDuplicateEntry(entry) { + return this.index.has(entry.path); + } + _createIndexRecord(entry) { + this.index.set(entry.path, undefined); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); + } + /** + * First, just trying to apply patterns to the path. + * Second, trying to apply patterns to the path with final slash. + */ + _isMatchToPatterns(entryPath, patternsRe) { + const filepath = utils.path.removeLeadingDotSegment(entryPath); + return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + '/', patternsRe); + } +} +exports["default"] = EntryFilter; -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; +/***/ }), - let matches = micromatch(list, patterns, { ...options, onResult }); +/***/ 6654: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(5444); +class ErrorFilter { + constructor(_settings) { + this._settings = _settings; } - } - return [...result]; -}; + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } +} +exports["default"] = ErrorFilter; -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } +/***/ }), - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } +/***/ 2576: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } +"use strict"; - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(5444); +class Matcher { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); } - } - - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; + _fillStorage() { + /** + * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). + * So, before expand patterns with brace expansion into separated patterns. + */ + const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); + for (const pattern of patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } +} +exports["default"] = Matcher; -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; +/***/ }), -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +/***/ 5295: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); +"use strict"; - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const matcher_1 = __nccwpck_require__(2576); +class PartialMatcher extends matcher_1.default { + match(filepath) { + const parts = filepath.split('/'); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + /** + * In this case, the pattern has a globstar and we must read all directories unconditionally, + * but only if the level has reached the end of the first group. + * + * fixtures/{a,b}/** + * ^ true/false ^ always true + */ + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; } - } - return false; -}; +} +exports["default"] = PartialMatcher; -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); +/***/ }), - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; +/***/ 257: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(1017); +const deep_1 = __nccwpck_require__(6983); +const entry_1 = __nccwpck_require__(1343); +const error_1 = __nccwpck_require__(6654); +const entry_2 = __nccwpck_require__(4029); +class Provider { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); } - } - return true; -}; + _getRootDirectory(task) { + return path.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === '.' ? '' : task.base; + return { + basePath, + pathSegmentSeparator: '/', + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } +} +exports["default"] = Provider; -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } +/***/ }), - return [].concat(patterns).every(p => picomatch(p, options)(str)); -}; +/***/ 4630: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ - -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; +"use strict"; -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(2781); +const stream_2 = __nccwpck_require__(2083); +const provider_1 = __nccwpck_require__(257); +class ProviderStream extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); + source + .once('error', (error) => destination.emit('error', error)) + .on('data', (entry) => destination.emit('data', options.transform(entry))) + .once('end', () => destination.emit('end')); + destination + .once('close', () => source.destroy()); + return destination; + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderStream; -micromatch.makeRe = (...args) => picomatch.makeRe(...args); -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ +/***/ }), -micromatch.scan = (...args) => picomatch.scan(...args); +/***/ 2405: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ +"use strict"; -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const sync_1 = __nccwpck_require__(8821); +const provider_1 = __nccwpck_require__(257); +class ProviderSync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); } - } - return res; -}; - -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderSync; -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces(pattern, options); -}; -/** - * Expand braces - */ +/***/ }), -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; +/***/ 4029: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Expose micromatch - */ +"use strict"; -module.exports = micromatch; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(5444); +class EntryTransformer { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += '/'; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } +} +exports["default"] = EntryTransformer; /***/ }), -/***/ 6867: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 5582: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - - - -const isNumber = __nccwpck_require__(2840); - -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); - } - if (max === void 0 || min === max) { - return String(min); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(1017); +const fsStat = __nccwpck_require__(109); +const utils = __nccwpck_require__(5444); +class Reader { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } +} +exports["default"] = Reader; - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } - let opts = { relaxZeros: true, ...options }; - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } +/***/ }), - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; +/***/ 2083: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; - } +"use strict"; - let a = Math.min(min, max); - let b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - if (opts.capture) { - return `(${result})`; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(2781); +const fsStat = __nccwpck_require__(109); +const fsWalk = __nccwpck_require__(6026); +const reader_1 = __nccwpck_require__(5582); +class ReaderStream extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; } - if (opts.wrap === false) { - return result; + dynamic(root, options) { + return this._walkStream(root, options); } - return `(?:${result})`; - } - - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; - let positives = []; - let negatives = []; - - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } - - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; - } + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options) + .then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }) + .catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options) { + return this._getStat(filepath) + .then((stats) => this._makeEntry(stats, pattern)) + .catch((error) => { + if (options.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve(stats) : reject(error); + }); + }); + } +} +exports["default"] = ReaderStream; - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); - } - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives, opts); +/***/ }), - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { - state.result = `(?:${state.result})`; - } +/***/ 8821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - toRegexRange.cache[cacheKey] = state; - return state.result; -}; +"use strict"; -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - let intersected = filterPatterns(neg, pos, '-?', true, options) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fsStat = __nccwpck_require__(109); +const fsWalk = __nccwpck_require__(6026); +const reader_1 = __nccwpck_require__(5582); +class ReaderSync extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root, options) { + return this._walkSync(root, options); + } + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } + catch (error) { + if (options.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } } +exports["default"] = ReaderSync; -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - - let stop = countNines(min, nines); - let stops = new Set([max]); - - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); - } - stop = countZeros(max + 1, zeros) - 1; +/***/ }), - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } +/***/ 952: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - stops = [...stops]; - stops.sort(compare); - return stops; -} +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; +const fs = __nccwpck_require__(7147); +const os = __nccwpck_require__(2037); /** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} + * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. + * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 */ +const CPU_COUNT = Math.max(os.cpus().length, 1); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + lstatSync: fs.lstatSync, + stat: fs.stat, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +class Settings { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + } + _getValue(option, value) { + return option === undefined ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } +} +exports["default"] = Settings; -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { pattern: start, count: [], digits: 0 }; - } - - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; - - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; - - if (startDigit === stopDigit) { - pattern += startDigit; - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit, options); +/***/ }), - } else { - count++; - } - } +/***/ 5325: +/***/ ((__unused_webpack_module, exports) => { - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; - } +"use strict"; - return { pattern, count: [count], digits }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.splitWhen = exports.flatten = void 0; +function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); } - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } - - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(max, tok, options); +exports.flatten = flatten; +function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } + else { + result[groupIndex].push(item); + } } - - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; - } - - return tokens; + return result; } +exports.splitWhen = splitWhen; -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; - for (let ele of arr) { - let { string } = ele; +/***/ }), - // only push if _both_ are negative... - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); - } +/***/ 1230: +/***/ ((__unused_webpack_module, exports) => { - // or _both_ are positive - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); - } - } - return result; +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isEnoentCodeError = void 0; +function isEnoentCodeError(error) { + return error.code === 'ENOENT'; } +exports.isEnoentCodeError = isEnoentCodeError; -/** - * Zip strings - */ -function zip(a, b) { - let arr = []; - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - return arr; -} +/***/ }), -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} +/***/ 7543: +/***/ ((__unused_webpack_module, exports) => { -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} +"use strict"; -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } } - -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); } +exports.createDirentFromStats = createDirentFromStats; -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; - } - return ''; -} -function toCharacterClass(a, b, options) { - return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; -} +/***/ }), -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} +/***/ 5444: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; - } +"use strict"; - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; +const array = __nccwpck_require__(5325); +exports.array = array; +const errno = __nccwpck_require__(1230); +exports.errno = errno; +const fs = __nccwpck_require__(7543); +exports.fs = fs; +const path = __nccwpck_require__(3873); +exports.path = path; +const pattern = __nccwpck_require__(1221); +exports.pattern = pattern; +const stream = __nccwpck_require__(8382); +exports.stream = stream; +const string = __nccwpck_require__(2203); +exports.string = string; - switch (diff) { - case 0: - return ''; - case 1: - return relax ? '0?' : '0'; - case 2: - return relax ? '0{0,2}' : '00'; - default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; - } - } -} -/** - * Cache - */ +/***/ }), -toRegexRange.cache = {}; -toRegexRange.clearCache = () => (toRegexRange.cache = {}); +/***/ 3873: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; +const path = __nccwpck_require__(1017); +const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ +const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; /** - * Expose `toRegexRange` + * Designed to work only with simple paths: `dir\\file`. */ - -module.exports = toRegexRange; +function unixify(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.unixify = unixify; +function makeAbsolute(cwd, filepath) { + return path.resolve(cwd, filepath); +} +exports.makeAbsolute = makeAbsolute; +function escape(pattern) { + return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escape = escape; +function removeLeadingDotSegment(entry) { + // We do not use `startsWith` because this is 10x slower than current implementation for some cases. + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with + if (entry.charAt(0) === '.') { + const secondCharactery = entry.charAt(1); + if (secondCharactery === '/' || secondCharactery === '\\') { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; +} +exports.removeLeadingDotSegment = removeLeadingDotSegment; /***/ }), -/***/ 3664: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 1221: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const taskManager = __nccwpck_require__(2708); -const async_1 = __nccwpck_require__(5679); -const stream_1 = __nccwpck_require__(4630); -const sync_1 = __nccwpck_require__(2405); -const settings_1 = __nccwpck_require__(952); -const utils = __nccwpck_require__(5444); -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; +const path = __nccwpck_require__(1017); +const globParent = __nccwpck_require__(4460); +const micromatch = __nccwpck_require__(6228); +const GLOBSTAR = '**'; +const ESCAPE_SYMBOL = '\\'; +const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; +const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; +const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; +const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; +const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; +function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); } -// https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare -(function (FastGlob) { - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); +exports.isStaticPattern = isStaticPattern; +function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; } - FastGlob.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - return utils.stream.merge(works); + /** + * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check + * filepath directly (without read directory). + */ + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; } - FastGlob.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; } - FastGlob.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; } - FastGlob.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; } - FastGlob.escapePath = escapePath; -})(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); + return false; } -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); +exports.isDynamicPattern = isDynamicPattern; +function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf('{'); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); } -module.exports = FastGlob; - - -/***/ }), - -/***/ 2708: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; -const utils = __nccwpck_require__(5444); -function generate(patterns, settings) { - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; } -exports.generate = generate; -function convertPatternsToTasks(positive, negative, dynamic) { - const positivePatternsGroup = groupPatternsByBaseDirectory(positive); - // When we have a global group – there is no reason to divide the patterns into independent tasks. - // In this case, the global task covers the rest. - if ('.' in positivePatternsGroup) { - const task = convertPatternGroupToTask('.', positive, negative, dynamic); - return [task]; - } - return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic); +exports.convertToPositivePattern = convertToPositivePattern; +function convertToNegativePattern(pattern) { + return '!' + pattern; } -exports.convertPatternsToTasks = convertPatternsToTasks; +exports.convertToNegativePattern = convertToNegativePattern; +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); + return patterns.filter(isPositivePattern); } exports.getPositivePatterns = getPositivePatterns; -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); } -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -function groupPatternsByBaseDirectory(patterns) { - const group = {}; +exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); +} +exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; +function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith('..') || pattern.startsWith('./..'); +} +exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; +function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); +} +exports.getBaseDirectory = getBaseDirectory; +function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); +} +exports.hasGlobStar = hasGlobStar; +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +function isAffectDepthOfReadingPattern(pattern) { + const basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +function expandPatternsWithBraceExpansion(patterns) { return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, group); + return collection.concat(expandBraceExpansion(pattern)); + }, []); } -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); +exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; +function expandBraceExpansion(pattern) { + return micromatch.braces(pattern, { + expand: true, + nodupes: true }); } -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; +exports.expandBraceExpansion = expandBraceExpansion; +function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); + } + return parts; } -exports.convertPatternGroupToTask = convertPatternGroupToTask; +exports.getPatternParts = getPatternParts; +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); +} +exports.convertPatternsToRe = convertPatternsToRe; +function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); +} +exports.matchAny = matchAny; /***/ }), -/***/ 5679: +/***/ 8382: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(2083); -const provider_1 = __nccwpck_require__(257); -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = []; - return new Promise((resolve, reject) => { - const stream = this.api(root, task, options); - stream.once('error', reject); - stream.on('data', (entry) => entries.push(options.transform(entry))); - stream.once('end', () => resolve(entries)); - }); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } +exports.merge = void 0; +const merge2 = __nccwpck_require__(2578); +function merge(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once('error', (error) => mergedStream.emit('error', error)); + }); + mergedStream.once('close', () => propagateCloseEventToSources(streams)); + mergedStream.once('end', () => propagateCloseEventToSources(streams)); + return mergedStream; +} +exports.merge = merge; +function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit('close')); } -exports.default = ProviderAsync; /***/ }), -/***/ 6983: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 2203: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(5444); -const partial_1 = __nccwpck_require__(5295); -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - if (basePath === '') { - return entryPathDepth; - } - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } +exports.isEmpty = exports.isString = void 0; +function isString(input) { + return typeof input === 'string'; +} +exports.isString = isString; +function isEmpty(input) { + return input === ''; } -exports.default = DeepFilter; +exports.isEmpty = isEmpty; /***/ }), -/***/ 1343: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7340: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(5444); -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique && this._isDuplicateEntry(entry)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { - return false; - } - const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); - if (this._settings.unique && isMatched) { - this._createIndexRecord(entry); - } - return isMatched; - } - _isDuplicateEntry(entry) { - return this.index.has(entry.path); - } - _createIndexRecord(entry) { - this.index.set(entry.path, undefined); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(entryPath, patternsRe) { - const filepath = utils.path.removeLeadingDotSegment(entryPath); - return utils.pattern.matchAny(filepath, patternsRe); - } -} -exports.default = EntryFilter; +/* eslint-disable no-var */ -/***/ }), +var reusify = __nccwpck_require__(2113) -/***/ 6654: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function fastqueue (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker + worker = context + context = null + } -"use strict"; + if (concurrency < 1) { + throw new Error('fastqueue concurrency must be greater than 1') + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(5444); -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error) => this._isNonFatalError(error); - } - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } -} -exports.default = ErrorFilter; + var cache = reusify(Task) + var queueHead = null + var queueTail = null + var _running = 0 + var errorHandler = null + + var self = { + push: push, + drain: noop, + saturated: noop, + pause: pause, + paused: false, + concurrency: concurrency, + running: running, + resume: resume, + idle: idle, + length: length, + getQueue: getQueue, + unshift: unshift, + empty: noop, + kill: kill, + killAndDrain: killAndDrain, + error: error + } + return self -/***/ }), + function running () { + return _running + } -/***/ 2576: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function pause () { + self.paused = true + } -"use strict"; + function length () { + var current = queueHead + var counter = 0 -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(5444); -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - /** - * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). - * So, before expand patterns with brace expansion into separated patterns. - */ - const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); - for (const pattern of patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + while (current) { + current = current.next + counter++ } -} -exports.default = Matcher; + return counter + } -/***/ }), + function getQueue () { + var current = queueHead + var tasks = [] -/***/ 5295: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + while (current) { + tasks.push(current.value) + current = current.next + } -"use strict"; + return tasks + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -const matcher_1 = __nccwpck_require__(2576); -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; + function resume () { + if (!self.paused) return + self.paused = false + for (var i = 0; i < self.concurrency; i++) { + _running++ + release() } -} -exports.default = PartialMatcher; - + } -/***/ }), + function idle () { + return _running === 0 && self.length() === 0 + } -/***/ 257: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function push (value, done) { + var current = cache.get() -"use strict"; + current.context = context + current.release = release + current.value = value + current.callback = done || noop + current.errorHandler = errorHandler -Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(5622); -const deep_1 = __nccwpck_require__(6983); -const entry_1 = __nccwpck_require__(1343); -const error_1 = __nccwpck_require__(6654); -const entry_2 = __nccwpck_require__(4029); -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current + queueTail = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) } -} -exports.default = Provider; - - -/***/ }), + } -/***/ 4630: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function unshift (value, done) { + var current = cache.get() -"use strict"; + current.context = context + current.release = release + current.value = value + current.callback = done || noop -Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(2413); -const stream_2 = __nccwpck_require__(2083); -const provider_1 = __nccwpck_require__(257); -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead + queueHead = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); - source - .once('error', (error) => destination.emit('error', error)) - .on('data', (entry) => destination.emit('data', options.transform(entry))) - .once('end', () => destination.emit('end')); - destination - .once('close', () => source.destroy()); - return destination; + } + + function release (holder) { + if (holder) { + cache.release(holder) } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); + var next = queueHead + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null } - return this._reader.static(task.patterns, options); + queueHead = next.next + next.next = null + worker.call(context, next.value, next.worked) + if (queueTail === null) { + self.empty() + } + } else { + _running-- + } + } else if (--_running === 0) { + self.drain() } -} -exports.default = ProviderStream; + } + function kill () { + queueHead = null + queueTail = null + self.drain = noop + } -/***/ }), + function killAndDrain () { + queueHead = null + queueTail = null + self.drain() + self.drain = noop + } -/***/ 2405: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function error (handler) { + errorHandler = handler + } +} -"use strict"; +function noop () {} -Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __nccwpck_require__(8821); -const provider_1 = __nccwpck_require__(257); -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); +function Task () { + this.value = null + this.callback = noop + this.next = null + this.release = noop + this.context = null + this.errorHandler = null + + var self = this + + this.worked = function worked (err, result) { + var callback = self.callback + var errorHandler = self.errorHandler + var val = self.value + self.value = null + self.callback = noop + if (self.errorHandler) { + errorHandler(err, val) } + callback.call(self.context, err, result) + self.release(self) + } } -exports.default = ProviderSync; +function queueAsPromised (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker + worker = context + context = null + } -/***/ }), + function asyncWrapper (arg, cb) { + worker.call(this, arg) + .then(function (res) { + cb(null, res) + }, cb) + } -/***/ 4029: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var queue = fastqueue(context, asyncWrapper, concurrency) -"use strict"; + var pushCb = queue.push + var unshiftCb = queue.unshift -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(5444); -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; + queue.push = push + queue.unshift = unshift + queue.drained = drained + + return queue + + function push (value) { + var p = new Promise(function (resolve, reject) { + pushCb(value, function (err, result) { + if (err) { + reject(err) + return } - if (!this._settings.objectMode) { - return filepath; + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function unshift (value) { + var p = new Promise(function (resolve, reject) { + unshiftCb(value, function (err, result) { + if (err) { + reject(err) + return } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function drained () { + var previousDrain = queue.drain + + var p = new Promise(function (resolve) { + queue.drain = function () { + previousDrain() + resolve() + } + }) + + return p + } } -exports.default = EntryTransformer; + +module.exports = fastqueue +module.exports.promise = queueAsPromised /***/ }), -/***/ 8062: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6330: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(5622); -const fsStat = __nccwpck_require__(109); -const utils = __nccwpck_require__(5444); -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } -} -exports.default = Reader; +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ -/***/ }), -/***/ 2083: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +const util = __nccwpck_require__(3837); +const toRegexRange = __nccwpck_require__(1861); -"use strict"; +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(2413); -const fsStat = __nccwpck_require__(109); -const fsWalk = __nccwpck_require__(6026); -const reader_1 = __nccwpck_require__(8062); -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options) - .then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }) - .catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath) - .then((stats) => this._makeEntry(stats, pattern)) - .catch((error) => { - if (options.errorFilter(error)) { - return null; - } - throw error; - }); - } - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } -} -exports.default = ReaderStream; +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; -/***/ }), +const isNumber = num => Number.isInteger(+num); -/***/ 8821: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; -"use strict"; +const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __nccwpck_require__(109); -const fsWalk = __nccwpck_require__(6026); -const reader_1 = __nccwpck_require__(8062); -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } - catch (error) { - if (options.errorFilter(error)) { - return null; - } - throw error; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } -} -exports.default = ReaderSync; +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; -/***/ }), +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); -/***/ 952: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; -"use strict"; + if (parts.positives.length) { + positives = parts.positives.join('|'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; -const fs = __nccwpck_require__(5747); -const os = __nccwpck_require__(2087); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -class Settings { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - } - _getValue(option, value) { - return option === undefined ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } -} -exports.default = Settings; + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; + } + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } -/***/ }), + if (options.wrap) { + return `(${prefix}${result})`; + } -/***/ 5325: -/***/ ((__unused_webpack_module, exports) => { + return result; +}; -"use strict"; +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitWhen = exports.flatten = void 0; -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} -exports.flatten = flatten; -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } - else { - result[groupIndex].push(item); - } - } - return result; -} -exports.splitWhen = splitWhen; + let start = String.fromCharCode(a); + if (a === b) return start; + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; -/***/ }), +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; -/***/ 1230: -/***/ ((__unused_webpack_module, exports) => { +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; -"use strict"; +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isEnoentCodeError = void 0; -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} -exports.isEnoentCodeError = isEnoentCodeError; +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); -/***/ }), + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } -/***/ 7543: -/***/ ((__unused_webpack_module, exports) => { + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; -"use strict"; + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); + } + return range; +}; -/***/ }), +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } -/***/ 5444: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; -const array = __nccwpck_require__(5325); -exports.array = array; -const errno = __nccwpck_require__(1230); -exports.errno = errno; -const fs = __nccwpck_require__(7543); -exports.fs = fs; -const path = __nccwpck_require__(3873); -exports.path = path; -const pattern = __nccwpck_require__(1221); -exports.pattern = pattern; -const stream = __nccwpck_require__(8382); -exports.stream = stream; -const string = __nccwpck_require__(2203); -exports.string = string; + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } -/***/ }), + let range = []; + let index = 0; -/***/ 3873: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } -"use strict"; + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; -const path = __nccwpck_require__(5622); -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ -const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.unixify = unixify; -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} -exports.makeAbsolute = makeAbsolute; -function escape(pattern) { - return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escape = escape; -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; -} -exports.removeLeadingDotSegment = removeLeadingDotSegment; + return range; +}; + +const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +module.exports = fill; /***/ }), -/***/ 1221: +/***/ 6457: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; -const path = __nccwpck_require__(5622); -const globParent = __nccwpck_require__(4655); -const micromatch = __nccwpck_require__(3913); -const picomatch = __nccwpck_require__(8569); -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/; -const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/; -function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); -} -exports.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern, options = {}) { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) { - return true; - } - return false; -} -exports.isDynamicPattern = isDynamicPattern; -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); -} -exports.getBaseDirectory = getBaseDirectory; -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} -exports.hasGlobStar = hasGlobStar; -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; -function expandBraceExpansion(pattern) { - return micromatch.braces(pattern, { - expand: true, - nodupes: true - }); -} -exports.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern, options) { - let { parts } = picomatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - return parts; -} -exports.getPatternParts = getPatternParts; -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); -} -exports.convertPatternsToRe = convertPatternsToRe; -function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); -} -exports.matchAny = matchAny; - - -/***/ }), - -/***/ 8382: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -const merge2 = __nccwpck_require__(2578); -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once('error', (error) => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} -exports.merge = merge; -function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit('close')); +const types_1 = __nccwpck_require__(4597); +function createRejection(error, ...beforeErrorGroups) { + const promise = (async () => { + if (error instanceof types_1.RequestError) { + try { + for (const hooks of beforeErrorGroups) { + if (hooks) { + for (const hook of hooks) { + // eslint-disable-next-line no-await-in-loop + error = await hook(error); + } + } + } + } + catch (error_) { + error = error_; + } + } + throw error; + })(); + const returnPromise = () => promise; + promise.json = returnPromise; + promise.text = returnPromise; + promise.buffer = returnPromise; + promise.on = returnPromise; + return promise; } +exports["default"] = createRejection; /***/ }), -/***/ 2203: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6056: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isEmpty = exports.isString = void 0; -function isString(input) { - return typeof input === 'string'; -} -exports.isString = isString; -function isEmpty(input) { - return input === ''; -} -exports.isEmpty = isEmpty; - - -/***/ }), - -/***/ 7340: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var reusify = __nccwpck_require__(2113) - -function fastqueue (context, worker, concurrency) { - if (typeof context === 'function') { - concurrency = worker - worker = context - context = null - } - - if (concurrency < 1) { - throw new Error('fastqueue concurrency must be greater than 1') - } - - var cache = reusify(Task) - var queueHead = null - var queueTail = null - var _running = 0 - var errorHandler = null - - var self = { - push: push, - drain: noop, - saturated: noop, - pause: pause, - paused: false, - concurrency: concurrency, - running: running, - resume: resume, - idle: idle, - length: length, - getQueue: getQueue, - unshift: unshift, - empty: noop, - kill: kill, - killAndDrain: killAndDrain, - error: error - } - - return self - - function running () { - return _running - } - - function pause () { - self.paused = true - } - - function length () { - var current = queueHead - var counter = 0 - - while (current) { - current = current.next - counter++ - } - - return counter - } - - function getQueue () { - var current = queueHead - var tasks = [] - - while (current) { - tasks.push(current.value) - current = current.next - } - - return tasks - } - - function resume () { - if (!self.paused) return - self.paused = false - for (var i = 0; i < self.concurrency; i++) { - _running++ - release() - } - } - - function idle () { - return _running === 0 && self.length() === 0 - } - - function push (value, done) { - var current = cache.get() - - current.context = context - current.release = release - current.value = value - current.callback = done || noop - current.errorHandler = errorHandler - - if (_running === self.concurrency || self.paused) { - if (queueTail) { - queueTail.next = current - queueTail = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) - } - } - - function unshift (value, done) { - var current = cache.get() - - current.context = context - current.release = release - current.value = value - current.callback = done || noop - - if (_running === self.concurrency || self.paused) { - if (queueHead) { - current.next = queueHead - queueHead = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) - } - } - - function release (holder) { - if (holder) { - cache.release(holder) - } - var next = queueHead - if (next) { - if (!self.paused) { - if (queueTail === queueHead) { - queueTail = null - } - queueHead = next.next - next.next = null - worker.call(context, next.value, next.worked) - if (queueTail === null) { - self.empty() - } - } else { - _running-- - } - } else if (--_running === 0) { - self.drain() - } - } - - function kill () { - queueHead = null - queueTail = null - self.drain = noop - } - - function killAndDrain () { - queueHead = null - queueTail = null - self.drain() - self.drain = noop - } - - function error (handler) { - errorHandler = handler - } -} - -function noop () {} - -function Task () { - this.value = null - this.callback = noop - this.next = null - this.release = noop - this.context = null - this.errorHandler = null - - var self = this - - this.worked = function worked (err, result) { - var callback = self.callback - var errorHandler = self.errorHandler - var val = self.value - self.value = null - self.callback = noop - if (self.errorHandler) { - errorHandler(err, val) - } - callback.call(self.context, err, result) - self.release(self) - } -} - -module.exports = fastqueue - - -/***/ }), - -/***/ 4655: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var isGlob = __nccwpck_require__(4466); -var pathPosixDirname = __nccwpck_require__(5622).posix.dirname; -var isWin32 = __nccwpck_require__(2087).platform() === 'win32'; - -var slash = '/'; -var backslash = /\\/g; -var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - -/** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] - */ -module.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - - // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { - str += slash; - } - - // preserves full path in case of trailing path separator - str += 'a'; - - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); - - // remove escape chars and return result - return str.replace(escaped, '$1'); -}; - - -/***/ }), - -/***/ 6457: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const types_1 = __nccwpck_require__(4597); -function createRejection(error, ...beforeErrorGroups) { - const promise = (async () => { - if (error instanceof types_1.RequestError) { - try { - for (const hooks of beforeErrorGroups) { - if (hooks) { - for (const hook of hooks) { - // eslint-disable-next-line no-await-in-loop - error = await hook(error); - } - } - } - } - catch (error_) { - error = error_; - } - } - throw error; - })(); - const returnPromise = () => promise; - promise.json = returnPromise; - promise.text = returnPromise; - promise.buffer = returnPromise; - promise.on = returnPromise; - return promise; -} -exports.default = createRejection; - - -/***/ }), - -/***/ 6056: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const events_1 = __nccwpck_require__(8614); +const events_1 = __nccwpck_require__(2361); const is_1 = __nccwpck_require__(7678); const PCancelable = __nccwpck_require__(9072); const types_1 = __nccwpck_require__(4597); @@ -15689,11 +16572,11 @@ function asPromise(normalizedOptions) { request._beforeError(new types_1.RequestError(error.message, error, request)); return; } + globalResponse = response; if (!is_response_ok_1.isResponseOk(response)) { request._beforeError(new types_1.HTTPError(response)); return; } - globalResponse = response; resolve(request.options.resolveBodyOnly ? response.body : response); }); const onError = (error) => { @@ -15747,7 +16630,7 @@ function asPromise(normalizedOptions) { promise.text = () => shortcut('text'); return promise; } -exports.default = asPromise; +exports["default"] = asPromise; __exportStar(__nccwpck_require__(4597), exports); @@ -15834,7 +16717,7 @@ const normalizeArguments = (options, defaults) => { } return options; }; -exports.default = normalizeArguments; +exports["default"] = normalizeArguments; /***/ }), @@ -15867,7 +16750,7 @@ const parseBody = (response, responseType, parseJson, encoding) => { throw new types_1.ParseError(error, response); } }; -exports.default = parseBody; +exports["default"] = parseBody; /***/ }), @@ -15899,6 +16782,7 @@ class ParseError extends core_1.RequestError { const { options } = response.request; super(`${error.message} in "${options.url.toString()}"`, error, response.request); this.name = 'ParseError'; + this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_BODY_PARSE_FAILURE' : this.code; } } exports.ParseError = ParseError; @@ -15909,6 +16793,7 @@ class CancelError extends core_1.RequestError { constructor(request) { super('Promise was canceled', {}, request); this.name = 'CancelError'; + this.code = 'ERR_CANCELED'; } get isCanceled() { return true; @@ -15952,7 +16837,7 @@ const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter }) const noise = Math.random() * 100; return ((2 ** (attemptCount - 1)) * 1000) + noise; }; -exports.default = calculateRetryDelay; +exports["default"] = calculateRetryDelay; /***/ }), @@ -15964,13 +16849,13 @@ exports.default = calculateRetryDelay; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UnsupportedProtocolError = exports.ReadError = exports.TimeoutError = exports.UploadError = exports.CacheError = exports.HTTPError = exports.MaxRedirectsError = exports.RequestError = exports.setNonEnumerableProperties = exports.knownHookEvents = exports.withoutBody = exports.kIsNormalizedAlready = void 0; -const util_1 = __nccwpck_require__(1669); -const stream_1 = __nccwpck_require__(2413); -const fs_1 = __nccwpck_require__(5747); -const url_1 = __nccwpck_require__(8835); -const http = __nccwpck_require__(8605); -const http_1 = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); +const util_1 = __nccwpck_require__(3837); +const stream_1 = __nccwpck_require__(2781); +const fs_1 = __nccwpck_require__(7147); +const url_1 = __nccwpck_require__(7310); +const http = __nccwpck_require__(3685); +const http_1 = __nccwpck_require__(3685); +const https = __nccwpck_require__(5687); const http_timer_1 = __nccwpck_require__(8097); const cacheable_lookup_1 = __nccwpck_require__(2286); const CacheableRequest = __nccwpck_require__(8116); @@ -15992,7 +16877,7 @@ const is_response_ok_1 = __nccwpck_require__(9298); const deprecation_warning_1 = __nccwpck_require__(397); const normalize_arguments_1 = __nccwpck_require__(1048); const calculate_retry_delay_1 = __nccwpck_require__(3462); -const globalDnsCache = new cacheable_lookup_1.default(); +let globalDnsCache; const kRequest = Symbol('request'); const kResponse = Symbol('response'); const kResponseSize = Symbol('responseSize'); @@ -16084,11 +16969,11 @@ Contains a `code` property with error class code, like `ECONNREFUSED`. */ class RequestError extends Error { constructor(message, error, self) { - var _a; + var _a, _b; super(message); Error.captureStackTrace(this, this.constructor); this.name = 'RequestError'; - this.code = error.code; + this.code = (_a = error.code) !== null && _a !== void 0 ? _a : 'ERR_GOT_REQUEST_ERROR'; if (self instanceof Request) { Object.defineProperty(this, 'request', { enumerable: false, @@ -16113,7 +16998,7 @@ class RequestError extends Error { value: self }); } - this.timings = (_a = this.request) === null || _a === void 0 ? void 0 : _a.timings; + this.timings = (_b = this.request) === null || _b === void 0 ? void 0 : _b.timings; // Recover the original stacktrace if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) { const indexOfMessage = this.stack.indexOf(this.message) + this.message.length; @@ -16136,6 +17021,7 @@ class MaxRedirectsError extends RequestError { constructor(request) { super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request); this.name = 'MaxRedirectsError'; + this.code = 'ERR_TOO_MANY_REDIRECTS'; } } exports.MaxRedirectsError = MaxRedirectsError; @@ -16147,6 +17033,7 @@ class HTTPError extends RequestError { constructor(response) { super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request); this.name = 'HTTPError'; + this.code = 'ERR_NON_2XX_3XX_RESPONSE'; } } exports.HTTPError = HTTPError; @@ -16158,6 +17045,7 @@ class CacheError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'CacheError'; + this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_CACHE_ACCESS' : this.code; } } exports.CacheError = CacheError; @@ -16168,6 +17056,7 @@ class UploadError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'UploadError'; + this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_UPLOAD' : this.code; } } exports.UploadError = UploadError; @@ -16191,6 +17080,7 @@ class ReadError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'ReadError'; + this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code; } } exports.ReadError = ReadError; @@ -16201,6 +17091,7 @@ class UnsupportedProtocolError extends RequestError { constructor(options) { super(`Unsupported protocol "${options.url.protocol}"`, {}, options); this.name = 'UnsupportedProtocolError'; + this.code = 'ERR_UNSUPPORTED_PROTOCOL'; } } exports.UnsupportedProtocolError = UnsupportedProtocolError; @@ -16549,6 +17440,9 @@ class Request extends stream_1.Duplex { options.cacheOptions = { ...options.cacheOptions }; // `options.dnsCache` if (options.dnsCache === true) { + if (!globalDnsCache) { + globalDnsCache = new cacheable_lookup_1.default(); + } options.dnsCache = globalDnsCache; } else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) { @@ -16820,6 +17714,14 @@ class Request extends stream_1.Duplex { const redirectUrl = new url_1.URL(redirectBuffer, url); const redirectString = redirectUrl.toString(); decodeURI(redirectString); + // eslint-disable-next-line no-inner-declarations + function isUnixSocketURL(url) { + return url.protocol === 'unix:' || url.hostname === 'unix'; + } + if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) { + this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this)); + return; + } // Redirecting to a different site, clear sensitive data. if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) { if ('host' in options.headers) { @@ -17448,7 +18350,7 @@ class Request extends stream_1.Duplex { return this; } } -exports.default = Request; +exports["default"] = Request; /***/ }), @@ -17484,12 +18386,12 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs_1 = __nccwpck_require__(5747); -const util_1 = __nccwpck_require__(1669); +const fs_1 = __nccwpck_require__(7147); +const util_1 = __nccwpck_require__(3837); const is_1 = __nccwpck_require__(7678); const is_form_data_1 = __nccwpck_require__(40); const statAsync = util_1.promisify(fs_1.stat); -exports.default = async (body, headers) => { +exports["default"] = async (body, headers) => { if (headers && 'content-length' in headers) { return Number(headers['content-length']); } @@ -17537,7 +18439,7 @@ const getBuffer = async (stream) => { } return Buffer.from(chunks.join('')); }; -exports.default = getBuffer; +exports["default"] = getBuffer; /***/ }), @@ -17549,7 +18451,7 @@ exports.default = getBuffer; Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __nccwpck_require__(7678); -exports.default = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary); +exports["default"] = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary); /***/ }), @@ -17577,7 +18479,7 @@ exports.isResponseOk = (response) => { Object.defineProperty(exports, "__esModule", ({ value: true })); /* istanbul ignore file: deprecated */ -const url_1 = __nccwpck_require__(8835); +const url_1 = __nccwpck_require__(7310); const keys = [ 'protocol', 'host', @@ -17586,7 +18488,7 @@ const keys = [ 'pathname', 'search' ]; -exports.default = (origin, options) => { +exports["default"] = (origin, options) => { var _a, _b; if (options.path) { if (options.pathname) { @@ -17651,7 +18553,7 @@ function default_1(from, to, events) { } }; } -exports.default = default_1; +exports["default"] = default_1; /***/ }), @@ -17663,7 +18565,7 @@ exports.default = default_1; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TimeoutError = void 0; -const net = __nccwpck_require__(1631); +const net = __nccwpck_require__(1808); const unhandle_1 = __nccwpck_require__(1593); const reentry = Symbol('reentry'); const noop = () => { }; @@ -17676,7 +18578,7 @@ class TimeoutError extends Error { } } exports.TimeoutError = TimeoutError; -exports.default = (request, delays, options) => { +exports["default"] = (request, delays, options) => { if (reentry in request) { return noop; } @@ -17795,7 +18697,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); // Especially if you do error handling and set timeouts. // So instead of checking if it's proper to throw an error on every timeout ever, // use this simple tool which will remove all listeners you have attached. -exports.default = () => { +exports["default"] = () => { const handlers = []; return { once(origin, event, fn) { @@ -17822,7 +18724,7 @@ exports.default = () => { Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __nccwpck_require__(7678); -exports.default = (url) => { +exports["default"] = (url) => { // Cast to URL url = url; const options = { @@ -17879,7 +18781,7 @@ class WeakableMap { return this.map.has(key); } } -exports.default = WeakableMap; +exports["default"] = WeakableMap; /***/ }), @@ -18126,7 +19028,7 @@ const create = (defaults) => { got.mergeOptions = mergeOptions; return got; }; -exports.default = create; +exports["default"] = create; __exportStar(__nccwpck_require__(2613), exports); @@ -18148,7 +19050,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const url_1 = __nccwpck_require__(8835); +const url_1 = __nccwpck_require__(7310); const create_1 = __nccwpck_require__(4337); const defaults = { options: { @@ -18261,10 +19163,10 @@ const defaults = { mutableDefaults: false }; const got = create_1.default(defaults); -exports.default = got; +exports["default"] = got; // For CommonJS default export support module.exports = got; -module.exports.default = got; +module.exports["default"] = got; module.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267 __exportStar(__nccwpck_require__(4337), exports); __exportStar(__nccwpck_require__(6056), exports); @@ -18297,7 +19199,7 @@ function deepFreeze(object) { } return Object.freeze(object); } -exports.default = deepFreeze; +exports["default"] = deepFreeze; /***/ }), @@ -18309,7 +19211,7 @@ exports.default = deepFreeze; Object.defineProperty(exports, "__esModule", ({ value: true })); const alreadyWarned = new Set(); -exports.default = (message) => { +exports["default"] = (message) => { if (alreadyWarned.has(message)) { return; } @@ -19009,9 +19911,9 @@ module.exports = class CachePolicy { "use strict"; -const EventEmitter = __nccwpck_require__(8614); -const tls = __nccwpck_require__(4016); -const http2 = __nccwpck_require__(7565); +const EventEmitter = __nccwpck_require__(2361); +const tls = __nccwpck_require__(4404); +const http2 = __nccwpck_require__(5158); const QuickLRU = __nccwpck_require__(9273); const kCurrentStreamsCount = Symbol('currentStreamsCount'); @@ -19687,8 +20589,8 @@ module.exports = { "use strict"; -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); +const http = __nccwpck_require__(3685); +const https = __nccwpck_require__(5687); const resolveALPN = __nccwpck_require__(6624); const QuickLRU = __nccwpck_require__(9273); const Http2ClientRequest = __nccwpck_require__(9632); @@ -19844,8 +20746,8 @@ module.exports.protocolCache = cache; "use strict"; -const http2 = __nccwpck_require__(7565); -const {Writable} = __nccwpck_require__(2413); +const http2 = __nccwpck_require__(5158); +const {Writable} = __nccwpck_require__(2781); const {Agent, globalAgent} = __nccwpck_require__(9898); const IncomingMessage = __nccwpck_require__(2575); const urlToOptions = __nccwpck_require__(2686); @@ -20297,7 +21199,7 @@ module.exports = ClientRequest; "use strict"; -const {Readable} = __nccwpck_require__(2413); +const {Readable} = __nccwpck_require__(2781); class IncomingMessage extends Readable { constructor(socket, highWaterMark) { @@ -20363,7 +21265,7 @@ module.exports = IncomingMessage; "use strict"; -const http2 = __nccwpck_require__(7565); +const http2 = __nccwpck_require__(5158); const agent = __nccwpck_require__(9898); const ClientRequest = __nccwpck_require__(9632); const IncomingMessage = __nccwpck_require__(2575); @@ -20399,7 +21301,7 @@ module.exports = { "use strict"; -const net = __nccwpck_require__(1631); +const net = __nccwpck_require__(1808); /* istanbul ignore file: https://github.com/nodejs/node/blob/v13.0.1/lib/_http_agent.js */ module.exports = options => { @@ -20590,47 +21492,221 @@ module.exports = function isExtglob(str) { var isExtglob = __nccwpck_require__(6435); var chars = { '{': '}', '(': ')', '[': ']'}; -var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; -var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; - -module.exports = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; } if (isExtglob(str)) { return true; } - var regex = strictRegex; - var match; + var check = strictCheck; - // optionally relax regex + // optionally relax check if (options && options.strict === false) { - regex = relaxedRegex; + check = relaxedCheck; } - while ((match = regex.exec(str))) { - if (match[2]) return true; - var idx = match.index + match[0].length; + return check(str); +}; + + +/***/ }), + +/***/ 5680: +/***/ ((module) => { + +"use strict"; +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ - // if an open bracket/brace/paren is escaped, - // set the index to the next closing character - var open = match[1]; - var close = open ? chars[open] : null; - if (open && close) { - var n = str.indexOf(close, idx); - if (n !== -1) { - idx = n + 1; - } - } - str = str.slice(idx); + +module.exports = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } return false; }; +/***/ }), + +/***/ 3287: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} + +function isPlainObject(o) { + var ctor,prot; + + if (isObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; + + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +} + +exports.isPlainObject = isPlainObject; + + /***/ }), /***/ 2820: @@ -20704,75 +21780,195 @@ exports.parse = function (s) { "use strict"; -const EventEmitter = __nccwpck_require__(8614); +const EventEmitter = __nccwpck_require__(2361); const JSONB = __nccwpck_require__(2820); +const compressBrotli = __nccwpck_require__(5728); -const loadStore = opts => { +const loadStore = options => { const adapters = { redis: '@keyv/redis', + rediss: '@keyv/redis', mongodb: '@keyv/mongo', mongo: '@keyv/mongo', sqlite: '@keyv/sqlite', postgresql: '@keyv/postgres', postgres: '@keyv/postgres', - mysql: '@keyv/mysql' + mysql: '@keyv/mysql', + etcd: '@keyv/etcd', + offline: '@keyv/offline', + tiered: '@keyv/tiered', }; - if (opts.adapter || opts.uri) { - const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; - return new (require(adapters[adapter]))(opts); + if (options.adapter || options.uri) { + const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0]; + return new (require(adapters[adapter]))(options); } return new Map(); }; +const iterableAdapters = [ + 'sqlite', + 'postgres', + 'mysql', + 'mongo', + 'redis', + 'tiered', +]; + class Keyv extends EventEmitter { - constructor(uri, opts) { + constructor(uri, {emitErrors = true, ...options} = {}) { super(); - this.opts = Object.assign( - { - namespace: 'keyv', - serialize: JSONB.stringify, - deserialize: JSONB.parse - }, - (typeof uri === 'string') ? { uri } : uri, - opts - ); + this.opts = { + namespace: 'keyv', + serialize: JSONB.stringify, + deserialize: JSONB.parse, + ...((typeof uri === 'string') ? {uri} : uri), + ...options, + }; if (!this.opts.store) { - const adapterOpts = Object.assign({}, this.opts); - this.opts.store = loadStore(adapterOpts); + const adapterOptions = {...this.opts}; + this.opts.store = loadStore(adapterOptions); + } + + if (this.opts.compress) { + const brotli = compressBrotli(this.opts.compress.opts); + this.opts.serialize = async ({value, expires}) => brotli.serialize({value: await brotli.compress(value), expires}); + this.opts.deserialize = async data => { + const {value, expires} = brotli.deserialize(data); + return {value: await brotli.decompress(value), expires}; + }; } - if (typeof this.opts.store.on === 'function') { - this.opts.store.on('error', err => this.emit('error', err)); + if (typeof this.opts.store.on === 'function' && emitErrors) { + this.opts.store.on('error', error => this.emit('error', error)); } this.opts.store.namespace = this.opts.namespace; + + const generateIterator = iterator => async function * () { + for await (const [key, raw] of typeof iterator === 'function' + ? iterator(this.opts.store.namespace) + : iterator) { + const data = this.opts.deserialize(raw); + if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) { + continue; + } + + if (typeof data.expires === 'number' && Date.now() > data.expires) { + this.delete(key); + continue; + } + + yield [this._getKeyUnprefix(key), data.value]; + } + }; + + // Attach iterators + if (typeof this.opts.store[Symbol.iterator] === 'function' && this.opts.store instanceof Map) { + this.iterator = generateIterator(this.opts.store); + } else if (typeof this.opts.store.iterator === 'function' && this.opts.store.opts + && this._checkIterableAdaptar()) { + this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store)); + } + } + + _checkIterableAdaptar() { + return iterableAdapters.includes(this.opts.store.opts.dialect) + || iterableAdapters.findIndex(element => this.opts.store.opts.url.includes(element)) >= 0; } _getKeyPrefix(key) { return `${this.opts.namespace}:${key}`; } - get(key, opts) { - const keyPrefixed = this._getKeyPrefix(key); - const { store } = this.opts; + _getKeyPrefixArray(keys) { + return keys.map(key => `${this.opts.namespace}:${key}`); + } + + _getKeyUnprefix(key) { + return key + .split(':') + .splice(1) + .join(':'); + } + + get(key, options) { + const {store} = this.opts; + const isArray = Array.isArray(key); + const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key); + if (isArray && store.getMany === undefined) { + const promises = []; + for (const key of keyPrefixed) { + promises.push(Promise.resolve() + .then(() => store.get(key)) + .then(data => (typeof data === 'string') ? this.opts.deserialize(data) : data) + .then(data => { + if (data === undefined || data === null) { + return undefined; + } + + if (typeof data.expires === 'number' && Date.now() > data.expires) { + return this.delete(key).then(() => undefined); + } + + return (options && options.raw) ? data : data.value; + }), + ); + } + + return Promise.allSettled(promises) + .then(values => { + const data = []; + for (const value of values) { + data.push(value.value); + } + + return data.every(x => x === undefined) ? [] : data; + }); + } + return Promise.resolve() - .then(() => store.get(keyPrefixed)) + .then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed)) + .then(data => (typeof data === 'string') ? this.opts.deserialize(data) : data) .then(data => { - return (typeof data === 'string') ? this.opts.deserialize(data) : data; - }) - .then(data => { - if (data === undefined) { + if (data === undefined || data === null) { return undefined; } + if (isArray) { + const result = []; + + if (data.length === 0) { + return []; + } + + for (let row of data) { + if ((typeof row === 'string')) { + row = this.opts.deserialize(row); + } + + if (row === undefined || row === null) { + result.push(undefined); + continue; + } + + if (typeof row.expires === 'number' && Date.now() > row.expires) { + this.delete(key).then(() => undefined); + result.push(undefined); + } else { + result.push((options && options.raw) ? row : row.value); + } + } + + return result.every(x => x === undefined) ? [] : result; + } + if (typeof data.expires === 'number' && Date.now() > data.expires) { - this.delete(key); - return undefined; + return this.delete(key).then(() => undefined); } - return (opts && opts.raw) ? data : data.value; + return (options && options.raw) ? data : data.value; }); } @@ -20786,12 +21982,16 @@ class Keyv extends EventEmitter { ttl = undefined; } - const { store } = this.opts; + const {store} = this.opts; return Promise.resolve() .then(() => { const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; - value = { value, expires }; + if (typeof value === 'symbol') { + this.emit('error', 'symbol cannot be serialized'); + } + + value = {value, expires}; return this.opts.serialize(value); }) .then(value => store.set(keyPrefixed, value, ttl)) @@ -20799,17 +21999,54 @@ class Keyv extends EventEmitter { } delete(key) { + const {store} = this.opts; + if (Array.isArray(key)) { + const keyPrefixed = this._getKeyPrefixArray(key); + if (store.deleteMany === undefined) { + const promises = []; + for (const key of keyPrefixed) { + promises.push(store.delete(key)); + } + + return Promise.allSettled(promises) + .then(values => values.every(x => x.value === true)); + } + + return Promise.resolve() + .then(() => store.deleteMany(keyPrefixed)); + } + const keyPrefixed = this._getKeyPrefix(key); - const { store } = this.opts; return Promise.resolve() .then(() => store.delete(keyPrefixed)); } clear() { - const { store } = this.opts; + const {store} = this.opts; return Promise.resolve() .then(() => store.clear()); } + + has(key) { + const keyPrefixed = this._getKeyPrefix(key); + const {store} = this.opts; + return Promise.resolve() + .then(async () => { + if (typeof store.has === 'function') { + return store.has(keyPrefixed); + } + + const value = await store.get(keyPrefixed); + return value !== undefined; + }); + } + + disconnect() { + const {store} = this.opts; + if (typeof store.disconnect === 'function') { + return store.disconnect(); + } + } } module.exports = Keyv; @@ -20847,7 +22084,7 @@ module.exports = object => { * Copyright (c) 2014-2020 Teambition * Licensed under the MIT license. */ -const Stream = __nccwpck_require__(2413) +const Stream = __nccwpck_require__(2781) const PassThrough = Stream.PassThrough const slice = Array.prototype.slice @@ -20987,5015 +22224,5606 @@ function pauseStreams (streams, options) { /***/ }), -/***/ 2610: -/***/ ((module) => { +/***/ 6228: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// We define these manually to ensure they're always copied -// even if they would move up the prototype chain -// https://nodejs.org/api/http.html#http_class_http_incomingmessage -const knownProps = [ - 'destroy', - 'setTimeout', - 'socket', - 'headers', - 'trailers', - 'rawHeaders', - 'statusCode', - 'httpVersion', - 'httpVersionMinor', - 'httpVersionMajor', - 'rawTrailers', - 'statusMessage' -]; +const util = __nccwpck_require__(3837); +const braces = __nccwpck_require__(610); +const picomatch = __nccwpck_require__(8569); +const utils = __nccwpck_require__(479); +const isEmptyString = val => val === '' || val === './'; -module.exports = (fromStream, toStream) => { - const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); +/** + * Returns an array of strings that match one or more glob patterns. + * + * ```js + * const mm = require('micromatch'); + * // mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {String|Array} `list` List of strings to match. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ - for (const prop of fromProps) { - // Don't overwrite existing properties - if (prop in toStream) { - continue; - } +const micromatch = (list, patterns, options) => { + patterns = [].concat(patterns); + list = [].concat(list); - toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; - } -}; - - -/***/ }), - -/***/ 467: -/***/ ((module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(__nccwpck_require__(2413)); -var http = _interopDefault(__nccwpck_require__(8605)); -var Url = _interopDefault(__nccwpck_require__(8835)); -var https = _interopDefault(__nccwpck_require__(7211)); -var zlib = _interopDefault(__nccwpck_require__(8761)); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; + let omit = new Set(); + let keep = new Set(); + let items = new Set(); + let negatives = 0; -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); + let onResult = state => { + items.add(state.output); + if (options && options.onResult) { + options.onResult(state); + } + }; -class Blob { - constructor() { - this[TYPE] = ''; + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; - const blobParts = arguments[0]; - const options = arguments[1]; + for (let item of list) { + let matched = isMatch(item, true); - const buffers = []; - let size = 0; + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } + if (negated) { + omit.add(matched.output); + } else { + omit.delete(matched.output); + keep.add(matched.output); + } + } + } - this[BUFFER] = Buffer.concat(buffers); + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter(item => !omit.has(item)); - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; + if (options && matches.length === 0) { + if (options.failglob === true) { + throw new Error(`No matches found for "${patterns.join(', ')}"`); + } - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); + if (options.nonull === true || options.nullglob === true) { + return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + } + } - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} + return matches; +}; -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); +/** + * Backwards compatibility + */ -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); +micromatch.match = micromatch; /** - * fetch-error.js + * Returns a matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. * - * FetchError interface for operational errors + * ```js + * const mm = require('micromatch'); + * // mm.matcher(pattern[, options]); + * + * const isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` + * @return {Function} Returns a matcher function. + * @api public */ +micromatch.matcher = (pattern, options) => picomatch(pattern, options); + /** - * Create FetchError instance + * Returns true if **any** of the given glob `patterns` match the specified `string`. * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError + * ```js + * const mm = require('micromatch'); + * // mm.isMatch(string, patterns[, options]); + * + * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(mm.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `[options]` See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; -let convert; -try { - convert = __nccwpck_require__(2877).convert; -} catch (e) {} +micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); -const INTERNALS = Symbol('Body internals'); +/** + * Backwards compatibility + */ -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; +micromatch.any = micromatch.isMatch; /** - * Body mixin + * Returns a list of strings that _**do not match any**_ of the given `patterns`. * - * Ref: https://fetch.spec.whatwg.org/#body + * ```js + * const mm = require('micromatch'); + * // mm.not(list, patterns[, options]); * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public */ -function Body(body) { - var _this = this; - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; +micromatch.not = (list, patterns, options = {}) => { + patterns = [].concat(patterns).map(String); + let result = new Set(); + let items = []; - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, + let onResult = state => { + if (options.onResult) options.onResult(state); + items.push(state.output); + }; - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, + let matches = new Set(micromatch(list, patterns, { ...options, onResult })); - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; +}; - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * // mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any of the patterns matches any part of `str`. + * @api public + */ - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, +micromatch.contains = (str, pattern, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, + if (Array.isArray(pattern)) { + return pattern.some(p => micromatch.contains(str, p, options)); + } - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, + if (typeof pattern === 'string') { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; + if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { + return true; + } + } - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } + return micromatch.isMatch(str, pattern, { ...options, contains: true }); }; -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * const mm = require('micromatch'); + * // mm.matchKeys(object, patterns[, options]); + * + * const obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } +micromatch.matchKeys = (obj, patterns, options) => { + if (!utils.isObject(obj)) { + throw new TypeError('Expected the first argument to be an object'); + } + let keys = micromatch(Object.keys(obj), patterns, options); + let res = {}; + for (let key of keys) res[key] = obj[key]; + return res; }; /** - * Consume and convert an entire Body to a Buffer. + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * ```js + * const mm = require('micromatch'); + * // mm.some(list, patterns[, options]); * - * @return Promise + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` + * @api public */ -function consumeBody() { - var _this4 = this; - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } +micromatch.some = (list, patterns, options) => { + let items = [].concat(list); - this[INTERNALS].disturbed = true; + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (items.some(item => isMatch(item))) { + return true; + } + } + return false; +}; - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` + * @api public + */ - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } +micromatch.every = (list, patterns, options) => { + let items = [].concat(list); - // body is blob - if (isBlob(body)) { - body = body.stream(); - } + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (!items.every(item => isMatch(item))) { + return false; + } + } + return true; +}; - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * const mm = require('micromatch'); + * // mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } +micromatch.all = (str, patterns, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; + return [].concat(patterns).every(p => picomatch(p, options)(str)); +}; - return new Body.Promise(function (resolve, reject) { - let resTimeout; +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * const mm = require('micromatch'); + * // mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `glob` Glob pattern to use for matching. + * @param {String} `input` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. + * @api public + */ - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } +micromatch.capture = (glob, input, options) => { + let posix = utils.isWindows(options); + let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); + if (match) { + return match.slice(1).map(v => v === void 0 ? '' : v); + } +}; - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * const mm = require('micromatch'); + * // mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } +micromatch.makeRe = (...args) => picomatch.makeRe(...args); - accumBytes += chunk.length; - accum.push(chunk); - }); +/** + * Scan a glob pattern to separate the pattern into segments. Used + * by the [split](#split) method. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.scan(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ - body.on('end', function () { - if (abort) { - return; - } +micromatch.scan = (...args) => picomatch.scan(...args); - clearTimeout(resTimeout); +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.parse(pattern[, options]); + * ``` + * @param {String} `glob` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as regex source string. + * @api public + */ - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} +micromatch.parse = (patterns, options) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces(String(pattern), options)) { + res.push(picomatch.parse(str, options)); + } + } + return res; +}; /** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * Process the given brace `pattern`. * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String + * ```js + * const { braces } = require('micromatch'); + * console.log(braces('foo/{a,b,c}/bar')); + * //=> [ 'foo/(a|b|c)/bar' ] + * + * console.log(braces('foo/{a,b,c}/bar', { expand: true })); + * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] + * ``` + * @param {String} `pattern` String with brace pattern to process. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; +micromatch.braces = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { + return [pattern]; + } + return braces(pattern, options); +}; - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } +/** + * Expand braces + */ - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); +micromatch.braceExpand = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + return micromatch.braces(pattern, { ...options, expand: true }); +}; - // html5 - if (!res && str) { - res = / { - // prevent decode issues when sites use incorrect encoding - // ref: https://hsivonen.fi/encoding-menu/ - if (charset === 'gb2312' || charset === 'gbk') { - charset = 'gb18030'; +"use strict"; + + +// We define these manually to ensure they're always copied +// even if they would move up the prototype chain +// https://nodejs.org/api/http.html#http_class_http_incomingmessage +const knownProps = [ + 'destroy', + 'setTimeout', + 'socket', + 'headers', + 'trailers', + 'rawHeaders', + 'statusCode', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'rawTrailers', + 'statusMessage' +]; + +module.exports = (fromStream, toStream) => { + const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); + + for (const prop of fromProps) { + // Don't overwrite existing properties + if (prop in toStream) { + continue; } + + toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; } +}; - // turn raw buffers into a single utf-8 buffer - return convert(buffer, 'UTF-8', charset).toString(); -} -/** - * Detect a URLSearchParams object - * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143 - * - * @param Object obj Object to detect by type or brand - * @return String - */ -function isURLSearchParams(obj) { - // Duck-typing as a necessary condition. - if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { - return false; +/***/ }), + +/***/ 467: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var Stream = _interopDefault(__nccwpck_require__(2781)); +var http = _interopDefault(__nccwpck_require__(3685)); +var Url = _interopDefault(__nccwpck_require__(7310)); +var whatwgUrl = _interopDefault(__nccwpck_require__(8665)); +var https = _interopDefault(__nccwpck_require__(5687)); +var zlib = _interopDefault(__nccwpck_require__(9796)); + +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; + +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); + +class Blob { + constructor() { + this[TYPE] = ''; + + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; - // Brand-checking and more duck-typing as optional condition. - return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function'; + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } } +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + /** - * Check if `obj` is a W3C `Blob` object (which `File` inherits from) - * @param {*} obj - * @return {boolean} + * fetch-error.js + * + * FetchError interface for operational errors */ -function isBlob(obj) { - return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); -} /** - * Clone body given Res/Req instance + * Create FetchError instance * - * @param Mixed instance Response or Request instance - * @return Mixed + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError */ -function clone(instance) { - let p1, p2; - let body = instance.body; +function FetchError(message, type, systemError) { + Error.call(this, message); - // don't allow cloning a used body - if (instance.bodyUsed) { - throw new Error('cannot clone body after it is used'); - } + this.message = message; + this.type = type; - // check that body is a stream and not form-data object - // note: we can't clone the form-data object without having it as a dependency - if (body instanceof Stream && typeof body.getBoundary !== 'function') { - // tee instance body - p1 = new PassThrough(); - p2 = new PassThrough(); - body.pipe(p1); - body.pipe(p2); - // set instance body to teed body and return the other teed body - instance[INTERNALS].body = p1; - body = p2; - } + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } - return body; + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); } +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; + +let convert; +try { + convert = (__nccwpck_require__(2877).convert); +} catch (e) {} + +const INTERNALS = Symbol('Body internals'); + +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; + /** - * Performs the operation "extract a `Content-Type` value from |object|" as - * specified in the specification: - * https://fetch.spec.whatwg.org/#concept-bodyinit-extract + * Body mixin * - * This function assumes that instance.body is present. + * Ref: https://fetch.spec.whatwg.org/#body * - * @param Mixed instance Any options.body input + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void */ -function extractContentType(body) { - if (body === null) { - // body is null - return null; - } else if (typeof body === 'string') { - // body is string - return 'text/plain;charset=UTF-8'; +function Body(body) { + var _this = this; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; + + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + + if (body == null) { + // body is undefined or null + body = null; } else if (isURLSearchParams(body)) { // body is a URLSearchParams - return 'application/x-www-form-urlencoded;charset=UTF-8'; - } else if (isBlob(body)) { - // body is blob - return body.type || null; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return null; - } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { // body is ArrayBuffer - return null; + body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { // body is ArrayBufferView - return null; - } else if (typeof body.getBoundary === 'function') { - // detect form data input from form-data module - return `multipart/form-data;boundary=${body.getBoundary()}`; - } else if (body instanceof Stream) { - // body is stream - // can't really do much about this - return null; - } else { - // Body constructor defaults other things to string - return 'text/plain;charset=UTF-8'; + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); } } -/** - * The Fetch Standard treats this as if "total bytes" is a property on the body. - * For us, we have to explicitly get it with a function. - * - * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes - * - * @param Body instance Instance of Body - * @return Number? Number of bytes, or null if not possible - */ -function getTotalBytes(instance) { - const body = instance.body; +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + get bodyUsed() { + return this[INTERNALS].disturbed; + }, - if (body === null) { - // body is null - return 0; - } else if (isBlob(body)) { - return body.size; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return body.length; - } else if (body && typeof body.getLengthSync === 'function') { - // detect form data input from form-data module - if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x - body.hasKnownLength && body.hasKnownLength()) { - // 2.x - return body.getLengthSync(); - } - return null; - } else { - // body is stream - return null; - } -} + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, -/** - * Write a Body to a Node.js WritableStream (e.g. http.Request) object. - * - * @param Body instance Instance of Body - * @return Void - */ -function writeToStream(dest, instance) { - const body = instance.body; + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; - if (body === null) { - // body is null - dest.end(); - } else if (isBlob(body)) { - body.stream().pipe(dest); - } else if (Buffer.isBuffer(body)) { - // body is buffer - dest.write(body); - dest.end(); - } else { - // body is stream - body.pipe(dest); - } -} + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, -// expose Promise -Body.Promise = global.Promise; + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, -/** - * headers.js - * - * Headers class offers convenient helpers - */ + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, -const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; -const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; -function validateName(name) { - name = `${name}`; - if (invalidTokenRegex.test(name) || name === '') { - throw new TypeError(`${name} is not a legal HTTP header name`); + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); } -} +}; -function validateValue(value) { - value = `${value}`; - if (invalidHeaderCharRegex.test(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`); +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); + +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } } -} +}; /** - * Find the key in the map object given a header name. + * Consume and convert an entire Body to a Buffer. * - * Returns undefined if not found. + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body * - * @param String name Header name - * @return String|Undefined + * @return Promise */ -function find(map, name) { - name = name.toLowerCase(); - for (const key in map) { - if (key.toLowerCase() === name) { - return key; - } +function consumeBody() { + var _this4 = this; + + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } - return undefined; -} -const MAP = Symbol('map'); -class Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + this[INTERNALS].disturbed = true; - this[MAP] = Object.create(null); + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); + let body = this.body; - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } - return; - } + // body is blob + if (isBlob(body)) { + body = body.stream(); + } - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; + + return new Body.Promise(function (resolve, reject) { + let resTimeout; + + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } + }); - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } - return this[MAP][key].join(', '); - } + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + accumBytes += chunk.length; + accum.push(chunk); + }); - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; + body.on('end', function () { + if (abort) { + return; + } - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } + clearTimeout(resTimeout); - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} + +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); } - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; + + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); } - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); + + // html5 + if (!res && str) { + res = / 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; +/** + * Detect a URLSearchParams object + * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143 + * + * @param Object obj Object to detect by type or brand + * @return String + */ +function isURLSearchParams(obj) { + // Duck-typing as a necessary condition. + if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { + return false; + } - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); + // Brand-checking and more duck-typing as optional condition. + return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function'; } -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; +/** + * Check if `obj` is a W3C `Blob` object (which `File` inherits from) + * @param {*} obj + * @return {boolean} + */ +function isBlob(obj) { + return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); } -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - /** - * Export the Headers object in a form that Node.js can consume. + * Clone body given Res/Req instance * - * @param Headers headers - * @return Object + * @param Mixed instance Response or Request instance + * @return Mixed */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); +function clone(instance) { + let p1, p2; + let body = instance.body; - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; + // don't allow cloning a used body + if (instance.bodyUsed) { + throw new Error('cannot clone body after it is used'); } - return obj; + // check that body is a stream and not form-data object + // note: we can't clone the form-data object without having it as a dependency + if (body instanceof Stream && typeof body.getBoundary !== 'function') { + // tee instance body + p1 = new PassThrough(); + p2 = new PassThrough(); + body.pipe(p1); + body.pipe(p2); + // set instance body to teed body and return the other teed body + instance[INTERNALS].body = p1; + body = p2; + } + + return body; } /** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. + * Performs the operation "extract a `Content-Type` value from |object|" as + * specified in the specification: + * https://fetch.spec.whatwg.org/#concept-bodyinit-extract * - * @param Object obj Object of headers - * @return Headers + * This function assumes that instance.body is present. + * + * @param Mixed instance Any options.body input */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } +function extractContentType(body) { + if (body === null) { + // body is null + return null; + } else if (typeof body === 'string') { + // body is string + return 'text/plain;charset=UTF-8'; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + return 'application/x-www-form-urlencoded;charset=UTF-8'; + } else if (isBlob(body)) { + // body is blob + return body.type || null; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return null; + } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + return null; + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + return null; + } else if (typeof body.getBoundary === 'function') { + // detect form data input from form-data module + return `multipart/form-data;boundary=${body.getBoundary()}`; + } else if (body instanceof Stream) { + // body is stream + // can't really do much about this + return null; + } else { + // Body constructor defaults other things to string + return 'text/plain;charset=UTF-8'; } - return headers; } -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - /** - * Response class + * The Fetch Standard treats this as if "total bytes" is a property on the body. + * For us, we have to explicitly get it with a function. * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void + * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes + * + * @param Body instance Instance of Body + * @return Number? Number of bytes, or null if not possible */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); +function getTotalBytes(instance) { + const body = instance.body; - const status = opts.status || 200; - const headers = new Headers(opts.headers); - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } + if (body === null) { + // body is null + return 0; + } else if (isBlob(body)) { + return body.size; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return body.length; + } else if (body && typeof body.getLengthSync === 'function') { + // detect form data input from form-data module + if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x + body.hasKnownLength && body.hasKnownLength()) { + // 2.x + return body.getLengthSync(); } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; + return null; + } else { + // body is stream + return null; } +} - get url() { - return this[INTERNALS$1].url || ''; - } +/** + * Write a Body to a Node.js WritableStream (e.g. http.Request) object. + * + * @param Body instance Instance of Body + * @return Void + */ +function writeToStream(dest, instance) { + const body = instance.body; - get status() { - return this[INTERNALS$1].status; - } - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + if (body === null) { + // body is null + dest.end(); + } else if (isBlob(body)) { + body.stream().pipe(dest); + } else if (Buffer.isBuffer(body)) { + // body is buffer + dest.write(body); + dest.end(); + } else { + // body is stream + body.pipe(dest); } +} - get redirected() { - return this[INTERNALS$1].counter > 0; - } +// expose Promise +Body.Promise = global.Promise; - get statusText() { - return this[INTERNALS$1].statusText; - } +/** + * headers.js + * + * Headers class offers convenient helpers + */ - get headers() { - return this[INTERNALS$1].headers; - } +const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); +function validateName(name) { + name = `${name}`; + if (invalidTokenRegex.test(name) || name === '') { + throw new TypeError(`${name} is not a legal HTTP header name`); } } -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; +function validateValue(value) { + value = `${value}`; + if (invalidHeaderCharRegex.test(value)) { + throw new TypeError(`${value} is not a legal HTTP header value`); + } +} /** - * Check if a value is an instance of Request. + * Find the key in the map object given a header name. * - * @param Mixed input - * @return Boolean + * Returns undefined if not found. + * + * @param String name Header name + * @return String|Undefined */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +function find(map, name) { + name = name.toLowerCase(); + for (const key in map) { + if (key.toLowerCase() === name) { + return key; + } + } + return undefined; } -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} +const MAP = Symbol('map'); +class Headers { + /** + * Headers class + * + * @param Object headers Response headers + * @return Void + */ + constructor() { + let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + this[MAP] = Object.create(null); - let parsedURL; + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); + return; } - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } - const headers = new Headers(init.headers || input.headers || {}); + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } } + } else { + throw new TypeError('Provided initializer must be an object'); } + } - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; } - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; + return this[MAP][key].join(', '); + } - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; + + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } } - get method() { - return this[INTERNALS$2].method; + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; } - get url() { - return format_url(this[INTERNALS$2].parsedURL); + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } } - get headers() { - return this[INTERNALS$2].headers; + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; } - get redirect() { - return this[INTERNALS$2].redirect; + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } } - get signal() { - return this[INTERNALS$2].signal; + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; } /** - * Clone this request + * Get an iterator on keys. * - * @return Request + * @return Iterator */ - clone() { - return new Request(this); + keys() { + return createHeadersIterator(this, 'key'); } -} -Body.mixIn(Request.prototype); + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', writable: false, enumerable: false, configurable: true }); -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } }); -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } +const INTERNAL = Symbol('internal'); - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } + this[INTERNAL].index = index + 1; - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); + return { + value: values[index], + done: false + }; } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); /** - * abort-error.js + * Export the Headers object in a form that Node.js can consume. * - * AbortError interface for cancelled requests + * @param Headers headers + * @return Object */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + + return obj; +} /** - * Create AbortError instance + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. * - * @param String message Error message for human - * @return AbortError + * @param Object obj Object of headers + * @return Headers */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; } -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; +const INTERNALS$1 = Symbol('Response internals'); -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; /** - * Fetch function + * Response class * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; + Body.call(this, body, opts); - let response = null; + const status = opts.status || 200; + const headers = new Headers(opts.headers); - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; } - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter }; + } - // send request - const req = send(options); - let reqTimeout; + get url() { + return this[INTERNALS$1].url || ''; + } - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } + get status() { + return this[INTERNALS$1].status; + } - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } + get redirected() { + return this[INTERNALS$1].counter > 0; + } - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } + + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected }); + } +} - req.on('response', function (res) { - clearTimeout(reqTimeout); +Body.mixIn(Response.prototype); - const headers = createHeadersLenient(res.headers); +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - writeToStream(req, request); - }); -} /** - * Redirect code matching + * Check if a value is an instance of Request. * - * @param Number code Status code + * @param Mixed input * @return Boolean */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} -// expose Promise -fetch.Promise = global.Promise; +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let parsedURL; -/***/ }), + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } -/***/ 7952: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); -"use strict"; + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } -// TODO: Use the `URL` global when targeting Node.js 10 -const URLParser = typeof URL === 'undefined' ? __nccwpck_require__(8835).URL : URL; + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs -const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; -const DATA_URL_DEFAULT_CHARSET = 'us-ascii'; + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); -const testParameter = (name, filters) => { - return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); -}; + const headers = new Headers(init.headers || input.headers || {}); -const normalizeDataURL = (urlString, {stripHash}) => { - const parts = urlString.match(/^data:(.*?),(.*?)(?:#(.*))?$/); + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } - if (!parts) { - throw new Error(`Invalid URL: ${urlString}`); - } + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; - const mediaType = parts[1].split(';'); - const body = parts[2]; - const hash = stripHash ? '' : parts[3]; + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } - let base64 = false; + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; - if (mediaType[mediaType.length - 1] === 'base64') { - mediaType.pop(); - base64 = true; + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; } - // Lowercase MIME type - const mimeType = (mediaType.shift() || '').toLowerCase(); - const attributes = mediaType - .map(attribute => { - let [key, value = ''] = attribute.split('=').map(string => string.trim()); - - // Lowercase `charset` - if (key === 'charset') { - value = value.toLowerCase(); - - if (value === DATA_URL_DEFAULT_CHARSET) { - return ''; - } - } - - return `${key}${value ? `=${value}` : ''}`; - }) - .filter(Boolean); + get method() { + return this[INTERNALS$2].method; + } - const normalizedMediaType = [ - ...attributes - ]; + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } - if (base64) { - normalizedMediaType.push('base64'); + get headers() { + return this[INTERNALS$2].headers; } - if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { - normalizedMediaType.unshift(mimeType); + get redirect() { + return this[INTERNALS$2].redirect; } - return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`; -}; + get signal() { + return this[INTERNALS$2].signal; + } -const normalizeUrl = (urlString, options) => { - options = { - defaultProtocol: 'http:', - normalizeProtocol: true, - forceHttp: false, - forceHttps: false, - stripAuthentication: true, - stripHash: false, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false, - sortQueryParameters: true, - ...options - }; - - // TODO: Remove this at some point in the future - if (Reflect.has(options, 'normalizeHttps')) { - throw new Error('options.normalizeHttps is renamed to options.forceHttp'); - } - - if (Reflect.has(options, 'normalizeHttp')) { - throw new Error('options.normalizeHttp is renamed to options.forceHttps'); + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); } +} - if (Reflect.has(options, 'stripFragment')) { - throw new Error('options.stripFragment is renamed to options.stripHash'); - } +Body.mixIn(Request.prototype); - urlString = urlString.trim(); +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); - // Data URL - if (/^data:/i.test(urlString)) { - return normalizeDataURL(urlString, options); - } +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); - const hasRelativeProtocol = urlString.startsWith('//'); - const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); - // Prepend protocol - if (!isRelativeUrl) { - urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); } - const urlObj = new URLParser(urlString); - - if (options.forceHttp && options.forceHttps) { - throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); } - if (options.forceHttp && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); } - if (options.forceHttps && urlObj.protocol === 'http:') { - urlObj.protocol = 'https:'; + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); } - // Remove auth - if (options.stripAuthentication) { - urlObj.username = ''; - urlObj.password = ''; + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; } - - // Remove hash - if (options.stripHash) { - urlObj.hash = ''; + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } } - - // Remove duplicate slashes if not preceded by a protocol - if (urlObj.pathname) { - // TODO: Use the following instead when targeting Node.js 10 - // `urlObj.pathname = urlObj.pathname.replace(/(? { - if (/^(?!\/)/g.test(p1)) { - return `${p1}/`; - } - - return '/'; - }); + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); } - // Decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); } - // Remove directory index - if (options.removeDirectoryIndex === true) { - options.removeDirectoryIndex = [/^index\.[a-z]+$/]; + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); } - if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { - let pathComponents = urlObj.pathname.split('/'); - const lastComponent = pathComponents[pathComponents.length - 1]; + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } - if (testParameter(lastComponent, options.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } + if (!headers.has('Connection') && !agent) { + headers.set('Connection', 'close'); } - if (urlObj.hostname) { - // Remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js - // Remove `www.` - if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) { - // Each label should be max 63 at length (min: 2). - // The extension should be max 5 at length (min: 2). - // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} - // Remove query unwanted parameters - if (Array.isArray(options.removeQueryParameters)) { - for (const key of [...urlObj.searchParams.keys()]) { - if (testParameter(key, options.removeQueryParameters)) { - urlObj.searchParams.delete(key); - } - } - } +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ - // Sort query parameters - if (options.sortQueryParameters) { - urlObj.searchParams.sort(); - } +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); - if (options.removeTrailingSlash) { - urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); - } + this.type = 'aborted'; + this.message = message; - // Take advantage of many of the Node `url` normalizations - urlString = urlObj.toString(); + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} - // Remove ending `/` - if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') { - urlString = urlString.replace(/\/$/, ''); - } +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; - // Restore relative protocol, if applicable - if (hasRelativeProtocol && !options.normalizeProtocol) { - urlString = urlString.replace(/^http:\/\//, '//'); - } +const URL$1 = Url.URL || whatwgUrl.URL; - // Remove http/https - if (options.stripProtocol) { - urlString = urlString.replace(/^(?:https?:)?\/\//, ''); - } +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; - return urlString; +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); }; -module.exports = normalizeUrl; -// TODO: Remove this for the next major release -module.exports.default = normalizeUrl; +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } -/***/ }), + Body.Promise = fetch.Promise; -/***/ 1223: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); -var wrappy = __nccwpck_require__(2940) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) + let response = null; - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + request.body.destroy(error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} + if (signal && signal.aborted) { + abort(); + return; + } -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} - - -/***/ }), - -/***/ 9072: -/***/ ((module) => { - -"use strict"; + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; + // send request + const req = send(options); + let reqTimeout; -class CancelError extends Error { - constructor(reason) { - super(reason || 'Promise was canceled'); - this.name = 'CancelError'; - } + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } - get isCanceled() { - return true; - } -} + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } -class PCancelable { - static fn(userFn) { - return (...arguments_) => { - return new PCancelable((resolve, reject, onCancel) => { - arguments_.push(onCancel); - // eslint-disable-next-line promise/prefer-await-to-then - userFn(...arguments_).then(resolve, reject); + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); }); - }; - } - - constructor(executor) { - this._cancelHandlers = []; - this._isPending = true; - this._isCanceled = false; - this._rejectOnCancel = true; - - this._promise = new Promise((resolve, reject) => { - this._reject = reject; + } - const onResolve = value => { - this._isPending = false; - resolve(value); - }; + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + finalize(); + }); - const onReject = error => { - this._isPending = false; - reject(error); - }; + req.on('response', function (res) { + clearTimeout(reqTimeout); - const onCancel = handler => { - if (!this._isPending) { - throw new Error('The `onCancel` handler was attached after the promise settled.'); - } + const headers = createHeadersLenient(res.headers); - this._cancelHandlers.push(handler); - }; + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); - Object.defineProperties(onCancel, { - shouldReject: { - get: () => this._rejectOnCancel, - set: boolean => { - this._rejectOnCancel = boolean; + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; } } - }); - return executor(onResolve, onReject, onCancel); - }); - } + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } - then(onFulfilled, onRejected) { - // eslint-disable-next-line promise/prefer-await-to-then - return this._promise.then(onFulfilled, onRejected); - } + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } - catch(onRejected) { - return this._promise.catch(onRejected); - } + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; - finally(onFinally) { - return this._promise.finally(onFinally); - } + if (!isDomainOrSubdomain(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } - cancel(reason) { - if (!this._isPending || this._isCanceled) { - return; - } + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } - if (this._cancelHandlers.length > 0) { - try { - for (const handler of this._cancelHandlers) { - handler(); + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; } - } catch (error) { - this._reject(error); } - } - - this._isCanceled = true; - if (this._rejectOnCancel) { - this._reject(new CancelError(reason)); - } - } - - get isCanceled() { - return this._isCanceled; - } -} - -Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); - -module.exports = PCancelable; -module.exports.CancelError = CancelError; + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); -/***/ }), + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; -/***/ 8569: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); -"use strict"; + // HTTP-network fetch step 12.1.1.4: handle content codings + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } -module.exports = __nccwpck_require__(3322); + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } -/***/ }), - -/***/ 6099: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const path = __nccwpck_require__(5622); -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; - -/** - * Posix glob regex - */ + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + return; + } -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); + writeToStream(req, request); + }); +} /** - * Windows glob regex + * Redirect code matching + * + * @param Number code Status code + * @return Boolean */ - -const WINDOWS_CHARS = { - ...POSIX_CHARS, - - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; }; -/** - * POSIX Bracket Regex - */ +// expose Promise +fetch.Promise = global.Promise; -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; +module.exports = exports = fetch; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = exports; +exports.Headers = Headers; +exports.Request = Request; +exports.Response = Response; +exports.FetchError = FetchError; -module.exports = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, +/***/ }), - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, +/***/ 7952: +/***/ ((module) => { - // Digits - CHAR_0: 48, /* 0 */ - CHAR_9: 57, /* 9 */ +"use strict"; - // Alphabet chars. - CHAR_UPPERCASE_A: 65, /* A */ - CHAR_LOWERCASE_A: 97, /* a */ - CHAR_UPPERCASE_Z: 90, /* Z */ - CHAR_LOWERCASE_Z: 122, /* z */ - CHAR_LEFT_PARENTHESES: 40, /* ( */ - CHAR_RIGHT_PARENTHESES: 41, /* ) */ +// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs +const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; +const DATA_URL_DEFAULT_CHARSET = 'us-ascii'; - CHAR_ASTERISK: 42, /* * */ +const testParameter = (name, filters) => { + return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); +}; - // Non-alphabetic chars. - CHAR_AMPERSAND: 38, /* & */ - CHAR_AT: 64, /* @ */ - CHAR_BACKWARD_SLASH: 92, /* \ */ - CHAR_CARRIAGE_RETURN: 13, /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ - CHAR_COLON: 58, /* : */ - CHAR_COMMA: 44, /* , */ - CHAR_DOT: 46, /* . */ - CHAR_DOUBLE_QUOTE: 34, /* " */ - CHAR_EQUAL: 61, /* = */ - CHAR_EXCLAMATION_MARK: 33, /* ! */ - CHAR_FORM_FEED: 12, /* \f */ - CHAR_FORWARD_SLASH: 47, /* / */ - CHAR_GRAVE_ACCENT: 96, /* ` */ - CHAR_HASH: 35, /* # */ - CHAR_HYPHEN_MINUS: 45, /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ - CHAR_LEFT_CURLY_BRACE: 123, /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ - CHAR_LINE_FEED: 10, /* \n */ - CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ - CHAR_PERCENT: 37, /* % */ - CHAR_PLUS: 43, /* + */ - CHAR_QUESTION_MARK: 63, /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ - CHAR_SEMICOLON: 59, /* ; */ - CHAR_SINGLE_QUOTE: 39, /* ' */ - CHAR_SPACE: 32, /* */ - CHAR_TAB: 9, /* \t */ - CHAR_UNDERSCORE: 95, /* _ */ - CHAR_VERTICAL_LINE: 124, /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ +const normalizeDataURL = (urlString, {stripHash}) => { + const match = /^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(urlString); - SEP: path.sep, + if (!match) { + throw new Error(`Invalid URL: ${urlString}`); + } - /** - * Create EXTGLOB_CHARS - */ + let {type, data, hash} = match.groups; + const mediaType = type.split(';'); + hash = stripHash ? '' : hash; - extglobChars(chars) { - return { - '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, - '?': { type: 'qmark', open: '(?:', close: ')?' }, - '+': { type: 'plus', open: '(?:', close: ')+' }, - '*': { type: 'star', open: '(?:', close: ')*' }, - '@': { type: 'at', open: '(?:', close: ')' } - }; - }, + let isBase64 = false; + if (mediaType[mediaType.length - 1] === 'base64') { + mediaType.pop(); + isBase64 = true; + } - /** - * Create GLOB_CHARS - */ + // Lowercase MIME type + const mimeType = (mediaType.shift() || '').toLowerCase(); + const attributes = mediaType + .map(attribute => { + let [key, value = ''] = attribute.split('=').map(string => string.trim()); - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; - } -}; + // Lowercase `charset` + if (key === 'charset') { + value = value.toLowerCase(); + if (value === DATA_URL_DEFAULT_CHARSET) { + return ''; + } + } -/***/ }), + return `${key}${value ? `=${value}` : ''}`; + }) + .filter(Boolean); -/***/ 2139: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const normalizedMediaType = [ + ...attributes + ]; -"use strict"; + if (isBase64) { + normalizedMediaType.push('base64'); + } + if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { + normalizedMediaType.unshift(mimeType); + } -const constants = __nccwpck_require__(6099); -const utils = __nccwpck_require__(479); + return `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`; +}; -/** - * Constants - */ +const normalizeUrl = (urlString, options) => { + options = { + defaultProtocol: 'http:', + normalizeProtocol: true, + forceHttp: false, + forceHttps: false, + stripAuthentication: true, + stripHash: false, + stripTextFragment: true, + stripWWW: true, + removeQueryParameters: [/^utm_\w+/i], + removeTrailingSlash: true, + removeSingleSlash: true, + removeDirectoryIndex: false, + sortQueryParameters: true, + ...options + }; -const { - MAX_LENGTH, - POSIX_REGEX_SOURCE, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants; + urlString = urlString.trim(); -/** - * Helpers - */ + // Data URL + if (/^data:/i.test(urlString)) { + return normalizeDataURL(urlString, options); + } -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); - } + if (/^view-source:/i.test(urlString)) { + throw new Error('`view-source:` is not supported as it is a non-standard protocol'); + } - args.sort(); - const value = `[${args.join('-')}]`; + const hasRelativeProtocol = urlString.startsWith('//'); + const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); - try { - /* eslint-disable-next-line no-new */ - new RegExp(value); - } catch (ex) { - return args.map(v => utils.escapeRegex(v)).join('..'); - } + // Prepend protocol + if (!isRelativeUrl) { + urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); + } - return value; -}; + const urlObj = new URL(urlString); -/** - * Create the message for a syntax error - */ + if (options.forceHttp && options.forceHttps) { + throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); + } -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; -}; + if (options.forceHttp && urlObj.protocol === 'https:') { + urlObj.protocol = 'http:'; + } -/** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} - */ + if (options.forceHttps && urlObj.protocol === 'http:') { + urlObj.protocol = 'https:'; + } -const parse = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } + // Remove auth + if (options.stripAuthentication) { + urlObj.username = ''; + urlObj.password = ''; + } - input = REPLACEMENTS[input] || input; + // Remove hash + if (options.stripHash) { + urlObj.hash = ''; + } else if (options.stripTextFragment) { + urlObj.hash = urlObj.hash.replace(/#?:~:text.*?$/i, ''); + } - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + // Remove duplicate slashes if not preceded by a protocol + if (urlObj.pathname) { + urlObj.pathname = urlObj.pathname.replace(/(? max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } + // Decode URI octets + if (urlObj.pathname) { + try { + urlObj.pathname = decodeURI(urlObj.pathname); + } catch (_) {} + } - const bos = { type: 'bos', value: '', output: opts.prepend || '' }; - const tokens = [bos]; + // Remove directory index + if (options.removeDirectoryIndex === true) { + options.removeDirectoryIndex = [/^index\.[a-z]+$/]; + } - const capture = opts.capture ? '' : '?:'; - const win32 = utils.isWindows(options); + if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { + let pathComponents = urlObj.pathname.split('/'); + const lastComponent = pathComponents[pathComponents.length - 1]; - // create constants based on platform, for windows or posix - const PLATFORM_CHARS = constants.globChars(win32); - const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + if (testParameter(lastComponent, options.removeDirectoryIndex)) { + pathComponents = pathComponents.slice(0, pathComponents.length - 1); + urlObj.pathname = pathComponents.slice(1).join('/') + '/'; + } + } - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; + if (urlObj.hostname) { + // Remove trailing dot + urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - const globstar = (opts) => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; + // Remove `www.` + if (options.stripWWW && /^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(urlObj.hostname)) { + // Each label should be max 63 at length (min: 1). + // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names + // Each TLD should be up to 63 characters long (min: 2). + // It is technically possible to have a single character TLD, but none currently exist. + urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); + } + } - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; + // Remove query unwanted parameters + if (Array.isArray(options.removeQueryParameters)) { + for (const key of [...urlObj.searchParams.keys()]) { + if (testParameter(key, options.removeQueryParameters)) { + urlObj.searchParams.delete(key); + } + } + } - if (opts.capture) { - star = `(${star})`; - } + if (options.removeQueryParameters === true) { + urlObj.search = ''; + } - // minimatch options support - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; - } + // Sort query parameters + if (options.sortQueryParameters) { + urlObj.searchParams.sort(); + } - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; + if (options.removeTrailingSlash) { + urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); + } - input = utils.removePrefix(input, state); - len = input.length; + const oldUrlString = urlString; - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; + // Take advantage of many of the Node `url` normalizations + urlString = urlObj.toString(); - /** - * Tokenizing helpers - */ + if (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') { + urlString = urlString.replace(/\/$/, ''); + } - const eos = () => state.index === len - 1; - const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index]; - const remaining = () => input.slice(state.index + 1); - const consume = (value = '', num = 0) => { - state.consumed += value; - state.index += num; - }; - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; + // Remove ending `/` unless removeSingleSlash is false + if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) { + urlString = urlString.replace(/\/$/, ''); + } - const negate = () => { - let count = 1; + // Restore relative protocol, if applicable + if (hasRelativeProtocol && !options.normalizeProtocol) { + urlString = urlString.replace(/^http:\/\//, '//'); + } - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } + // Remove http/https + if (options.stripProtocol) { + urlString = urlString.replace(/^(?:https?:)?\/\//, ''); + } - if (count % 2 === 0) { - return false; - } + return urlString; +}; - state.negated = true; - state.start++; - return true; - }; +module.exports = normalizeUrl; - const increment = type => { - state[type]++; - stack.push(type); - }; - const decrement = type => { - state[type]--; - stack.pop(); - }; +/***/ }), - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ +/***/ 1223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); +var wrappy = __nccwpck_require__(2940) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) - if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) { - extglobs[extglobs.length - 1].inner += tok.value; - } + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) - if (tok.value || tok.output) append(tok); - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; - } +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; +/***/ }), - increment('parens'); - push({ type, value, output: state.output ? '' : ONE_CHAR }); - push({ type: 'paren', extglob: true, value: advance(), output }); - extglobs.push(token); - }; +/***/ 9072: +/***/ ((module) => { - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); +"use strict"; - if (token.type === 'negate') { - let extglobStar = star; - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); - } +class CancelError extends Error { + constructor(reason) { + super(reason || 'Promise was canceled'); + this.name = 'CancelError'; + } - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; - } + get isCanceled() { + return true; + } +} - if (token.prev.type === 'bos' && eos()) { - state.negatedExtglob = true; - } - } +class PCancelable { + static fn(userFn) { + return (...arguments_) => { + return new PCancelable((resolve, reject, onCancel) => { + arguments_.push(onCancel); + // eslint-disable-next-line promise/prefer-await-to-then + userFn(...arguments_).then(resolve, reject); + }); + }; + } - push({ type: 'paren', extglob: true, value, output }); - decrement('parens'); - }; + constructor(executor) { + this._cancelHandlers = []; + this._isPending = true; + this._isCanceled = false; + this._rejectOnCancel = true; - /** - * Fast paths - */ + this._promise = new Promise((resolve, reject) => { + this._reject = reject; - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; + const onResolve = value => { + if (!this._isCanceled || !onCancel.shouldReject) { + this._isPending = false; + resolve(value); + } + }; - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } + const onReject = error => { + this._isPending = false; + reject(error); + }; - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); - } - return QMARK.repeat(chars.length); - } + const onCancel = handler => { + if (!this._isPending) { + throw new Error('The `onCancel` handler was attached after the promise settled.'); + } - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } + this._cancelHandlers.push(handler); + }; - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); - } - return star; - } - return esc ? m : `\\${m}`; - }); + Object.defineProperties(onCancel, { + shouldReject: { + get: () => this._rejectOnCancel, + set: boolean => { + this._rejectOnCancel = boolean; + } + } + }); - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); - }); - } - } + return executor(onResolve, onReject, onCancel); + }); + } - if (output === input && opts.contains === true) { - state.output = input; - return state; - } + then(onFulfilled, onRejected) { + // eslint-disable-next-line promise/prefer-await-to-then + return this._promise.then(onFulfilled, onRejected); + } - state.output = utils.wrapOutput(output, state, options); - return state; - } + catch(onRejected) { + return this._promise.catch(onRejected); + } - /** - * Tokenize input until we reach end-of-string - */ + finally(onFinally) { + return this._promise.finally(onFinally); + } - while (!eos()) { - value = advance(); + cancel(reason) { + if (!this._isPending || this._isCanceled) { + return; + } - if (value === '\u0000') { - continue; - } + this._isCanceled = true; - /** - * Escaped characters - */ + if (this._cancelHandlers.length > 0) { + try { + for (const handler of this._cancelHandlers) { + handler(); + } + } catch (error) { + this._reject(error); + return; + } + } - if (value === '\\') { - const next = peek(); + if (this._rejectOnCancel) { + this._reject(new CancelError(reason)); + } + } - if (next === '/' && opts.bash !== true) { - continue; - } + get isCanceled() { + return this._isCanceled; + } +} - if (next === '.' || next === ';') { - continue; - } +Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); - if (!next) { - value += '\\'; - push({ type: 'text', value }); - continue; - } +module.exports = PCancelable; +module.exports.CancelError = CancelError; - // collapse slashes to reduce potential for exploits - const match = /^\\+/.exec(remaining()); - let slashes = 0; - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - if (slashes % 2 !== 0) { - value += '\\'; - } - } - - if (opts.unescape === true) { - value = advance() || ''; - } else { - value += advance() || ''; - } - - if (state.brackets === 0) { - push({ type: 'text', value }); - continue; - } - } - - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ - - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - if (inner.includes('[')) { - prev.posix = true; - - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE[rest]; - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); - - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - continue; - } - } - } - } - - if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { - value = `\\${value}`; - } +/***/ }), - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } +/***/ 8569: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; - } +"use strict"; - prev.value += value; - append({ value }); - continue; - } - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ +module.exports = __nccwpck_require__(3322); - if (state.quotes === 1 && value !== '"') { - value = utils.escapeRegex(value); - prev.value += value; - append({ value }); - continue; - } - /** - * Double quotes - */ +/***/ }), - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - if (opts.keepQuotes === true) { - push({ type: 'text', value }); - } - continue; - } +/***/ 6099: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Parentheses - */ +"use strict"; - if (value === '(') { - increment('parens'); - push({ type: 'paren', value }); - continue; - } - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } +const path = __nccwpck_require__(1017); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; - const extglob = extglobs[extglobs.length - 1]; - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } +/** + * Posix glob regex + */ - push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); - decrement('parens'); - continue; - } +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; - /** - * Square brackets - */ +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); - } +/** + * Windows glob regex + */ - value = `\\${value}`; - } else { - increment('brackets'); - } +const WINDOWS_CHARS = { + ...POSIX_CHARS, - push({ type: 'bracket', value }); - continue; - } + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; - if (value === ']') { - if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { - push({ type: 'text', value, output: `\\${value}` }); - continue; - } +/** + * POSIX Bracket Regex + */ - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; - push({ type: 'text', value, output: `\\${value}` }); - continue; - } +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, - decrement('brackets'); + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - const prevValue = prev.value.slice(1); - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, - prev.value += value; - append({ value }); + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ - // when literal brackets are explicitly disabled - // assume we should match with a regex character class - if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { - continue; - } + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ - const escaped = utils.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ - // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } + CHAR_ASTERISK: 42, /* * */ - // when the user specifies nothing, try to match both - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; - } - - /** - * Braces - */ - - if (value === '{' && opts.nobrace !== true) { - increment('braces'); + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; + SEP: path.sep, - braces.push(open); - push(open); - continue; - } + /** + * Create EXTGLOB_CHARS + */ - if (value === '}') { - const brace = braces[braces.length - 1]; + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, - if (opts.nobrace === true || !brace) { - push({ type: 'text', value, output: value }); - continue; - } + /** + * Create GLOB_CHARS + */ - let output = ')'; + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - if (arr[i].type === 'brace') { - break; - } - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } +/***/ }), - output = expandRange(range, opts); - state.backtrack = true; - } +/***/ 2139: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - for (const t of toks) { - state.output += (t.output || t.value); - } - } +"use strict"; - push({ type: 'brace', value, output }); - decrement('braces'); - braces.pop(); - continue; - } - /** - * Pipes - */ +const constants = __nccwpck_require__(6099); +const utils = __nccwpck_require__(479); - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - push({ type: 'text', value }); - continue; - } +/** + * Constants + */ - /** - * Commas - */ +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; - if (value === ',') { - let output = value; +/** + * Helpers + */ - const brace = braces[braces.length - 1]; - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } - push({ type: 'comma', value, output }); - continue; - } + args.sort(); + const value = `[${args.join('-')}]`; - /** - * Slashes - */ + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - continue; - } + return value; +}; - push({ type: 'slash', value, output: SLASH_LITERAL }); - continue; - } +/** + * Create the message for a syntax error + */ - /** - * Dots - */ +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ - if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ type: 'text', value, output: DOT_LITERAL }); - continue; - } +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } - push({ type: 'dot', value, output: DOT_LITERAL }); - continue; - } + input = REPLACEMENTS[input] || input; - /** - * Question marks - */ + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (value === '?') { - const isGroup = prev && prev.value === '('; - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; - if (next === '<' && !utils.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); - if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { - output = `\\${value}`; - } + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); - push({ type: 'text', value, output }); - continue; - } + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ type: 'qmark', value, output: QMARK_NO_DOT }); - continue; - } + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; - push({ type: 'qmark', value, output: QMARK }); - continue; - } + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; - /** - * Exclamation - */ + if (opts.capture) { + star = `(${star})`; + } - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; - /** - * Plus - */ + input = utils.removePrefix(input, state); + len = input.length; - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; - if ((prev && prev.value === '(') || opts.regex === false) { - push({ type: 'plus', value, output: PLUS_LITERAL }); - continue; - } + /** + * Tokenizing helpers + */ - if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { - push({ type: 'plus', value }); - continue; - } + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; - push({ type: 'plus', value: PLUS_LITERAL }); - continue; - } + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; - /** - * Plain text - */ + const negate = () => { + let count = 1; - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ type: 'at', extglob: true, value, output: '' }); - continue; - } + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } - push({ type: 'text', value }); - continue; + if (count % 2 === 0) { + return false; } - /** - * Plain text - */ + state.negated = true; + state.start++; + return true; + }; - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } + const increment = type => { + state[type]++; + stack.push(type); + }; - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; - } + const decrement = type => { + state[type]--; + stack.pop(); + }; - push({ type: 'text', value }); - continue; - } + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ - /** - * Stars - */ + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } } - let rest = remaining(); - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; } - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; - if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { - push({ type: 'star', value, output: '' }); - continue; - } + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ type: 'star', value, output: '' }); - continue; - } + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; - // strip consecutive `/**/` - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - if (after && after !== '/') { - break; - } - rest = rest.slice(3); - consume('/**', 3); + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); } - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; } - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; + output = token.close = `)${expression})${extglobStar})`; } - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; + /** + * Fast paths + */ - state.output += prior.output + prev.output; - state.globstar = true; + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; - consume(value + advance()); + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } - push({ type: 'slash', value: '/', output: '' }); - continue; + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); } - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ type: 'slash', value: '/', output: '' }); - continue; + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); } - // remove single star from output - state.output = state.output.slice(0, -prev.output.length); + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); - // reset previous token to globstar - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } - // reset output with globstar - state.output += prev.output; - state.globstar = true; - consume(value); - continue; + if (output === input && opts.contains === true) { + state.output = input; + return state; } - const token = { type: 'star', value, output: star }; + state.output = utils.wrapOutput(output, state, options); + return state; + } - if (opts.bash === true) { - token.output = '.*?'; - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; - } - push(token); - continue; - } + /** + * Tokenize input until we reach end-of-string + */ - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); + while (!eos()) { + value = advance(); + + if (value === '\u0000') { continue; } - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; + /** + * Escaped characters + */ - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + if (opts.unescape === true) { + value = advance(); } else { - state.output += nodot; - prev.output += nodot; + value += advance(); } - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; } } - push(token); - } - - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils.escapeLast(state.output, '['); - decrement('brackets'); - } + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils.escapeLast(state.output, '('); - decrement('parens'); - } + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils.escapeLast(state.output, '{'); - decrement('braces'); - } + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); - } + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } - // rebuild the output if we had to backtrack at any point - if (state.backtrack === true) { - state.output = ''; + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } - if (token.suffix) { - state.output += token.suffix; + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; } - } - } - return state; -}; + prev.value += value; + append({ value }); + continue; + } -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ -parse.fastpaths = (input, options) => { - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } - input = REPLACEMENTS[input] || input; - const win32 = utils.isWindows(options); + /** + * Double quotes + */ - // create constants based on platform, for windows or posix - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants.globChars(win32); + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { negated: false, prefix: '' }; - let star = opts.bash === true ? '.*?' : STAR; + /** + * Parentheses + */ - if (opts.capture) { - star = `(${star})`; - } + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } - const globstar = (opts) => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + /** + * Square brackets + */ - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } - case '**': - return nodot + globstar(opts); + value = `\\${value}`; + } else { + increment('brackets'); + } - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + push({ type: 'bracket', value }); + continue; + } - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } - default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; + push({ type: 'text', value, output: `\\${value}` }); + continue; + } - const source = create(match[1]); - if (!source) return; + decrement('brackets'); - return source + DOT_LITERAL + match[2]; + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; } - } - }; - - const output = utils.removePrefix(input, state); - let source = create(output); - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; - } + prev.value += value; + append({ value }); - return source; -}; + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } -module.exports = parse; + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } -/***/ }), + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } -/***/ 3322: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Braces + */ -"use strict"; + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; -const path = __nccwpck_require__(5622); -const scan = __nccwpck_require__(2429); -const parse = __nccwpck_require__(2139); -const utils = __nccwpck_require__(479); -const constants = __nccwpck_require__(6099); -const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + braces.push(open); + push(open); + continue; + } -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ + if (value === '}') { + const brace = braces[braces.length - 1]; -const picomatch = (glob, options, returnState = false) => { - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; } - return false; - }; - return arrayMatcher; - } - - const isState = isObject(glob) && glob.tokens && glob.input; - - if (glob === '' || (typeof glob !== 'string' && !isState)) { - throw new TypeError('Expected pattern to be a non-empty string'); - } - const opts = options || {}; - const posix = utils.isWindows(options); - const regex = isState - ? picomatch.compileRe(glob, options) - : picomatch.makeRe(glob, options, false, true); + let output = ')'; - const state = regex.state; - delete regex.state; + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; - let isIgnored = () => false; - if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); - } + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } - const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); - const result = { glob, state, regex, posix, input, output, match, isMatch }; + output = expandRange(range, opts); + state.backtrack = true; + } - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; } - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - result.isMatch = false; - return returnObject ? result : false; - } + /** + * Pipes + */ - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; } - return returnObject ? result : true; - }; - - if (returnState) { - matcher.state = state; - } - return matcher; -}; + /** + * Commas + */ -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ + if (value === ',') { + let output = value; -picomatch.test = (input, regex, options, { glob, posix } = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); - } + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } - if (input === '') { - return { isMatch: false, output: '' }; - } + push({ type: 'comma', value, output }); + continue; + } - const opts = options || {}; - const format = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input === glob; - let output = (match && format) ? format(input) : input; + /** + * Slashes + */ - if (match === false) { - output = format ? format(input) : input; - match = output === glob; - } + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; } - } - - return { isMatch: Boolean(match), match, output }; -}; - -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ -picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); -}; + /** + * Dots + */ -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse(pattern, { ...options, fastpaths: false }); -}; + /** + * Question marks + */ -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } -picomatch.scan = (input, options) => scan(input, options); + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } -picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => { - if (returnOutput === true) { - return parsed.output; - } + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; + push({ type: 'text', value, output }); + continue; + } - let source = `${prepend}(?:${parsed.output})${append}`; - if (parsed && parsed.negated === true) { - source = `^(?!${source}).*$`; - } + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } - const regex = picomatch.toRegex(source, options); - if (returnState === true) { - regex.state = parsed; - } + push({ type: 'qmark', value, output: QMARK }); + continue; + } - return regex; -}; + /** + * Exclamation + */ -picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); - } + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } - const opts = options || {}; - let parsed = { negated: false, fastpaths: true }; - let prefix = ''; - let output; + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } - if (input.startsWith('./')) { - input = input.slice(2); - prefix = parsed.prefix = './'; - } + /** + * Plus + */ - if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - output = parse.fastpaths(input, options); - } + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } - if (output === undefined) { - parsed = parse(input, options); - parsed.prefix = prefix + (parsed.prefix || ''); - } else { - parsed.output = output; - } + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } - return picomatch.compileRe(parsed, options, returnOutput, returnState); -}; + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; - } -}; + /** + * Plain text + */ -/** - * Picomatch constants. - * @return {Object} - */ + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } -picomatch.constants = constants; + push({ type: 'text', value }); + continue; + } -/** - * Expose "picomatch" - */ + /** + * Plain text + */ -module.exports = picomatch; + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } -/***/ }), + push({ type: 'text', value }); + continue; + } -/***/ 2429: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Stars + */ -"use strict"; + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } -const utils = __nccwpck_require__(479); -const { - CHAR_ASTERISK, /* * */ - CHAR_AT, /* @ */ - CHAR_BACKWARD_SLASH, /* \ */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_EXCLAMATION_MARK, /* ! */ - CHAR_FORWARD_SLASH, /* / */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_PLUS, /* + */ - CHAR_QUESTION_MARK, /* ? */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __nccwpck_require__(6099); + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; - } -}; + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), and `negated` (true if the path starts with `!`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } -const scan = (input, options) => { - const opts = options || {}; + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { value: '', depth: 0, isGlob: false }; + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; - const eos = () => index >= length; - const peek = () => str.charCodeAt(index + 1); - const advance = () => { - prev = code; - return str.charCodeAt(++index); - }; + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } - while (index < length) { - code = advance(); - let next; + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; - if (code === CHAR_LEFT_CURLY_BRACE) { - braceEscaped = true; - } - continue; - } - - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { - braces++; - - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } - - if (code === CHAR_LEFT_CURLY_BRACE) { - braces++; - continue; - } - - if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; - break; - } + state.output += prior.output + prev.output; + state.globstar = true; - if (code === CHAR_RIGHT_CURLY_BRACE) { - braces--; + consume(value + advance()); - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; - break; - } - } + push({ type: 'slash', value: '/', output: '' }); + continue; } - if (scanToEnd === true) { + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); continue; } - break; + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; } - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { value: '', depth: 0, isGlob: false }; + const token = { type: 'star', value, output: star }; - if (finished === true) continue; - if (prev === CHAR_DOT && index === (start + 1)) { - start += 2; - continue; + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; } - - lastIndex = index + 1; + push(token); continue; } - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS - || code === CHAR_AT - || code === CHAR_ASTERISK - || code === CHAR_QUESTION_MARK - || code === CHAR_EXCLAMATION_MARK; + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - continue; - } - break; + } else { + state.output += nodot; + prev.output += nodot; } - } - - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; - if (scanToEnd === true) { - continue; + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; } - break; } - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - break; - } + push(token); + } - if (code === CHAR_LEFT_SQUARE_BRACKET) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } - if (scanToEnd === true) { - continue; - } - break; - } - } - } + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; - continue; - } + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; - if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; - break; - } - } - continue; + if (token.suffix) { + state.output += token.suffix; } - break; } + } - if (isGlob === true) { - finished = true; - - if (scanToEnd === true) { - continue; - } + return state; +}; - break; - } - } +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ - if (opts.noext === true) { - isExtglob = false; - isGlob = false; +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } - let base = str; - let prefix = ''; - let glob = ''; + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; - } + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; - } + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } + if (opts.capture) { + star = `(${star})`; } - if (opts.unescape === true) { - if (glob) glob = utils.removeBackslashes(glob); + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; - if (base && backslashes === true) { - base = utils.removeBackslashes(base); - } - } + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated - }; + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; - if (opts.tokens === true) { - state.maxDepth = 0; - if (!isPathSeparator(code)) { - tokens.push(token); - } - state.tokens = tokens; - } + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - if (opts.parts === true || opts.tokens === true) { - let prevIndex; + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - if (idx !== 0 || value !== '') { - parts.push(value); - } - prevIndex = i; - } + case '**': + return nodot + globstar(opts); - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; } } + }; - state.slashes = slashes; - state.parts = parts; + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; } - return state; + return source; }; -module.exports = scan; +module.exports = parse; /***/ }), -/***/ 479: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3322: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __nccwpck_require__(5622); -const win32 = process.platform === 'win32'; -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = __nccwpck_require__(6099); - -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); - -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); -}; +const path = __nccwpck_require__(1017); +const scan = __nccwpck_require__(2429); +const parse = __nccwpck_require__(2139); +const utils = __nccwpck_require__(479); +const constants = __nccwpck_require__(6099); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { - return true; - } - return false; -}; +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; } - return win32 === true || path.sep === '\\'; -}; -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; -}; + const isState = isObject(glob) && glob.tokens && glob.input; -exports.removePrefix = (input, state = {}) => { - let output = input; - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); } - return output; -}; -exports.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); - let output = `${prepend}(?:${input})${append}`; - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; - } - return output; -}; + const state = regex.state; + delete regex.state; + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } -/***/ }), + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; -/***/ 8341: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } -var once = __nccwpck_require__(1223) -var eos = __nccwpck_require__(1205) -var fs = __nccwpck_require__(5747) // we only need fs to get the ReadStream and WriteStream prototypes + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' -} - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) + if (returnState) { + matcher.state = state; + } - var closed = false - stream.on('close', function () { - closed = true - }) + return matcher; +}; - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + if (input === '') { + return { isMatch: false, output: '' }; + } - if (isFn(stream.destroy)) return stream.destroy() + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; - callback(err || new Error('stream was destroyed')) + if (match === false) { + output = format ? format(input) : input; + match = output === glob; } -} -var call = function (fn) { - fn() -} + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } -var pipe = function (from, to) { - return from.pipe(to) -} + return { isMatch: Boolean(match), match, output }; +}; -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ - return streams.reduce(pipe) -} +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); -module.exports = pump +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; -/***/ }), +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ -/***/ 9273: -/***/ ((module) => { +picomatch.scan = (input, options) => scan(input, options); -"use strict"; +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } -class QuickLRU { - constructor(options = {}) { - if (!(options.maxSize && options.maxSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; - this.maxSize = options.maxSize; - this.onEviction = options.onEviction; - this.cache = new Map(); - this.oldCache = new Map(); - this._size = 0; - } + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } - _set(key, value) { - this.cache.set(key, value); - this._size++; + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } - if (this._size >= this.maxSize) { - this._size = 0; + return regex; +}; - if (typeof this.onEviction === 'function') { - for (const [key, value] of this.oldCache.entries()) { - this.onEviction(key, value); - } - } +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ - this.oldCache = this.cache; - this.cache = new Map(); - } - } - - get(key) { - if (this.cache.has(key)) { - return this.cache.get(key); - } - - if (this.oldCache.has(key)) { - const value = this.oldCache.get(key); - this.oldCache.delete(key); - this._set(key, value); - return value; - } - } - - set(key, value) { - if (this.cache.has(key)) { - this.cache.set(key, value); - } else { - this._set(key, value); - } - - return this; - } - - has(key) { - return this.cache.has(key) || this.oldCache.has(key); - } - - peek(key) { - if (this.cache.has(key)) { - return this.cache.get(key); - } - - if (this.oldCache.has(key)) { - return this.oldCache.get(key); - } - } +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } - delete(key) { - const deleted = this.cache.delete(key); - if (deleted) { - this._size--; - } + let parsed = { negated: false, fastpaths: true }; - return this.oldCache.delete(key) || deleted; - } + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } - clear() { - this.cache.clear(); - this.oldCache.clear(); - this._size = 0; - } + if (!parsed.output) { + parsed = parse(input, options); + } - * keys() { - for (const [key] of this) { - yield key; - } - } + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; - * values() { - for (const [, value] of this) { - yield value; - } - } +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ - * [Symbol.iterator]() { - for (const item of this.cache) { - yield item; - } +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; - for (const item of this.oldCache) { - const [key] = item; - if (!this.cache.has(key)) { - yield item; - } - } - } +/** + * Picomatch constants. + * @return {Object} + */ - get size() { - let oldCacheSize = 0; - for (const key of this.oldCache.keys()) { - if (!this.cache.has(key)) { - oldCacheSize++; - } - } +picomatch.constants = constants; - return Math.min(this._size + oldCacheSize, this.maxSize); - } -} +/** + * Expose "picomatch" + */ -module.exports = QuickLRU; +module.exports = picomatch; /***/ }), -/***/ 6624: +/***/ 2429: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const tls = __nccwpck_require__(4016); -module.exports = (options = {}) => new Promise((resolve, reject) => { - const socket = tls.connect(options, () => { - if (options.resolveSocket) { - socket.off('error', reject); - resolve({alpnProtocol: socket.alpnProtocol, socket}); - } else { - socket.destroy(); - resolve({alpnProtocol: socket.alpnProtocol}); - } - }); +const utils = __nccwpck_require__(479); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = __nccwpck_require__(6099); - socket.on('error', reject); -}); +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; -/***/ }), +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ -/***/ 9004: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const scan = (input, options) => { + const opts = options || {}; -"use strict"; + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; -const Readable = __nccwpck_require__(2413).Readable; -const lowercaseKeys = __nccwpck_require__(9662); + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; -class Response extends Readable { - constructor(statusCode, headers, body, url) { - if (typeof statusCode !== 'number') { - throw new TypeError('Argument `statusCode` should be a number'); - } - if (typeof headers !== 'object') { - throw new TypeError('Argument `headers` should be an object'); - } - if (!(body instanceof Buffer)) { - throw new TypeError('Argument `body` should be a buffer'); - } - if (typeof url !== 'string') { - throw new TypeError('Argument `url` should be a string'); - } + while (index < length) { + code = advance(); + let next; - super(); - this.statusCode = statusCode; - this.headers = lowercaseKeys(headers); - this.body = body; - this.url = url; - } + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); - _read() { - this.push(this.body); - this.push(null); - } -} + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } -module.exports = Response; + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } -/***/ }), - -/***/ 2113: -/***/ ((module) => { + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } -"use strict"; + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } -function reusify (Constructor) { - var head = new Constructor() - var tail = head + break; + } - function get () { - var current = head + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; - if (current.next) { - head = current.next - } else { - head = new Constructor() - tail = head - } + if (scanToEnd === true) { + continue; + } - current.next = null + break; + } - return current - } + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; - function release (obj) { - tail.next = obj - tail = obj - } + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } - return { - get: get, - release: release - } -} + if (scanToEnd === true) { + continue; + } -module.exports = reusify + break; + } + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; -/***/ }), + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } -/***/ 5288: -/***/ ((module) => { + lastIndex = index + 1; + continue; + } -/*! run-parallel. MIT License. Feross Aboukhadijeh */ -module.exports = runParallel + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; -function runParallel (tasks, cb) { - var results, pending, keys - var isSync = true + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } - if (Array.isArray(tasks)) { - results = [] - pending = tasks.length - } else { - keys = Object.keys(tasks) - results = {} - pending = keys.length - } + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } - function done (err) { - function end () { - if (cb) cb(err, results) - cb = null + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } } - if (isSync) process.nextTick(end) - else end() - } - function each (i, err, result) { - results[i] = result - if (--pending === 0 || err) { - done(err) + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; } - } - if (!pending) { - // empty - done(null) - } else if (keys) { - // object - keys.forEach(function (key) { - tasks[key](function (err, result) { each(key, err, result) }) - }) - } else { - // array - tasks.forEach(function (task, i) { - task(function (err, result) { each(i, err, result) }) - }) - } + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; - isSync = false -} + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } -/***/ }), + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } -/***/ 2043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (scanToEnd === true) { + continue; + } -;(function (sax) { // wrapper for non-node envs - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream + break; + } - // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. - // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), - // since that's the earliest that a buffer overrun could occur. This way, checks are - // as rare as required, but as often as necessary to ensure never crossing this bound. - // Furthermore, buffers are only tested at most once per write(), so passing a very - // large string into write() might have undesirable effects, but this is manageable by - // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme - // edge case, result in creating at most one complete copy of the string passed in. - // Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } - var buffers = [ - 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', - 'procInstName', 'procInstBody', 'entity', 'attribName', - 'attribValue', 'cdata', 'script' - ] + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; - sax.EVENTS = [ - 'text', - 'processinginstruction', - 'sgmldeclaration', - 'doctype', - 'comment', - 'opentagstart', - 'attribute', - 'opentag', - 'closetag', - 'opencdata', - 'cdata', - 'closecdata', - 'error', - 'end', - 'ready', - 'script', - 'opennamespace', - 'closenamespace' - ] + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) { - return new SAXParser(strict, opt) + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; } - var parser = this - clearBuffers(parser) - parser.q = parser.c = '' - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.strictEntities = parser.opt.strictEntities - parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) - parser.attribList = [] + if (isGlob === true) { + finished = true; - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) { - parser.ns = Object.create(rootNS) - } + if (scanToEnd === true) { + continue; + } - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 + break; } - emit(parser, 'onready') } - if (!Object.create) { - Object.create = function (o) { - function F () {} - F.prototype = o - var newf = new F() - return newf - } + if (opts.noext === true) { + isExtglob = false; + isGlob = false; } - if (!Object.keys) { - Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a - } + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; } - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - var maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case 'textNode': - closeText(parser) - break + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } - case 'cdata': - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - break + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } - case 'script': - emitNode(parser, 'onscript', parser.script) - parser.script = '' - break + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); - default: - error(parser, 'Max buffer length exceeded: ' + buffers[i]) - } - } - maxActual = Math.max(maxActual, len) + if (base && backslashes === true) { + base = utils.removeBackslashes(base); } - // schedule the next check for the earliest possible buffer overrun. - var m = sax.MAX_BUFFER_LENGTH - maxActual - parser.bufferCheckPosition = m + parser.position } - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i++) { - parser[buffers[i]] = '' + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); } + state.tokens = tokens; } - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== '') { - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; } - if (parser.script !== '') { - emitNode(parser, 'onscript', parser.script) - parser.script = '' + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } } - } - SAXParser.prototype = { - end: function () { end(this) }, - write: write, - resume: function () { this.error = null; return this }, - close: function () { return this.write(null) }, - flush: function () { flushBuffers(this) } + state.slashes = slashes; + state.parts = parts; } - var Stream - try { - Stream = __nccwpck_require__(2413).Stream - } catch (ex) { - Stream = function () {} - } + return state; +}; - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== 'error' && ev !== 'end' - }) +module.exports = scan; - function createStream (strict, opt) { - return new SAXStream(strict, opt) - } - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) { - return new SAXStream(strict, opt) - } +/***/ }), - Stream.apply(this) +/***/ 479: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true +"use strict"; - var me = this - this._parser.onend = function () { - me.emit('end') - } +const path = __nccwpck_require__(1017); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = __nccwpck_require__(6099); - this._parser.onerror = function (er) { - me.emit('error', er) +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null - } +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; - this._decoder = null +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; - streamWraps.forEach(function (ev) { - Object.defineProperty(me, 'on' + ev, { - get: function () { - return me._parser['on' + ev] - }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - me._parser['on' + ev] = h - return h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; } + return win32 === true || path.sep === '\\'; +}; - SAXStream.prototype = Object.create(Stream.prototype, { - constructor: { - value: SAXStream - } - }) - - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = __nccwpck_require__(4304).StringDecoder - this._decoder = new SD('utf8') - } - data = this._decoder.write(data) - } +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; - this._parser.write(data.toString()) - this.emit('data', data) - return true +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; } + return output; +}; - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) { - this.write(chunk) - } - this._parser.end() - return true +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; } + return output; +}; - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { - me._parser['on' + ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - return Stream.prototype.on.call(me, ev, handler) - } +/***/ }), - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - var CDATA = '[CDATA[' - var DOCTYPE = 'DOCTYPE' - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' - var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' - var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } +/***/ 8341: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // http://www.w3.org/TR/REC-xml/#NT-NameStartChar - // This implementation works on strings, a single character at a time - // as such, it cannot ever support astral-plane characters (10000-EFFFF) - // without a significant breaking change to either this parser, or the - // JavaScript language. Implementation of an emoji-capable xml parser - // is left as an exercise for the reader. - var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ +var once = __nccwpck_require__(1223) +var eos = __nccwpck_require__(1205) +var fs = __nccwpck_require__(7147) // we only need fs to get the ReadStream and WriteStream prototypes - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) - var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ +var isFn = function (fn) { + return typeof fn === 'function' +} - function isWhitespace (c) { - return c === ' ' || c === '\n' || c === '\r' || c === '\t' - } +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} - function isQuote (c) { - return c === '"' || c === '\'' - } +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} - function isAttribEnd (c) { - return c === '>' || isWhitespace(c) - } +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) - function isMatch (regex, c) { - return regex.test(c) - } + var closed = false + stream.on('close', function () { + closed = true + }) - function notMatch (regex, c) { - return !isMatch(regex, c) - } + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) - var S = 0 - sax.STATE = { - BEGIN: S++, // leading byte order mark or whitespace - BEGIN_WHITESPACE: S++, // leading whitespace - TEXT: S++, // general stuff - TEXT_ENTITY: S++, // & and such. - OPEN_WAKA: S++, // < - SGML_DECL: S++, // - SCRIPT: S++, //