@skyramp/mcp 0.4.1 → 0.4.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/localDevTestChangesCommand.js +2 -1
- package/build/commands/recommendTestsAndExecuteCommand.js +15 -7
- package/build/commands/testThisEndpointCommand.js +35 -6
- package/build/execution/wrapperConfig.d.ts +56 -0
- package/build/execution/wrapperConfig.js +155 -0
- package/build/index.js +40 -10
- package/build/playwright/blueprintDigest.js +28 -7
- package/build/playwright/registerPlaywrightTools.js +47 -28
- package/build/playwright/traceExportStore.d.ts +22 -0
- package/build/playwright/traceExportStore.js +81 -0
- package/build/playwright/traceRecordingPrompt.js +11 -3
- package/build/prompts/code-reuse.js +118 -49
- package/build/prompts/fix-error-prompt.d.ts +9 -1
- package/build/prompts/fix-error-prompt.js +31 -28
- package/build/prompts/local-dev/local-dev-plan.d.ts +3 -0
- package/build/prompts/local-dev/local-dev-plan.js +8 -23
- package/build/prompts/local-dev/local-dev-prompts.d.ts +1 -1
- package/build/prompts/local-dev/local-dev-prompts.js +31 -4
- package/build/prompts/modularization/integration-test-modularization.js +13 -6
- package/build/prompts/modularization/ui-test-modularization.js +1 -1
- package/build/prompts/personas.js +1 -1
- package/build/prompts/pom-aware-code-reuse.js +7 -9
- package/build/prompts/reuse-hand-off.d.ts +64 -0
- package/build/prompts/reuse-hand-off.js +130 -0
- package/build/prompts/shared-helper-policy.d.ts +124 -2
- package/build/prompts/shared-helper-policy.js +178 -12
- package/build/prompts/startTraceCollectionPrompts.js +1 -1
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +7 -8
- package/build/prompts/sut-setup/modes/dockerComposePrompt.js +1 -1
- package/build/prompts/sut-setup/shared.d.ts +4 -1
- package/build/prompts/sut-setup/shared.js +6 -4
- package/build/prompts/test-maintenance/actionsInstructions.d.ts +19 -11
- package/build/prompts/test-maintenance/actionsInstructions.js +47 -26
- package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +16 -8
- package/build/prompts/test-maintenance/drift-analysis-prompt.js +93 -38
- package/build/prompts/test-maintenance/driftAnalysisSections.js +5 -3
- package/build/prompts/test-maintenance/driftAnalysisShared.js +4 -2
- package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +8 -5
- package/build/prompts/test-recommendation/recommendationSections.js +19 -8
- package/build/prompts/test-recommendation/recommendationShared.d.ts +1 -1
- package/build/prompts/test-recommendation/recommendationShared.js +0 -1
- package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +5 -2
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +10 -7
- package/build/prompts/testbot/testbot-prompts.js +133 -63
- package/build/recommendation/answers.js +18 -9
- package/build/recommendation/pullRequestText.js +1 -1
- package/build/recommendation/registerPlan.js +31 -17
- package/build/recommendation/subjectStep.d.ts +8 -10
- package/build/recommendation/subjectStep.js +17 -16
- package/build/recommendation/types.d.ts +71 -17
- package/build/recommendation/types.js +9 -15
- package/build/recommendation/verifierContracts.d.ts +7 -3
- package/build/recommendation/verifierContracts.js +8 -4
- package/build/recommendation/verifiers/changedFile.js +11 -13
- package/build/recommendation/verifiers/citedPath.d.ts +8 -0
- package/build/recommendation/verifiers/citedPath.js +16 -2
- package/build/recommendation/verifiers/coverage.d.ts +2 -2
- package/build/recommendation/verifiers/coverage.js +190 -134
- package/build/recommendation/verifiers/defects.js +56 -16
- package/build/recommendation/verifiers/deliveredMatchesPlan.d.ts +7 -1
- package/build/recommendation/verifiers/deliveredMatchesPlan.js +28 -14
- package/build/recommendation/verifiers/endpointGrounded.js +14 -8
- package/build/recommendation/verifiers/existingCoverage.d.ts +6 -0
- package/build/recommendation/verifiers/existingCoverage.js +30 -21
- package/build/recommendation/verifiers/expectedOutcome.js +17 -8
- package/build/recommendation/verifiers/expectedValueSourced.js +54 -43
- package/build/recommendation/verifiers/issueTraceability.d.ts +5 -0
- package/build/recommendation/verifiers/issueTraceability.js +64 -7
- package/build/recommendation/verifiers/removedElementGuarded.js +19 -11
- package/build/recommendation/verifiers/reportedCategory.js +9 -4
- package/build/recommendation/verifiers/requirementSourced.js +34 -21
- package/build/recommendation/verifiers/screenRoute.js +15 -10
- package/build/recommendation/verifiers/statedDifference.js +15 -8
- package/build/recommendation/verifiers/uiElementGrounded.js +50 -16
- package/build/resources/analysisResources.js +7 -3
- package/build/resources/progressResource.js +4 -2
- package/build/resources/sutSetupResource.js +20 -2
- package/build/resources/testbotResource.js +19 -1
- package/build/services/AnalyticsService.js +3 -1
- package/build/services/ScenarioGenerationService.js +5 -5
- package/build/services/TestDiscoveryService.js +53 -9
- package/build/services/TestExecutionService.js +63 -21
- package/build/services/TestGenerationService.d.ts +1 -1
- package/build/services/TestGenerationService.js +43 -24
- package/build/skills/enhanceAssertionsSkill.d.ts +45 -0
- package/build/skills/enhanceAssertionsSkill.js +103 -0
- package/build/skills/fixTestImportErrorsSkill.d.ts +2 -2
- package/build/skills/fixTestImportErrorsSkill.js +2 -2
- package/build/skills/runTestSkill.d.ts +6 -0
- package/build/skills/runTestSkill.js +17 -0
- package/build/skills/skillFiles.d.ts +38 -0
- package/build/skills/skillFiles.js +94 -0
- package/build/skills/validateAssertionAlignmentSkill.d.ts +34 -0
- package/build/skills/validateAssertionAlignmentSkill.js +59 -0
- package/build/tool-phases.js +4 -1
- package/build/tools/auth/loginTool.js +3 -1
- package/build/tools/auth/logoutTool.js +3 -1
- package/build/tools/budgetExcuse.d.ts +15 -0
- package/build/tools/budgetExcuse.js +113 -0
- package/build/tools/code-refactor/alignAssertionsTool.d.ts +2 -0
- package/build/tools/code-refactor/alignAssertionsTool.js +51 -0
- package/build/tools/code-refactor/assertion-state.d.ts +1 -1
- package/build/tools/code-refactor/assertion-state.js +1 -1
- package/build/tools/code-refactor/assertionOperations.d.ts +44 -0
- package/build/tools/code-refactor/assertionOperations.js +82 -0
- package/build/tools/code-refactor/assertionSkillTools.d.ts +3 -0
- package/build/tools/code-refactor/assertionSkillTools.js +86 -0
- package/build/tools/code-refactor/codeReuseTool.js +27 -3
- package/build/tools/code-refactor/enhanceAssertionsTool.js +19 -83
- package/build/tools/code-refactor/gate-markers.d.ts +51 -0
- package/build/tools/code-refactor/gate-markers.js +95 -0
- package/build/tools/code-refactor/retrofit-state.d.ts +3 -1
- package/build/tools/code-refactor/retrofit-state.js +44 -2
- package/build/tools/code-refactor/reuse-outcome.d.ts +23 -1
- package/build/tools/code-refactor/reuse-outcome.js +36 -13
- package/build/tools/code-refactor/reuse-state.d.ts +90 -16
- package/build/tools/code-refactor/reuse-state.js +191 -61
- package/build/tools/code-refactor/utils-verify-gates.d.ts +4 -0
- package/build/tools/code-refactor/utils-verify-gates.js +269 -30
- package/build/tools/code-refactor/verify-gates.d.ts +15 -1
- package/build/tools/code-refactor/verify-gates.js +36 -4
- package/build/tools/enrichTestWithMocksTool.d.ts +1 -1
- package/build/tools/enrichTestWithMocksTool.js +9 -5
- package/build/tools/executeSkyrampTestTool.d.ts +118 -48
- package/build/tools/executeSkyrampTestTool.js +998 -372
- package/build/tools/execution-video-state.js +1 -1
- package/build/tools/fixErrorTool.js +5 -6
- package/build/tools/generate-tests/batchMockGenerationTool.js +1 -1
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +114 -73
- package/build/tools/generate-tests/generateContractRestTool.js +34 -16
- package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -0
- package/build/tools/generate-tests/generateE2ERestTool.js +9 -1
- package/build/tools/generate-tests/generateIntegrationRestTool.js +22 -7
- package/build/tools/generate-tests/generateMockRestTool.js +3 -1
- package/build/tools/generate-tests/generateUIRestTool.d.ts +2 -0
- package/build/tools/generate-tests/generateUIRestTool.js +11 -2
- package/build/tools/generate-tests/loadTestSchema.js +1 -3
- package/build/tools/generate-tests/planGuard.js +6 -3
- package/build/tools/generate-tests/scenarioFileIdentity.js +4 -1
- package/build/tools/generate-tests/scenarioLint.js +17 -5
- package/build/tools/generate-tests/trace-reuse-guard.js +5 -2
- package/build/tools/generateEnrichedIntegrationTestTool.js +9 -3
- package/build/tools/one-click/oneClickTool.js +3 -1
- package/build/tools/preflightMockCheckTool.js +23 -7
- package/build/tools/submitReportTool.d.ts +51 -12
- package/build/tools/submitReportTool.js +988 -161
- package/build/tools/test-management/actionsTool.js +241 -51
- package/build/tools/test-management/analyzeChangesTool.d.ts +8 -9
- package/build/tools/test-management/analyzeChangesTool.js +127 -68
- package/build/tools/test-management/analyzeTestHealthTool.d.ts +0 -11
- package/build/tools/test-management/analyzeTestHealthTool.js +42 -76
- package/build/tools/test-management/registerTestPlanTool.d.ts +44 -34
- package/build/tools/test-management/registerTestPlanTool.js +255 -111
- package/build/tools/test-management/resolveScreenTool.js +33 -9
- package/build/tools/test-management/testsOwedBeforeRun.d.ts +28 -0
- package/build/tools/test-management/testsOwedBeforeRun.js +53 -0
- package/build/tools/trace/startTraceCollectionTool.js +3 -1
- package/build/tools/trace/stopTraceCollectionTool.js +42 -6
- package/build/tools/verifyTestDependenciesTool.d.ts +3 -0
- package/build/tools/verifyTestDependenciesTool.js +54 -0
- package/build/tools/workspace/initScanWorkspaceTool.js +9 -3
- package/build/tools/workspace/initializeWorkspaceTool.js +3 -1
- package/build/types/AssertionOutcome.d.ts +1 -1
- package/build/types/EnhanceType.d.ts +6 -0
- package/build/types/EnhanceType.js +1 -0
- package/build/types/RepositoryAnalysis.d.ts +32 -72
- package/build/types/ReuseOutcome.d.ts +100 -7
- package/build/types/ReuseOutcome.js +16 -0
- package/build/types/StepMethod.js +20 -6
- package/build/types/TestAnalysis.d.ts +10 -2
- package/build/types/TestExecution.d.ts +45 -0
- package/build/types/TestRecommendation.d.ts +1 -1
- package/build/types/TestRecommendation.js +4 -1
- package/build/types/TestTypes.d.ts +16 -0
- package/build/types/TestTypes.js +40 -3
- package/build/types/TestbotPromptOptions.d.ts +9 -1
- package/build/types/TestbotReport.d.ts +45 -9
- package/build/utils/AnalysisStateManager.d.ts +137 -34
- package/build/utils/AnalysisStateManager.js +228 -44
- package/build/utils/assertion-verify/api-shared-lints.js +34 -16
- package/build/utils/assertion-verify/metrics.js +39 -6
- package/build/utils/assertion-verify/ui-lints.js +4 -2
- package/build/utils/branchDiff.js +47 -12
- package/build/utils/canonicalJson.js +3 -1
- package/build/utils/connectionErrors.d.ts +10 -0
- package/build/utils/connectionErrors.js +10 -0
- package/build/utils/dartRouteExtractor.js +36 -7
- package/build/utils/fixAttempts.d.ts +26 -0
- package/build/utils/fixAttempts.js +109 -0
- package/build/utils/frontendSelectors.js +23 -4
- package/build/utils/generatedTestRecord.d.ts +19 -0
- package/build/utils/generatedTestRecord.js +61 -0
- package/build/utils/gitStaging.js +7 -2
- package/build/utils/initAgent.js +26 -6
- package/build/utils/language-helper.js +60 -45
- package/build/utils/pathMatching.js +2 -1
- package/build/utils/pathSignatures.js +6 -2
- package/build/utils/planMatchKeys.d.ts +2 -2
- package/build/utils/planMatchKeys.js +20 -14
- package/build/utils/pom-catalog-parse.js +7 -2
- package/build/utils/pom-scope/import-expansion.js +6 -1
- package/build/utils/pom-scope/index.js +50 -12
- package/build/utils/pom-scope/scoring.js +13 -3
- package/build/utils/pom-scope/selector-extractor.js +16 -3
- package/build/utils/pom-scope/strip.d.ts +8 -0
- package/build/utils/pom-scope/strip.js +238 -0
- package/build/utils/pom-scope/testIdDiscovery.js +14 -2
- package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.d.ts +1 -1
- package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.js +4 -2
- package/build/utils/pom-verify/__fixtures__/af-style/report.iframe.page.js +3 -1
- package/build/utils/pom-verify/__fixtures__/af-style/workflow-footer.page.js +3 -1
- package/build/utils/pom-verify/bindings.js +5 -1
- package/build/utils/pom-verify/calls.js +9 -2
- package/build/utils/pom-verify/verify.js +27 -5
- package/build/utils/pr-comment-parser.js +20 -7
- package/build/utils/progress.d.ts +1 -1
- package/build/utils/progress.js +1 -1
- package/build/utils/proxy-terminal.d.ts +19 -1
- package/build/utils/proxy-terminal.js +346 -21
- package/build/utils/rebaselineSnapshots.d.ts +1 -1
- package/build/utils/rebaselineSnapshots.js +6 -16
- package/build/utils/removedUiElements.js +1 -1
- package/build/utils/reportLanguage.js +35 -7
- package/build/utils/reportVerification.d.ts +14 -8
- package/build/utils/reportVerification.js +19 -19
- package/build/utils/repositorySlug.d.ts +32 -0
- package/build/utils/repositorySlug.js +77 -0
- package/build/utils/reuseRouting.d.ts +10 -0
- package/build/utils/reuseRouting.js +21 -2
- package/build/utils/runContextGauge.d.ts +27 -0
- package/build/utils/runContextGauge.js +181 -0
- package/build/utils/runSerialized.d.ts +3 -0
- package/build/utils/runSerialized.js +39 -0
- package/build/utils/screenRoutes.js +74 -18
- package/build/utils/skyrampMdContent.d.ts +1 -1
- package/build/utils/skyrampMdContent.js +1 -1
- package/build/utils/skyrampSdkVersion.d.ts +9 -0
- package/build/utils/skyrampSdkVersion.js +16 -0
- package/build/utils/sourceRouteExtractor.js +13 -6
- package/build/utils/telemetry.d.ts +1 -0
- package/build/utils/telemetry.js +8 -5
- package/build/utils/testDependencyPolicy.d.ts +9 -0
- package/build/utils/testDependencyPolicy.js +809 -0
- package/build/utils/testExecutionRecord.d.ts +94 -0
- package/build/utils/testExecutionRecord.js +269 -0
- package/build/utils/testFileClassification.d.ts +8 -0
- package/build/utils/testFileClassification.js +39 -4
- package/build/utils/trace-parser.js +62 -14
- package/build/utils/urlPath.js +3 -1
- package/build/utils/utils-verify/action-key.d.ts +46 -0
- package/build/utils/utils-verify/action-key.js +120 -38
- package/build/utils/utils-verify/action-sites.d.ts +32 -0
- package/build/utils/utils-verify/action-sites.js +202 -0
- package/build/utils/utils-verify/allow.d.ts +122 -3
- package/build/utils/utils-verify/allow.js +146 -21
- package/build/utils/utils-verify/body-reach.d.ts +120 -0
- package/build/utils/utils-verify/body-reach.js +333 -0
- package/build/utils/utils-verify/call-sites.d.ts +31 -7
- package/build/utils/utils-verify/call-sites.js +80 -13
- package/build/utils/utils-verify/delivered-imports.d.ts +43 -0
- package/build/utils/utils-verify/delivered-imports.js +84 -0
- package/build/utils/utils-verify/fixed-sleep.d.ts +96 -0
- package/build/utils/utils-verify/fixed-sleep.js +461 -0
- package/build/utils/utils-verify/in-house.d.ts +93 -0
- package/build/utils/utils-verify/in-house.js +719 -0
- package/build/utils/utils-verify/incumbent.d.ts +3 -0
- package/build/utils/utils-verify/incumbent.js +75 -0
- package/build/utils/utils-verify/index.d.ts +2 -0
- package/build/utils/utils-verify/index.js +2 -0
- package/build/utils/utils-verify/language-spec.d.ts +51 -10
- package/build/utils/utils-verify/language-spec.js +232 -21
- package/build/utils/utils-verify/locate.d.ts +26 -0
- package/build/utils/utils-verify/locate.js +125 -23
- package/build/utils/utils-verify/module-name.d.ts +40 -0
- package/build/utils/utils-verify/module-name.js +98 -0
- package/build/utils/utils-verify/parse.d.ts +56 -7
- package/build/utils/utils-verify/parse.js +195 -40
- package/build/utils/utils-verify/retrofit-equivalence.d.ts +5 -0
- package/build/utils/utils-verify/retrofit-equivalence.js +4 -2
- package/build/utils/utils-verify/stage.d.ts +5 -0
- package/build/utils/utils-verify/stage.js +47 -2
- package/build/utils/utils-verify/status-once.d.ts +62 -0
- package/build/utils/utils-verify/status-once.js +207 -0
- package/build/utils/utils-verify/typecheck.d.ts +61 -0
- package/build/utils/utils-verify/typecheck.js +338 -0
- package/build/utils/utils-verify/verify.d.ts +79 -3
- package/build/utils/utils-verify/verify.js +531 -61
- package/build/utils/versions.d.ts +3 -3
- package/build/utils/versions.js +1 -1
- package/build/utils/workspaceAuth.js +107 -37
- package/build/workspace/queryParamResolution.js +11 -4
- package/build/workspace/workspace.d.ts +72 -52
- package/build/workspace/workspace.js +19 -15
- package/node_modules/playwright/ThirdPartyNotices.txt +19 -19
- package/node_modules/playwright/lib/mcp/skyramp/assertTool.js +8 -2
- package/node_modules/playwright/lib/mcp/skyramp/common/cssValue.js +87 -0
- package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +31 -0
- package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +3 -0
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +181 -15
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +24 -0
- package/node_modules/playwright/lib/transform/babelBundleImpl.js +2353 -190
- package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +62 -34
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.package-lock.json +72 -41
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.mjs +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/package.json +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/README.md +16 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/index.js +4 -20
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/read.js +17 -17
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/json.js +60 -32
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/raw.js +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/text.js +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/urlencoded.js +16 -20
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/utils.js +18 -16
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/LICENSE +22 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/README.md +71 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/package.json +52 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/package.json +23 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/CHANGELOG.md +21 -14
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/isObject.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/package.json +6 -7
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/tsconfig.json +1 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/index.js +266 -45
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/schemes.js +9 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/utils.js +396 -92
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/package.json +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/equal.test.js +31 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/parse.test.js +7 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security-normalization.test.js +101 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security.test.js +301 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/CHANGELOG.md +7 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/index.d.ts +0 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/package.json +4 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/client.js +30 -16
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/utils.js +4 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/context.js +32 -13
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/streaming/sse.js +5 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/hono-base.js +10 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/base.js +44 -23
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/components.js +25 -26
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/context.js +5 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cors/index.js +17 -14
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/index.js +7 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +16 -7
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/request.js +20 -13
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +65 -59
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +71 -128
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +14 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/node.js +47 -70
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/utils.js +27 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/accept.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/body.js +21 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/cookie.js +4 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/stream.js +12 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/url.js +19 -11
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/client.js +30 -16
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/utils.js +4 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/context.js +32 -13
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/proxy/index.js +4 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/utils.js +30 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/streaming/sse.js +5 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/hono-base.js +10 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/base.js +41 -23
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/components.js +26 -27
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/context.js +6 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/render.js +2 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/server.js +5 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/hooks/index.js +16 -13
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/intrinsic-element/components.js +4 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/streaming.js +5 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cache/index.js +103 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/compress/index.js +5 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cors/index.js +17 -14
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/csrf/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/digest.js +47 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/index.js +7 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/language/language.js +10 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +16 -7
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/request.js +21 -14
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/linear-router/router.js +7 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/pattern-router/router.js +3 -9
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/node.js +61 -58
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/router.js +77 -129
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/trie.js +14 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/node.js +47 -70
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/router.js +3 -11
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/utils.js +5 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/client/types.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/context.d.ts +6 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/hono-base.d.ts +4 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/base.d.ts +7 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/combine/index.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +4 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/utils.d.ts +1 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/url.d.ts +5 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/accept.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/body.js +21 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/cookie.js +5 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/ipaddr.js +5 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/stream.js +12 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/url.js +17 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/package.json +11 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/README.md +173 -143
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.d.ts +11 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.d.ts +49 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js +79 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.d.ts +78 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js +119 -24
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.d.ts +151 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js +316 -90
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js +45 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js +50 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/package.json +6 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/CHANGELOG.md +26 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/README.md +19 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/dist/qs.js +25 -25
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/parse.js +16 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/utils.js +57 -11
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/package.json +8 -7
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/parse.js +419 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/utils.js +206 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/CHANGELOG.md +10 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/README.md +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/index.js +5 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/package.json +10 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/test/index.js +16 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/index.js +8 -18
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/README.md +71 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/package.json +52 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/package.json +9 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/package-lock.json +72 -41
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.package-lock.json +6 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/README.md +23 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/index.js +265 -86
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/package.json +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/README.md +173 -143
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.d.ts +11 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.d.ts +49 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js +79 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.d.ts +78 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js +119 -24
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.d.ts +151 -10
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js +316 -90
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js +45 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js +50 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/package.json +6 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/package-lock.json +6 -6
- package/node_modules/playwright/node_modules/playwright-core/lib/cli/program.js +18 -9
- package/node_modules/playwright/node_modules/playwright-core/lib/mcpBundleImpl/index.js +47 -47
- package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +3 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +42 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/utilsBundleImpl/index.js +121 -121
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.B7KbSQcC.js → index.BAkLd5DX.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +1 -1
- package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
- package/node_modules/playwright/node_modules/playwright-core/src/cli/program.ts +31 -9
- package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +1 -0
- package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderRunner.ts +57 -1
- package/node_modules/playwright/package.json +2 -2
- package/package.json +7 -6
- package/plugin/prompts/code-reuse/hand-off.md +30 -0
- package/plugin/prompts/generate-tests/generation.md +1 -1
- package/plugin/prompts/plan-tests.md +14 -14
- package/plugin/prompts/testbot-task1.md +2 -2
- package/plugin/skills/enhance-assertions/SKILL.md +25 -0
- package/plugin/skills/enhance-assertions/reference/contract.md +51 -0
- package/plugin/skills/enhance-assertions/reference/integration.md +58 -0
- package/plugin/skills/enhance-assertions/reference/shared-rules.md +220 -0
- package/plugin/skills/enhance-assertions/reference/ui.md +373 -0
- package/plugin/skills/fix-test-import-errors/SKILL.md +45 -50
- package/plugin/skills/run-test/SKILL.md +16 -0
- package/plugin/skills/validate-assertion-alignment-post-execution/SKILL.md +32 -0
- package/plugin/skills/validate-assertion-alignment-post-execution/reference/checks.md +44 -0
- package/plugin/skills/validate-assertion-alignment-post-execution/reference/evidence.md +47 -0
- package/build/adapters/jestAdapter.d.ts +0 -14
- package/build/adapters/jestAdapter.js +0 -113
- package/build/adapters/mochaAdapter.d.ts +0 -13
- package/build/adapters/mochaAdapter.js +0 -87
- package/build/adapters/playwrightAdapter.d.ts +0 -17
- package/build/adapters/playwrightAdapter.js +0 -182
- package/build/adapters/pytestAdapter.d.ts +0 -15
- package/build/adapters/pytestAdapter.js +0 -108
- package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +0 -2
- package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.js +0 -29
- package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +0 -2
- package/build/prompts/enhance-assertions/integrationAssertionsPrompt.js +0 -36
- package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +0 -16
- package/build/prompts/enhance-assertions/sharedAssertionRules.js +0 -284
- package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +0 -2
- package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +0 -388
- package/build/tools/runExistingTestsTool.d.ts +0 -138
- package/build/tools/runExistingTestsTool.js +0 -644
- package/build/types/ExternalTestExecution.d.ts +0 -67
- package/build/types/ExternalTestExecution.js +0 -8
- package/build/workspace/testSuites.d.ts +0 -20
- package/build/workspace/testSuites.js +0 -17
- package/node_modules/playwright/node_modules/playwright-core/.DS_Store +0 -0
|
@@ -3,7 +3,50 @@ import { Address6 } from './ipv6';
|
|
|
3
3
|
export interface ReverseFormOptions {
|
|
4
4
|
omitSuffix?: boolean;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns whether this address's *network* is contained within `address`,
|
|
8
|
+
* i.e. whether every address this one can represent also falls inside
|
|
9
|
+
* `address`. A network wider than `address` is not contained in it, so
|
|
10
|
+
* `10.0.0.0/8` is not in `10.0.0.0/16`.
|
|
11
|
+
*
|
|
12
|
+
* To ask whether the address itself falls inside a range, ignoring any CIDR
|
|
13
|
+
* suffix it was written with, use {@link isHostInSubnet} instead. That is the
|
|
14
|
+
* question the special-use classifiers ask.
|
|
15
|
+
*/
|
|
6
16
|
export declare function isInSubnet(this: Address4 | Address6, address: Address4 | Address6): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Returns whether this address's host bits fall inside `address`, ignoring
|
|
19
|
+
* this address's own subnet mask.
|
|
20
|
+
*
|
|
21
|
+
* This is the primitive the special-use classifiers (`isLoopback`,
|
|
22
|
+
* `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a
|
|
23
|
+
* question about the address, so the answer must not change with the CIDR
|
|
24
|
+
* suffix the caller happened to write. Use this rather than
|
|
25
|
+
* {@link isInSubnet} when classifying a single address — notably when the
|
|
26
|
+
* address came from untrusted input and the result backs a trust-boundary
|
|
27
|
+
* decision such as an SSRF allow/deny filter.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isHostInSubnet(this: Address4 | Address6, address: Address4 | Address6): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* One parsed row of an IANA special-purpose address registry: the block, and
|
|
32
|
+
* whether the registry marks it globally reachable (`null` when the column is
|
|
33
|
+
* blank, in which case the containing block answers).
|
|
34
|
+
*/
|
|
35
|
+
export interface SpecialPurposeEntry<A extends Address4 | Address6> {
|
|
36
|
+
subnet: A;
|
|
37
|
+
reachable: boolean | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns whether the registry marks this address globally reachable: the
|
|
41
|
+
* answer of the most specific entry containing it that has one, or `true`
|
|
42
|
+
* when no entry contains it.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isGloballyReachable<A extends Address4 | Address6>(this: A, entries: ReadonlyArray<SpecialPurposeEntry<A>>): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Adds `n` to `value` and returns the result, throwing `AddressError` unless
|
|
47
|
+
* `n` is an integer and the result stays within `[0, 2**bits - 1]`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function offsetBigInt(value: bigint, n: number | bigint, bits: number, family: string): bigint;
|
|
7
50
|
export declare function isCorrect(defaultBits: number): (this: Address4 | Address6) => boolean;
|
|
8
51
|
/**
|
|
9
52
|
* Returns the prefix length (number of leading 1 bits) of a contiguous
|
|
@@ -11,6 +54,12 @@ export declare function isCorrect(defaultBits: number): (this: Address4 | Addres
|
|
|
11
54
|
* `255.0.255.0`).
|
|
12
55
|
*/
|
|
13
56
|
export declare function prefixLengthFromMask(value: bigint, totalBits: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,
|
|
59
|
+
* each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes
|
|
60
|
+
* are accepted and folded to unsigned, and `0` where they are not.
|
|
61
|
+
*/
|
|
62
|
+
export declare function assertByteArray(bytes: number[], byteCount: number, family: 'IPv4' | 'IPv6', minimum: number): void;
|
|
14
63
|
export declare function numberToPaddedHex(number: number): string;
|
|
15
64
|
export declare function stringToPaddedHex(numberString: string): string;
|
|
16
65
|
/**
|
|
@@ -1,23 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isInSubnet = isInSubnet;
|
|
4
|
+
exports.isHostInSubnet = isHostInSubnet;
|
|
5
|
+
exports.isGloballyReachable = isGloballyReachable;
|
|
6
|
+
exports.offsetBigInt = offsetBigInt;
|
|
4
7
|
exports.isCorrect = isCorrect;
|
|
5
8
|
exports.prefixLengthFromMask = prefixLengthFromMask;
|
|
9
|
+
exports.assertByteArray = assertByteArray;
|
|
6
10
|
exports.numberToPaddedHex = numberToPaddedHex;
|
|
7
11
|
exports.stringToPaddedHex = stringToPaddedHex;
|
|
8
12
|
exports.testBit = testBit;
|
|
9
13
|
const address_error_1 = require("./address-error");
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether this address's *network* is contained within `address`,
|
|
16
|
+
* i.e. whether every address this one can represent also falls inside
|
|
17
|
+
* `address`. A network wider than `address` is not contained in it, so
|
|
18
|
+
* `10.0.0.0/8` is not in `10.0.0.0/16`.
|
|
19
|
+
*
|
|
20
|
+
* To ask whether the address itself falls inside a range, ignoring any CIDR
|
|
21
|
+
* suffix it was written with, use {@link isHostInSubnet} instead. That is the
|
|
22
|
+
* question the special-use classifiers ask.
|
|
23
|
+
*/
|
|
10
24
|
function isInSubnet(address) {
|
|
11
25
|
if (this.subnetMask < address.subnetMask) {
|
|
12
26
|
return false;
|
|
13
27
|
}
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
return isHostInSubnet.call(this, address);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns whether this address's host bits fall inside `address`, ignoring
|
|
32
|
+
* this address's own subnet mask.
|
|
33
|
+
*
|
|
34
|
+
* This is the primitive the special-use classifiers (`isLoopback`,
|
|
35
|
+
* `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a
|
|
36
|
+
* question about the address, so the answer must not change with the CIDR
|
|
37
|
+
* suffix the caller happened to write. Use this rather than
|
|
38
|
+
* {@link isInSubnet} when classifying a single address — notably when the
|
|
39
|
+
* address came from untrusted input and the result backs a trust-boundary
|
|
40
|
+
* decision such as an SSRF allow/deny filter.
|
|
41
|
+
*/
|
|
42
|
+
function isHostInSubnet(address) {
|
|
43
|
+
return this.mask(address.subnetMask) === address.mask();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether the registry marks this address globally reachable: the
|
|
47
|
+
* answer of the most specific entry containing it that has one, or `true`
|
|
48
|
+
* when no entry contains it.
|
|
49
|
+
*/
|
|
50
|
+
function isGloballyReachable(entries) {
|
|
51
|
+
let best = null;
|
|
52
|
+
for (let i = 0; i < entries.length; i++) {
|
|
53
|
+
const entry = entries[i];
|
|
54
|
+
if (entry.reachable !== null &&
|
|
55
|
+
isHostInSubnet.call(this, entry.subnet) &&
|
|
56
|
+
(best === null || entry.subnet.subnetMask > best.subnet.subnetMask)) {
|
|
57
|
+
best = entry;
|
|
58
|
+
}
|
|
16
59
|
}
|
|
17
|
-
return
|
|
60
|
+
return best === null ? true : best.reachable;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Adds `n` to `value` and returns the result, throwing `AddressError` unless
|
|
64
|
+
* `n` is an integer and the result stays within `[0, 2**bits - 1]`.
|
|
65
|
+
*/
|
|
66
|
+
function offsetBigInt(value, n, bits, family) {
|
|
67
|
+
if (typeof n === 'number' && !Number.isSafeInteger(n)) {
|
|
68
|
+
throw new address_error_1.AddressError(`${family} offset must be an integer`);
|
|
69
|
+
}
|
|
70
|
+
if (typeof n !== 'number' && typeof n !== 'bigint') {
|
|
71
|
+
throw new address_error_1.AddressError(`${family} offset must be an integer`);
|
|
72
|
+
}
|
|
73
|
+
const result = value + BigInt(n);
|
|
74
|
+
if (result < BigInt(0) || result > (BigInt(1) << BigInt(bits)) - BigInt(1)) {
|
|
75
|
+
throw new address_error_1.AddressError(`${family} offset leaves the address space`);
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
18
78
|
}
|
|
19
79
|
function isCorrect(defaultBits) {
|
|
20
|
-
return function () {
|
|
80
|
+
return function isCorrectForm() {
|
|
21
81
|
if (this.addressMinusSuffix !== this.correctForm()) {
|
|
22
82
|
return false;
|
|
23
83
|
}
|
|
@@ -46,6 +106,21 @@ function prefixLengthFromMask(value, totalBits) {
|
|
|
46
106
|
}
|
|
47
107
|
return firstZero;
|
|
48
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,
|
|
111
|
+
* each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes
|
|
112
|
+
* are accepted and folded to unsigned, and `0` where they are not.
|
|
113
|
+
*/
|
|
114
|
+
function assertByteArray(bytes, byteCount, family, minimum) {
|
|
115
|
+
if (bytes.length !== byteCount) {
|
|
116
|
+
throw new address_error_1.AddressError(`${family} addresses require exactly ${byteCount} bytes`);
|
|
117
|
+
}
|
|
118
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
119
|
+
if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {
|
|
120
|
+
throw new address_error_1.AddressError(`All bytes must be integers between ${minimum} and 255`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
49
124
|
function numberToPaddedHex(number) {
|
|
50
125
|
return number.toString(16).padStart(2, '0');
|
|
51
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAkBA,gCAMC;AAcD,wCAEC;AAiBD,kDAmBC;AAMD,oCAqBC;AAED,8BAYC;AAOD,oDAkBC;AAOD,0CAeC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AAzLD,mDAA+C;AAM/C;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAA4B,OAA4B;IACpF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;AAC1D,CAAC;AAYD;;;;GAIG;AACH,SAAgB,mBAAmB,CAEjC,OAA8C;IAE9C,IAAI,IAAI,GAAkC,IAAI,CAAC;IAE/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAEzB,IACE,KAAK,CAAC,SAAS,KAAK,IAAI;YACxB,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACvC,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EACnE,CAAC;YACD,IAAI,GAAG,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,SAAqB,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAC1B,KAAa,EACb,CAAkB,EAClB,IAAY,EACZ,MAAc;IAEd,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,4BAA4B,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,4BAA4B,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAEjC,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,kCAAkC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO,SAAS,aAAa;QAC3B,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAE1D,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,KAAe,EACf,SAAiB,EACjB,MAAuB,EACvB,OAAe;IAEf,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,8BAA8B,SAAS,QAAQ,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC;YACxE,MAAM,IAAI,4BAAY,CAAC,sCAAsC,OAAO,UAAU,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\n/**\n * Returns whether this address's *network* is contained within `address`,\n * i.e. whether every address this one can represent also falls inside\n * `address`. A network wider than `address` is not contained in it, so\n * `10.0.0.0/8` is not in `10.0.0.0/16`.\n *\n * To ask whether the address itself falls inside a range, ignoring any CIDR\n * suffix it was written with, use {@link isHostInSubnet} instead. That is the\n * question the special-use classifiers ask.\n */\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n return isHostInSubnet.call(this, address);\n}\n\n/**\n * Returns whether this address's host bits fall inside `address`, ignoring\n * this address's own subnet mask.\n *\n * This is the primitive the special-use classifiers (`isLoopback`,\n * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a\n * question about the address, so the answer must not change with the CIDR\n * suffix the caller happened to write. Use this rather than\n * {@link isInSubnet} when classifying a single address — notably when the\n * address came from untrusted input and the result backs a trust-boundary\n * decision such as an SSRF allow/deny filter.\n */\nexport function isHostInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n return this.mask(address.subnetMask) === address.mask();\n}\n\n/**\n * One parsed row of an IANA special-purpose address registry: the block, and\n * whether the registry marks it globally reachable (`null` when the column is\n * blank, in which case the containing block answers).\n */\nexport interface SpecialPurposeEntry<A extends Address4 | Address6> {\n subnet: A;\n reachable: boolean | null;\n}\n\n/**\n * Returns whether the registry marks this address globally reachable: the\n * answer of the most specific entry containing it that has one, or `true`\n * when no entry contains it.\n */\nexport function isGloballyReachable<A extends Address4 | Address6>(\n this: A,\n entries: ReadonlyArray<SpecialPurposeEntry<A>>,\n): boolean {\n let best: SpecialPurposeEntry<A> | null = null;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n\n if (\n entry.reachable !== null &&\n isHostInSubnet.call(this, entry.subnet) &&\n (best === null || entry.subnet.subnetMask > best.subnet.subnetMask)\n ) {\n best = entry;\n }\n }\n\n return best === null ? true : (best.reachable as boolean);\n}\n\n/**\n * Adds `n` to `value` and returns the result, throwing `AddressError` unless\n * `n` is an integer and the result stays within `[0, 2**bits - 1]`.\n */\nexport function offsetBigInt(\n value: bigint,\n n: number | bigint,\n bits: number,\n family: string,\n): bigint {\n if (typeof n === 'number' && !Number.isSafeInteger(n)) {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n if (typeof n !== 'number' && typeof n !== 'bigint') {\n throw new AddressError(`${family} offset must be an integer`);\n }\n\n const result = value + BigInt(n);\n\n if (result < BigInt(0) || result > (BigInt(1) << BigInt(bits)) - BigInt(1)) {\n throw new AddressError(`${family} offset leaves the address space`);\n }\n\n return result;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function isCorrectForm(this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\n/**\n * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,\n * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes\n * are accepted and folded to unsigned, and `0` where they are not.\n */\nexport function assertByteArray(\n bytes: number[],\n byteCount: number,\n family: 'IPv4' | 'IPv6',\n minimum: number,\n): void {\n if (bytes.length !== byteCount) {\n throw new AddressError(`${family} addresses require exactly ${byteCount} bytes`);\n }\n\n for (let i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {\n throw new AddressError(`All bytes must be integers between ${minimum} and 255`);\n }\n }\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import * as common from './common';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Address4 {
|
|
7
7
|
address: string;
|
|
8
|
-
addressMinusSuffix
|
|
8
|
+
addressMinusSuffix: string;
|
|
9
9
|
groups: number;
|
|
10
10
|
parsedAddress: string[];
|
|
11
11
|
parsedSubnet: string;
|
|
@@ -138,6 +138,27 @@ export declare class Address4 {
|
|
|
138
138
|
* @returns {Address4}
|
|
139
139
|
*/
|
|
140
140
|
startAddressExclusive(): Address4;
|
|
141
|
+
/**
|
|
142
|
+
* Returns the address `n` addresses after this one (or before, when `n` is
|
|
143
|
+
* negative), keeping this address's subnet mask. Throws `AddressError` when
|
|
144
|
+
* the result would fall outside the IPv4 address space or `n` is not an
|
|
145
|
+
* integer.
|
|
146
|
+
* @param {number | bigint} n
|
|
147
|
+
* @returns {Address4}
|
|
148
|
+
* @example
|
|
149
|
+
* new Address4('10.0.0.0/24').offset(1).correctForm(); // '10.0.0.1'
|
|
150
|
+
*/
|
|
151
|
+
offset(n: number | bigint): Address4;
|
|
152
|
+
/**
|
|
153
|
+
* Returns the network that follows this address's network: the address after
|
|
154
|
+
* {@link endAddress}, with the same subnet mask. Throws `AddressError` when
|
|
155
|
+
* this network is the last one in the address space.
|
|
156
|
+
* @returns {Address4}
|
|
157
|
+
* @example
|
|
158
|
+
* new Address4('10.0.0.0/24').nextNetwork().networkForm(); // '10.0.1.0/24'
|
|
159
|
+
*/
|
|
160
|
+
nextNetwork(): Address4;
|
|
161
|
+
private withSubnetMask;
|
|
141
162
|
/**
|
|
142
163
|
* Helper function getting end address.
|
|
143
164
|
* @returns {bigint}
|
|
@@ -183,7 +204,10 @@ export declare class Address4 {
|
|
|
183
204
|
*/
|
|
184
205
|
static fromBigInt(bigInt: bigint): Address4;
|
|
185
206
|
/**
|
|
186
|
-
* Convert a byte array to an Address4 object.
|
|
207
|
+
* Convert a byte array to an Address4 object. Throws `AddressError` unless
|
|
208
|
+
* given exactly 4 integers from 0 to 255. Signed bytes are rejected, so
|
|
209
|
+
* this differs from `Address6.fromByteArray`, which folds them; the two
|
|
210
|
+
* contracts converge on this stricter form in the next major version.
|
|
187
211
|
*
|
|
188
212
|
* To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.
|
|
189
213
|
* @param {Array<number>} bytes - an array of 4 bytes (0-255)
|
|
@@ -191,7 +215,12 @@ export declare class Address4 {
|
|
|
191
215
|
*/
|
|
192
216
|
static fromByteArray(bytes: Array<number>): Address4;
|
|
193
217
|
/**
|
|
194
|
-
* Convert an unsigned byte array to an Address4 object
|
|
218
|
+
* Convert an unsigned byte array to an Address4 object. Throws
|
|
219
|
+
* `AddressError` unless given exactly 4 bytes, and rejects values outside
|
|
220
|
+
* 0 to 255 when parsing the resulting address.
|
|
221
|
+
*
|
|
222
|
+
* To convert from a Node.js `Buffer`, spread it:
|
|
223
|
+
* `Address4.fromUnsignedByteArray([...buf])`.
|
|
195
224
|
* @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)
|
|
196
225
|
* @returns {Address4}
|
|
197
226
|
*/
|
|
@@ -208,7 +237,8 @@ export declare class Address4 {
|
|
|
208
237
|
*/
|
|
209
238
|
getBitsBase2(start: number, end: number): string;
|
|
210
239
|
/**
|
|
211
|
-
* Return the reversed
|
|
240
|
+
* Return the reversed in-addr.arpa form of the address, e.g.
|
|
241
|
+
* `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.
|
|
212
242
|
* @param {Object} options
|
|
213
243
|
* @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
|
|
214
244
|
* @returns {String}
|
|
@@ -219,6 +249,15 @@ export declare class Address4 {
|
|
|
219
249
|
* @returns {boolean}
|
|
220
250
|
*/
|
|
221
251
|
isInSubnet: typeof common.isInSubnet;
|
|
252
|
+
/**
|
|
253
|
+
* Returns true if this address's host bits fall inside the given subnet,
|
|
254
|
+
* ignoring this address's own subnet mask. Prefer this over `isInSubnet`
|
|
255
|
+
* when classifying a single address, so the answer doesn't change with the
|
|
256
|
+
* CIDR suffix the caller happened to write — notably when the address came
|
|
257
|
+
* from untrusted input and the result backs a trust-boundary decision.
|
|
258
|
+
* @returns {boolean}
|
|
259
|
+
*/
|
|
260
|
+
isHostInSubnet: typeof common.isHostInSubnet;
|
|
222
261
|
/**
|
|
223
262
|
* Returns true if the given address is a multicast address
|
|
224
263
|
* @returns {boolean}
|
|
@@ -254,13 +293,47 @@ export declare class Address4 {
|
|
|
254
293
|
* @returns {boolean}
|
|
255
294
|
*/
|
|
256
295
|
isCGNAT(): boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Returns true if the address is in one of the documentation ranges
|
|
298
|
+
* `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)).
|
|
299
|
+
* @returns {boolean}
|
|
300
|
+
*/
|
|
301
|
+
isDocumentation(): boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)).
|
|
304
|
+
* @returns {boolean}
|
|
305
|
+
*/
|
|
306
|
+
isBenchmarking(): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)),
|
|
309
|
+
* which includes the limited broadcast address.
|
|
310
|
+
* @returns {boolean}
|
|
311
|
+
*/
|
|
312
|
+
isReserved(): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Returns true if the address is globally reachable: not multicast, and not
|
|
315
|
+
* in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/)
|
|
316
|
+
* marks as not globally reachable. That covers everything the individual
|
|
317
|
+
* classifiers name (private, loopback, link-local, CGNAT, unspecified,
|
|
318
|
+
* broadcast, documentation, benchmarking, reserved) and the blocks they do
|
|
319
|
+
* not, such as `0.0.0.0/8` and the IETF protocol assignments in
|
|
320
|
+
* `192.0.0.0/24`. This is the single predicate to use where a request must
|
|
321
|
+
* not reach an internal or special-purpose destination; see SECURITY.md.
|
|
322
|
+
* @returns {boolean}
|
|
323
|
+
*/
|
|
324
|
+
isGlobal(): boolean;
|
|
257
325
|
/**
|
|
258
326
|
* Returns a zero-padded base-2 string representation of the address
|
|
259
327
|
* @returns {string}
|
|
260
328
|
*/
|
|
261
329
|
binaryZeroPad(): string;
|
|
262
330
|
/**
|
|
263
|
-
* Groups an IPv4 address for inclusion at the end of an IPv6 address
|
|
331
|
+
* Groups an IPv4 address for inclusion at the end of an IPv6 address.
|
|
332
|
+
*
|
|
333
|
+
* Returns an HTML fragment: each half of the address is wrapped in a
|
|
334
|
+
* `<span>` carrying the group classes an address-inspector UI hovers on.
|
|
335
|
+
* The address content is HTML-escaped; anything you concatenate around it
|
|
336
|
+
* is your responsibility.
|
|
264
337
|
* @returns {String}
|
|
265
338
|
*/
|
|
266
339
|
groupForV6(): string;
|
|
@@ -35,6 +35,7 @@ const isCorrect4 = common.isCorrect(constants.BITS);
|
|
|
35
35
|
*/
|
|
36
36
|
class Address4 {
|
|
37
37
|
constructor(address) {
|
|
38
|
+
this.addressMinusSuffix = '';
|
|
38
39
|
this.groups = constants.GROUPS;
|
|
39
40
|
this.parsedAddress = [];
|
|
40
41
|
this.parsedSubnet = '';
|
|
@@ -51,6 +52,15 @@ class Address4 {
|
|
|
51
52
|
* @returns {boolean}
|
|
52
53
|
*/
|
|
53
54
|
this.isInSubnet = common.isInSubnet;
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if this address's host bits fall inside the given subnet,
|
|
57
|
+
* ignoring this address's own subnet mask. Prefer this over `isInSubnet`
|
|
58
|
+
* when classifying a single address, so the answer doesn't change with the
|
|
59
|
+
* CIDR suffix the caller happened to write — notably when the address came
|
|
60
|
+
* from untrusted input and the result backs a trust-boundary decision.
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
this.isHostInSubnet = common.isHostInSubnet;
|
|
54
64
|
this.address = address;
|
|
55
65
|
const subnet = constants.RE_SUBNET_STRING.exec(address);
|
|
56
66
|
if (subnet) {
|
|
@@ -78,7 +88,7 @@ class Address4 {
|
|
|
78
88
|
new Address4(address);
|
|
79
89
|
return true;
|
|
80
90
|
}
|
|
81
|
-
catch
|
|
91
|
+
catch {
|
|
82
92
|
return false;
|
|
83
93
|
}
|
|
84
94
|
}
|
|
@@ -90,6 +100,11 @@ class Address4 {
|
|
|
90
100
|
*/
|
|
91
101
|
parse(address) {
|
|
92
102
|
const groups = address.split('.');
|
|
103
|
+
// Checked before the general match so the error names the actual problem.
|
|
104
|
+
// Address6 rejects the same notation on its v4-in-v6 path.
|
|
105
|
+
if (groups.some((group) => /^0\d/.test(group))) {
|
|
106
|
+
throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.");
|
|
107
|
+
}
|
|
93
108
|
if (!address.match(constants.RE_ADDRESS)) {
|
|
94
109
|
throw new address_error_1.AddressError('Invalid IPv4 address.');
|
|
95
110
|
}
|
|
@@ -128,7 +143,6 @@ class Address4 {
|
|
|
128
143
|
static fromAddressAndWildcardMask(address, wildcardMask) {
|
|
129
144
|
const wildcard = new Address4(wildcardMask).bigInt();
|
|
130
145
|
const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);
|
|
131
|
-
// eslint-disable-next-line no-bitwise
|
|
132
146
|
const mask = wildcard ^ allOnes;
|
|
133
147
|
const bits = common.prefixLengthFromMask(mask, constants.BITS);
|
|
134
148
|
return new Address4(`${address}/${bits}`);
|
|
@@ -271,6 +285,33 @@ class Address4 {
|
|
|
271
285
|
const adjust = BigInt('1');
|
|
272
286
|
return Address4.fromBigInt(this._startAddress() + adjust);
|
|
273
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Returns the address `n` addresses after this one (or before, when `n` is
|
|
290
|
+
* negative), keeping this address's subnet mask. Throws `AddressError` when
|
|
291
|
+
* the result would fall outside the IPv4 address space or `n` is not an
|
|
292
|
+
* integer.
|
|
293
|
+
* @param {number | bigint} n
|
|
294
|
+
* @returns {Address4}
|
|
295
|
+
* @example
|
|
296
|
+
* new Address4('10.0.0.0/24').offset(1).correctForm(); // '10.0.0.1'
|
|
297
|
+
*/
|
|
298
|
+
offset(n) {
|
|
299
|
+
return Address4.fromBigInt(common.offsetBigInt(this.bigInt(), n, constants.BITS, 'IPv4')).withSubnetMask(this.subnetMask);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Returns the network that follows this address's network: the address after
|
|
303
|
+
* {@link endAddress}, with the same subnet mask. Throws `AddressError` when
|
|
304
|
+
* this network is the last one in the address space.
|
|
305
|
+
* @returns {Address4}
|
|
306
|
+
* @example
|
|
307
|
+
* new Address4('10.0.0.0/24').nextNetwork().networkForm(); // '10.0.1.0/24'
|
|
308
|
+
*/
|
|
309
|
+
nextNetwork() {
|
|
310
|
+
return Address4.fromBigInt(common.offsetBigInt(this._endAddress(), 1, constants.BITS, 'IPv4')).withSubnetMask(this.subnetMask);
|
|
311
|
+
}
|
|
312
|
+
withSubnetMask(subnetMask) {
|
|
313
|
+
return new Address4(`${this.correctForm()}/${subnetMask}`);
|
|
314
|
+
}
|
|
274
315
|
/**
|
|
275
316
|
* Helper function getting end address.
|
|
276
317
|
* @returns {bigint}
|
|
@@ -328,32 +369,32 @@ class Address4 {
|
|
|
328
369
|
* @returns {Address4}
|
|
329
370
|
*/
|
|
330
371
|
static fromBigInt(bigInt) {
|
|
331
|
-
if (bigInt <
|
|
372
|
+
if (bigInt < BigInt(0) || bigInt > BigInt(0xffffffff)) {
|
|
332
373
|
throw new address_error_1.AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');
|
|
333
374
|
}
|
|
334
375
|
return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));
|
|
335
376
|
}
|
|
336
377
|
/**
|
|
337
|
-
* Convert a byte array to an Address4 object.
|
|
378
|
+
* Convert a byte array to an Address4 object. Throws `AddressError` unless
|
|
379
|
+
* given exactly 4 integers from 0 to 255. Signed bytes are rejected, so
|
|
380
|
+
* this differs from `Address6.fromByteArray`, which folds them; the two
|
|
381
|
+
* contracts converge on this stricter form in the next major version.
|
|
338
382
|
*
|
|
339
383
|
* To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.
|
|
340
384
|
* @param {Array<number>} bytes - an array of 4 bytes (0-255)
|
|
341
385
|
* @returns {Address4}
|
|
342
386
|
*/
|
|
343
387
|
static fromByteArray(bytes) {
|
|
344
|
-
|
|
345
|
-
throw new address_error_1.AddressError('IPv4 addresses require exactly 4 bytes');
|
|
346
|
-
}
|
|
347
|
-
// Validate that all bytes are within valid range (0-255)
|
|
348
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
349
|
-
if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {
|
|
350
|
-
throw new address_error_1.AddressError('All bytes must be integers between 0 and 255');
|
|
351
|
-
}
|
|
352
|
-
}
|
|
388
|
+
common.assertByteArray(bytes, 4, 'IPv4', 0);
|
|
353
389
|
return this.fromUnsignedByteArray(bytes);
|
|
354
390
|
}
|
|
355
391
|
/**
|
|
356
|
-
* Convert an unsigned byte array to an Address4 object
|
|
392
|
+
* Convert an unsigned byte array to an Address4 object. Throws
|
|
393
|
+
* `AddressError` unless given exactly 4 bytes, and rejects values outside
|
|
394
|
+
* 0 to 255 when parsing the resulting address.
|
|
395
|
+
*
|
|
396
|
+
* To convert from a Node.js `Buffer`, spread it:
|
|
397
|
+
* `Address4.fromUnsignedByteArray([...buf])`.
|
|
357
398
|
* @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)
|
|
358
399
|
* @returns {Address4}
|
|
359
400
|
*/
|
|
@@ -383,7 +424,8 @@ class Address4 {
|
|
|
383
424
|
return this.binaryZeroPad().slice(start, end);
|
|
384
425
|
}
|
|
385
426
|
/**
|
|
386
|
-
* Return the reversed
|
|
427
|
+
* Return the reversed in-addr.arpa form of the address, e.g.
|
|
428
|
+
* `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.
|
|
387
429
|
* @param {Object} options
|
|
388
430
|
* @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
|
|
389
431
|
* @returns {String}
|
|
@@ -403,49 +445,86 @@ class Address4 {
|
|
|
403
445
|
* @returns {boolean}
|
|
404
446
|
*/
|
|
405
447
|
isMulticast() {
|
|
406
|
-
return this.
|
|
448
|
+
return this.isHostInSubnet(MULTICAST_V4);
|
|
407
449
|
}
|
|
408
450
|
/**
|
|
409
451
|
* Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
|
|
410
452
|
* @returns {boolean}
|
|
411
453
|
*/
|
|
412
454
|
isPrivate() {
|
|
413
|
-
return PRIVATE_V4.some((subnet) => this.
|
|
455
|
+
return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));
|
|
414
456
|
}
|
|
415
457
|
/**
|
|
416
458
|
* Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
|
|
417
459
|
* @returns {boolean}
|
|
418
460
|
*/
|
|
419
461
|
isLoopback() {
|
|
420
|
-
return this.
|
|
462
|
+
return this.isHostInSubnet(LOOPBACK_V4);
|
|
421
463
|
}
|
|
422
464
|
/**
|
|
423
465
|
* Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).
|
|
424
466
|
* @returns {boolean}
|
|
425
467
|
*/
|
|
426
468
|
isLinkLocal() {
|
|
427
|
-
return this.
|
|
469
|
+
return this.isHostInSubnet(LINK_LOCAL_V4);
|
|
428
470
|
}
|
|
429
471
|
/**
|
|
430
472
|
* Returns true if the address is the unspecified address `0.0.0.0`.
|
|
431
473
|
* @returns {boolean}
|
|
432
474
|
*/
|
|
433
475
|
isUnspecified() {
|
|
434
|
-
return this.
|
|
476
|
+
return this.isHostInSubnet(UNSPECIFIED_V4);
|
|
435
477
|
}
|
|
436
478
|
/**
|
|
437
479
|
* Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
|
|
438
480
|
* @returns {boolean}
|
|
439
481
|
*/
|
|
440
482
|
isBroadcast() {
|
|
441
|
-
return this.
|
|
483
|
+
return this.isHostInSubnet(BROADCAST_V4);
|
|
442
484
|
}
|
|
443
485
|
/**
|
|
444
486
|
* Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).
|
|
445
487
|
* @returns {boolean}
|
|
446
488
|
*/
|
|
447
489
|
isCGNAT() {
|
|
448
|
-
return this.
|
|
490
|
+
return this.isHostInSubnet(CGNAT_V4);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Returns true if the address is in one of the documentation ranges
|
|
494
|
+
* `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)).
|
|
495
|
+
* @returns {boolean}
|
|
496
|
+
*/
|
|
497
|
+
isDocumentation() {
|
|
498
|
+
return DOCUMENTATION_V4.some((subnet) => this.isHostInSubnet(subnet));
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)).
|
|
502
|
+
* @returns {boolean}
|
|
503
|
+
*/
|
|
504
|
+
isBenchmarking() {
|
|
505
|
+
return this.isHostInSubnet(BENCHMARKING_V4);
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)),
|
|
509
|
+
* which includes the limited broadcast address.
|
|
510
|
+
* @returns {boolean}
|
|
511
|
+
*/
|
|
512
|
+
isReserved() {
|
|
513
|
+
return this.isHostInSubnet(RESERVED_V4);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Returns true if the address is globally reachable: not multicast, and not
|
|
517
|
+
* in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/)
|
|
518
|
+
* marks as not globally reachable. That covers everything the individual
|
|
519
|
+
* classifiers name (private, loopback, link-local, CGNAT, unspecified,
|
|
520
|
+
* broadcast, documentation, benchmarking, reserved) and the blocks they do
|
|
521
|
+
* not, such as `0.0.0.0/8` and the IETF protocol assignments in
|
|
522
|
+
* `192.0.0.0/24`. This is the single predicate to use where a request must
|
|
523
|
+
* not reach an internal or special-purpose destination; see SECURITY.md.
|
|
524
|
+
* @returns {boolean}
|
|
525
|
+
*/
|
|
526
|
+
isGlobal() {
|
|
527
|
+
return !this.isMulticast() && common.isGloballyReachable.call(this, SPECIAL_PURPOSE_V4);
|
|
449
528
|
}
|
|
450
529
|
/**
|
|
451
530
|
* Returns a zero-padded base-2 string representation of the address
|
|
@@ -458,12 +537,17 @@ class Address4 {
|
|
|
458
537
|
return this._binaryZeroPad;
|
|
459
538
|
}
|
|
460
539
|
/**
|
|
461
|
-
* Groups an IPv4 address for inclusion at the end of an IPv6 address
|
|
540
|
+
* Groups an IPv4 address for inclusion at the end of an IPv6 address.
|
|
541
|
+
*
|
|
542
|
+
* Returns an HTML fragment: each half of the address is wrapped in a
|
|
543
|
+
* `<span>` carrying the group classes an address-inspector UI hovers on.
|
|
544
|
+
* The address content is HTML-escaped; anything you concatenate around it
|
|
545
|
+
* is your responsibility.
|
|
462
546
|
* @returns {String}
|
|
463
547
|
*/
|
|
464
548
|
groupForV6() {
|
|
465
549
|
const segments = this.parsedAddress;
|
|
466
|
-
return this.
|
|
550
|
+
return this.correctForm().replace(constants.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments
|
|
467
551
|
.slice(0, 2)
|
|
468
552
|
.join('.')}</span>.<span class="hover-group group-v4 group-7">${segments
|
|
469
553
|
.slice(2, 4)
|
|
@@ -482,4 +566,15 @@ const LINK_LOCAL_V4 = new Address4('169.254.0.0/16');
|
|
|
482
566
|
const UNSPECIFIED_V4 = new Address4('0.0.0.0/32');
|
|
483
567
|
const BROADCAST_V4 = new Address4('255.255.255.255/32');
|
|
484
568
|
const CGNAT_V4 = new Address4('100.64.0.0/10');
|
|
569
|
+
const DOCUMENTATION_V4 = [
|
|
570
|
+
new Address4('192.0.2.0/24'),
|
|
571
|
+
new Address4('198.51.100.0/24'),
|
|
572
|
+
new Address4('203.0.113.0/24'),
|
|
573
|
+
];
|
|
574
|
+
const BENCHMARKING_V4 = new Address4('198.18.0.0/15');
|
|
575
|
+
const RESERVED_V4 = new Address4('240.0.0.0/4');
|
|
576
|
+
const SPECIAL_PURPOSE_V4 = constants.SPECIAL_PURPOSE.map(([cidr, , reachable]) => ({
|
|
577
|
+
subnet: new Address4(cidr),
|
|
578
|
+
reachable,
|
|
579
|
+
}));
|
|
485
580
|
//# sourceMappingURL=ipv4.js.map
|