@foundation0/git 1.3.0 → 1.3.1
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/README.md +291 -291
- package/gitea-swagger.json +28627 -28627
- package/mcp/README.md +266 -266
- package/mcp/cli.mjs +37 -37
- package/mcp/src/cli.ts +76 -76
- package/mcp/src/client.ts +147 -147
- package/mcp/src/index.ts +7 -7
- package/mcp/src/redaction.ts +207 -207
- package/mcp/src/server.ts +1778 -938
- package/package.json +3 -1
- package/src/actions-api.ts +860 -637
- package/src/api.ts +69 -69
- package/src/ci-api.ts +544 -544
- package/src/git-service-api.ts +822 -754
- package/src/git-service-feature-spec.generated.ts +5341 -5341
- package/src/index.ts +55 -55
- package/src/issue-dependencies.ts +533 -533
- package/src/label-management.ts +587 -587
- package/src/platform/config.ts +62 -62
- package/src/platform/gitea-adapter.ts +460 -460
- package/src/platform/gitea-rules.ts +129 -129
- package/src/platform/index.ts +44 -44
- package/src/repository.ts +151 -151
- package/src/spec-mock.ts +45 -45
package/src/api.ts
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GIT_API_VERSION,
|
|
3
|
-
buildGitApiMockResponse,
|
|
4
|
-
GitApiHeaders,
|
|
5
|
-
GitApiMockResponse,
|
|
6
|
-
GitApiPath,
|
|
7
|
-
GitApiQuery,
|
|
8
|
-
MockInvocation,
|
|
9
|
-
} from './spec-mock'
|
|
10
|
-
|
|
11
|
-
export type GitApiInvocationPath = GitApiPath
|
|
12
|
-
export type GitApiInvocationQuery = GitApiQuery
|
|
13
|
-
export type GitApiInvocationHeaders = GitApiHeaders
|
|
14
|
-
|
|
15
|
-
export interface GitApiInvocation {
|
|
16
|
-
path: GitApiInvocationPath
|
|
17
|
-
method?: string
|
|
18
|
-
query?: GitApiInvocationQuery
|
|
19
|
-
headers?: GitApiInvocationHeaders
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface GitApiClientOptions {
|
|
23
|
-
apiBase?: string
|
|
24
|
-
apiVersion?: string
|
|
25
|
-
defaultMethod?: string
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export class RemoteGitApiClient {
|
|
29
|
-
private readonly apiBase: string
|
|
30
|
-
private readonly apiVersion: string
|
|
31
|
-
private readonly defaultMethod: string
|
|
32
|
-
|
|
33
|
-
public constructor(options: GitApiClientOptions = {}) {
|
|
34
|
-
this.apiBase = options.apiBase ?? 'https://api.github.com'
|
|
35
|
-
this.apiVersion = options.apiVersion ?? GIT_API_VERSION
|
|
36
|
-
this.defaultMethod = options.defaultMethod ?? 'GET'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public buildInvocation(invocation: GitApiInvocation): MockInvocation {
|
|
40
|
-
return {
|
|
41
|
-
path: invocation.path,
|
|
42
|
-
method: invocation.method ?? this.defaultMethod,
|
|
43
|
-
query: invocation.query,
|
|
44
|
-
headers: invocation.headers,
|
|
45
|
-
apiBase: this.apiBase,
|
|
46
|
-
apiVersion: this.apiVersion,
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public request(invocation: GitApiInvocation): GitApiMockResponse {
|
|
51
|
-
return buildGitApiMockResponse(this.buildInvocation(invocation))
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public requestAsync(invocation: GitApiInvocation): Promise<GitApiMockResponse> {
|
|
55
|
-
return Promise.resolve(this.request(invocation))
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public get metadata() {
|
|
59
|
-
return {
|
|
60
|
-
apiBase: this.apiBase,
|
|
61
|
-
apiVersion: this.apiVersion,
|
|
62
|
-
defaultMethod: this.defaultMethod,
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function createRemoteGitApiClient(options: GitApiClientOptions = {}): RemoteGitApiClient {
|
|
68
|
-
return new RemoteGitApiClient(options)
|
|
69
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
GIT_API_VERSION,
|
|
3
|
+
buildGitApiMockResponse,
|
|
4
|
+
GitApiHeaders,
|
|
5
|
+
GitApiMockResponse,
|
|
6
|
+
GitApiPath,
|
|
7
|
+
GitApiQuery,
|
|
8
|
+
MockInvocation,
|
|
9
|
+
} from './spec-mock'
|
|
10
|
+
|
|
11
|
+
export type GitApiInvocationPath = GitApiPath
|
|
12
|
+
export type GitApiInvocationQuery = GitApiQuery
|
|
13
|
+
export type GitApiInvocationHeaders = GitApiHeaders
|
|
14
|
+
|
|
15
|
+
export interface GitApiInvocation {
|
|
16
|
+
path: GitApiInvocationPath
|
|
17
|
+
method?: string
|
|
18
|
+
query?: GitApiInvocationQuery
|
|
19
|
+
headers?: GitApiInvocationHeaders
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GitApiClientOptions {
|
|
23
|
+
apiBase?: string
|
|
24
|
+
apiVersion?: string
|
|
25
|
+
defaultMethod?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class RemoteGitApiClient {
|
|
29
|
+
private readonly apiBase: string
|
|
30
|
+
private readonly apiVersion: string
|
|
31
|
+
private readonly defaultMethod: string
|
|
32
|
+
|
|
33
|
+
public constructor(options: GitApiClientOptions = {}) {
|
|
34
|
+
this.apiBase = options.apiBase ?? 'https://api.github.com'
|
|
35
|
+
this.apiVersion = options.apiVersion ?? GIT_API_VERSION
|
|
36
|
+
this.defaultMethod = options.defaultMethod ?? 'GET'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public buildInvocation(invocation: GitApiInvocation): MockInvocation {
|
|
40
|
+
return {
|
|
41
|
+
path: invocation.path,
|
|
42
|
+
method: invocation.method ?? this.defaultMethod,
|
|
43
|
+
query: invocation.query,
|
|
44
|
+
headers: invocation.headers,
|
|
45
|
+
apiBase: this.apiBase,
|
|
46
|
+
apiVersion: this.apiVersion,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public request(invocation: GitApiInvocation): GitApiMockResponse {
|
|
51
|
+
return buildGitApiMockResponse(this.buildInvocation(invocation))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public requestAsync(invocation: GitApiInvocation): Promise<GitApiMockResponse> {
|
|
55
|
+
return Promise.resolve(this.request(invocation))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public get metadata() {
|
|
59
|
+
return {
|
|
60
|
+
apiBase: this.apiBase,
|
|
61
|
+
apiVersion: this.apiVersion,
|
|
62
|
+
defaultMethod: this.defaultMethod,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createRemoteGitApiClient(options: GitApiClientOptions = {}): RemoteGitApiClient {
|
|
68
|
+
return new RemoteGitApiClient(options)
|
|
69
|
+
}
|