@vm3jack/mcp-server-azure-devops 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/clients/azure-devops.d.ts +105 -0
- package/dist/clients/azure-devops.js +501 -0
- package/dist/clients/azure-devops.js.map +1 -0
- package/dist/clients/azure-devops.spec.unit.d.ts +1 -0
- package/dist/clients/azure-devops.spec.unit.js +42 -0
- package/dist/clients/azure-devops.spec.unit.js.map +1 -0
- package/dist/features/organizations/__test__/test-helpers.d.ts +13 -0
- package/dist/features/organizations/__test__/test-helpers.js +38 -0
- package/dist/features/organizations/__test__/test-helpers.js.map +1 -0
- package/dist/features/organizations/index.d.ts +13 -0
- package/dist/features/organizations/index.js +63 -0
- package/dist/features/organizations/index.js.map +1 -0
- package/dist/features/organizations/index.spec.unit.d.ts +1 -0
- package/dist/features/organizations/index.spec.unit.js +106 -0
- package/dist/features/organizations/index.spec.unit.js.map +1 -0
- package/dist/features/organizations/list-organizations/feature.d.ts +13 -0
- package/dist/features/organizations/list-organizations/feature.js +101 -0
- package/dist/features/organizations/list-organizations/feature.js.map +1 -0
- package/dist/features/organizations/list-organizations/feature.spec.int.d.ts +1 -0
- package/dist/features/organizations/list-organizations/feature.spec.int.js +34 -0
- package/dist/features/organizations/list-organizations/feature.spec.int.js.map +1 -0
- package/dist/features/organizations/list-organizations/feature.spec.unit.d.ts +1 -0
- package/dist/features/organizations/list-organizations/feature.spec.unit.js +115 -0
- package/dist/features/organizations/list-organizations/feature.spec.unit.js.map +1 -0
- package/dist/features/organizations/list-organizations/index.d.ts +2 -0
- package/dist/features/organizations/list-organizations/index.js +19 -0
- package/dist/features/organizations/list-organizations/index.js.map +1 -0
- package/dist/features/organizations/list-organizations/schema.d.ts +2 -0
- package/dist/features/organizations/list-organizations/schema.js +6 -0
- package/dist/features/organizations/list-organizations/schema.js.map +1 -0
- package/dist/features/organizations/schemas.d.ts +6 -0
- package/dist/features/organizations/schemas.js +10 -0
- package/dist/features/organizations/schemas.js.map +1 -0
- package/dist/features/organizations/tool-definitions.d.ts +5 -0
- package/dist/features/organizations/tool-definitions.js +16 -0
- package/dist/features/organizations/tool-definitions.js.map +1 -0
- package/dist/features/organizations/types.d.ts +21 -0
- package/dist/features/organizations/types.js +8 -0
- package/dist/features/organizations/types.js.map +1 -0
- package/dist/features/pipelines/artifacts.d.ts +11 -0
- package/dist/features/pipelines/artifacts.js +288 -0
- package/dist/features/pipelines/artifacts.js.map +1 -0
- package/dist/features/pipelines/artifacts.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/artifacts.spec.unit.js +103 -0
- package/dist/features/pipelines/artifacts.spec.unit.js.map +1 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.d.ts +3 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.js +222 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.js.map +1 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.spec.unit.js +65 -0
- package/dist/features/pipelines/download-pipeline-artifact/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/download-pipeline-artifact/index.d.ts +2 -0
- package/dist/features/pipelines/download-pipeline-artifact/index.js +19 -0
- package/dist/features/pipelines/download-pipeline-artifact/index.js.map +1 -0
- package/dist/features/pipelines/download-pipeline-artifact/schema.d.ts +17 -0
- package/dist/features/pipelines/download-pipeline-artifact/schema.js +23 -0
- package/dist/features/pipelines/download-pipeline-artifact/schema.js.map +1 -0
- package/dist/features/pipelines/get-pipeline/feature.d.ts +10 -0
- package/dist/features/pipelines/get-pipeline/feature.js +46 -0
- package/dist/features/pipelines/get-pipeline/feature.js.map +1 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.int.d.ts +1 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.int.js +54 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.int.js.map +1 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.unit.js +89 -0
- package/dist/features/pipelines/get-pipeline/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/get-pipeline/index.d.ts +2 -0
- package/dist/features/pipelines/get-pipeline/index.js +19 -0
- package/dist/features/pipelines/get-pipeline/index.js.map +1 -0
- package/dist/features/pipelines/get-pipeline/schema.d.ts +17 -0
- package/dist/features/pipelines/get-pipeline/schema.js +29 -0
- package/dist/features/pipelines/get-pipeline/schema.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-log/feature.d.ts +3 -0
- package/dist/features/pipelines/get-pipeline-log/feature.js +57 -0
- package/dist/features/pipelines/get-pipeline-log/feature.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-log/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/get-pipeline-log/feature.spec.unit.js +81 -0
- package/dist/features/pipelines/get-pipeline-log/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-log/index.d.ts +2 -0
- package/dist/features/pipelines/get-pipeline-log/index.js +19 -0
- package/dist/features/pipelines/get-pipeline-log/index.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-log/schema.d.ts +26 -0
- package/dist/features/pipelines/get-pipeline-log/schema.js +40 -0
- package/dist/features/pipelines/get-pipeline-log/schema.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-run/feature.d.ts +3 -0
- package/dist/features/pipelines/get-pipeline-run/feature.js +76 -0
- package/dist/features/pipelines/get-pipeline-run/feature.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-run/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/get-pipeline-run/feature.spec.unit.js +156 -0
- package/dist/features/pipelines/get-pipeline-run/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-run/index.d.ts +2 -0
- package/dist/features/pipelines/get-pipeline-run/index.js +19 -0
- package/dist/features/pipelines/get-pipeline-run/index.js.map +1 -0
- package/dist/features/pipelines/get-pipeline-run/schema.d.ts +14 -0
- package/dist/features/pipelines/get-pipeline-run/schema.js +19 -0
- package/dist/features/pipelines/get-pipeline-run/schema.js.map +1 -0
- package/dist/features/pipelines/helpers.d.ts +3 -0
- package/dist/features/pipelines/helpers.js +29 -0
- package/dist/features/pipelines/helpers.js.map +1 -0
- package/dist/features/pipelines/index.d.ts +19 -0
- package/dist/features/pipelines/index.js +156 -0
- package/dist/features/pipelines/index.js.map +1 -0
- package/dist/features/pipelines/index.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/index.spec.unit.js +223 -0
- package/dist/features/pipelines/index.spec.unit.js.map +1 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.d.ts +3 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.js +98 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.js.map +1 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.spec.unit.js +148 -0
- package/dist/features/pipelines/list-pipeline-runs/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/list-pipeline-runs/index.d.ts +2 -0
- package/dist/features/pipelines/list-pipeline-runs/index.js +19 -0
- package/dist/features/pipelines/list-pipeline-runs/index.js.map +1 -0
- package/dist/features/pipelines/list-pipeline-runs/schema.d.ts +35 -0
- package/dist/features/pipelines/list-pipeline-runs/schema.js +50 -0
- package/dist/features/pipelines/list-pipeline-runs/schema.js.map +1 -0
- package/dist/features/pipelines/list-pipelines/feature.d.ts +10 -0
- package/dist/features/pipelines/list-pipelines/feature.js +42 -0
- package/dist/features/pipelines/list-pipelines/feature.js.map +1 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.int.d.ts +1 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.int.js +36 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.int.js.map +1 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.unit.js +91 -0
- package/dist/features/pipelines/list-pipelines/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/list-pipelines/index.d.ts +2 -0
- package/dist/features/pipelines/list-pipelines/index.js +19 -0
- package/dist/features/pipelines/list-pipelines/index.js.map +1 -0
- package/dist/features/pipelines/list-pipelines/schema.d.ts +17 -0
- package/dist/features/pipelines/list-pipelines/schema.js +23 -0
- package/dist/features/pipelines/list-pipelines/schema.js.map +1 -0
- package/dist/features/pipelines/pipeline-timeline/feature.d.ts +3 -0
- package/dist/features/pipelines/pipeline-timeline/feature.js +95 -0
- package/dist/features/pipelines/pipeline-timeline/feature.js.map +1 -0
- package/dist/features/pipelines/pipeline-timeline/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/pipeline-timeline/feature.spec.unit.js +100 -0
- package/dist/features/pipelines/pipeline-timeline/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/pipeline-timeline/index.d.ts +2 -0
- package/dist/features/pipelines/pipeline-timeline/index.js +19 -0
- package/dist/features/pipelines/pipeline-timeline/index.js.map +1 -0
- package/dist/features/pipelines/pipeline-timeline/schema.d.ts +23 -0
- package/dist/features/pipelines/pipeline-timeline/schema.js +51 -0
- package/dist/features/pipelines/pipeline-timeline/schema.js.map +1 -0
- package/dist/features/pipelines/tool-definitions.d.ts +5 -0
- package/dist/features/pipelines/tool-definitions.js +66 -0
- package/dist/features/pipelines/tool-definitions.js.map +1 -0
- package/dist/features/pipelines/trigger-pipeline/feature.d.ts +10 -0
- package/dist/features/pipelines/trigger-pipeline/feature.js +65 -0
- package/dist/features/pipelines/trigger-pipeline/feature.js.map +1 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.int.d.ts +1 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.int.js +85 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.int.js.map +1 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.unit.d.ts +1 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.unit.js +112 -0
- package/dist/features/pipelines/trigger-pipeline/feature.spec.unit.js.map +1 -0
- package/dist/features/pipelines/trigger-pipeline/index.d.ts +2 -0
- package/dist/features/pipelines/trigger-pipeline/index.js +8 -0
- package/dist/features/pipelines/trigger-pipeline/index.js.map +1 -0
- package/dist/features/pipelines/trigger-pipeline/schema.d.ts +41 -0
- package/dist/features/pipelines/trigger-pipeline/schema.js +45 -0
- package/dist/features/pipelines/trigger-pipeline/schema.js.map +1 -0
- package/dist/features/pipelines/types.d.ts +122 -0
- package/dist/features/pipelines/types.js +3 -0
- package/dist/features/pipelines/types.js.map +1 -0
- package/dist/features/projects/__test__/test-helpers.d.ts +13 -0
- package/dist/features/projects/__test__/test-helpers.js +35 -0
- package/dist/features/projects/__test__/test-helpers.js.map +1 -0
- package/dist/features/projects/get-project/feature.d.ts +11 -0
- package/dist/features/projects/get-project/feature.js +29 -0
- package/dist/features/projects/get-project/feature.js.map +1 -0
- package/dist/features/projects/get-project/feature.spec.int.d.ts +1 -0
- package/dist/features/projects/get-project/feature.spec.int.js +39 -0
- package/dist/features/projects/get-project/feature.spec.int.js.map +1 -0
- package/dist/features/projects/get-project/feature.spec.unit.d.ts +1 -0
- package/dist/features/projects/get-project/feature.spec.unit.js +41 -0
- package/dist/features/projects/get-project/feature.spec.unit.js.map +1 -0
- package/dist/features/projects/get-project/index.d.ts +2 -0
- package/dist/features/projects/get-project/index.js +19 -0
- package/dist/features/projects/get-project/index.js.map +1 -0
- package/dist/features/projects/get-project/schema.d.ts +2 -0
- package/dist/features/projects/get-project/schema.js +6 -0
- package/dist/features/projects/get-project/schema.js.map +1 -0
- package/dist/features/projects/get-project-details/feature.d.ts +78 -0
- package/dist/features/projects/get-project-details/feature.js +185 -0
- package/dist/features/projects/get-project-details/feature.js.map +1 -0
- package/dist/features/projects/get-project-details/feature.spec.int.d.ts +1 -0
- package/dist/features/projects/get-project-details/feature.spec.int.js +120 -0
- package/dist/features/projects/get-project-details/feature.spec.int.js.map +1 -0
- package/dist/features/projects/get-project-details/feature.spec.unit.d.ts +1 -0
- package/dist/features/projects/get-project-details/feature.spec.unit.js +379 -0
- package/dist/features/projects/get-project-details/feature.spec.unit.js.map +1 -0
- package/dist/features/projects/get-project-details/index.d.ts +2 -0
- package/dist/features/projects/get-project-details/index.js +8 -0
- package/dist/features/projects/get-project-details/index.js.map +1 -0
- package/dist/features/projects/get-project-details/schema.d.ts +2 -0
- package/dist/features/projects/get-project-details/schema.js +6 -0
- package/dist/features/projects/get-project-details/schema.js.map +1 -0
- package/dist/features/projects/index.d.ts +15 -0
- package/dist/features/projects/index.js +80 -0
- package/dist/features/projects/index.js.map +1 -0
- package/dist/features/projects/index.spec.unit.d.ts +1 -0
- package/dist/features/projects/index.spec.unit.js +131 -0
- package/dist/features/projects/index.spec.unit.js.map +1 -0
- package/dist/features/projects/list-projects/feature.d.ts +10 -0
- package/dist/features/projects/list-projects/feature.js +25 -0
- package/dist/features/projects/list-projects/feature.js.map +1 -0
- package/dist/features/projects/list-projects/feature.spec.int.d.ts +1 -0
- package/dist/features/projects/list-projects/feature.spec.int.js +54 -0
- package/dist/features/projects/list-projects/feature.spec.int.js.map +1 -0
- package/dist/features/projects/list-projects/index.d.ts +2 -0
- package/dist/features/projects/list-projects/index.js +19 -0
- package/dist/features/projects/list-projects/index.js.map +1 -0
- package/dist/features/projects/list-projects/schema.d.ts +2 -0
- package/dist/features/projects/list-projects/schema.js +6 -0
- package/dist/features/projects/list-projects/schema.js.map +1 -0
- package/dist/features/projects/schemas.d.ts +64 -0
- package/dist/features/projects/schemas.js +76 -0
- package/dist/features/projects/schemas.js.map +1 -0
- package/dist/features/projects/tool-definitions.d.ts +5 -0
- package/dist/features/projects/tool-definitions.js +26 -0
- package/dist/features/projects/tool-definitions.js.map +1 -0
- package/dist/features/projects/types.d.ts +11 -0
- package/dist/features/projects/types.js +3 -0
- package/dist/features/projects/types.js.map +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.d.ts +13 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.js +130 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.js.map +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.int.js +186 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.unit.js +259 -0
- package/dist/features/pull-requests/add-pull-request-comment/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/index.d.ts +1 -0
- package/dist/features/pull-requests/add-pull-request-comment/index.js +18 -0
- package/dist/features/pull-requests/add-pull-request-comment/index.js.map +1 -0
- package/dist/features/pull-requests/create-pull-request/feature.d.ts +12 -0
- package/dist/features/pull-requests/create-pull-request/feature.js +99 -0
- package/dist/features/pull-requests/create-pull-request/feature.js.map +1 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.int.js +111 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.unit.js +112 -0
- package/dist/features/pull-requests/create-pull-request/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/create-pull-request/index.d.ts +2 -0
- package/dist/features/pull-requests/create-pull-request/index.js +19 -0
- package/dist/features/pull-requests/create-pull-request/index.js.map +1 -0
- package/dist/features/pull-requests/create-pull-request/schema.d.ts +2 -0
- package/dist/features/pull-requests/create-pull-request/schema.js +6 -0
- package/dist/features/pull-requests/create-pull-request/schema.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request/feature.d.ts +6 -0
- package/dist/features/pull-requests/get-pull-request/feature.js +22 -0
- package/dist/features/pull-requests/get-pull-request/feature.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.int.js +109 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.unit.js +37 -0
- package/dist/features/pull-requests/get-pull-request/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request/index.d.ts +2 -0
- package/dist/features/pull-requests/get-pull-request/index.js +19 -0
- package/dist/features/pull-requests/get-pull-request/index.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request/schema.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request/schema.js +6 -0
- package/dist/features/pull-requests/get-pull-request/schema.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.d.ts +22 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.js +60 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.spec.unit.js +77 -0
- package/dist/features/pull-requests/get-pull-request-changes/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-changes/index.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-changes/index.js +18 -0
- package/dist/features/pull-requests/get-pull-request-changes/index.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.d.ts +51 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.js +259 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.spec.unit.js +138 -0
- package/dist/features/pull-requests/get-pull-request-checks/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-checks/index.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-checks/index.js +18 -0
- package/dist/features/pull-requests/get-pull-request-checks/index.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.d.ts +13 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.js +88 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.int.js +216 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.unit.js +340 -0
- package/dist/features/pull-requests/get-pull-request-comments/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/index.d.ts +1 -0
- package/dist/features/pull-requests/get-pull-request-comments/index.js +18 -0
- package/dist/features/pull-requests/get-pull-request-comments/index.js.map +1 -0
- package/dist/features/pull-requests/index.d.ts +20 -0
- package/dist/features/pull-requests/index.js +157 -0
- package/dist/features/pull-requests/index.js.map +1 -0
- package/dist/features/pull-requests/index.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/index.spec.unit.js +261 -0
- package/dist/features/pull-requests/index.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/list-pull-requests/feature.d.ts +17 -0
- package/dist/features/pull-requests/list-pull-requests/feature.js +81 -0
- package/dist/features/pull-requests/list-pull-requests/feature.js.map +1 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.int.js +124 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.unit.js +180 -0
- package/dist/features/pull-requests/list-pull-requests/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/list-pull-requests/index.d.ts +2 -0
- package/dist/features/pull-requests/list-pull-requests/index.js +19 -0
- package/dist/features/pull-requests/list-pull-requests/index.js.map +1 -0
- package/dist/features/pull-requests/list-pull-requests/schema.d.ts +1 -0
- package/dist/features/pull-requests/list-pull-requests/schema.js +6 -0
- package/dist/features/pull-requests/list-pull-requests/schema.js.map +1 -0
- package/dist/features/pull-requests/schemas.d.ts +318 -0
- package/dist/features/pull-requests/schemas.js +283 -0
- package/dist/features/pull-requests/schemas.js.map +1 -0
- package/dist/features/pull-requests/tool-definitions.d.ts +5 -0
- package/dist/features/pull-requests/tool-definitions.js +55 -0
- package/dist/features/pull-requests/tool-definitions.js.map +1 -0
- package/dist/features/pull-requests/types.d.ts +100 -0
- package/dist/features/pull-requests/types.js +3 -0
- package/dist/features/pull-requests/types.js.map +1 -0
- package/dist/features/pull-requests/update-pull-request/feature.d.ts +9 -0
- package/dist/features/pull-requests/update-pull-request/feature.js +250 -0
- package/dist/features/pull-requests/update-pull-request/feature.js.map +1 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.int.d.ts +1 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.int.js +162 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.int.js.map +1 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.unit.d.ts +1 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.unit.js +280 -0
- package/dist/features/pull-requests/update-pull-request/feature.spec.unit.js.map +1 -0
- package/dist/features/pull-requests/update-pull-request/index.d.ts +1 -0
- package/dist/features/pull-requests/update-pull-request/index.js +18 -0
- package/dist/features/pull-requests/update-pull-request/index.js.map +1 -0
- package/dist/features/releases/create-release/feature.d.ts +3 -0
- package/dist/features/releases/create-release/feature.js +51 -0
- package/dist/features/releases/create-release/feature.js.map +1 -0
- package/dist/features/releases/create-release/index.d.ts +2 -0
- package/dist/features/releases/create-release/index.js +19 -0
- package/dist/features/releases/create-release/index.js.map +1 -0
- package/dist/features/releases/create-release/schema.d.ts +20 -0
- package/dist/features/releases/create-release/schema.js +24 -0
- package/dist/features/releases/create-release/schema.js.map +1 -0
- package/dist/features/releases/deploy-release-stage/feature.d.ts +9 -0
- package/dist/features/releases/deploy-release-stage/feature.js +38 -0
- package/dist/features/releases/deploy-release-stage/feature.js.map +1 -0
- package/dist/features/releases/deploy-release-stage/index.d.ts +2 -0
- package/dist/features/releases/deploy-release-stage/index.js +19 -0
- package/dist/features/releases/deploy-release-stage/index.js.map +1 -0
- package/dist/features/releases/deploy-release-stage/schema.d.ts +17 -0
- package/dist/features/releases/deploy-release-stage/schema.js +20 -0
- package/dist/features/releases/deploy-release-stage/schema.js.map +1 -0
- package/dist/features/releases/get-release/feature.d.ts +3 -0
- package/dist/features/releases/get-release/feature.js +34 -0
- package/dist/features/releases/get-release/feature.js.map +1 -0
- package/dist/features/releases/get-release/index.d.ts +2 -0
- package/dist/features/releases/get-release/index.js +19 -0
- package/dist/features/releases/get-release/index.js.map +1 -0
- package/dist/features/releases/get-release/schema.d.ts +11 -0
- package/dist/features/releases/get-release/schema.js +13 -0
- package/dist/features/releases/get-release/schema.js.map +1 -0
- package/dist/features/releases/get-release-definition/feature.d.ts +3 -0
- package/dist/features/releases/get-release-definition/feature.js +34 -0
- package/dist/features/releases/get-release-definition/feature.js.map +1 -0
- package/dist/features/releases/get-release-definition/index.d.ts +2 -0
- package/dist/features/releases/get-release-definition/index.js +19 -0
- package/dist/features/releases/get-release-definition/index.js.map +1 -0
- package/dist/features/releases/get-release-definition/schema.d.ts +11 -0
- package/dist/features/releases/get-release-definition/schema.js +13 -0
- package/dist/features/releases/get-release-definition/schema.js.map +1 -0
- package/dist/features/releases/index.d.ts +11 -0
- package/dist/features/releases/index.js +121 -0
- package/dist/features/releases/index.js.map +1 -0
- package/dist/features/releases/list-release-definitions/feature.d.ts +3 -0
- package/dist/features/releases/list-release-definitions/feature.js +31 -0
- package/dist/features/releases/list-release-definitions/feature.js.map +1 -0
- package/dist/features/releases/list-release-definitions/index.d.ts +2 -0
- package/dist/features/releases/list-release-definitions/index.js +19 -0
- package/dist/features/releases/list-release-definitions/index.js.map +1 -0
- package/dist/features/releases/list-release-definitions/schema.d.ts +17 -0
- package/dist/features/releases/list-release-definitions/schema.js +24 -0
- package/dist/features/releases/list-release-definitions/schema.js.map +1 -0
- package/dist/features/releases/list-releases/feature.d.ts +3 -0
- package/dist/features/releases/list-releases/feature.js +31 -0
- package/dist/features/releases/list-releases/feature.js.map +1 -0
- package/dist/features/releases/list-releases/index.d.ts +2 -0
- package/dist/features/releases/list-releases/index.js +19 -0
- package/dist/features/releases/list-releases/index.js.map +1 -0
- package/dist/features/releases/list-releases/schema.d.ts +26 -0
- package/dist/features/releases/list-releases/schema.js +30 -0
- package/dist/features/releases/list-releases/schema.js.map +1 -0
- package/dist/features/releases/tool-definitions.d.ts +2 -0
- package/dist/features/releases/tool-definitions.js +49 -0
- package/dist/features/releases/tool-definitions.js.map +1 -0
- package/dist/features/releases/types.d.ts +32 -0
- package/dist/features/releases/types.js +3 -0
- package/dist/features/releases/types.js.map +1 -0
- package/dist/features/repositories/__test__/test-helpers.d.ts +13 -0
- package/dist/features/repositories/__test__/test-helpers.js +35 -0
- package/dist/features/repositories/__test__/test-helpers.js.map +1 -0
- package/dist/features/repositories/create-branch/feature.d.ts +6 -0
- package/dist/features/repositories/create-branch/feature.js +33 -0
- package/dist/features/repositories/create-branch/feature.js.map +1 -0
- package/dist/features/repositories/create-branch/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/create-branch/feature.spec.unit.js +36 -0
- package/dist/features/repositories/create-branch/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/create-branch/index.d.ts +1 -0
- package/dist/features/repositories/create-branch/index.js +18 -0
- package/dist/features/repositories/create-branch/index.js.map +1 -0
- package/dist/features/repositories/create-commit/feature.d.ts +6 -0
- package/dist/features/repositories/create-commit/feature.js +122 -0
- package/dist/features/repositories/create-commit/feature.js.map +1 -0
- package/dist/features/repositories/create-commit/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/create-commit/feature.spec.unit.js +157 -0
- package/dist/features/repositories/create-commit/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/create-commit/index.d.ts +1 -0
- package/dist/features/repositories/create-commit/index.js +18 -0
- package/dist/features/repositories/create-commit/index.js.map +1 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.d.ts +22 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.js +303 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.js.map +1 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.int.d.ts +1 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.int.js +89 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.int.js.map +1 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.unit.js +391 -0
- package/dist/features/repositories/get-all-repositories-tree/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/get-all-repositories-tree/index.d.ts +2 -0
- package/dist/features/repositories/get-all-repositories-tree/index.js +19 -0
- package/dist/features/repositories/get-all-repositories-tree/index.js.map +1 -0
- package/dist/features/repositories/get-all-repositories-tree/schema.d.ts +2 -0
- package/dist/features/repositories/get-all-repositories-tree/schema.js +6 -0
- package/dist/features/repositories/get-all-repositories-tree/schema.js.map +1 -0
- package/dist/features/repositories/get-file-content/feature.d.ts +23 -0
- package/dist/features/repositories/get-file-content/feature.js +96 -0
- package/dist/features/repositories/get-file-content/feature.js.map +1 -0
- package/dist/features/repositories/get-file-content/feature.spec.int.d.ts +1 -0
- package/dist/features/repositories/get-file-content/feature.spec.int.js +86 -0
- package/dist/features/repositories/get-file-content/feature.spec.int.js.map +1 -0
- package/dist/features/repositories/get-file-content/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/get-file-content/feature.spec.unit.js +128 -0
- package/dist/features/repositories/get-file-content/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/get-file-content/index.d.ts +2 -0
- package/dist/features/repositories/get-file-content/index.js +19 -0
- package/dist/features/repositories/get-file-content/index.js.map +1 -0
- package/dist/features/repositories/get-file-content/schema.d.ts +2 -0
- package/dist/features/repositories/get-file-content/schema.js +6 -0
- package/dist/features/repositories/get-file-content/schema.js.map +1 -0
- package/dist/features/repositories/get-repository/feature.d.ts +12 -0
- package/dist/features/repositories/get-repository/feature.js +30 -0
- package/dist/features/repositories/get-repository/feature.js.map +1 -0
- package/dist/features/repositories/get-repository/feature.spec.int.d.ts +1 -0
- package/dist/features/repositories/get-repository/feature.spec.int.js +44 -0
- package/dist/features/repositories/get-repository/feature.spec.int.js.map +1 -0
- package/dist/features/repositories/get-repository/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/get-repository/feature.spec.unit.js +41 -0
- package/dist/features/repositories/get-repository/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/get-repository/index.d.ts +2 -0
- package/dist/features/repositories/get-repository/index.js +19 -0
- package/dist/features/repositories/get-repository/index.js.map +1 -0
- package/dist/features/repositories/get-repository/schema.d.ts +2 -0
- package/dist/features/repositories/get-repository/schema.js +6 -0
- package/dist/features/repositories/get-repository/schema.js.map +1 -0
- package/dist/features/repositories/get-repository-details/feature.d.ts +11 -0
- package/dist/features/repositories/get-repository-details/feature.js +67 -0
- package/dist/features/repositories/get-repository-details/feature.js.map +1 -0
- package/dist/features/repositories/get-repository-details/feature.spec.int.d.ts +1 -0
- package/dist/features/repositories/get-repository-details/feature.spec.int.js +119 -0
- package/dist/features/repositories/get-repository-details/feature.spec.int.js.map +1 -0
- package/dist/features/repositories/get-repository-details/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/get-repository-details/feature.spec.unit.js +255 -0
- package/dist/features/repositories/get-repository-details/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/get-repository-details/index.d.ts +2 -0
- package/dist/features/repositories/get-repository-details/index.js +19 -0
- package/dist/features/repositories/get-repository-details/index.js.map +1 -0
- package/dist/features/repositories/get-repository-details/schema.d.ts +2 -0
- package/dist/features/repositories/get-repository-details/schema.js +6 -0
- package/dist/features/repositories/get-repository-details/schema.js.map +1 -0
- package/dist/features/repositories/get-repository-tree/feature.d.ts +6 -0
- package/dist/features/repositories/get-repository-tree/feature.js +65 -0
- package/dist/features/repositories/get-repository-tree/feature.js.map +1 -0
- package/dist/features/repositories/get-repository-tree/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/get-repository-tree/feature.spec.unit.js +69 -0
- package/dist/features/repositories/get-repository-tree/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/get-repository-tree/index.d.ts +1 -0
- package/dist/features/repositories/get-repository-tree/index.js +18 -0
- package/dist/features/repositories/get-repository-tree/index.js.map +1 -0
- package/dist/features/repositories/index.d.ts +21 -0
- package/dist/features/repositories/index.js +179 -0
- package/dist/features/repositories/index.js.map +1 -0
- package/dist/features/repositories/index.spec.unit.d.ts +1 -0
- package/dist/features/repositories/index.spec.unit.js +291 -0
- package/dist/features/repositories/index.spec.unit.js.map +1 -0
- package/dist/features/repositories/list-commits/feature.d.ts +6 -0
- package/dist/features/repositories/list-commits/feature.js +75 -0
- package/dist/features/repositories/list-commits/feature.js.map +1 -0
- package/dist/features/repositories/list-commits/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/list-commits/feature.spec.unit.js +58 -0
- package/dist/features/repositories/list-commits/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/list-commits/index.d.ts +1 -0
- package/dist/features/repositories/list-commits/index.js +18 -0
- package/dist/features/repositories/list-commits/index.js.map +1 -0
- package/dist/features/repositories/list-repositories/feature.d.ts +10 -0
- package/dist/features/repositories/list-repositories/feature.js +25 -0
- package/dist/features/repositories/list-repositories/feature.js.map +1 -0
- package/dist/features/repositories/list-repositories/feature.spec.int.d.ts +1 -0
- package/dist/features/repositories/list-repositories/feature.spec.int.js +56 -0
- package/dist/features/repositories/list-repositories/feature.spec.int.js.map +1 -0
- package/dist/features/repositories/list-repositories/feature.spec.unit.d.ts +1 -0
- package/dist/features/repositories/list-repositories/feature.spec.unit.js +59 -0
- package/dist/features/repositories/list-repositories/feature.spec.unit.js.map +1 -0
- package/dist/features/repositories/list-repositories/index.d.ts +2 -0
- package/dist/features/repositories/list-repositories/index.js +19 -0
- package/dist/features/repositories/list-repositories/index.js.map +1 -0
- package/dist/features/repositories/list-repositories/schema.d.ts +2 -0
- package/dist/features/repositories/list-repositories/schema.js +6 -0
- package/dist/features/repositories/list-repositories/schema.js.map +1 -0
- package/dist/features/repositories/schemas.d.ts +237 -0
- package/dist/features/repositories/schemas.js +306 -0
- package/dist/features/repositories/schemas.js.map +1 -0
- package/dist/features/repositories/tool-definitions.d.ts +5 -0
- package/dist/features/repositories/tool-definitions.js +94 -0
- package/dist/features/repositories/tool-definitions.js.map +1 -0
- package/dist/features/repositories/types.d.ts +167 -0
- package/dist/features/repositories/types.js +3 -0
- package/dist/features/repositories/types.js.map +1 -0
- package/dist/features/search/index.d.ts +15 -0
- package/dist/features/search/index.js +65 -0
- package/dist/features/search/index.js.map +1 -0
- package/dist/features/search/index.spec.unit.d.ts +1 -0
- package/dist/features/search/index.spec.unit.js +143 -0
- package/dist/features/search/index.spec.unit.js.map +1 -0
- package/dist/features/search/schemas.d.ts +171 -0
- package/dist/features/search/schemas.js +159 -0
- package/dist/features/search/schemas.js.map +1 -0
- package/dist/features/search/schemas.spec.unit.d.ts +1 -0
- package/dist/features/search/schemas.spec.unit.js +39 -0
- package/dist/features/search/schemas.spec.unit.js.map +1 -0
- package/dist/features/search/search-code/feature.d.ts +10 -0
- package/dist/features/search/search-code/feature.js +177 -0
- package/dist/features/search/search-code/feature.js.map +1 -0
- package/dist/features/search/search-code/feature.spec.int.d.ts +1 -0
- package/dist/features/search/search-code/feature.spec.int.js +192 -0
- package/dist/features/search/search-code/feature.spec.int.js.map +1 -0
- package/dist/features/search/search-code/feature.spec.unit.d.ts +1 -0
- package/dist/features/search/search-code/feature.spec.unit.js +968 -0
- package/dist/features/search/search-code/feature.spec.unit.js.map +1 -0
- package/dist/features/search/search-code/index.d.ts +2 -0
- package/dist/features/search/search-code/index.js +19 -0
- package/dist/features/search/search-code/index.js.map +1 -0
- package/dist/features/search/search-wiki/feature.d.ts +10 -0
- package/dist/features/search/search-wiki/feature.js +132 -0
- package/dist/features/search/search-wiki/feature.js.map +1 -0
- package/dist/features/search/search-wiki/feature.spec.int.d.ts +1 -0
- package/dist/features/search/search-wiki/feature.spec.int.js +67 -0
- package/dist/features/search/search-wiki/feature.spec.int.js.map +1 -0
- package/dist/features/search/search-wiki/feature.spec.unit.d.ts +1 -0
- package/dist/features/search/search-wiki/feature.spec.unit.js +176 -0
- package/dist/features/search/search-wiki/feature.spec.unit.js.map +1 -0
- package/dist/features/search/search-wiki/index.d.ts +1 -0
- package/dist/features/search/search-wiki/index.js +18 -0
- package/dist/features/search/search-wiki/index.js.map +1 -0
- package/dist/features/search/search-work-items/feature.d.ts +10 -0
- package/dist/features/search/search-work-items/feature.js +118 -0
- package/dist/features/search/search-work-items/feature.js.map +1 -0
- package/dist/features/search/search-work-items/feature.spec.int.d.ts +1 -0
- package/dist/features/search/search-work-items/feature.spec.int.js +150 -0
- package/dist/features/search/search-work-items/feature.spec.int.js.map +1 -0
- package/dist/features/search/search-work-items/feature.spec.unit.d.ts +1 -0
- package/dist/features/search/search-work-items/feature.spec.unit.js +342 -0
- package/dist/features/search/search-work-items/feature.spec.unit.js.map +1 -0
- package/dist/features/search/search-work-items/index.d.ts +1 -0
- package/dist/features/search/search-work-items/index.js +18 -0
- package/dist/features/search/search-work-items/index.js.map +1 -0
- package/dist/features/search/tool-definitions.d.ts +5 -0
- package/dist/features/search/tool-definitions.js +26 -0
- package/dist/features/search/tool-definitions.js.map +1 -0
- package/dist/features/search/types.d.ts +537 -0
- package/dist/features/search/types.js +3 -0
- package/dist/features/search/types.js.map +1 -0
- package/dist/features/users/get-me/feature.d.ts +12 -0
- package/dist/features/users/get-me/feature.js +96 -0
- package/dist/features/users/get-me/feature.js.map +1 -0
- package/dist/features/users/get-me/feature.spec.int.d.ts +1 -0
- package/dist/features/users/get-me/feature.spec.int.js +33 -0
- package/dist/features/users/get-me/feature.spec.int.js.map +1 -0
- package/dist/features/users/get-me/feature.spec.unit.d.ts +1 -0
- package/dist/features/users/get-me/feature.spec.unit.js +164 -0
- package/dist/features/users/get-me/feature.spec.unit.js.map +1 -0
- package/dist/features/users/get-me/index.d.ts +2 -0
- package/dist/features/users/get-me/index.js +19 -0
- package/dist/features/users/get-me/index.js.map +1 -0
- package/dist/features/users/get-me/schema.d.ts +2 -0
- package/dist/features/users/get-me/schema.js +6 -0
- package/dist/features/users/get-me/schema.js.map +1 -0
- package/dist/features/users/index.d.ts +17 -0
- package/dist/features/users/index.js +52 -0
- package/dist/features/users/index.js.map +1 -0
- package/dist/features/users/index.spec.unit.d.ts +1 -0
- package/dist/features/users/index.spec.unit.js +71 -0
- package/dist/features/users/index.spec.unit.js.map +1 -0
- package/dist/features/users/schemas.d.ts +5 -0
- package/dist/features/users/schemas.js +9 -0
- package/dist/features/users/schemas.js.map +1 -0
- package/dist/features/users/tool-definitions.d.ts +5 -0
- package/dist/features/users/tool-definitions.js +16 -0
- package/dist/features/users/tool-definitions.js.map +1 -0
- package/dist/features/users/types.d.ts +17 -0
- package/dist/features/users/types.js +3 -0
- package/dist/features/users/types.js.map +1 -0
- package/dist/features/wikis/create-wiki/feature.d.ts +49 -0
- package/dist/features/wikis/create-wiki/feature.js +56 -0
- package/dist/features/wikis/create-wiki/feature.js.map +1 -0
- package/dist/features/wikis/create-wiki/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/create-wiki/feature.spec.int.js +44 -0
- package/dist/features/wikis/create-wiki/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/create-wiki/feature.spec.unit.d.ts +1 -0
- package/dist/features/wikis/create-wiki/feature.spec.unit.js +168 -0
- package/dist/features/wikis/create-wiki/feature.spec.unit.js.map +1 -0
- package/dist/features/wikis/create-wiki/index.d.ts +2 -0
- package/dist/features/wikis/create-wiki/index.js +9 -0
- package/dist/features/wikis/create-wiki/index.js.map +1 -0
- package/dist/features/wikis/create-wiki/schema.d.ts +53 -0
- package/dist/features/wikis/create-wiki/schema.js +60 -0
- package/dist/features/wikis/create-wiki/schema.js.map +1 -0
- package/dist/features/wikis/create-wiki-page/feature.d.ts +18 -0
- package/dist/features/wikis/create-wiki-page/feature.js +95 -0
- package/dist/features/wikis/create-wiki-page/feature.js.map +1 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.int.js +274 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.unit.d.ts +1 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.unit.js +141 -0
- package/dist/features/wikis/create-wiki-page/feature.spec.unit.js.map +1 -0
- package/dist/features/wikis/create-wiki-page/index.d.ts +2 -0
- package/dist/features/wikis/create-wiki-page/index.js +8 -0
- package/dist/features/wikis/create-wiki-page/index.js.map +1 -0
- package/dist/features/wikis/create-wiki-page/schema.d.ts +26 -0
- package/dist/features/wikis/create-wiki-page/schema.js +36 -0
- package/dist/features/wikis/create-wiki-page/schema.js.map +1 -0
- package/dist/features/wikis/get-wiki-page/feature.d.ts +33 -0
- package/dist/features/wikis/get-wiki-page/feature.js +68 -0
- package/dist/features/wikis/get-wiki-page/feature.js.map +1 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.int.js +58 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.unit.d.ts +1 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.unit.js +121 -0
- package/dist/features/wikis/get-wiki-page/feature.spec.unit.js.map +1 -0
- package/dist/features/wikis/get-wiki-page/index.d.ts +2 -0
- package/dist/features/wikis/get-wiki-page/index.js +8 -0
- package/dist/features/wikis/get-wiki-page/index.js.map +1 -0
- package/dist/features/wikis/get-wiki-page/schema.d.ts +20 -0
- package/dist/features/wikis/get-wiki-page/schema.js +23 -0
- package/dist/features/wikis/get-wiki-page/schema.js.map +1 -0
- package/dist/features/wikis/get-wikis/feature.d.ts +25 -0
- package/dist/features/wikis/get-wikis/feature.js +37 -0
- package/dist/features/wikis/get-wikis/feature.js.map +1 -0
- package/dist/features/wikis/get-wikis/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/get-wikis/feature.spec.int.js +34 -0
- package/dist/features/wikis/get-wikis/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/get-wikis/feature.spec.unit.d.ts +1 -0
- package/dist/features/wikis/get-wikis/feature.spec.unit.js +83 -0
- package/dist/features/wikis/get-wikis/feature.spec.unit.js.map +1 -0
- package/dist/features/wikis/get-wikis/index.d.ts +2 -0
- package/dist/features/wikis/get-wikis/index.js +8 -0
- package/dist/features/wikis/get-wikis/index.js.map +1 -0
- package/dist/features/wikis/get-wikis/schema.d.ts +14 -0
- package/dist/features/wikis/get-wikis/schema.js +21 -0
- package/dist/features/wikis/get-wikis/schema.js.map +1 -0
- package/dist/features/wikis/index.d.ts +16 -0
- package/dist/features/wikis/index.js +141 -0
- package/dist/features/wikis/index.js.map +1 -0
- package/dist/features/wikis/index.spec.unit.d.ts +1 -0
- package/dist/features/wikis/index.spec.unit.js +214 -0
- package/dist/features/wikis/index.spec.unit.js.map +1 -0
- package/dist/features/wikis/list-wiki-pages/feature.d.ts +20 -0
- package/dist/features/wikis/list-wiki-pages/feature.js +79 -0
- package/dist/features/wikis/list-wiki-pages/feature.js.map +1 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.int.js +230 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.unit.d.ts +1 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.unit.js +427 -0
- package/dist/features/wikis/list-wiki-pages/feature.spec.unit.js.map +1 -0
- package/dist/features/wikis/list-wiki-pages/index.d.ts +2 -0
- package/dist/features/wikis/list-wiki-pages/index.js +8 -0
- package/dist/features/wikis/list-wiki-pages/index.js.map +1 -0
- package/dist/features/wikis/list-wiki-pages/schema.d.ts +18 -0
- package/dist/features/wikis/list-wiki-pages/schema.js +22 -0
- package/dist/features/wikis/list-wiki-pages/schema.js.map +1 -0
- package/dist/features/wikis/tool-definitions.d.ts +5 -0
- package/dist/features/wikis/tool-definitions.js +46 -0
- package/dist/features/wikis/tool-definitions.js.map +1 -0
- package/dist/features/wikis/update-wiki-page/feature.d.ts +12 -0
- package/dist/features/wikis/update-wiki-page/feature.js +63 -0
- package/dist/features/wikis/update-wiki-page/feature.js.map +1 -0
- package/dist/features/wikis/update-wiki-page/feature.spec.int.d.ts +1 -0
- package/dist/features/wikis/update-wiki-page/feature.spec.int.js +39 -0
- package/dist/features/wikis/update-wiki-page/feature.spec.int.js.map +1 -0
- package/dist/features/wikis/update-wiki-page/index.d.ts +2 -0
- package/dist/features/wikis/update-wiki-page/index.js +8 -0
- package/dist/features/wikis/update-wiki-page/index.js.map +1 -0
- package/dist/features/wikis/update-wiki-page/schema.d.ts +26 -0
- package/dist/features/wikis/update-wiki-page/schema.js +32 -0
- package/dist/features/wikis/update-wiki-page/schema.js.map +1 -0
- package/dist/features/work-items/__test__/fixtures.d.ts +9 -0
- package/dist/features/work-items/__test__/fixtures.js +28 -0
- package/dist/features/work-items/__test__/fixtures.js.map +1 -0
- package/dist/features/work-items/__test__/test-helpers.d.ts +13 -0
- package/dist/features/work-items/__test__/test-helpers.js +35 -0
- package/dist/features/work-items/__test__/test-helpers.js.map +1 -0
- package/dist/features/work-items/__test__/test-utils.d.ts +17 -0
- package/dist/features/work-items/__test__/test-utils.js +39 -0
- package/dist/features/work-items/__test__/test-utils.js.map +1 -0
- package/dist/features/work-items/create-work-item/feature.d.ts +12 -0
- package/dist/features/work-items/create-work-item/feature.js +99 -0
- package/dist/features/work-items/create-work-item/feature.js.map +1 -0
- package/dist/features/work-items/create-work-item/feature.spec.int.d.ts +1 -0
- package/dist/features/work-items/create-work-item/feature.spec.int.js +105 -0
- package/dist/features/work-items/create-work-item/feature.spec.int.js.map +1 -0
- package/dist/features/work-items/create-work-item/feature.spec.unit.d.ts +1 -0
- package/dist/features/work-items/create-work-item/feature.spec.unit.js +46 -0
- package/dist/features/work-items/create-work-item/feature.spec.unit.js.map +1 -0
- package/dist/features/work-items/create-work-item/index.d.ts +2 -0
- package/dist/features/work-items/create-work-item/index.js +19 -0
- package/dist/features/work-items/create-work-item/index.js.map +1 -0
- package/dist/features/work-items/create-work-item/schema.d.ts +2 -0
- package/dist/features/work-items/create-work-item/schema.js +6 -0
- package/dist/features/work-items/create-work-item/schema.js.map +1 -0
- package/dist/features/work-items/get-work-item/feature.d.ts +12 -0
- package/dist/features/work-items/get-work-item/feature.js +69 -0
- package/dist/features/work-items/get-work-item/feature.js.map +1 -0
- package/dist/features/work-items/get-work-item/feature.spec.int.d.ts +1 -0
- package/dist/features/work-items/get-work-item/feature.spec.int.js +138 -0
- package/dist/features/work-items/get-work-item/feature.spec.int.js.map +1 -0
- package/dist/features/work-items/get-work-item/feature.spec.unit.d.ts +1 -0
- package/dist/features/work-items/get-work-item/feature.spec.unit.js +31 -0
- package/dist/features/work-items/get-work-item/feature.spec.unit.js.map +1 -0
- package/dist/features/work-items/get-work-item/index.d.ts +2 -0
- package/dist/features/work-items/get-work-item/index.js +19 -0
- package/dist/features/work-items/get-work-item/index.js.map +1 -0
- package/dist/features/work-items/get-work-item/schema.d.ts +2 -0
- package/dist/features/work-items/get-work-item/schema.js +6 -0
- package/dist/features/work-items/get-work-item/schema.js.map +1 -0
- package/dist/features/work-items/index.d.ts +17 -0
- package/dist/features/work-items/index.js +122 -0
- package/dist/features/work-items/index.js.map +1 -0
- package/dist/features/work-items/index.spec.unit.d.ts +1 -0
- package/dist/features/work-items/index.spec.unit.js +232 -0
- package/dist/features/work-items/index.spec.unit.js.map +1 -0
- package/dist/features/work-items/list-work-items/feature.d.ts +10 -0
- package/dist/features/work-items/list-work-items/feature.js +89 -0
- package/dist/features/work-items/list-work-items/feature.js.map +1 -0
- package/dist/features/work-items/list-work-items/feature.spec.int.d.ts +1 -0
- package/dist/features/work-items/list-work-items/feature.spec.int.js +103 -0
- package/dist/features/work-items/list-work-items/feature.spec.int.js.map +1 -0
- package/dist/features/work-items/list-work-items/feature.spec.unit.d.ts +1 -0
- package/dist/features/work-items/list-work-items/feature.spec.unit.js +95 -0
- package/dist/features/work-items/list-work-items/feature.spec.unit.js.map +1 -0
- package/dist/features/work-items/list-work-items/index.d.ts +2 -0
- package/dist/features/work-items/list-work-items/index.js +19 -0
- package/dist/features/work-items/list-work-items/index.js.map +1 -0
- package/dist/features/work-items/list-work-items/schema.d.ts +2 -0
- package/dist/features/work-items/list-work-items/schema.js +6 -0
- package/dist/features/work-items/list-work-items/schema.js.map +1 -0
- package/dist/features/work-items/manage-work-item-link/feature.d.ts +24 -0
- package/dist/features/work-items/manage-work-item-link/feature.js +76 -0
- package/dist/features/work-items/manage-work-item-link/feature.js.map +1 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.int.d.ts +1 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.int.js +75 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.int.js.map +1 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.unit.d.ts +1 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.unit.js +137 -0
- package/dist/features/work-items/manage-work-item-link/feature.spec.unit.js.map +1 -0
- package/dist/features/work-items/manage-work-item-link/index.d.ts +2 -0
- package/dist/features/work-items/manage-work-item-link/index.js +8 -0
- package/dist/features/work-items/manage-work-item-link/index.js.map +1 -0
- package/dist/features/work-items/manage-work-item-link/schema.d.ts +2 -0
- package/dist/features/work-items/manage-work-item-link/schema.js +6 -0
- package/dist/features/work-items/manage-work-item-link/schema.js.map +1 -0
- package/dist/features/work-items/schemas.d.ts +147 -0
- package/dist/features/work-items/schemas.js +134 -0
- package/dist/features/work-items/schemas.js.map +1 -0
- package/dist/features/work-items/tool-definitions.d.ts +5 -0
- package/dist/features/work-items/tool-definitions.js +36 -0
- package/dist/features/work-items/tool-definitions.js.map +1 -0
- package/dist/features/work-items/types.d.ts +39 -0
- package/dist/features/work-items/types.js +3 -0
- package/dist/features/work-items/types.js.map +1 -0
- package/dist/features/work-items/update-work-item/feature.d.ts +12 -0
- package/dist/features/work-items/update-work-item/feature.js +103 -0
- package/dist/features/work-items/update-work-item/feature.js.map +1 -0
- package/dist/features/work-items/update-work-item/feature.spec.int.d.ts +1 -0
- package/dist/features/work-items/update-work-item/feature.spec.int.js +84 -0
- package/dist/features/work-items/update-work-item/feature.spec.int.js.map +1 -0
- package/dist/features/work-items/update-work-item/feature.spec.unit.d.ts +1 -0
- package/dist/features/work-items/update-work-item/feature.spec.unit.js +38 -0
- package/dist/features/work-items/update-work-item/feature.spec.unit.js.map +1 -0
- package/dist/features/work-items/update-work-item/index.d.ts +2 -0
- package/dist/features/work-items/update-work-item/index.js +19 -0
- package/dist/features/work-items/update-work-item/index.js.map +1 -0
- package/dist/features/work-items/update-work-item/schema.d.ts +2 -0
- package/dist/features/work-items/update-work-item/schema.js +6 -0
- package/dist/features/work-items/update-work-item/schema.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/index.spec.unit.d.ts +1 -0
- package/dist/index.spec.unit.js +83 -0
- package/dist/index.spec.unit.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +382 -0
- package/dist/server.js.map +1 -0
- package/dist/server.spec.e2e.d.ts +1 -0
- package/dist/server.spec.e2e.js +229 -0
- package/dist/server.spec.e2e.js.map +1 -0
- package/dist/setup-env.spec.unit.d.ts +1 -0
- package/dist/setup-env.spec.unit.js +146 -0
- package/dist/setup-env.spec.unit.js.map +1 -0
- package/dist/shared/api/client.d.ts +91 -0
- package/dist/shared/api/client.js +242 -0
- package/dist/shared/api/client.js.map +1 -0
- package/dist/shared/api/index.d.ts +1 -0
- package/dist/shared/api/index.js +18 -0
- package/dist/shared/api/index.js.map +1 -0
- package/dist/shared/auth/auth-factory.d.ts +43 -0
- package/dist/shared/auth/auth-factory.js +140 -0
- package/dist/shared/auth/auth-factory.js.map +1 -0
- package/dist/shared/auth/auth-factory.spec.unit.d.ts +1 -0
- package/dist/shared/auth/auth-factory.spec.unit.js +38 -0
- package/dist/shared/auth/auth-factory.spec.unit.js.map +1 -0
- package/dist/shared/auth/client-factory.d.ts +109 -0
- package/dist/shared/auth/client-factory.js +272 -0
- package/dist/shared/auth/client-factory.js.map +1 -0
- package/dist/shared/auth/index.d.ts +11 -0
- package/dist/shared/auth/index.js +18 -0
- package/dist/shared/auth/index.js.map +1 -0
- package/dist/shared/azure-devops-url.d.ts +17 -0
- package/dist/shared/azure-devops-url.js +120 -0
- package/dist/shared/azure-devops-url.js.map +1 -0
- package/dist/shared/azure-devops-url.spec.unit.d.ts +1 -0
- package/dist/shared/azure-devops-url.spec.unit.js +103 -0
- package/dist/shared/azure-devops-url.spec.unit.js.map +1 -0
- package/dist/shared/config/index.d.ts +1 -0
- package/dist/shared/config/index.js +18 -0
- package/dist/shared/config/index.js.map +1 -0
- package/dist/shared/config/version.d.ts +4 -0
- package/dist/shared/config/version.js +8 -0
- package/dist/shared/config/version.js.map +1 -0
- package/dist/shared/enums/index.d.ts +40 -0
- package/dist/shared/enums/index.js +87 -0
- package/dist/shared/enums/index.js.map +1 -0
- package/dist/shared/enums/index.spec.unit.d.ts +1 -0
- package/dist/shared/enums/index.spec.unit.js +75 -0
- package/dist/shared/enums/index.spec.unit.js.map +1 -0
- package/dist/shared/errors/azure-devops-errors.d.ts +107 -0
- package/dist/shared/errors/azure-devops-errors.js +161 -0
- package/dist/shared/errors/azure-devops-errors.js.map +1 -0
- package/dist/shared/errors/handle-request-error.d.ts +31 -0
- package/dist/shared/errors/handle-request-error.js +98 -0
- package/dist/shared/errors/handle-request-error.js.map +1 -0
- package/dist/shared/errors/index.d.ts +1 -0
- package/dist/shared/errors/index.js +18 -0
- package/dist/shared/errors/index.js.map +1 -0
- package/dist/shared/test/test-helpers.d.ts +20 -0
- package/dist/shared/test/test-helpers.js +57 -0
- package/dist/shared/test/test-helpers.js.map +1 -0
- package/dist/shared/types/config.d.ts +27 -0
- package/dist/shared/types/config.js +3 -0
- package/dist/shared/types/config.js.map +1 -0
- package/dist/shared/types/index.d.ts +1 -0
- package/dist/shared/types/index.js +18 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/types/request-handler.d.ts +21 -0
- package/dist/shared/types/request-handler.js +3 -0
- package/dist/shared/types/request-handler.js.map +1 -0
- package/dist/shared/types/tool-definition.d.ts +10 -0
- package/dist/shared/types/tool-definition.js +3 -0
- package/dist/shared/types/tool-definition.js.map +1 -0
- package/dist/shared/utils/serialize.d.ts +5 -0
- package/dist/shared/utils/serialize.js +15 -0
- package/dist/shared/utils/serialize.js.map +1 -0
- package/dist/utils/environment.d.ts +15 -0
- package/dist/utils/environment.js +52 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/environment.spec.unit.d.ts +1 -0
- package/dist/utils/environment.spec.unit.js +64 -0
- package/dist/utils/environment.spec.unit.js.map +1 -0
- package/docs/SOLUTION_SUMMARY.md +145 -0
- package/docs/authentication.md +267 -0
- package/docs/azure-identity-authentication.md +187 -0
- package/docs/ci-setup.md +61 -0
- package/docs/examples/README.md +33 -0
- package/docs/examples/azure-cli-authentication.env +25 -0
- package/docs/examples/azure-identity-authentication.env +33 -0
- package/docs/examples/pat-authentication.env +24 -0
- package/docs/important-knowledge/azure-devops-rest-api-research.md +88 -0
- package/docs/important-knowledge/llm-tldr-cli.md +37 -0
- package/docs/npm-trusted-publishers-migration.md +142 -0
- package/docs/release-troubleshooting.md +153 -0
- package/docs/testing/README.md +140 -0
- package/docs/testing/setup.md +72 -0
- package/docs/tools/README.md +73 -0
- package/docs/tools/core-navigation.md +114 -0
- package/docs/tools/organizations.md +73 -0
- package/docs/tools/pipelines.md +532 -0
- package/docs/tools/projects.md +114 -0
- package/docs/tools/pull-requests.md +1108 -0
- package/docs/tools/repositories.md +610 -0
- package/docs/tools/resources.md +133 -0
- package/docs/tools/search.md +165 -0
- package/docs/tools/user-tools.md +39 -0
- package/docs/tools/wiki.md +192 -0
- package/docs/tools/work-items.md +182 -0
- package/package.json +125 -0
|
@@ -0,0 +1,968 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axios_1 = __importDefault(require("axios"));
|
|
7
|
+
const feature_1 = require("./feature");
|
|
8
|
+
const errors_1 = require("../../../shared/errors");
|
|
9
|
+
const GitInterfaces_1 = require("azure-devops-node-api/interfaces/GitInterfaces");
|
|
10
|
+
// Mock Azure Identity
|
|
11
|
+
jest.mock('@azure/identity', () => {
|
|
12
|
+
const mockGetToken = jest.fn().mockResolvedValue({ token: 'mock-token' });
|
|
13
|
+
return {
|
|
14
|
+
DefaultAzureCredential: jest.fn().mockImplementation(() => ({
|
|
15
|
+
getToken: mockGetToken,
|
|
16
|
+
})),
|
|
17
|
+
AzureCliCredential: jest.fn().mockImplementation(() => ({
|
|
18
|
+
getToken: mockGetToken,
|
|
19
|
+
})),
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
// Mock axios
|
|
23
|
+
jest.mock('axios');
|
|
24
|
+
const mockedAxios = axios_1.default;
|
|
25
|
+
describe('searchCode unit', () => {
|
|
26
|
+
// Mock WebApi connection
|
|
27
|
+
const mockConnection = {
|
|
28
|
+
getGitApi: jest.fn().mockImplementation(() => ({
|
|
29
|
+
getItemContent: jest.fn().mockImplementation((_repoId, path) => {
|
|
30
|
+
// Return different content based on the path to simulate different files
|
|
31
|
+
if (path === '/src/example.ts') {
|
|
32
|
+
return Buffer.from('export function example() { return "test"; }');
|
|
33
|
+
}
|
|
34
|
+
return Buffer.from('// Empty file');
|
|
35
|
+
}),
|
|
36
|
+
})),
|
|
37
|
+
_getHttpClient: jest.fn().mockReturnValue({
|
|
38
|
+
getAuthorizationHeader: jest.fn().mockReturnValue('Bearer mock-token'),
|
|
39
|
+
}),
|
|
40
|
+
getCoreApi: jest.fn().mockImplementation(() => ({
|
|
41
|
+
getProjects: jest
|
|
42
|
+
.fn()
|
|
43
|
+
.mockResolvedValue([{ name: 'TestProject', id: 'project-id' }]),
|
|
44
|
+
})),
|
|
45
|
+
serverUrl: 'https://dev.azure.com/testorg',
|
|
46
|
+
};
|
|
47
|
+
// Store original console.error
|
|
48
|
+
const originalConsoleError = console.error;
|
|
49
|
+
beforeEach(() => {
|
|
50
|
+
jest.clearAllMocks();
|
|
51
|
+
// Mock console.error to prevent error messages from being displayed during tests
|
|
52
|
+
console.error = jest.fn();
|
|
53
|
+
});
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
// Restore original console.error
|
|
56
|
+
console.error = originalConsoleError;
|
|
57
|
+
});
|
|
58
|
+
test('should return search results with content', async () => {
|
|
59
|
+
// Arrange
|
|
60
|
+
const mockSearchResponse = {
|
|
61
|
+
data: {
|
|
62
|
+
count: 1,
|
|
63
|
+
results: [
|
|
64
|
+
{
|
|
65
|
+
fileName: 'example.ts',
|
|
66
|
+
path: '/src/example.ts',
|
|
67
|
+
matches: {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
charOffset: 17,
|
|
71
|
+
length: 7,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
collection: {
|
|
76
|
+
name: 'DefaultCollection',
|
|
77
|
+
},
|
|
78
|
+
project: {
|
|
79
|
+
name: 'TestProject',
|
|
80
|
+
id: 'project-id',
|
|
81
|
+
},
|
|
82
|
+
repository: {
|
|
83
|
+
name: 'TestRepo',
|
|
84
|
+
id: 'repo-id',
|
|
85
|
+
type: 'git',
|
|
86
|
+
},
|
|
87
|
+
versions: [
|
|
88
|
+
{
|
|
89
|
+
branchName: 'main',
|
|
90
|
+
changeId: 'commit-hash',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
contentId: 'content-hash',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
99
|
+
// Create a mock stream with content
|
|
100
|
+
const fileContent = 'export function example() { return "test"; }';
|
|
101
|
+
const mockStream = {
|
|
102
|
+
on: jest.fn().mockImplementation((event, callback) => {
|
|
103
|
+
if (event === 'data') {
|
|
104
|
+
// Call the callback with the data
|
|
105
|
+
callback(Buffer.from(fileContent));
|
|
106
|
+
}
|
|
107
|
+
else if (event === 'end') {
|
|
108
|
+
// Call the end callback asynchronously
|
|
109
|
+
setTimeout(callback, 0);
|
|
110
|
+
}
|
|
111
|
+
return mockStream; // Return this for chaining
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
// Mock Git API to return content
|
|
115
|
+
const mockGitApi = {
|
|
116
|
+
getItemContent: jest.fn().mockResolvedValue(mockStream),
|
|
117
|
+
};
|
|
118
|
+
const mockConnectionWithContent = {
|
|
119
|
+
...mockConnection,
|
|
120
|
+
getGitApi: jest.fn().mockResolvedValue(mockGitApi),
|
|
121
|
+
serverUrl: 'https://dev.azure.com/testorg',
|
|
122
|
+
};
|
|
123
|
+
// Act
|
|
124
|
+
const result = await (0, feature_1.searchCode)(mockConnectionWithContent, {
|
|
125
|
+
searchText: 'example',
|
|
126
|
+
projectId: 'TestProject',
|
|
127
|
+
includeContent: true,
|
|
128
|
+
});
|
|
129
|
+
// Assert
|
|
130
|
+
expect(result).toBeDefined();
|
|
131
|
+
expect(result.count).toBe(1);
|
|
132
|
+
expect(result.results).toHaveLength(1);
|
|
133
|
+
expect(result.results[0].fileName).toBe('example.ts');
|
|
134
|
+
expect(result.results[0].content).toBe('export function example() { return "test"; }');
|
|
135
|
+
expect(mockedAxios.post).toHaveBeenCalledTimes(1);
|
|
136
|
+
expect(mockGitApi.getItemContent).toHaveBeenCalledTimes(1);
|
|
137
|
+
expect(mockGitApi.getItemContent).toHaveBeenCalledWith('repo-id', '/src/example.ts', 'TestProject', undefined, undefined, undefined, undefined, false, {
|
|
138
|
+
version: 'commit-hash',
|
|
139
|
+
versionType: GitInterfaces_1.GitVersionType.Commit,
|
|
140
|
+
}, true);
|
|
141
|
+
});
|
|
142
|
+
test('should use organizationId override for services search', async () => {
|
|
143
|
+
mockedAxios.post.mockResolvedValueOnce({
|
|
144
|
+
data: {
|
|
145
|
+
count: 0,
|
|
146
|
+
results: [],
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
await (0, feature_1.searchCode)(mockConnection, {
|
|
150
|
+
searchText: 'override',
|
|
151
|
+
projectId: 'ProjectX',
|
|
152
|
+
organizationId: 'override-org',
|
|
153
|
+
});
|
|
154
|
+
expect(mockedAxios.post).toHaveBeenCalledWith('https://almsearch.dev.azure.com/override-org/ProjectX/_apis/search/codesearchresults?api-version=7.1', expect.any(Object), expect.any(Object));
|
|
155
|
+
});
|
|
156
|
+
test('should build server search URL when using Azure DevOps Server', async () => {
|
|
157
|
+
const serverConnection = {
|
|
158
|
+
...mockConnection,
|
|
159
|
+
serverUrl: 'https://ado.local/tfs/DefaultCollection',
|
|
160
|
+
};
|
|
161
|
+
mockedAxios.post.mockResolvedValueOnce({
|
|
162
|
+
data: {
|
|
163
|
+
count: 0,
|
|
164
|
+
results: [],
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
await (0, feature_1.searchCode)(serverConnection, {
|
|
168
|
+
searchText: 'server',
|
|
169
|
+
projectId: 'ProjectX',
|
|
170
|
+
});
|
|
171
|
+
expect(mockedAxios.post).toHaveBeenCalledWith('https://ado.local/tfs/DefaultCollection/ProjectX/_apis/search/codesearchresults?api-version=7.1', expect.any(Object), expect.any(Object));
|
|
172
|
+
});
|
|
173
|
+
test('should not fetch content when includeContent is false', async () => {
|
|
174
|
+
// Arrange
|
|
175
|
+
const mockSearchResponse = {
|
|
176
|
+
data: {
|
|
177
|
+
count: 1,
|
|
178
|
+
results: [
|
|
179
|
+
{
|
|
180
|
+
fileName: 'example.ts',
|
|
181
|
+
path: '/src/example.ts',
|
|
182
|
+
matches: {
|
|
183
|
+
content: [
|
|
184
|
+
{
|
|
185
|
+
charOffset: 17,
|
|
186
|
+
length: 7,
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
collection: {
|
|
191
|
+
name: 'DefaultCollection',
|
|
192
|
+
},
|
|
193
|
+
project: {
|
|
194
|
+
name: 'TestProject',
|
|
195
|
+
id: 'project-id',
|
|
196
|
+
},
|
|
197
|
+
repository: {
|
|
198
|
+
name: 'TestRepo',
|
|
199
|
+
id: 'repo-id',
|
|
200
|
+
type: 'git',
|
|
201
|
+
},
|
|
202
|
+
versions: [
|
|
203
|
+
{
|
|
204
|
+
branchName: 'main',
|
|
205
|
+
changeId: 'commit-hash',
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
contentId: 'content-hash',
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
214
|
+
// Act
|
|
215
|
+
const result = await (0, feature_1.searchCode)(mockConnection, {
|
|
216
|
+
searchText: 'example',
|
|
217
|
+
projectId: 'TestProject',
|
|
218
|
+
includeContent: false,
|
|
219
|
+
});
|
|
220
|
+
// Assert
|
|
221
|
+
expect(result).toBeDefined();
|
|
222
|
+
expect(result.count).toBe(1);
|
|
223
|
+
expect(result.results).toHaveLength(1);
|
|
224
|
+
expect(result.results[0].fileName).toBe('example.ts');
|
|
225
|
+
expect(result.results[0].content).toBeUndefined();
|
|
226
|
+
expect(mockConnection.getGitApi).not.toHaveBeenCalled();
|
|
227
|
+
});
|
|
228
|
+
test('should handle empty search results', async () => {
|
|
229
|
+
// Arrange
|
|
230
|
+
const mockSearchResponse = {
|
|
231
|
+
data: {
|
|
232
|
+
count: 0,
|
|
233
|
+
results: [],
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
237
|
+
// Act
|
|
238
|
+
const result = await (0, feature_1.searchCode)(mockConnection, {
|
|
239
|
+
searchText: 'nonexistent',
|
|
240
|
+
projectId: 'TestProject',
|
|
241
|
+
});
|
|
242
|
+
// Assert
|
|
243
|
+
expect(result).toBeDefined();
|
|
244
|
+
expect(result.count).toBe(0);
|
|
245
|
+
expect(result.results).toHaveLength(0);
|
|
246
|
+
});
|
|
247
|
+
test('should handle API errors', async () => {
|
|
248
|
+
// Arrange
|
|
249
|
+
const axiosError = new Error('API Error');
|
|
250
|
+
axiosError.isAxiosError = true;
|
|
251
|
+
axiosError.response = {
|
|
252
|
+
status: 404,
|
|
253
|
+
data: {
|
|
254
|
+
message: 'Project not found',
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
mockedAxios.post.mockRejectedValueOnce(axiosError);
|
|
258
|
+
// Act & Assert
|
|
259
|
+
await expect((0, feature_1.searchCode)(mockConnection, {
|
|
260
|
+
searchText: 'example',
|
|
261
|
+
projectId: 'NonExistentProject',
|
|
262
|
+
})).rejects.toThrow(errors_1.AzureDevOpsError);
|
|
263
|
+
});
|
|
264
|
+
test('should propagate custom errors when thrown internally', async () => {
|
|
265
|
+
// Arrange
|
|
266
|
+
const customError = new errors_1.AzureDevOpsError('Custom error');
|
|
267
|
+
// Mock axios to properly return the custom error
|
|
268
|
+
mockedAxios.post.mockImplementationOnce(() => {
|
|
269
|
+
throw customError;
|
|
270
|
+
});
|
|
271
|
+
// Act & Assert
|
|
272
|
+
await expect((0, feature_1.searchCode)(mockConnection, {
|
|
273
|
+
searchText: 'example',
|
|
274
|
+
projectId: 'TestProject',
|
|
275
|
+
})).rejects.toThrow(errors_1.AzureDevOpsError);
|
|
276
|
+
// Reset mock and set it up again for the second test
|
|
277
|
+
mockedAxios.post.mockReset();
|
|
278
|
+
mockedAxios.post.mockImplementationOnce(() => {
|
|
279
|
+
throw customError;
|
|
280
|
+
});
|
|
281
|
+
await expect((0, feature_1.searchCode)(mockConnection, {
|
|
282
|
+
searchText: 'example',
|
|
283
|
+
projectId: 'TestProject',
|
|
284
|
+
})).rejects.toThrow('Custom error');
|
|
285
|
+
});
|
|
286
|
+
test('should apply filters when provided', async () => {
|
|
287
|
+
// Arrange
|
|
288
|
+
const mockSearchResponse = {
|
|
289
|
+
data: {
|
|
290
|
+
count: 1,
|
|
291
|
+
results: [
|
|
292
|
+
{
|
|
293
|
+
fileName: 'example.ts',
|
|
294
|
+
path: '/src/example.ts',
|
|
295
|
+
matches: {
|
|
296
|
+
content: [
|
|
297
|
+
{
|
|
298
|
+
charOffset: 17,
|
|
299
|
+
length: 7,
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
collection: {
|
|
304
|
+
name: 'DefaultCollection',
|
|
305
|
+
},
|
|
306
|
+
project: {
|
|
307
|
+
name: 'TestProject',
|
|
308
|
+
id: 'project-id',
|
|
309
|
+
},
|
|
310
|
+
repository: {
|
|
311
|
+
name: 'TestRepo',
|
|
312
|
+
id: 'repo-id',
|
|
313
|
+
type: 'git',
|
|
314
|
+
},
|
|
315
|
+
versions: [
|
|
316
|
+
{
|
|
317
|
+
branchName: 'main',
|
|
318
|
+
changeId: 'commit-hash',
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
contentId: 'content-hash',
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
327
|
+
// Act
|
|
328
|
+
await (0, feature_1.searchCode)(mockConnection, {
|
|
329
|
+
searchText: 'example',
|
|
330
|
+
projectId: 'TestProject',
|
|
331
|
+
filters: {
|
|
332
|
+
Repository: ['TestRepo'],
|
|
333
|
+
Path: ['/src'],
|
|
334
|
+
Branch: ['main'],
|
|
335
|
+
CodeElement: ['function'],
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
// Assert
|
|
339
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({
|
|
340
|
+
filters: {
|
|
341
|
+
Project: ['TestProject'],
|
|
342
|
+
Repository: ['TestRepo'],
|
|
343
|
+
Path: ['/src'],
|
|
344
|
+
Branch: ['main'],
|
|
345
|
+
CodeElement: ['function'],
|
|
346
|
+
},
|
|
347
|
+
}), expect.any(Object));
|
|
348
|
+
});
|
|
349
|
+
test('should handle pagination parameters', async () => {
|
|
350
|
+
// Arrange
|
|
351
|
+
const mockSearchResponse = {
|
|
352
|
+
data: {
|
|
353
|
+
count: 100,
|
|
354
|
+
results: Array(10)
|
|
355
|
+
.fill(0)
|
|
356
|
+
.map((_, i) => ({
|
|
357
|
+
fileName: `example${i}.ts`,
|
|
358
|
+
path: `/src/example${i}.ts`,
|
|
359
|
+
matches: {
|
|
360
|
+
content: [
|
|
361
|
+
{
|
|
362
|
+
charOffset: 17,
|
|
363
|
+
length: 7,
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
},
|
|
367
|
+
collection: {
|
|
368
|
+
name: 'DefaultCollection',
|
|
369
|
+
},
|
|
370
|
+
project: {
|
|
371
|
+
name: 'TestProject',
|
|
372
|
+
id: 'project-id',
|
|
373
|
+
},
|
|
374
|
+
repository: {
|
|
375
|
+
name: 'TestRepo',
|
|
376
|
+
id: 'repo-id',
|
|
377
|
+
type: 'git',
|
|
378
|
+
},
|
|
379
|
+
versions: [
|
|
380
|
+
{
|
|
381
|
+
branchName: 'main',
|
|
382
|
+
changeId: 'commit-hash',
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
contentId: `content-hash-${i}`,
|
|
386
|
+
})),
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
390
|
+
// Act
|
|
391
|
+
await (0, feature_1.searchCode)(mockConnection, {
|
|
392
|
+
searchText: 'example',
|
|
393
|
+
projectId: 'TestProject',
|
|
394
|
+
top: 10,
|
|
395
|
+
skip: 20,
|
|
396
|
+
});
|
|
397
|
+
// Assert
|
|
398
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({
|
|
399
|
+
$top: 10,
|
|
400
|
+
$skip: 20,
|
|
401
|
+
}), expect.any(Object));
|
|
402
|
+
});
|
|
403
|
+
test('should handle errors when fetching file content', async () => {
|
|
404
|
+
// Arrange
|
|
405
|
+
const mockSearchResponse = {
|
|
406
|
+
data: {
|
|
407
|
+
count: 1,
|
|
408
|
+
results: [
|
|
409
|
+
{
|
|
410
|
+
fileName: 'example.ts',
|
|
411
|
+
path: '/src/example.ts',
|
|
412
|
+
matches: {
|
|
413
|
+
content: [
|
|
414
|
+
{
|
|
415
|
+
charOffset: 17,
|
|
416
|
+
length: 7,
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
},
|
|
420
|
+
collection: {
|
|
421
|
+
name: 'DefaultCollection',
|
|
422
|
+
},
|
|
423
|
+
project: {
|
|
424
|
+
name: 'TestProject',
|
|
425
|
+
id: 'project-id',
|
|
426
|
+
},
|
|
427
|
+
repository: {
|
|
428
|
+
name: 'TestRepo',
|
|
429
|
+
id: 'repo-id',
|
|
430
|
+
type: 'git',
|
|
431
|
+
},
|
|
432
|
+
versions: [
|
|
433
|
+
{
|
|
434
|
+
branchName: 'main',
|
|
435
|
+
changeId: 'commit-hash',
|
|
436
|
+
},
|
|
437
|
+
],
|
|
438
|
+
contentId: 'content-hash',
|
|
439
|
+
},
|
|
440
|
+
],
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
444
|
+
// Mock Git API to throw an error
|
|
445
|
+
const mockGitApi = {
|
|
446
|
+
getItemContent: jest
|
|
447
|
+
.fn()
|
|
448
|
+
.mockRejectedValue(new Error('Failed to fetch content')),
|
|
449
|
+
};
|
|
450
|
+
const mockConnectionWithError = {
|
|
451
|
+
...mockConnection,
|
|
452
|
+
getGitApi: jest.fn().mockResolvedValue(mockGitApi),
|
|
453
|
+
};
|
|
454
|
+
// Act
|
|
455
|
+
const result = await (0, feature_1.searchCode)(mockConnectionWithError, {
|
|
456
|
+
searchText: 'example',
|
|
457
|
+
projectId: 'TestProject',
|
|
458
|
+
includeContent: true,
|
|
459
|
+
});
|
|
460
|
+
// Assert
|
|
461
|
+
expect(result).toBeDefined();
|
|
462
|
+
expect(result.count).toBe(1);
|
|
463
|
+
expect(result.results).toHaveLength(1);
|
|
464
|
+
// Content should be undefined when there's an error fetching it
|
|
465
|
+
expect(result.results[0].content).toBeUndefined();
|
|
466
|
+
});
|
|
467
|
+
test('should use default project when projectId is not provided', async () => {
|
|
468
|
+
// Arrange
|
|
469
|
+
// Set up environment variable for default project
|
|
470
|
+
const originalEnv = process.env.AZURE_DEVOPS_DEFAULT_PROJECT;
|
|
471
|
+
process.env.AZURE_DEVOPS_DEFAULT_PROJECT = 'DefaultProject';
|
|
472
|
+
const mockSearchResponse = {
|
|
473
|
+
data: {
|
|
474
|
+
count: 2,
|
|
475
|
+
results: [
|
|
476
|
+
{
|
|
477
|
+
fileName: 'example1.ts',
|
|
478
|
+
path: '/src/example1.ts',
|
|
479
|
+
matches: {
|
|
480
|
+
content: [
|
|
481
|
+
{
|
|
482
|
+
charOffset: 17,
|
|
483
|
+
length: 7,
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
},
|
|
487
|
+
collection: {
|
|
488
|
+
name: 'DefaultCollection',
|
|
489
|
+
},
|
|
490
|
+
project: {
|
|
491
|
+
name: 'DefaultProject',
|
|
492
|
+
id: 'default-project-id',
|
|
493
|
+
},
|
|
494
|
+
repository: {
|
|
495
|
+
name: 'Repo1',
|
|
496
|
+
id: 'repo-id-1',
|
|
497
|
+
type: 'git',
|
|
498
|
+
},
|
|
499
|
+
versions: [
|
|
500
|
+
{
|
|
501
|
+
branchName: 'main',
|
|
502
|
+
changeId: 'commit-hash-1',
|
|
503
|
+
},
|
|
504
|
+
],
|
|
505
|
+
contentId: 'content-hash-1',
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
fileName: 'example2.ts',
|
|
509
|
+
path: '/src/example2.ts',
|
|
510
|
+
matches: {
|
|
511
|
+
content: [
|
|
512
|
+
{
|
|
513
|
+
charOffset: 17,
|
|
514
|
+
length: 7,
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
},
|
|
518
|
+
collection: {
|
|
519
|
+
name: 'DefaultCollection',
|
|
520
|
+
},
|
|
521
|
+
project: {
|
|
522
|
+
name: 'DefaultProject',
|
|
523
|
+
id: 'default-project-id',
|
|
524
|
+
},
|
|
525
|
+
repository: {
|
|
526
|
+
name: 'Repo2',
|
|
527
|
+
id: 'repo-id-2',
|
|
528
|
+
type: 'git',
|
|
529
|
+
},
|
|
530
|
+
versions: [
|
|
531
|
+
{
|
|
532
|
+
branchName: 'main',
|
|
533
|
+
changeId: 'commit-hash-2',
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
contentId: 'content-hash-2',
|
|
537
|
+
},
|
|
538
|
+
],
|
|
539
|
+
},
|
|
540
|
+
};
|
|
541
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
542
|
+
try {
|
|
543
|
+
// Act
|
|
544
|
+
const result = await (0, feature_1.searchCode)(mockConnection, {
|
|
545
|
+
searchText: 'example',
|
|
546
|
+
includeContent: false,
|
|
547
|
+
});
|
|
548
|
+
// Assert
|
|
549
|
+
expect(result).toBeDefined();
|
|
550
|
+
expect(result.count).toBe(2);
|
|
551
|
+
expect(result.results).toHaveLength(2);
|
|
552
|
+
expect(result.results[0].project.name).toBe('DefaultProject');
|
|
553
|
+
expect(result.results[1].project.name).toBe('DefaultProject');
|
|
554
|
+
expect(mockedAxios.post).toHaveBeenCalledTimes(1);
|
|
555
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(expect.stringContaining('https://almsearch.dev.azure.com/testorg/DefaultProject/_apis/search/codesearchresults'), expect.objectContaining({
|
|
556
|
+
filters: expect.objectContaining({
|
|
557
|
+
Project: ['DefaultProject'],
|
|
558
|
+
}),
|
|
559
|
+
}), expect.any(Object));
|
|
560
|
+
}
|
|
561
|
+
finally {
|
|
562
|
+
// Restore original environment variable
|
|
563
|
+
process.env.AZURE_DEVOPS_DEFAULT_PROJECT = originalEnv;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
test('should throw error when no projectId is provided and no default project is set', async () => {
|
|
567
|
+
// Arrange
|
|
568
|
+
// Ensure no default project is set
|
|
569
|
+
const originalEnv = process.env.AZURE_DEVOPS_DEFAULT_PROJECT;
|
|
570
|
+
process.env.AZURE_DEVOPS_DEFAULT_PROJECT = '';
|
|
571
|
+
try {
|
|
572
|
+
// Act & Assert
|
|
573
|
+
await expect((0, feature_1.searchCode)(mockConnection, {
|
|
574
|
+
searchText: 'example',
|
|
575
|
+
includeContent: false,
|
|
576
|
+
})).rejects.toThrow('Project ID is required');
|
|
577
|
+
}
|
|
578
|
+
finally {
|
|
579
|
+
// Restore original environment variable
|
|
580
|
+
process.env.AZURE_DEVOPS_DEFAULT_PROJECT = originalEnv;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
test('should handle includeContent for different content types', async () => {
|
|
584
|
+
// Arrange
|
|
585
|
+
const mockSearchResponse = {
|
|
586
|
+
data: {
|
|
587
|
+
count: 4,
|
|
588
|
+
results: [
|
|
589
|
+
// Result 1 - Buffer content
|
|
590
|
+
{
|
|
591
|
+
fileName: 'example1.ts',
|
|
592
|
+
path: '/src/example1.ts',
|
|
593
|
+
matches: {
|
|
594
|
+
content: [
|
|
595
|
+
{
|
|
596
|
+
charOffset: 17,
|
|
597
|
+
length: 7,
|
|
598
|
+
},
|
|
599
|
+
],
|
|
600
|
+
},
|
|
601
|
+
collection: {
|
|
602
|
+
name: 'DefaultCollection',
|
|
603
|
+
},
|
|
604
|
+
project: {
|
|
605
|
+
name: 'TestProject',
|
|
606
|
+
id: 'project-id',
|
|
607
|
+
},
|
|
608
|
+
repository: {
|
|
609
|
+
name: 'TestRepo',
|
|
610
|
+
id: 'repo-id-1',
|
|
611
|
+
type: 'git',
|
|
612
|
+
},
|
|
613
|
+
versions: [
|
|
614
|
+
{
|
|
615
|
+
branchName: 'main',
|
|
616
|
+
changeId: 'commit-hash-1',
|
|
617
|
+
},
|
|
618
|
+
],
|
|
619
|
+
contentId: 'content-hash-1',
|
|
620
|
+
},
|
|
621
|
+
// Result 2 - String content
|
|
622
|
+
{
|
|
623
|
+
fileName: 'example2.ts',
|
|
624
|
+
path: '/src/example2.ts',
|
|
625
|
+
matches: {
|
|
626
|
+
content: [
|
|
627
|
+
{
|
|
628
|
+
charOffset: 17,
|
|
629
|
+
length: 7,
|
|
630
|
+
},
|
|
631
|
+
],
|
|
632
|
+
},
|
|
633
|
+
collection: {
|
|
634
|
+
name: 'DefaultCollection',
|
|
635
|
+
},
|
|
636
|
+
project: {
|
|
637
|
+
name: 'TestProject',
|
|
638
|
+
id: 'project-id',
|
|
639
|
+
},
|
|
640
|
+
repository: {
|
|
641
|
+
name: 'TestRepo',
|
|
642
|
+
id: 'repo-id-2',
|
|
643
|
+
type: 'git',
|
|
644
|
+
},
|
|
645
|
+
versions: [
|
|
646
|
+
{
|
|
647
|
+
branchName: 'main',
|
|
648
|
+
changeId: 'commit-hash-2',
|
|
649
|
+
},
|
|
650
|
+
],
|
|
651
|
+
contentId: 'content-hash-2',
|
|
652
|
+
},
|
|
653
|
+
// Result 3 - Object content
|
|
654
|
+
{
|
|
655
|
+
fileName: 'example3.ts',
|
|
656
|
+
path: '/src/example3.ts',
|
|
657
|
+
matches: {
|
|
658
|
+
content: [
|
|
659
|
+
{
|
|
660
|
+
charOffset: 17,
|
|
661
|
+
length: 7,
|
|
662
|
+
},
|
|
663
|
+
],
|
|
664
|
+
},
|
|
665
|
+
collection: {
|
|
666
|
+
name: 'DefaultCollection',
|
|
667
|
+
},
|
|
668
|
+
project: {
|
|
669
|
+
name: 'TestProject',
|
|
670
|
+
id: 'project-id',
|
|
671
|
+
},
|
|
672
|
+
repository: {
|
|
673
|
+
name: 'TestRepo',
|
|
674
|
+
id: 'repo-id-3',
|
|
675
|
+
type: 'git',
|
|
676
|
+
},
|
|
677
|
+
versions: [
|
|
678
|
+
{
|
|
679
|
+
branchName: 'main',
|
|
680
|
+
changeId: 'commit-hash-3',
|
|
681
|
+
},
|
|
682
|
+
],
|
|
683
|
+
contentId: 'content-hash-3',
|
|
684
|
+
},
|
|
685
|
+
// Result 4 - Uint8Array content
|
|
686
|
+
{
|
|
687
|
+
fileName: 'example4.ts',
|
|
688
|
+
path: '/src/example4.ts',
|
|
689
|
+
matches: {
|
|
690
|
+
content: [
|
|
691
|
+
{
|
|
692
|
+
charOffset: 17,
|
|
693
|
+
length: 7,
|
|
694
|
+
},
|
|
695
|
+
],
|
|
696
|
+
},
|
|
697
|
+
collection: {
|
|
698
|
+
name: 'DefaultCollection',
|
|
699
|
+
},
|
|
700
|
+
project: {
|
|
701
|
+
name: 'TestProject',
|
|
702
|
+
id: 'project-id',
|
|
703
|
+
},
|
|
704
|
+
repository: {
|
|
705
|
+
name: 'TestRepo',
|
|
706
|
+
id: 'repo-id-4',
|
|
707
|
+
type: 'git',
|
|
708
|
+
},
|
|
709
|
+
versions: [
|
|
710
|
+
{
|
|
711
|
+
branchName: 'main',
|
|
712
|
+
changeId: 'commit-hash-4',
|
|
713
|
+
},
|
|
714
|
+
],
|
|
715
|
+
contentId: 'content-hash-4',
|
|
716
|
+
},
|
|
717
|
+
],
|
|
718
|
+
},
|
|
719
|
+
};
|
|
720
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
721
|
+
// Create mock contents for each type - all as streams, since that's what getItemContent returns
|
|
722
|
+
// These are all streams but with different content to demonstrate handling different data types from the stream
|
|
723
|
+
const createMockStream = (content) => ({
|
|
724
|
+
on: jest.fn().mockImplementation((event, callback) => {
|
|
725
|
+
if (event === 'data') {
|
|
726
|
+
callback(Buffer.from(content));
|
|
727
|
+
}
|
|
728
|
+
else if (event === 'end') {
|
|
729
|
+
setTimeout(callback, 0);
|
|
730
|
+
}
|
|
731
|
+
return createMockStream(content); // Return this for chaining
|
|
732
|
+
}),
|
|
733
|
+
});
|
|
734
|
+
// Create four different mock streams with different content
|
|
735
|
+
const mockStream1 = createMockStream('Buffer content');
|
|
736
|
+
const mockStream2 = createMockStream('String content');
|
|
737
|
+
const mockStream3 = createMockStream(JSON.stringify({ foo: 'bar', baz: 42 }));
|
|
738
|
+
const mockStream4 = createMockStream('hello');
|
|
739
|
+
// Mock Git API to return our different mock streams for each repository
|
|
740
|
+
const mockGitApi = {
|
|
741
|
+
getItemContent: jest
|
|
742
|
+
.fn()
|
|
743
|
+
.mockImplementationOnce(() => Promise.resolve(mockStream1))
|
|
744
|
+
.mockImplementationOnce(() => Promise.resolve(mockStream2))
|
|
745
|
+
.mockImplementationOnce(() => Promise.resolve(mockStream3))
|
|
746
|
+
.mockImplementationOnce(() => Promise.resolve(mockStream4)),
|
|
747
|
+
};
|
|
748
|
+
const mockConnectionWithStreams = {
|
|
749
|
+
...mockConnection,
|
|
750
|
+
getGitApi: jest.fn().mockResolvedValue(mockGitApi),
|
|
751
|
+
serverUrl: 'https://dev.azure.com/testorg',
|
|
752
|
+
};
|
|
753
|
+
// Act
|
|
754
|
+
const result = await (0, feature_1.searchCode)(mockConnectionWithStreams, {
|
|
755
|
+
searchText: 'example',
|
|
756
|
+
projectId: 'TestProject',
|
|
757
|
+
includeContent: true,
|
|
758
|
+
});
|
|
759
|
+
// Assert
|
|
760
|
+
expect(result).toBeDefined();
|
|
761
|
+
expect(result.count).toBe(4);
|
|
762
|
+
expect(result.results).toHaveLength(4);
|
|
763
|
+
// Check each result has appropriate content from the streams
|
|
764
|
+
// Result 1 - Buffer content stream
|
|
765
|
+
expect(result.results[0].content).toBe('Buffer content');
|
|
766
|
+
// Result 2 - String content stream
|
|
767
|
+
expect(result.results[1].content).toBe('String content');
|
|
768
|
+
// Result 3 - JSON object content stream
|
|
769
|
+
expect(result.results[2].content).toBe('{"foo":"bar","baz":42}');
|
|
770
|
+
// Result 4 - Text content stream
|
|
771
|
+
expect(result.results[3].content).toBe('hello');
|
|
772
|
+
// Git API should have been called 4 times
|
|
773
|
+
expect(mockGitApi.getItemContent).toHaveBeenCalledTimes(4);
|
|
774
|
+
// Verify the parameters for the first call
|
|
775
|
+
expect(mockGitApi.getItemContent.mock.calls[0]).toEqual([
|
|
776
|
+
'repo-id-1',
|
|
777
|
+
'/src/example1.ts',
|
|
778
|
+
'TestProject',
|
|
779
|
+
undefined,
|
|
780
|
+
undefined,
|
|
781
|
+
undefined,
|
|
782
|
+
undefined,
|
|
783
|
+
false,
|
|
784
|
+
{
|
|
785
|
+
version: 'commit-hash-1',
|
|
786
|
+
versionType: GitInterfaces_1.GitVersionType.Commit,
|
|
787
|
+
},
|
|
788
|
+
true,
|
|
789
|
+
]);
|
|
790
|
+
});
|
|
791
|
+
test('should properly convert content stream to string', async () => {
|
|
792
|
+
// Arrange
|
|
793
|
+
const mockSearchResponse = {
|
|
794
|
+
data: {
|
|
795
|
+
count: 1,
|
|
796
|
+
results: [
|
|
797
|
+
{
|
|
798
|
+
fileName: 'example.ts',
|
|
799
|
+
path: '/src/example.ts',
|
|
800
|
+
matches: {
|
|
801
|
+
content: [
|
|
802
|
+
{
|
|
803
|
+
charOffset: 17,
|
|
804
|
+
length: 7,
|
|
805
|
+
},
|
|
806
|
+
],
|
|
807
|
+
},
|
|
808
|
+
collection: {
|
|
809
|
+
name: 'DefaultCollection',
|
|
810
|
+
},
|
|
811
|
+
project: {
|
|
812
|
+
name: 'TestProject',
|
|
813
|
+
id: 'project-id',
|
|
814
|
+
},
|
|
815
|
+
repository: {
|
|
816
|
+
name: 'TestRepo',
|
|
817
|
+
id: 'repo-id',
|
|
818
|
+
type: 'git',
|
|
819
|
+
},
|
|
820
|
+
versions: [
|
|
821
|
+
{
|
|
822
|
+
branchName: 'main',
|
|
823
|
+
changeId: 'commit-hash',
|
|
824
|
+
},
|
|
825
|
+
],
|
|
826
|
+
contentId: 'content-hash',
|
|
827
|
+
},
|
|
828
|
+
],
|
|
829
|
+
},
|
|
830
|
+
};
|
|
831
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
832
|
+
// Create a mock ReadableStream
|
|
833
|
+
const mockContent = 'This is the file content';
|
|
834
|
+
// Create a simplified mock stream that emits the content
|
|
835
|
+
const mockStream = {
|
|
836
|
+
on: jest.fn().mockImplementation((event, callback) => {
|
|
837
|
+
if (event === 'data') {
|
|
838
|
+
// Call the callback with the data
|
|
839
|
+
callback(Buffer.from(mockContent));
|
|
840
|
+
}
|
|
841
|
+
else if (event === 'end') {
|
|
842
|
+
// Call the end callback asynchronously
|
|
843
|
+
setTimeout(callback, 0);
|
|
844
|
+
}
|
|
845
|
+
return mockStream; // Return this for chaining
|
|
846
|
+
}),
|
|
847
|
+
};
|
|
848
|
+
// Mock Git API to return our mock stream
|
|
849
|
+
const mockGitApi = {
|
|
850
|
+
getItemContent: jest.fn().mockResolvedValue(mockStream),
|
|
851
|
+
};
|
|
852
|
+
const mockConnectionWithStream = {
|
|
853
|
+
...mockConnection,
|
|
854
|
+
getGitApi: jest.fn().mockResolvedValue(mockGitApi),
|
|
855
|
+
serverUrl: 'https://dev.azure.com/testorg',
|
|
856
|
+
};
|
|
857
|
+
// Act
|
|
858
|
+
const result = await (0, feature_1.searchCode)(mockConnectionWithStream, {
|
|
859
|
+
searchText: 'example',
|
|
860
|
+
projectId: 'TestProject',
|
|
861
|
+
includeContent: true,
|
|
862
|
+
});
|
|
863
|
+
// Assert
|
|
864
|
+
expect(result).toBeDefined();
|
|
865
|
+
expect(result.count).toBe(1);
|
|
866
|
+
expect(result.results).toHaveLength(1);
|
|
867
|
+
// Check that the content was properly converted from stream to string
|
|
868
|
+
expect(result.results[0].content).toBe(mockContent);
|
|
869
|
+
// Verify the stream event handlers were attached
|
|
870
|
+
expect(mockStream.on).toHaveBeenCalledWith('data', expect.any(Function));
|
|
871
|
+
expect(mockStream.on).toHaveBeenCalledWith('end', expect.any(Function));
|
|
872
|
+
expect(mockStream.on).toHaveBeenCalledWith('error', expect.any(Function));
|
|
873
|
+
// Verify the parameters for getItemContent
|
|
874
|
+
expect(mockGitApi.getItemContent).toHaveBeenCalledWith('repo-id', '/src/example.ts', 'TestProject', undefined, undefined, undefined, undefined, false, {
|
|
875
|
+
version: 'commit-hash',
|
|
876
|
+
versionType: GitInterfaces_1.GitVersionType.Commit,
|
|
877
|
+
}, true);
|
|
878
|
+
});
|
|
879
|
+
test('should limit top to 10 when includeContent is true', async () => {
|
|
880
|
+
// Arrange
|
|
881
|
+
const mockSearchResponse = {
|
|
882
|
+
data: {
|
|
883
|
+
count: 10,
|
|
884
|
+
results: Array(10)
|
|
885
|
+
.fill(0)
|
|
886
|
+
.map((_, i) => ({
|
|
887
|
+
fileName: `example${i}.ts`,
|
|
888
|
+
path: `/src/example${i}.ts`,
|
|
889
|
+
matches: {
|
|
890
|
+
content: [
|
|
891
|
+
{
|
|
892
|
+
charOffset: 17,
|
|
893
|
+
length: 7,
|
|
894
|
+
},
|
|
895
|
+
],
|
|
896
|
+
},
|
|
897
|
+
collection: {
|
|
898
|
+
name: 'DefaultCollection',
|
|
899
|
+
},
|
|
900
|
+
project: {
|
|
901
|
+
name: 'TestProject',
|
|
902
|
+
id: 'project-id',
|
|
903
|
+
},
|
|
904
|
+
repository: {
|
|
905
|
+
name: 'TestRepo',
|
|
906
|
+
id: 'repo-id',
|
|
907
|
+
type: 'git',
|
|
908
|
+
},
|
|
909
|
+
versions: [
|
|
910
|
+
{
|
|
911
|
+
branchName: 'main',
|
|
912
|
+
changeId: 'commit-hash',
|
|
913
|
+
},
|
|
914
|
+
],
|
|
915
|
+
contentId: `content-hash-${i}`,
|
|
916
|
+
})),
|
|
917
|
+
},
|
|
918
|
+
};
|
|
919
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
920
|
+
// For this test, we don't need to mock the Git API since we're only testing the top parameter
|
|
921
|
+
// We'll create a connection that doesn't have includeContent functionality
|
|
922
|
+
const mockConnectionWithoutContent = {
|
|
923
|
+
...mockConnection,
|
|
924
|
+
getGitApi: jest.fn().mockImplementation(() => {
|
|
925
|
+
throw new Error('Git API not available');
|
|
926
|
+
}),
|
|
927
|
+
serverUrl: 'https://dev.azure.com/testorg',
|
|
928
|
+
};
|
|
929
|
+
// Act
|
|
930
|
+
await (0, feature_1.searchCode)(mockConnectionWithoutContent, {
|
|
931
|
+
searchText: 'example',
|
|
932
|
+
projectId: 'TestProject',
|
|
933
|
+
top: 50, // User tries to get 50 results
|
|
934
|
+
includeContent: true, // But includeContent is true
|
|
935
|
+
});
|
|
936
|
+
// Assert
|
|
937
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({
|
|
938
|
+
$top: 10, // Should be limited to 10
|
|
939
|
+
}), expect.any(Object));
|
|
940
|
+
});
|
|
941
|
+
test('should not limit top when includeContent is false', async () => {
|
|
942
|
+
// Arrange
|
|
943
|
+
const mockSearchResponse = {
|
|
944
|
+
data: {
|
|
945
|
+
count: 50,
|
|
946
|
+
results: Array(50)
|
|
947
|
+
.fill(0)
|
|
948
|
+
.map((_, i) => ({
|
|
949
|
+
// ... simplified result object
|
|
950
|
+
fileName: `example${i}.ts`,
|
|
951
|
+
})),
|
|
952
|
+
},
|
|
953
|
+
};
|
|
954
|
+
mockedAxios.post.mockResolvedValueOnce(mockSearchResponse);
|
|
955
|
+
// Act
|
|
956
|
+
await (0, feature_1.searchCode)(mockConnection, {
|
|
957
|
+
searchText: 'example',
|
|
958
|
+
projectId: 'TestProject',
|
|
959
|
+
top: 50, // User wants 50 results
|
|
960
|
+
includeContent: false, // includeContent is false
|
|
961
|
+
});
|
|
962
|
+
// Assert
|
|
963
|
+
expect(mockedAxios.post).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({
|
|
964
|
+
$top: 50, // Should use requested value
|
|
965
|
+
}), expect.any(Object));
|
|
966
|
+
});
|
|
967
|
+
});
|
|
968
|
+
//# sourceMappingURL=feature.spec.unit.js.map
|