@xemahq/scm-connector-api-client 0.1.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 +36 -0
- package/README.md +62 -0
- package/dist/custom-fetch.d.ts +30 -0
- package/dist/custom-fetch.js +160 -0
- package/dist/endpoints/change-requests/change-requests.d.ts +33 -0
- package/dist/endpoints/change-requests/change-requests.js +80 -0
- package/dist/endpoints/git-content/git-content.d.ts +43 -0
- package/dist/endpoints/git-content/git-content.js +163 -0
- package/dist/endpoints/org-repositories/org-repositories.d.ts +33 -0
- package/dist/endpoints/org-repositories/org-repositories.js +78 -0
- package/dist/endpoints/org-scm-config/org-scm-config.d.ts +58 -0
- package/dist/endpoints/org-scm-config/org-scm-config.js +222 -0
- package/dist/endpoints/project-repositories/project-repositories.d.ts +48 -0
- package/dist/endpoints/project-repositories/project-repositories.js +120 -0
- package/dist/endpoints/project-repository-git/project-repository-git.d.ts +28 -0
- package/dist/endpoints/project-repository-git/project-repository-git.js +117 -0
- package/dist/endpoints/project-repository-lifecycle/project-repository-lifecycle.d.ts +23 -0
- package/dist/endpoints/project-repository-lifecycle/project-repository-lifecycle.js +67 -0
- package/dist/endpoints/repository-snapshots/repository-snapshots.d.ts +23 -0
- package/dist/endpoints/repository-snapshots/repository-snapshots.js +46 -0
- package/dist/endpoints/scm-providers/scm-providers.d.ts +33 -0
- package/dist/endpoints/scm-providers/scm-providers.js +120 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -0
- package/dist/models/bindBranchOpDto.d.ts +15 -0
- package/dist/models/bindBranchOpDto.js +2 -0
- package/dist/models/bindBranchOpKind.d.ts +13 -0
- package/dist/models/bindBranchOpKind.js +15 -0
- package/dist/models/bindBranchOpRejectedBodyDto.d.ts +19 -0
- package/dist/models/bindBranchOpRejectedBodyDto.js +9 -0
- package/dist/models/bindRepositoryToProjectDto.d.ts +24 -0
- package/dist/models/bindRepositoryToProjectDto.js +2 -0
- package/dist/models/bindRepositoryToProjectDtoProvider.d.ts +16 -0
- package/dist/models/bindRepositoryToProjectDtoProvider.js +15 -0
- package/dist/models/bindRepositoryToProjectDtoRole.d.ts +15 -0
- package/dist/models/bindRepositoryToProjectDtoRole.js +14 -0
- package/dist/models/bindingHealthDto.d.ts +19 -0
- package/dist/models/bindingHealthDto.js +9 -0
- package/dist/models/bindingSnapshotResponseDto.d.ts +81 -0
- package/dist/models/bindingSnapshotResponseDto.js +2 -0
- package/dist/models/bindingSnapshotResponseDtoCodebaseMetadata.d.ts +14 -0
- package/dist/models/bindingSnapshotResponseDtoCodebaseMetadata.js +9 -0
- package/dist/models/bindingSnapshotResponseDtoCustomTaxonomy.d.ts +14 -0
- package/dist/models/bindingSnapshotResponseDtoCustomTaxonomy.js +9 -0
- package/dist/models/bindingSnapshotResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/bindingSnapshotResponseDtoDataEnvelope.js +2 -0
- package/dist/models/bindingSnapshotResponseDtoL1ModuleMap.d.ts +14 -0
- package/dist/models/bindingSnapshotResponseDtoL1ModuleMap.js +9 -0
- package/dist/models/bindingSnapshotResponseDtoL2FileTopology.d.ts +14 -0
- package/dist/models/bindingSnapshotResponseDtoL2FileTopology.js +9 -0
- package/dist/models/bindingSnapshotResponseDtoRepositorySummary.d.ts +14 -0
- package/dist/models/bindingSnapshotResponseDtoRepositorySummary.js +9 -0
- package/dist/models/bindingSnapshotResponseDtoRole.d.ts +15 -0
- package/dist/models/bindingSnapshotResponseDtoRole.js +14 -0
- package/dist/models/bindingSnapshotResponseDtoStatus.d.ts +17 -0
- package/dist/models/bindingSnapshotResponseDtoStatus.js +16 -0
- package/dist/models/bindingSnapshotResponseDtoTriggerKind.d.ts +17 -0
- package/dist/models/bindingSnapshotResponseDtoTriggerKind.js +16 -0
- package/dist/models/changeRequestCommentResponseDto.d.ts +16 -0
- package/dist/models/changeRequestCommentResponseDto.js +9 -0
- package/dist/models/changeRequestResponseDto.d.ts +25 -0
- package/dist/models/changeRequestResponseDto.js +2 -0
- package/dist/models/changeRequestResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/changeRequestResponseDtoDataEnvelope.js +2 -0
- package/dist/models/changeRequestResponseDtoMetadataJson.d.ts +10 -0
- package/dist/models/changeRequestResponseDtoMetadataJson.js +9 -0
- package/dist/models/checkoutInstructionResponseDto.d.ts +17 -0
- package/dist/models/checkoutInstructionResponseDto.js +9 -0
- package/dist/models/checkoutInstructionResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/checkoutInstructionResponseDtoDataEnvelope.js +2 -0
- package/dist/models/createBranchDto.d.ts +15 -0
- package/dist/models/createBranchDto.js +9 -0
- package/dist/models/createChangeRequestDto.d.ts +17 -0
- package/dist/models/createChangeRequestDto.js +9 -0
- package/dist/models/createProviderRepoDto.d.ts +21 -0
- package/dist/models/createProviderRepoDto.js +9 -0
- package/dist/models/createRepoRequestDto.d.ts +15 -0
- package/dist/models/createRepoRequestDto.js +2 -0
- package/dist/models/errorDetailsDto.d.ts +12 -0
- package/dist/models/errorDetailsDto.js +2 -0
- package/dist/models/errorDetailsDtoDetails.d.ts +13 -0
- package/dist/models/errorDetailsDtoDetails.js +9 -0
- package/dist/models/errorPayloadDto.d.ts +13 -0
- package/dist/models/errorPayloadDto.js +2 -0
- package/dist/models/errorResponseDto.d.ts +11 -0
- package/dist/models/errorResponseDto.js +2 -0
- package/dist/models/gitContentControllerGetDiffParams.d.ts +17 -0
- package/dist/models/gitContentControllerGetDiffParams.js +9 -0
- package/dist/models/gitContentControllerGetFileParams.d.ts +17 -0
- package/dist/models/gitContentControllerGetFileParams.js +9 -0
- package/dist/models/gitContentControllerListFilesParams.d.ts +17 -0
- package/dist/models/gitContentControllerListFilesParams.js +9 -0
- package/dist/models/gitDiffFileDto.d.ts +22 -0
- package/dist/models/gitDiffFileDto.js +2 -0
- package/dist/models/gitDiffFileDtoStatus.d.ts +18 -0
- package/dist/models/gitDiffFileDtoStatus.js +17 -0
- package/dist/models/gitDiffResultDto.d.ts +15 -0
- package/dist/models/gitDiffResultDto.js +2 -0
- package/dist/models/gitDiffResultDtoDataEnvelope.d.ts +11 -0
- package/dist/models/gitDiffResultDtoDataEnvelope.js +2 -0
- package/dist/models/gitFileContentDto.d.ts +23 -0
- package/dist/models/gitFileContentDto.js +9 -0
- package/dist/models/gitFileContentDtoDataEnvelope.d.ts +11 -0
- package/dist/models/gitFileContentDtoDataEnvelope.js +2 -0
- package/dist/models/gitHubAppBootstrapDto.d.ts +26 -0
- package/dist/models/gitHubAppBootstrapDto.js +2 -0
- package/dist/models/gitHubAppBootstrapDtoDataEnvelope.d.ts +11 -0
- package/dist/models/gitHubAppBootstrapDtoDataEnvelope.js +2 -0
- package/dist/models/githubAccountType.d.ts +15 -0
- package/dist/models/githubAccountType.js +14 -0
- package/dist/models/githubAppInstallationDto.d.ts +21 -0
- package/dist/models/githubAppInstallationDto.js +2 -0
- package/dist/models/githubAppInstallationDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/githubAppInstallationDtoDataArrayEnvelope.js +2 -0
- package/dist/models/githubAppRepoSyncErrorDto.d.ts +13 -0
- package/dist/models/githubAppRepoSyncErrorDto.js +9 -0
- package/dist/models/githubAppRepoSyncResultDto.d.ts +22 -0
- package/dist/models/githubAppRepoSyncResultDto.js +2 -0
- package/dist/models/githubAppRepoSyncResultDtoDataEnvelope.d.ts +11 -0
- package/dist/models/githubAppRepoSyncResultDtoDataEnvelope.js +2 -0
- package/dist/models/githubRepositorySelection.d.ts +15 -0
- package/dist/models/githubRepositorySelection.js +14 -0
- package/dist/models/inaccessibleReason.d.ts +15 -0
- package/dist/models/inaccessibleReason.js +14 -0
- package/dist/models/index.d.ts +112 -0
- package/dist/models/index.js +129 -0
- package/dist/models/initializeRepositoryDto.d.ts +14 -0
- package/dist/models/initializeRepositoryDto.js +9 -0
- package/dist/models/initializeRepositoryResponseDto.d.ts +13 -0
- package/dist/models/initializeRepositoryResponseDto.js +9 -0
- package/dist/models/initializeRepositoryResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/initializeRepositoryResponseDtoDataEnvelope.js +2 -0
- package/dist/models/mergeBranchDto.d.ts +15 -0
- package/dist/models/mergeBranchDto.js +9 -0
- package/dist/models/orgRepositoryResponseDto.d.ts +26 -0
- package/dist/models/orgRepositoryResponseDto.js +2 -0
- package/dist/models/orgRepositoryResponseDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/orgRepositoryResponseDtoDataArrayEnvelope.js +2 -0
- package/dist/models/orgRepositoryResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/orgRepositoryResponseDtoDataEnvelope.js +2 -0
- package/dist/models/orgRepositoryResponseDtoMetadataJson.d.ts +10 -0
- package/dist/models/orgRepositoryResponseDtoMetadataJson.js +9 -0
- package/dist/models/orgRepositoryResponseDtoProvider.d.ts +13 -0
- package/dist/models/orgRepositoryResponseDtoProvider.js +15 -0
- package/dist/models/orgScmConfigControllerGetGitHubAppBootstrapParams.d.ts +17 -0
- package/dist/models/orgScmConfigControllerGetGitHubAppBootstrapParams.js +9 -0
- package/dist/models/orgScmConfigControllerHandleGitHubAppCallbackParams.d.ts +22 -0
- package/dist/models/orgScmConfigControllerHandleGitHubAppCallbackParams.js +9 -0
- package/dist/models/orgScmConfigControllerListGitHubAppRepositoriesParams.d.ts +13 -0
- package/dist/models/orgScmConfigControllerListGitHubAppRepositoriesParams.js +9 -0
- package/dist/models/orgScmConfigControllerListGitHubAppRepositoryBranchesParams.d.ts +17 -0
- package/dist/models/orgScmConfigControllerListGitHubAppRepositoryBranchesParams.js +9 -0
- package/dist/models/orgScmConfigResponseDto.d.ts +19 -0
- package/dist/models/orgScmConfigResponseDto.js +2 -0
- package/dist/models/orgScmConfigResponseDtoConfigJson.d.ts +10 -0
- package/dist/models/orgScmConfigResponseDtoConfigJson.js +9 -0
- package/dist/models/orgScmConfigResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/orgScmConfigResponseDtoDataEnvelope.js +2 -0
- package/dist/models/orgScmConfigResponseDtoProvider.d.ts +15 -0
- package/dist/models/orgScmConfigResponseDtoProvider.js +17 -0
- package/dist/models/postChangeRequestCommentDto.d.ts +26 -0
- package/dist/models/postChangeRequestCommentDto.js +9 -0
- package/dist/models/projectRepoGitContentControllerGetDiffParams.d.ts +17 -0
- package/dist/models/projectRepoGitContentControllerGetDiffParams.js +9 -0
- package/dist/models/projectRepoGitContentControllerGetFileParams.d.ts +17 -0
- package/dist/models/projectRepoGitContentControllerGetFileParams.js +9 -0
- package/dist/models/projectRepoGitContentControllerListFilesParams.d.ts +17 -0
- package/dist/models/projectRepoGitContentControllerListFilesParams.js +9 -0
- package/dist/models/projectRepoLifecycleControllerGetCheckoutInstructionParams.d.ts +14 -0
- package/dist/models/projectRepoLifecycleControllerGetCheckoutInstructionParams.js +9 -0
- package/dist/models/projectRepositoryBindingResponseDto.d.ts +22 -0
- package/dist/models/projectRepositoryBindingResponseDto.js +2 -0
- package/dist/models/projectRepositoryBindingResponseDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/projectRepositoryBindingResponseDtoDataArrayEnvelope.js +2 -0
- package/dist/models/projectRepositoryBindingResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/projectRepositoryBindingResponseDtoDataEnvelope.js +2 -0
- package/dist/models/projectRepositoryBindingResponseDtoRole.d.ts +12 -0
- package/dist/models/projectRepositoryBindingResponseDtoRole.js +14 -0
- package/dist/models/projectRepositoryBindingResponseDtoStatus.d.ts +12 -0
- package/dist/models/projectRepositoryBindingResponseDtoStatus.js +14 -0
- package/dist/models/projectRepositoryStateResponseDto.d.ts +29 -0
- package/dist/models/projectRepositoryStateResponseDto.js +2 -0
- package/dist/models/projectRepositoryStateResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/projectRepositoryStateResponseDtoDataEnvelope.js +2 -0
- package/dist/models/providerBranchResponseDto.d.ts +17 -0
- package/dist/models/providerBranchResponseDto.js +9 -0
- package/dist/models/providerBranchResponseDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/providerBranchResponseDtoDataArrayEnvelope.js +2 -0
- package/dist/models/providerConnectionDto.d.ts +16 -0
- package/dist/models/providerConnectionDto.js +2 -0
- package/dist/models/providerConnectionDtoProvider.d.ts +17 -0
- package/dist/models/providerConnectionDtoProvider.js +16 -0
- package/dist/models/providerOrgResponseDto.d.ts +18 -0
- package/dist/models/providerOrgResponseDto.js +9 -0
- package/dist/models/providerOrgResponseDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/providerOrgResponseDtoDataArrayEnvelope.js +2 -0
- package/dist/models/providerRepoResponseDto.d.ts +32 -0
- package/dist/models/providerRepoResponseDto.js +9 -0
- package/dist/models/providerRepoResponseDtoDataArrayEnvelope.d.ts +11 -0
- package/dist/models/providerRepoResponseDtoDataArrayEnvelope.js +2 -0
- package/dist/models/providerRepoResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/providerRepoResponseDtoDataEnvelope.js +2 -0
- package/dist/models/registerOrgRepositoryDto.d.ts +19 -0
- package/dist/models/registerOrgRepositoryDto.js +2 -0
- package/dist/models/registerOrgRepositoryDtoMetadataJson.d.ts +13 -0
- package/dist/models/registerOrgRepositoryDtoMetadataJson.js +9 -0
- package/dist/models/registerOrgRepositoryDtoProvider.d.ts +16 -0
- package/dist/models/registerOrgRepositoryDtoProvider.js +15 -0
- package/dist/models/repositoryStateKind.d.ts +16 -0
- package/dist/models/repositoryStateKind.js +15 -0
- package/dist/models/scmHealthResponseDto.d.ts +15 -0
- package/dist/models/scmHealthResponseDto.js +2 -0
- package/dist/models/scmHealthResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/scmHealthResponseDtoDataEnvelope.js +2 -0
- package/dist/models/scmHealthResponseDtoStatus.d.ts +16 -0
- package/dist/models/scmHealthResponseDtoStatus.js +15 -0
- package/dist/models/scmProvider.d.ts +18 -0
- package/dist/models/scmProvider.js +17 -0
- package/dist/models/scmProviderControllerListBranchesParams.d.ts +17 -0
- package/dist/models/scmProviderControllerListBranchesParams.js +9 -0
- package/dist/models/scmProviderControllerListReposParams.d.ts +13 -0
- package/dist/models/scmProviderControllerListReposParams.js +9 -0
- package/dist/models/scmReadRejectedCode.d.ts +15 -0
- package/dist/models/scmReadRejectedCode.js +14 -0
- package/dist/models/scmReadRejectedResponseDto.d.ts +28 -0
- package/dist/models/scmReadRejectedResponseDto.js +2 -0
- package/dist/models/snapshotRefreshResponseDto.d.ts +15 -0
- package/dist/models/snapshotRefreshResponseDto.js +9 -0
- package/dist/models/snapshotRefreshResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/snapshotRefreshResponseDtoDataEnvelope.js +2 -0
- package/dist/models/updateChangeRequestDto.d.ts +19 -0
- package/dist/models/updateChangeRequestDto.js +2 -0
- package/dist/models/updateChangeRequestDtoMetadataJson.d.ts +13 -0
- package/dist/models/updateChangeRequestDtoMetadataJson.js +9 -0
- package/dist/models/updateChangeRequestDtoStatus.d.ts +16 -0
- package/dist/models/updateChangeRequestDtoStatus.js +15 -0
- package/dist/models/updateOrgRepositoryDto.d.ts +12 -0
- package/dist/models/updateOrgRepositoryDto.js +2 -0
- package/dist/models/updateOrgRepositoryDtoMetadataJson.d.ts +13 -0
- package/dist/models/updateOrgRepositoryDtoMetadataJson.js +9 -0
- package/dist/models/updateProjectRepositoryBindingDto.d.ts +16 -0
- package/dist/models/updateProjectRepositoryBindingDto.js +2 -0
- package/dist/models/updateProjectRepositoryBindingDtoRole.d.ts +15 -0
- package/dist/models/updateProjectRepositoryBindingDtoRole.js +14 -0
- package/dist/models/upsertOrgScmConfigDto.d.ts +19 -0
- package/dist/models/upsertOrgScmConfigDto.js +2 -0
- package/dist/models/upsertOrgScmConfigDtoConfigJson.d.ts +13 -0
- package/dist/models/upsertOrgScmConfigDtoConfigJson.js +9 -0
- package/dist/models/upsertOrgScmConfigDtoProvider.d.ts +18 -0
- package/dist/models/upsertOrgScmConfigDtoProvider.js +17 -0
- package/package.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Xema Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Neuralchowder Inc.. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software and its source code, object code, documentation, and all
|
|
6
|
+
associated materials (the "Software") are the confidential and proprietary
|
|
7
|
+
property of Neuralchowder Inc. ("Licensor") and are protected by copyright, trade secret,
|
|
8
|
+
and other intellectual property laws.
|
|
9
|
+
|
|
10
|
+
NO LICENSE IS GRANTED BY THIS FILE. No right or license to use, copy, modify,
|
|
11
|
+
merge, publish, distribute, sublicense, sell, host, embed, or create
|
|
12
|
+
derivative works of the Software is granted, whether by implication, estoppel,
|
|
13
|
+
or otherwise, except under a separate written agreement signed by an
|
|
14
|
+
authorized representative of Neuralchowder Inc..
|
|
15
|
+
|
|
16
|
+
Unauthorized copying, use, distribution, or disclosure of the Software, in
|
|
17
|
+
whole or in part, by any means, is strictly prohibited and may violate
|
|
18
|
+
applicable law.
|
|
19
|
+
|
|
20
|
+
Access to the Software, where provided, is granted solely under and subject to
|
|
21
|
+
the terms of a separate written commercial, evaluation, or subscription
|
|
22
|
+
agreement between you and Neuralchowder Inc.. In the event of any conflict between
|
|
23
|
+
this file and such signed agreement, the signed agreement controls.
|
|
24
|
+
|
|
25
|
+
Third-party software, libraries, packages, and assets included with or used by
|
|
26
|
+
the Software remain subject to their own respective license terms.
|
|
27
|
+
|
|
28
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED ON
|
|
29
|
+
AN "AS IS" AND "AS AVAILABLE" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
30
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF
|
|
31
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
|
|
32
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
|
|
33
|
+
Neuralchowder Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
34
|
+
CONSEQUENTIAL, OR EXEMPLARY DAMAGES ARISING OUT OF OR RELATED TO THE SOFTWARE.
|
|
35
|
+
|
|
36
|
+
For licensing inquiries, contact: licensing@neuralchowder.com
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- Generated by @xemahq/api-client-generator. Do not edit by hand. -->
|
|
2
|
+
<p align="center">
|
|
3
|
+
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/scm-connector-api-client">
|
|
4
|
+
<rect width="680" height="120" rx="14" fill="#0B1020"/>
|
|
5
|
+
<g transform="translate(28,34)">
|
|
6
|
+
<path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#14B8A6" opacity="0.18"/>
|
|
7
|
+
<path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#14B8A6"/>
|
|
8
|
+
</g>
|
|
9
|
+
<text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/scm-connector-api-client</text>
|
|
10
|
+
<text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Typed, generated HTTP client for the SCM Integration API.</text>
|
|
11
|
+
<text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
|
|
12
|
+
</svg>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://xema.dev">Website</a> ·
|
|
17
|
+
<a href="https://www.npmjs.com/package/@xemahq/scm-connector-api-client">npm</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fscm-connector-api-client?color=2563eb&label=npm">
|
|
22
|
+
<img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fscm-connector-api-client?color=10b981">
|
|
23
|
+
<img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fscm-connector-api-client?color=3178c6">
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
# @xemahq/scm-connector-api-client
|
|
27
|
+
|
|
28
|
+
> Typed, generated HTTP client for the SCM Integration API.
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
Auto-generated TypeScript client for the **SCM Integration API**. It exports typed
|
|
33
|
+
request functions and response models that mirror the service's OpenAPI surface,
|
|
34
|
+
so callers get end-to-end type safety without hand-writing HTTP calls. This
|
|
35
|
+
package is produced by `@xemahq/api-client-generator` and regenerated whenever
|
|
36
|
+
the service's API changes — do not edit it by hand.
|
|
37
|
+
|
|
38
|
+
## When to use it
|
|
39
|
+
|
|
40
|
+
- Use it from any TypeScript service or app that calls the SCM Integration API over HTTP.
|
|
41
|
+
- You get compile-time types for every endpoint and payload; regenerate to pick
|
|
42
|
+
up API changes rather than editing the client.
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm add @xemahq/scm-connector-api-client
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// Every endpoint function and response model is exported from the package root.
|
|
54
|
+
import * as client from '@xemahq/scm-connector-api-client';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Call the typed endpoint functions; request and response shapes are fully typed
|
|
58
|
+
from the service's OpenAPI spec.
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
Proprietary — © Xema. All rights reserved. — [xema.dev](https://xema.dev)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurable fetch wrapper for Orval-generated clients.
|
|
3
|
+
*
|
|
4
|
+
* Consumers must call `configureClient()` before using any endpoint function.
|
|
5
|
+
* The baseUrl is prepended to the relative paths generated by Orval.
|
|
6
|
+
*/
|
|
7
|
+
export interface ClientConfig {
|
|
8
|
+
/** Static base URL (e.g. 'http://localhost:3140') — no trailing slash. */
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
/** Per-request base-URL resolver (service-registry-safe). */
|
|
11
|
+
baseUrlResolver?: () => string | Promise<string>;
|
|
12
|
+
/** Optional async callback to get an auth token. */
|
|
13
|
+
getAuthToken?: () => Promise<string>;
|
|
14
|
+
/** Optional callback returning headers to inject on every request. */
|
|
15
|
+
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
16
|
+
/** Optional callback invoked on 401 before a single retry. */
|
|
17
|
+
onUnauthorized?: () => Promise<void>;
|
|
18
|
+
/** Maximum retry attempts for transient failures (default: 3). */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class ClientError extends Error {
|
|
22
|
+
readonly status: number;
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly body: unknown;
|
|
25
|
+
constructor(status: number, url: string, body: unknown);
|
|
26
|
+
}
|
|
27
|
+
export declare function configureClient(config: ClientConfig): void;
|
|
28
|
+
export declare function getClientConfig(): ClientConfig;
|
|
29
|
+
export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
|
|
30
|
+
export default customFetch;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Configurable fetch wrapper for Orval-generated clients.
|
|
4
|
+
*
|
|
5
|
+
* Consumers must call `configureClient()` before using any endpoint function.
|
|
6
|
+
* The baseUrl is prepended to the relative paths generated by Orval.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.customFetch = exports.ClientError = void 0;
|
|
10
|
+
exports.configureClient = configureClient;
|
|
11
|
+
exports.getClientConfig = getClientConfig;
|
|
12
|
+
class ClientError extends Error {
|
|
13
|
+
status;
|
|
14
|
+
url;
|
|
15
|
+
body;
|
|
16
|
+
constructor(status, url, body) {
|
|
17
|
+
super(`HTTP ${status} from ${url}`);
|
|
18
|
+
this.status = status;
|
|
19
|
+
this.url = url;
|
|
20
|
+
this.body = body;
|
|
21
|
+
this.name = 'ClientError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ClientError = ClientError;
|
|
25
|
+
let clientConfig = null;
|
|
26
|
+
function configureClient(config) {
|
|
27
|
+
clientConfig = config;
|
|
28
|
+
}
|
|
29
|
+
function getClientConfig() {
|
|
30
|
+
if (!clientConfig) {
|
|
31
|
+
throw new Error('Client not configured. Call configureClient({ baseUrl }) before using endpoint functions.');
|
|
32
|
+
}
|
|
33
|
+
return clientConfig;
|
|
34
|
+
}
|
|
35
|
+
const RETRYABLE_STATUSES = [429, 502, 503, 504];
|
|
36
|
+
async function buildHeaders(config, callerHeaders) {
|
|
37
|
+
const headers = new Headers(callerHeaders);
|
|
38
|
+
if (config.getHeaders) {
|
|
39
|
+
const globalHeaders = await Promise.resolve(config.getHeaders());
|
|
40
|
+
for (const [key, value] of Object.entries(globalHeaders)) {
|
|
41
|
+
if (!headers.has(key)) {
|
|
42
|
+
headers.set(key, value);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (config.getAuthToken && !headers.has('Authorization')) {
|
|
47
|
+
const token = await config.getAuthToken();
|
|
48
|
+
headers.set('Authorization', `Bearer ${token}`);
|
|
49
|
+
}
|
|
50
|
+
return headers;
|
|
51
|
+
}
|
|
52
|
+
const customFetch = async (url, options) => {
|
|
53
|
+
const config = getClientConfig();
|
|
54
|
+
const base = config.baseUrlResolver
|
|
55
|
+
? await config.baseUrlResolver()
|
|
56
|
+
: config.baseUrl;
|
|
57
|
+
if (base === undefined) {
|
|
58
|
+
throw new Error('Client not configured: set baseUrl or baseUrlResolver via configureClient().');
|
|
59
|
+
}
|
|
60
|
+
const fullUrl = `${base}${url}`;
|
|
61
|
+
const maxRetries = config.maxRetries ?? 3;
|
|
62
|
+
const headers = await buildHeaders(config, options.headers);
|
|
63
|
+
const requestInit = { ...options, headers };
|
|
64
|
+
let delay = 1000;
|
|
65
|
+
let lastError;
|
|
66
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetch(fullUrl, requestInit);
|
|
69
|
+
if (response.status === 401 && config.onUnauthorized && attempt === 0) {
|
|
70
|
+
await config.onUnauthorized();
|
|
71
|
+
const refreshedHeaders = await buildHeaders(config, options.headers);
|
|
72
|
+
const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
|
|
73
|
+
const retryBody = await parseBody(retryResponse);
|
|
74
|
+
if (retryResponse.status >= 400) {
|
|
75
|
+
throw new ClientError(retryResponse.status, fullUrl, retryBody);
|
|
76
|
+
}
|
|
77
|
+
return unwrapEnvelope(retryBody);
|
|
78
|
+
}
|
|
79
|
+
if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
|
|
80
|
+
const body = await parseBody(response);
|
|
81
|
+
if (response.status >= 400) {
|
|
82
|
+
throw new ClientError(response.status, fullUrl, body);
|
|
83
|
+
}
|
|
84
|
+
return unwrapEnvelope(body);
|
|
85
|
+
}
|
|
86
|
+
const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
|
|
87
|
+
const waitMs = retryAfter ?? addJitter(delay);
|
|
88
|
+
await sleep(waitMs);
|
|
89
|
+
delay = Math.min(delay * 2, 30_000);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error instanceof ClientError)
|
|
93
|
+
throw error;
|
|
94
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
95
|
+
if (attempt >= maxRetries)
|
|
96
|
+
throw lastError;
|
|
97
|
+
const waitMs = addJitter(delay);
|
|
98
|
+
await sleep(waitMs);
|
|
99
|
+
delay = Math.min(delay * 2, 30_000);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
|
|
103
|
+
};
|
|
104
|
+
exports.customFetch = customFetch;
|
|
105
|
+
/**
|
|
106
|
+
* Xema platform services wrap every 2xx payload in a { data: T } envelope via
|
|
107
|
+
* the global ResponseEnvelopeInterceptor (platform-common). Generated types
|
|
108
|
+
* describe the INNER T (controllers declare their return type as T, not
|
|
109
|
+
* { data: T }), so the client must peel data to keep the static types and the
|
|
110
|
+
* wire shape consistent — otherwise consumers read fields off the envelope and
|
|
111
|
+
* get undefined.
|
|
112
|
+
*
|
|
113
|
+
* Only 2xx bodies reach this helper: non-2xx responses are surfaced as a thrown
|
|
114
|
+
* ClientError before unwrap, and error envelopes are emitted by the
|
|
115
|
+
* GlobalExceptionFilter, never wrapped in { data }. Paginated lists arrive as
|
|
116
|
+
* { data: T[], pagination: {...} }; consumers read both fields, so that envelope
|
|
117
|
+
* is kept intact (detected by the presence of pagination). Any body without a
|
|
118
|
+
* top-level data field is returned as-is.
|
|
119
|
+
*/
|
|
120
|
+
function unwrapEnvelope(body) {
|
|
121
|
+
if (body === null ||
|
|
122
|
+
typeof body !== 'object' ||
|
|
123
|
+
Array.isArray(body) ||
|
|
124
|
+
!('data' in body)) {
|
|
125
|
+
return body;
|
|
126
|
+
}
|
|
127
|
+
const envelope = body;
|
|
128
|
+
if ('pagination' in envelope) {
|
|
129
|
+
return envelope;
|
|
130
|
+
}
|
|
131
|
+
return envelope.data;
|
|
132
|
+
}
|
|
133
|
+
async function parseBody(response) {
|
|
134
|
+
const contentType = response.headers.get('content-type');
|
|
135
|
+
if (contentType?.includes('application/json')) {
|
|
136
|
+
return response.json();
|
|
137
|
+
}
|
|
138
|
+
if (response.status === 204) {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
return response.text();
|
|
142
|
+
}
|
|
143
|
+
function parseRetryAfter(value) {
|
|
144
|
+
if (!value)
|
|
145
|
+
return undefined;
|
|
146
|
+
const seconds = Number(value);
|
|
147
|
+
if (!isNaN(seconds) && seconds >= 0)
|
|
148
|
+
return seconds * 1000;
|
|
149
|
+
const date = new Date(value);
|
|
150
|
+
if (!isNaN(date.getTime()))
|
|
151
|
+
return Math.max(0, date.getTime() - Date.now());
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
function addJitter(delay) {
|
|
155
|
+
return delay + (Math.random() * 2 - 1) * delay * 0.25;
|
|
156
|
+
}
|
|
157
|
+
function sleep(ms) {
|
|
158
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
159
|
+
}
|
|
160
|
+
exports.default = exports.customFetch;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.15.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* SCM Integration API
|
|
5
|
+
* SCM / software-dev domain extracted out of connector-gateway-api (WS-E1). Owns org-scm-config, org-repositories, project-repository-bindings, change-requests, repository snapshots, the GitHub App, and SCM webhook ingestion.
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { ChangeRequestResponseDtoDataEnvelope, CreateChangeRequestDto, PostChangeRequestCommentDto, UpdateChangeRequestDto } from '../../models';
|
|
9
|
+
export declare const getChangeRequestControllerCreateChangeRequestUrl: (projectId: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* @summary Create a change request (pull request) for a project
|
|
12
|
+
*/
|
|
13
|
+
export declare const changeRequestControllerCreateChangeRequest: (projectId: string, createChangeRequestDto: CreateChangeRequestDto, options?: RequestInit) => Promise<ChangeRequestResponseDtoDataEnvelope>;
|
|
14
|
+
export declare const getChangeRequestControllerListChangeRequestsUrl: (projectId: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* @summary List change requests for a project
|
|
17
|
+
*/
|
|
18
|
+
export declare const changeRequestControllerListChangeRequests: (projectId: string, options?: RequestInit) => Promise<unknown>;
|
|
19
|
+
export declare const getChangeRequestControllerGetChangeRequestUrl: (projectId: string, id: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @summary Get a specific change request
|
|
22
|
+
*/
|
|
23
|
+
export declare const changeRequestControllerGetChangeRequest: (projectId: string, id: string, options?: RequestInit) => Promise<ChangeRequestResponseDtoDataEnvelope>;
|
|
24
|
+
export declare const getChangeRequestControllerUpdateChangeRequestUrl: (projectId: string, id: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @summary Update a change request
|
|
27
|
+
*/
|
|
28
|
+
export declare const changeRequestControllerUpdateChangeRequest: (projectId: string, id: string, updateChangeRequestDto: UpdateChangeRequestDto, options?: RequestInit) => Promise<ChangeRequestResponseDtoDataEnvelope>;
|
|
29
|
+
export declare const getChangeRequestControllerPostChangeRequestCommentUrl: (projectId: string, id: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* @summary Post a review comment on an existing change request. Inline (file+line) or top-level.
|
|
32
|
+
*/
|
|
33
|
+
export declare const changeRequestControllerPostChangeRequestComment: (projectId: string, id: string, postChangeRequestCommentDto: PostChangeRequestCommentDto, options?: RequestInit) => Promise<unknown>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.changeRequestControllerPostChangeRequestComment = exports.getChangeRequestControllerPostChangeRequestCommentUrl = exports.changeRequestControllerUpdateChangeRequest = exports.getChangeRequestControllerUpdateChangeRequestUrl = exports.changeRequestControllerGetChangeRequest = exports.getChangeRequestControllerGetChangeRequestUrl = exports.changeRequestControllerListChangeRequests = exports.getChangeRequestControllerListChangeRequestsUrl = exports.changeRequestControllerCreateChangeRequest = exports.getChangeRequestControllerCreateChangeRequestUrl = void 0;
|
|
4
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
|
+
const getChangeRequestControllerCreateChangeRequestUrl = (projectId) => {
|
|
6
|
+
return `/projects/${projectId}/change-requests`;
|
|
7
|
+
};
|
|
8
|
+
exports.getChangeRequestControllerCreateChangeRequestUrl = getChangeRequestControllerCreateChangeRequestUrl;
|
|
9
|
+
/**
|
|
10
|
+
* @summary Create a change request (pull request) for a project
|
|
11
|
+
*/
|
|
12
|
+
const changeRequestControllerCreateChangeRequest = async (projectId, createChangeRequestDto, options) => {
|
|
13
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getChangeRequestControllerCreateChangeRequestUrl)(projectId), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'POST',
|
|
16
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
17
|
+
body: JSON.stringify(createChangeRequestDto)
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.changeRequestControllerCreateChangeRequest = changeRequestControllerCreateChangeRequest;
|
|
21
|
+
const getChangeRequestControllerListChangeRequestsUrl = (projectId) => {
|
|
22
|
+
return `/projects/${projectId}/change-requests`;
|
|
23
|
+
};
|
|
24
|
+
exports.getChangeRequestControllerListChangeRequestsUrl = getChangeRequestControllerListChangeRequestsUrl;
|
|
25
|
+
/**
|
|
26
|
+
* @summary List change requests for a project
|
|
27
|
+
*/
|
|
28
|
+
const changeRequestControllerListChangeRequests = async (projectId, options) => {
|
|
29
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getChangeRequestControllerListChangeRequestsUrl)(projectId), {
|
|
30
|
+
...options,
|
|
31
|
+
method: 'GET'
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
exports.changeRequestControllerListChangeRequests = changeRequestControllerListChangeRequests;
|
|
35
|
+
const getChangeRequestControllerGetChangeRequestUrl = (projectId, id) => {
|
|
36
|
+
return `/projects/${projectId}/change-requests/${id}`;
|
|
37
|
+
};
|
|
38
|
+
exports.getChangeRequestControllerGetChangeRequestUrl = getChangeRequestControllerGetChangeRequestUrl;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Get a specific change request
|
|
41
|
+
*/
|
|
42
|
+
const changeRequestControllerGetChangeRequest = async (projectId, id, options) => {
|
|
43
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getChangeRequestControllerGetChangeRequestUrl)(projectId, id), {
|
|
44
|
+
...options,
|
|
45
|
+
method: 'GET'
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.changeRequestControllerGetChangeRequest = changeRequestControllerGetChangeRequest;
|
|
49
|
+
const getChangeRequestControllerUpdateChangeRequestUrl = (projectId, id) => {
|
|
50
|
+
return `/projects/${projectId}/change-requests/${id}`;
|
|
51
|
+
};
|
|
52
|
+
exports.getChangeRequestControllerUpdateChangeRequestUrl = getChangeRequestControllerUpdateChangeRequestUrl;
|
|
53
|
+
/**
|
|
54
|
+
* @summary Update a change request
|
|
55
|
+
*/
|
|
56
|
+
const changeRequestControllerUpdateChangeRequest = async (projectId, id, updateChangeRequestDto, options) => {
|
|
57
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getChangeRequestControllerUpdateChangeRequestUrl)(projectId, id), {
|
|
58
|
+
...options,
|
|
59
|
+
method: 'PATCH',
|
|
60
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
61
|
+
body: JSON.stringify(updateChangeRequestDto)
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
exports.changeRequestControllerUpdateChangeRequest = changeRequestControllerUpdateChangeRequest;
|
|
65
|
+
const getChangeRequestControllerPostChangeRequestCommentUrl = (projectId, id) => {
|
|
66
|
+
return `/projects/${projectId}/change-requests/${id}/comments`;
|
|
67
|
+
};
|
|
68
|
+
exports.getChangeRequestControllerPostChangeRequestCommentUrl = getChangeRequestControllerPostChangeRequestCommentUrl;
|
|
69
|
+
/**
|
|
70
|
+
* @summary Post a review comment on an existing change request. Inline (file+line) or top-level.
|
|
71
|
+
*/
|
|
72
|
+
const changeRequestControllerPostChangeRequestComment = async (projectId, id, postChangeRequestCommentDto, options) => {
|
|
73
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getChangeRequestControllerPostChangeRequestCommentUrl)(projectId, id), {
|
|
74
|
+
...options,
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
77
|
+
body: JSON.stringify(postChangeRequestCommentDto)
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.changeRequestControllerPostChangeRequestComment = changeRequestControllerPostChangeRequestComment;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.15.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* SCM Integration API
|
|
5
|
+
* SCM / software-dev domain extracted out of connector-gateway-api (WS-E1). Owns org-scm-config, org-repositories, project-repository-bindings, change-requests, repository snapshots, the GitHub App, and SCM webhook ingestion.
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { CreateBranchDto, GitContentControllerGetDiffParams, GitContentControllerGetFileParams, GitContentControllerListFilesParams, GitDiffResultDtoDataEnvelope, GitFileContentDtoDataEnvelope, MergeBranchDto } from '../../models';
|
|
9
|
+
export declare const getGitContentControllerListBranchesUrl: (projectId: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* @summary List branches in the project repository
|
|
12
|
+
*/
|
|
13
|
+
export declare const gitContentControllerListBranches: (projectId: string, options?: RequestInit) => Promise<unknown>;
|
|
14
|
+
export declare const getGitContentControllerCreateBranchUrl: (projectId: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* @summary Create a branch on the remote SCM provider (idempotent)
|
|
17
|
+
*/
|
|
18
|
+
export declare const gitContentControllerCreateBranch: (projectId: string, createBranchDto: CreateBranchDto, options?: RequestInit) => Promise<unknown>;
|
|
19
|
+
export declare const getGitContentControllerListFilesUrl: (projectId: string, params?: GitContentControllerListFilesParams) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @summary List files and directories at a path in the project repository
|
|
22
|
+
*/
|
|
23
|
+
export declare const gitContentControllerListFiles: (projectId: string, params?: GitContentControllerListFilesParams, options?: RequestInit) => Promise<unknown>;
|
|
24
|
+
export declare const getGitContentControllerGetFileUrl: (projectId: string, params: GitContentControllerGetFileParams) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @summary Get file content from the project repository
|
|
27
|
+
*/
|
|
28
|
+
export declare const gitContentControllerGetFile: (projectId: string, params: GitContentControllerGetFileParams, options?: RequestInit) => Promise<GitFileContentDtoDataEnvelope>;
|
|
29
|
+
export declare const getGitContentControllerGetDiffUrl: (projectId: string, params: GitContentControllerGetDiffParams) => string;
|
|
30
|
+
/**
|
|
31
|
+
* @summary Compare two git refs (branches, tags, or commits)
|
|
32
|
+
*/
|
|
33
|
+
export declare const gitContentControllerGetDiff: (projectId: string, params: GitContentControllerGetDiffParams, options?: RequestInit) => Promise<GitDiffResultDtoDataEnvelope>;
|
|
34
|
+
export declare const getGitContentControllerDeleteBranchUrl: (projectId: string, branchName: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* @summary Delete a branch from the remote SCM provider (idempotent)
|
|
37
|
+
*/
|
|
38
|
+
export declare const gitContentControllerDeleteBranch: (projectId: string, branchName: string, options?: RequestInit) => Promise<unknown>;
|
|
39
|
+
export declare const getGitContentControllerMergeBranchUrl: (projectId: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Merge a source branch into a target branch on the remote SCM provider
|
|
42
|
+
*/
|
|
43
|
+
export declare const gitContentControllerMergeBranch: (projectId: string, mergeBranchDto: MergeBranchDto, options?: RequestInit) => Promise<unknown>;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gitContentControllerMergeBranch = exports.getGitContentControllerMergeBranchUrl = exports.gitContentControllerDeleteBranch = exports.getGitContentControllerDeleteBranchUrl = exports.gitContentControllerGetDiff = exports.getGitContentControllerGetDiffUrl = exports.gitContentControllerGetFile = exports.getGitContentControllerGetFileUrl = exports.gitContentControllerListFiles = exports.getGitContentControllerListFilesUrl = exports.gitContentControllerCreateBranch = exports.getGitContentControllerCreateBranchUrl = exports.gitContentControllerListBranches = exports.getGitContentControllerListBranchesUrl = void 0;
|
|
4
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
|
+
const getGitContentControllerListBranchesUrl = (projectId) => {
|
|
6
|
+
return `/projects/${projectId}/git/branches`;
|
|
7
|
+
};
|
|
8
|
+
exports.getGitContentControllerListBranchesUrl = getGitContentControllerListBranchesUrl;
|
|
9
|
+
/**
|
|
10
|
+
* @summary List branches in the project repository
|
|
11
|
+
*/
|
|
12
|
+
const gitContentControllerListBranches = async (projectId, options) => {
|
|
13
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerListBranchesUrl)(projectId), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'GET'
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.gitContentControllerListBranches = gitContentControllerListBranches;
|
|
19
|
+
const getGitContentControllerCreateBranchUrl = (projectId) => {
|
|
20
|
+
return `/projects/${projectId}/git/branches`;
|
|
21
|
+
};
|
|
22
|
+
exports.getGitContentControllerCreateBranchUrl = getGitContentControllerCreateBranchUrl;
|
|
23
|
+
/**
|
|
24
|
+
* @summary Create a branch on the remote SCM provider (idempotent)
|
|
25
|
+
*/
|
|
26
|
+
const gitContentControllerCreateBranch = async (projectId, createBranchDto, options) => {
|
|
27
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerCreateBranchUrl)(projectId), {
|
|
28
|
+
...options,
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
31
|
+
body: JSON.stringify(createBranchDto)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
exports.gitContentControllerCreateBranch = gitContentControllerCreateBranch;
|
|
35
|
+
const getGitContentControllerListFilesUrl = (projectId, params) => {
|
|
36
|
+
const normalizedParams = new URLSearchParams();
|
|
37
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
38
|
+
if (value === undefined)
|
|
39
|
+
return;
|
|
40
|
+
if (value === null) {
|
|
41
|
+
normalizedParams.append(key, 'null');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
for (const item of value) {
|
|
46
|
+
if (item === undefined || item === null)
|
|
47
|
+
continue;
|
|
48
|
+
normalizedParams.append(key, item.toString());
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
normalizedParams.append(key, value.toString());
|
|
53
|
+
});
|
|
54
|
+
const stringifiedParams = normalizedParams.toString();
|
|
55
|
+
return stringifiedParams.length > 0 ? `/projects/${projectId}/git/files?${stringifiedParams}` : `/projects/${projectId}/git/files`;
|
|
56
|
+
};
|
|
57
|
+
exports.getGitContentControllerListFilesUrl = getGitContentControllerListFilesUrl;
|
|
58
|
+
/**
|
|
59
|
+
* @summary List files and directories at a path in the project repository
|
|
60
|
+
*/
|
|
61
|
+
const gitContentControllerListFiles = async (projectId, params, options) => {
|
|
62
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerListFilesUrl)(projectId, params), {
|
|
63
|
+
...options,
|
|
64
|
+
method: 'GET'
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.gitContentControllerListFiles = gitContentControllerListFiles;
|
|
68
|
+
const getGitContentControllerGetFileUrl = (projectId, params) => {
|
|
69
|
+
const normalizedParams = new URLSearchParams();
|
|
70
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
71
|
+
if (value === undefined)
|
|
72
|
+
return;
|
|
73
|
+
if (value === null) {
|
|
74
|
+
normalizedParams.append(key, 'null');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(value)) {
|
|
78
|
+
for (const item of value) {
|
|
79
|
+
if (item === undefined || item === null)
|
|
80
|
+
continue;
|
|
81
|
+
normalizedParams.append(key, item.toString());
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
normalizedParams.append(key, value.toString());
|
|
86
|
+
});
|
|
87
|
+
const stringifiedParams = normalizedParams.toString();
|
|
88
|
+
return stringifiedParams.length > 0 ? `/projects/${projectId}/git/file?${stringifiedParams}` : `/projects/${projectId}/git/file`;
|
|
89
|
+
};
|
|
90
|
+
exports.getGitContentControllerGetFileUrl = getGitContentControllerGetFileUrl;
|
|
91
|
+
/**
|
|
92
|
+
* @summary Get file content from the project repository
|
|
93
|
+
*/
|
|
94
|
+
const gitContentControllerGetFile = async (projectId, params, options) => {
|
|
95
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerGetFileUrl)(projectId, params), {
|
|
96
|
+
...options,
|
|
97
|
+
method: 'GET'
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
exports.gitContentControllerGetFile = gitContentControllerGetFile;
|
|
101
|
+
const getGitContentControllerGetDiffUrl = (projectId, params) => {
|
|
102
|
+
const normalizedParams = new URLSearchParams();
|
|
103
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
104
|
+
if (value === undefined)
|
|
105
|
+
return;
|
|
106
|
+
if (value === null) {
|
|
107
|
+
normalizedParams.append(key, 'null');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
for (const item of value) {
|
|
112
|
+
if (item === undefined || item === null)
|
|
113
|
+
continue;
|
|
114
|
+
normalizedParams.append(key, item.toString());
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
normalizedParams.append(key, value.toString());
|
|
119
|
+
});
|
|
120
|
+
const stringifiedParams = normalizedParams.toString();
|
|
121
|
+
return stringifiedParams.length > 0 ? `/projects/${projectId}/git/diff?${stringifiedParams}` : `/projects/${projectId}/git/diff`;
|
|
122
|
+
};
|
|
123
|
+
exports.getGitContentControllerGetDiffUrl = getGitContentControllerGetDiffUrl;
|
|
124
|
+
/**
|
|
125
|
+
* @summary Compare two git refs (branches, tags, or commits)
|
|
126
|
+
*/
|
|
127
|
+
const gitContentControllerGetDiff = async (projectId, params, options) => {
|
|
128
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerGetDiffUrl)(projectId, params), {
|
|
129
|
+
...options,
|
|
130
|
+
method: 'GET'
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
exports.gitContentControllerGetDiff = gitContentControllerGetDiff;
|
|
134
|
+
const getGitContentControllerDeleteBranchUrl = (projectId, branchName) => {
|
|
135
|
+
return `/projects/${projectId}/git/branches/${branchName}`;
|
|
136
|
+
};
|
|
137
|
+
exports.getGitContentControllerDeleteBranchUrl = getGitContentControllerDeleteBranchUrl;
|
|
138
|
+
/**
|
|
139
|
+
* @summary Delete a branch from the remote SCM provider (idempotent)
|
|
140
|
+
*/
|
|
141
|
+
const gitContentControllerDeleteBranch = async (projectId, branchName, options) => {
|
|
142
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerDeleteBranchUrl)(projectId, branchName), {
|
|
143
|
+
...options,
|
|
144
|
+
method: 'DELETE'
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
exports.gitContentControllerDeleteBranch = gitContentControllerDeleteBranch;
|
|
148
|
+
const getGitContentControllerMergeBranchUrl = (projectId) => {
|
|
149
|
+
return `/projects/${projectId}/git/merge`;
|
|
150
|
+
};
|
|
151
|
+
exports.getGitContentControllerMergeBranchUrl = getGitContentControllerMergeBranchUrl;
|
|
152
|
+
/**
|
|
153
|
+
* @summary Merge a source branch into a target branch on the remote SCM provider
|
|
154
|
+
*/
|
|
155
|
+
const gitContentControllerMergeBranch = async (projectId, mergeBranchDto, options) => {
|
|
156
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getGitContentControllerMergeBranchUrl)(projectId), {
|
|
157
|
+
...options,
|
|
158
|
+
method: 'POST',
|
|
159
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
160
|
+
body: JSON.stringify(mergeBranchDto)
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
exports.gitContentControllerMergeBranch = gitContentControllerMergeBranch;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.15.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* SCM Integration API
|
|
5
|
+
* SCM / software-dev domain extracted out of connector-gateway-api (WS-E1). Owns org-scm-config, org-repositories, project-repository-bindings, change-requests, repository snapshots, the GitHub App, and SCM webhook ingestion.
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { OrgRepositoryResponseDtoDataArrayEnvelope, OrgRepositoryResponseDtoDataEnvelope, RegisterOrgRepositoryDto, UpdateOrgRepositoryDto } from '../../models';
|
|
9
|
+
export declare const getOrgRepositoriesControllerRegisterUrl: () => string;
|
|
10
|
+
/**
|
|
11
|
+
* @summary Register a repository at the org level
|
|
12
|
+
*/
|
|
13
|
+
export declare const orgRepositoriesControllerRegister: (registerOrgRepositoryDto: RegisterOrgRepositoryDto, options?: RequestInit) => Promise<OrgRepositoryResponseDtoDataEnvelope>;
|
|
14
|
+
export declare const getOrgRepositoriesControllerListUrl: () => string;
|
|
15
|
+
/**
|
|
16
|
+
* @summary List all repositories registered at the org level
|
|
17
|
+
*/
|
|
18
|
+
export declare const orgRepositoriesControllerList: (options?: RequestInit) => Promise<OrgRepositoryResponseDtoDataArrayEnvelope>;
|
|
19
|
+
export declare const getOrgRepositoriesControllerGetUrl: (id: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @summary Get an org-level repository with its project bindings
|
|
22
|
+
*/
|
|
23
|
+
export declare const orgRepositoriesControllerGet: (id: string, options?: RequestInit) => Promise<OrgRepositoryResponseDtoDataEnvelope>;
|
|
24
|
+
export declare const getOrgRepositoriesControllerUpdateUrl: (id: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @summary Update an org-level repository
|
|
27
|
+
*/
|
|
28
|
+
export declare const orgRepositoriesControllerUpdate: (id: string, updateOrgRepositoryDto: UpdateOrgRepositoryDto, options?: RequestInit) => Promise<OrgRepositoryResponseDtoDataEnvelope>;
|
|
29
|
+
export declare const getOrgRepositoriesControllerRemoveUrl: (id: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* @summary Delete an org-level repository (fails if bindings exist)
|
|
32
|
+
*/
|
|
33
|
+
export declare const orgRepositoriesControllerRemove: (id: string, options?: RequestInit) => Promise<unknown>;
|