@apiclient.xyz/gitlab 2.4.0 → 2.6.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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/gitlab.classes.branch.d.ts +7 -0
- package/dist_ts/gitlab.classes.branch.js +13 -0
- package/dist_ts/gitlab.classes.gitlabclient.d.ts +117 -32
- package/dist_ts/gitlab.classes.gitlabclient.js +278 -96
- package/dist_ts/gitlab.classes.group.d.ts +47 -0
- package/dist_ts/gitlab.classes.group.js +97 -0
- package/dist_ts/gitlab.classes.job.d.ts +29 -0
- package/dist_ts/gitlab.classes.job.js +74 -0
- package/dist_ts/gitlab.classes.pipeline.d.ts +32 -0
- package/dist_ts/gitlab.classes.pipeline.js +87 -0
- package/dist_ts/gitlab.classes.project.d.ts +63 -0
- package/dist_ts/gitlab.classes.project.js +122 -0
- package/dist_ts/gitlab.classes.protectedbranch.d.ts +8 -0
- package/dist_ts/gitlab.classes.protectedbranch.js +15 -0
- package/dist_ts/gitlab.classes.tag.d.ts +7 -0
- package/dist_ts/gitlab.classes.tag.js +13 -0
- package/dist_ts/gitlab.classes.testreport.d.ts +34 -0
- package/dist_ts/gitlab.classes.testreport.js +67 -0
- package/dist_ts/gitlab.classes.variable.d.ts +18 -0
- package/dist_ts/gitlab.classes.variable.js +35 -0
- package/dist_ts/gitlab.helpers.d.ts +8 -0
- package/dist_ts/gitlab.helpers.js +23 -0
- package/dist_ts/gitlab.interfaces.d.ts +114 -9
- package/dist_ts/gitlab.interfaces.js +4 -1
- package/dist_ts/index.d.ts +11 -1
- package/dist_ts/index.js +15 -1
- package/package.json +1 -1
- package/readme.md +468 -163
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/gitlab.classes.branch.ts +18 -0
- package/ts/gitlab.classes.gitlabclient.ts +354 -114
- package/ts/gitlab.classes.group.ts +137 -0
- package/ts/gitlab.classes.job.ts +104 -0
- package/ts/gitlab.classes.pipeline.ts +122 -0
- package/ts/gitlab.classes.project.ts +177 -0
- package/ts/gitlab.classes.protectedbranch.ts +21 -0
- package/ts/gitlab.classes.tag.ts +18 -0
- package/ts/gitlab.classes.testreport.ts +97 -0
- package/ts/gitlab.classes.variable.ts +50 -0
- package/ts/gitlab.helpers.ts +26 -0
- package/ts/gitlab.interfaces.ts +162 -11
- package/ts/index.ts +25 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@apiclient.xyz/gitlab',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.5.0',
|
|
7
7
|
description: 'A TypeScript client for the GitLab API, providing easy access to projects, groups, CI/CD variables, and pipelines.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLG9IQUFvSDtDQUNsSSxDQUFBIn0=
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class GitLabBranch {
|
|
2
|
+
constructor(raw) {
|
|
3
|
+
this.name = raw.name || '';
|
|
4
|
+
this.commitSha = raw.commit?.id || '';
|
|
5
|
+
}
|
|
6
|
+
toJSON() {
|
|
7
|
+
return {
|
|
8
|
+
name: this.name,
|
|
9
|
+
commit: { id: this.commitSha },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2l0bGFiLmNsYXNzZXMuYnJhbmNoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZ2l0bGFiLmNsYXNzZXMuYnJhbmNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sT0FBTyxZQUFZO0lBSXZCLFlBQVksR0FBa0I7UUFDNUIsSUFBSSxDQUFDLElBQUksR0FBRyxHQUFHLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQztRQUMzQixJQUFJLENBQUMsU0FBUyxHQUFHLEdBQUcsQ0FBQyxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsQ0FBQztJQUN4QyxDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU87WUFDTCxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUk7WUFDZixNQUFNLEVBQUUsRUFBRSxFQUFFLEVBQUUsSUFBSSxDQUFDLFNBQVMsRUFBRTtTQUMvQixDQUFDO0lBQ0osQ0FBQztDQUNGIn0=
|
|
@@ -1,54 +1,139 @@
|
|
|
1
|
-
import type { IGitLabProject, IGitLabGroup, IGitLabVariable, IVariableOptions, IGitLabProtectedBranch, IGitLabBranch, IGitLabTag, IGitLabPipeline, IGitLabJob, ITestConnectionResult, IListOptions } from './gitlab.interfaces.js';
|
|
1
|
+
import type { IGitLabProject, IGitLabGroup, IGitLabVariable, IVariableOptions, IGitLabProtectedBranch, IGitLabBranch, IGitLabTag, IGitLabPipeline, IGitLabPipelineVariable, IGitLabTestReport, IGitLabJob, ITestConnectionResult, IListOptions, IPipelineListOptions, IJobListOptions } from './gitlab.interfaces.js';
|
|
2
|
+
import { GitLabGroup } from './gitlab.classes.group.js';
|
|
3
|
+
import { GitLabProject } from './gitlab.classes.project.js';
|
|
2
4
|
export declare class GitLabClient {
|
|
3
5
|
private baseUrl;
|
|
4
6
|
private token;
|
|
5
7
|
constructor(baseUrl: string, token: string);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/** @internal */
|
|
9
|
+
request<T = any>(method: 'GET' | 'POST' | 'PUT' | 'DELETE', path: string, data?: any, customHeaders?: Record<string, string>): Promise<T>;
|
|
10
|
+
/** @internal */
|
|
11
|
+
requestText(method: 'GET' | 'POST' | 'PUT' | 'DELETE', path: string): Promise<string>;
|
|
12
|
+
/** @internal — multipart form upload (for avatars) */
|
|
13
|
+
requestMultipart<T = any>(method: 'PUT' | 'POST', path: string, formData: FormData): Promise<T>;
|
|
14
|
+
/** @internal — fetch binary data (e.g. avatar images) */
|
|
15
|
+
requestBinary(url: string): Promise<Uint8Array>;
|
|
8
16
|
testConnection(): Promise<ITestConnectionResult>;
|
|
9
17
|
/**
|
|
10
|
-
* Get
|
|
18
|
+
* Get all groups (auto-paginated).
|
|
11
19
|
*/
|
|
12
|
-
|
|
20
|
+
getGroups(opts?: IListOptions): Promise<GitLabGroup[]>;
|
|
13
21
|
/**
|
|
14
|
-
*
|
|
22
|
+
* Get a single group by full path.
|
|
15
23
|
*/
|
|
16
|
-
|
|
24
|
+
getGroup(fullPath: string): Promise<GitLabGroup>;
|
|
17
25
|
/**
|
|
18
|
-
*
|
|
26
|
+
* Create a new group.
|
|
19
27
|
*/
|
|
20
|
-
|
|
28
|
+
createGroup(name: string, path: string, parentId?: number): Promise<GitLabGroup>;
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
30
|
+
* Get all projects (auto-paginated, membership=true).
|
|
23
31
|
*/
|
|
24
|
-
|
|
32
|
+
getProjects(opts?: IListOptions): Promise<GitLabProject[]>;
|
|
25
33
|
/**
|
|
26
|
-
*
|
|
34
|
+
* Get a single project by ID or path.
|
|
35
|
+
*/
|
|
36
|
+
getProject(idOrPath: number | string): Promise<GitLabProject>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new project.
|
|
27
39
|
*/
|
|
28
40
|
createProject(name: string, opts?: {
|
|
29
41
|
path?: string;
|
|
30
42
|
namespaceId?: number;
|
|
31
43
|
visibility?: string;
|
|
32
44
|
description?: string;
|
|
45
|
+
}): Promise<GitLabProject>;
|
|
46
|
+
/** @internal */
|
|
47
|
+
requestGetGroups(opts?: IListOptions): Promise<IGitLabGroup[]>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
requestGetGroupByPath(fullPath: string): Promise<IGitLabGroup>;
|
|
50
|
+
/** @internal */
|
|
51
|
+
requestGetGroupProjects(groupId: number | string, opts?: IListOptions): Promise<IGitLabProject[]>;
|
|
52
|
+
/** @internal */
|
|
53
|
+
requestGetDescendantGroups(groupId: number | string, opts?: IListOptions): Promise<IGitLabGroup[]>;
|
|
54
|
+
/** @internal */
|
|
55
|
+
requestCreateGroup(name: string, path: string, parentId?: number): Promise<IGitLabGroup>;
|
|
56
|
+
/** @internal */
|
|
57
|
+
requestUpdateGroup(groupId: number | string, data: Record<string, any>): Promise<void>;
|
|
58
|
+
/** @internal */
|
|
59
|
+
requestSetGroupAvatar(groupId: number | string, imageData: Uint8Array, filename: string): Promise<void>;
|
|
60
|
+
/** @internal */
|
|
61
|
+
requestTransferGroup(groupId: number | string, parentGroupId: number): Promise<void>;
|
|
62
|
+
/** @internal */
|
|
63
|
+
requestDeleteGroup(groupId: number | string): Promise<void>;
|
|
64
|
+
/** @internal */
|
|
65
|
+
requestGetProjects(opts?: IListOptions): Promise<IGitLabProject[]>;
|
|
66
|
+
/** @internal */
|
|
67
|
+
requestGetProject(idOrPath: number | string): Promise<IGitLabProject>;
|
|
68
|
+
/** @internal */
|
|
69
|
+
requestCreateProject(name: string, opts?: {
|
|
70
|
+
path?: string;
|
|
71
|
+
namespaceId?: number;
|
|
72
|
+
visibility?: string;
|
|
73
|
+
description?: string;
|
|
33
74
|
}): Promise<IGitLabProject>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
/** @internal */
|
|
76
|
+
requestUpdateProject(projectId: number | string, data: Record<string, any>): Promise<void>;
|
|
77
|
+
/** @internal */
|
|
78
|
+
requestSetProjectAvatar(projectId: number | string, imageData: Uint8Array, filename: string): Promise<void>;
|
|
79
|
+
/** @internal */
|
|
80
|
+
requestTransferProject(projectId: number | string, namespaceId: number): Promise<void>;
|
|
81
|
+
/** @internal */
|
|
82
|
+
requestDeleteProject(projectId: number | string): Promise<void>;
|
|
83
|
+
/** @internal */
|
|
84
|
+
requestGetRepoBranches(projectId: number | string, opts?: IListOptions): Promise<IGitLabBranch[]>;
|
|
85
|
+
/** @internal */
|
|
86
|
+
requestGetRepoTags(projectId: number | string, opts?: IListOptions): Promise<IGitLabTag[]>;
|
|
87
|
+
/** @internal */
|
|
88
|
+
requestGetProtectedBranches(projectId: number | string): Promise<IGitLabProtectedBranch[]>;
|
|
89
|
+
/** @internal */
|
|
90
|
+
requestUnprotectBranch(projectId: number | string, branchName: string): Promise<void>;
|
|
91
|
+
/** @internal */
|
|
92
|
+
requestGetProjectVariables(projectId: number | string): Promise<IGitLabVariable[]>;
|
|
93
|
+
/** @internal */
|
|
94
|
+
requestCreateProjectVariable(projectId: number | string, key: string, value: string, opts?: IVariableOptions): Promise<IGitLabVariable>;
|
|
95
|
+
/** @internal */
|
|
96
|
+
requestUpdateProjectVariable(projectId: number | string, key: string, value: string, opts?: IVariableOptions): Promise<IGitLabVariable>;
|
|
97
|
+
/** @internal */
|
|
98
|
+
requestDeleteProjectVariable(projectId: number | string, key: string): Promise<void>;
|
|
99
|
+
/** @internal */
|
|
100
|
+
requestGetGroupVariables(groupId: number | string): Promise<IGitLabVariable[]>;
|
|
101
|
+
/** @internal */
|
|
102
|
+
requestCreateGroupVariable(groupId: number | string, key: string, value: string, opts?: IVariableOptions): Promise<IGitLabVariable>;
|
|
103
|
+
/** @internal */
|
|
104
|
+
requestUpdateGroupVariable(groupId: number | string, key: string, value: string, opts?: IVariableOptions): Promise<IGitLabVariable>;
|
|
105
|
+
/** @internal */
|
|
106
|
+
requestDeleteGroupVariable(groupId: number | string, key: string): Promise<void>;
|
|
107
|
+
/** @internal */
|
|
108
|
+
requestGetPipelines(projectId: number | string, opts?: IPipelineListOptions): Promise<IGitLabPipeline[]>;
|
|
109
|
+
/** @internal */
|
|
110
|
+
requestGetPipeline(projectId: number | string, pipelineId: number): Promise<IGitLabPipeline>;
|
|
111
|
+
/** @internal */
|
|
112
|
+
requestTriggerPipeline(projectId: number | string, ref: string, variables?: {
|
|
113
|
+
key: string;
|
|
114
|
+
value: string;
|
|
115
|
+
variable_type?: string;
|
|
116
|
+
}[]): Promise<IGitLabPipeline>;
|
|
117
|
+
/** @internal */
|
|
118
|
+
requestRetryPipeline(projectId: number | string, pipelineId: number): Promise<IGitLabPipeline>;
|
|
119
|
+
/** @internal */
|
|
120
|
+
requestCancelPipeline(projectId: number | string, pipelineId: number): Promise<IGitLabPipeline>;
|
|
121
|
+
/** @internal */
|
|
122
|
+
requestDeletePipeline(projectId: number | string, pipelineId: number): Promise<void>;
|
|
123
|
+
/** @internal */
|
|
124
|
+
requestGetPipelineVariables(projectId: number | string, pipelineId: number): Promise<IGitLabPipelineVariable[]>;
|
|
125
|
+
/** @internal */
|
|
126
|
+
requestGetPipelineTestReport(projectId: number | string, pipelineId: number): Promise<IGitLabTestReport>;
|
|
127
|
+
/** @internal */
|
|
128
|
+
requestGetPipelineJobs(projectId: number | string, pipelineId: number, opts?: IJobListOptions): Promise<IGitLabJob[]>;
|
|
129
|
+
/** @internal */
|
|
130
|
+
requestGetJobLog(projectId: number | string, jobId: number): Promise<string>;
|
|
131
|
+
/** @internal */
|
|
132
|
+
requestRetryJob(projectId: number | string, jobId: number): Promise<IGitLabJob>;
|
|
133
|
+
/** @internal */
|
|
134
|
+
requestCancelJob(projectId: number | string, jobId: number): Promise<IGitLabJob>;
|
|
135
|
+
/** @internal */
|
|
136
|
+
requestPlayJob(projectId: number | string, jobId: number): Promise<IGitLabJob>;
|
|
137
|
+
/** @internal */
|
|
138
|
+
requestEraseJob(projectId: number | string, jobId: number): Promise<void>;
|
|
54
139
|
}
|