@opentabs-dev/opentabs-plugin-bitbucket 0.0.74
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/adapter.iife.js +15383 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/bitbucket-api.d.ts +12 -0
- package/dist/bitbucket-api.d.ts.map +1 -0
- package/dist/bitbucket-api.js +106 -0
- package/dist/bitbucket-api.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/approve-pull-request.d.ts +9 -0
- package/dist/tools/approve-pull-request.d.ts.map +1 -0
- package/dist/tools/approve-pull-request.js +24 -0
- package/dist/tools/approve-pull-request.js.map +1 -0
- package/dist/tools/create-branch.d.ts +14 -0
- package/dist/tools/create-branch.d.ts.map +1 -0
- package/dist/tools/create-branch.js +27 -0
- package/dist/tools/create-branch.js.map +1 -0
- package/dist/tools/create-pr-comment.d.ts +14 -0
- package/dist/tools/create-pr-comment.d.ts.map +1 -0
- package/dist/tools/create-pr-comment.js +24 -0
- package/dist/tools/create-pr-comment.js.map +1 -0
- package/dist/tools/create-pull-request.d.ts +25 -0
- package/dist/tools/create-pull-request.d.ts.map +1 -0
- package/dist/tools/create-pull-request.js +48 -0
- package/dist/tools/create-pull-request.js.map +1 -0
- package/dist/tools/create-repository.d.ts +24 -0
- package/dist/tools/create-repository.d.ts.map +1 -0
- package/dist/tools/create-repository.js +40 -0
- package/dist/tools/create-repository.js.map +1 -0
- package/dist/tools/decline-pull-request.d.ts +20 -0
- package/dist/tools/decline-pull-request.d.ts.map +1 -0
- package/dist/tools/decline-pull-request.js +23 -0
- package/dist/tools/decline-pull-request.js.map +1 -0
- package/dist/tools/delete-branch.d.ts +9 -0
- package/dist/tools/delete-branch.d.ts.map +1 -0
- package/dist/tools/delete-branch.js +26 -0
- package/dist/tools/delete-branch.js.map +1 -0
- package/dist/tools/get-commit.d.ts +13 -0
- package/dist/tools/get-commit.d.ts.map +1 -0
- package/dist/tools/get-commit.js +23 -0
- package/dist/tools/get-commit.js.map +1 -0
- package/dist/tools/get-file-content.d.ts +11 -0
- package/dist/tools/get-file-content.d.ts.map +1 -0
- package/dist/tools/get-file-content.js +30 -0
- package/dist/tools/get-file-content.js.map +1 -0
- package/dist/tools/get-pipeline.d.ts +18 -0
- package/dist/tools/get-pipeline.d.ts.map +1 -0
- package/dist/tools/get-pipeline.js +23 -0
- package/dist/tools/get-pipeline.js.map +1 -0
- package/dist/tools/get-pull-request-diff.d.ts +9 -0
- package/dist/tools/get-pull-request-diff.d.ts.map +1 -0
- package/dist/tools/get-pull-request-diff.js +24 -0
- package/dist/tools/get-pull-request-diff.js.map +1 -0
- package/dist/tools/get-pull-request.d.ts +20 -0
- package/dist/tools/get-pull-request.d.ts.map +1 -0
- package/dist/tools/get-pull-request.js +23 -0
- package/dist/tools/get-pull-request.js.map +1 -0
- package/dist/tools/get-repository.d.ts +19 -0
- package/dist/tools/get-repository.d.ts.map +1 -0
- package/dist/tools/get-repository.js +22 -0
- package/dist/tools/get-repository.js.map +1 -0
- package/dist/tools/get-user-profile.d.ts +9 -0
- package/dist/tools/get-user-profile.d.ts.map +1 -0
- package/dist/tools/get-user-profile.js +19 -0
- package/dist/tools/get-user-profile.js.map +1 -0
- package/dist/tools/list-branches.d.ts +17 -0
- package/dist/tools/list-branches.d.ts.map +1 -0
- package/dist/tools/list-branches.js +32 -0
- package/dist/tools/list-branches.js.map +1 -0
- package/dist/tools/list-commits.d.ts +17 -0
- package/dist/tools/list-commits.d.ts.map +1 -0
- package/dist/tools/list-commits.js +34 -0
- package/dist/tools/list-commits.js.map +1 -0
- package/dist/tools/list-pipeline-steps.d.ts +19 -0
- package/dist/tools/list-pipeline-steps.d.ts.map +1 -0
- package/dist/tools/list-pipeline-steps.js +31 -0
- package/dist/tools/list-pipeline-steps.js.map +1 -0
- package/dist/tools/list-pipelines.d.ts +22 -0
- package/dist/tools/list-pipelines.d.ts.map +1 -0
- package/dist/tools/list-pipelines.js +32 -0
- package/dist/tools/list-pipelines.js.map +1 -0
- package/dist/tools/list-pr-comments.d.ts +17 -0
- package/dist/tools/list-pr-comments.d.ts.map +1 -0
- package/dist/tools/list-pr-comments.js +31 -0
- package/dist/tools/list-pr-comments.js.map +1 -0
- package/dist/tools/list-pull-requests.d.ts +29 -0
- package/dist/tools/list-pull-requests.d.ts.map +1 -0
- package/dist/tools/list-pull-requests.js +37 -0
- package/dist/tools/list-pull-requests.js.map +1 -0
- package/dist/tools/list-repositories.d.ts +23 -0
- package/dist/tools/list-repositories.d.ts.map +1 -0
- package/dist/tools/list-repositories.js +31 -0
- package/dist/tools/list-repositories.js.map +1 -0
- package/dist/tools/list-tags.d.ts +15 -0
- package/dist/tools/list-tags.d.ts.map +1 -0
- package/dist/tools/list-tags.js +32 -0
- package/dist/tools/list-tags.js.map +1 -0
- package/dist/tools/list-workspace-members.d.ts +14 -0
- package/dist/tools/list-workspace-members.d.ts.map +1 -0
- package/dist/tools/list-workspace-members.js +29 -0
- package/dist/tools/list-workspace-members.js.map +1 -0
- package/dist/tools/list-workspaces.d.ts +13 -0
- package/dist/tools/list-workspaces.d.ts.map +1 -0
- package/dist/tools/list-workspaces.js +28 -0
- package/dist/tools/list-workspaces.js.map +1 -0
- package/dist/tools/merge-pull-request.d.ts +27 -0
- package/dist/tools/merge-pull-request.d.ts.map +1 -0
- package/dist/tools/merge-pull-request.js +36 -0
- package/dist/tools/merge-pull-request.js.map +1 -0
- package/dist/tools/schemas.d.ts +343 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +193 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-code.d.ts +16 -0
- package/dist/tools/search-code.d.ts.map +1 -0
- package/dist/tools/search-code.js +55 -0
- package/dist/tools/search-code.js.map +1 -0
- package/dist/tools/update-pull-request.d.ts +25 -0
- package/dist/tools/update-pull-request.d.ts.map +1 -0
- package/dist/tools/update-pull-request.js +41 -0
- package/dist/tools/update-pull-request.js.map +1 -0
- package/dist/tools.json +2383 -0
- package/package.json +55 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const repositorySchema: z.ZodObject<{
|
|
3
|
+
uuid: z.ZodString;
|
|
4
|
+
slug: z.ZodString;
|
|
5
|
+
full_name: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
is_private: z.ZodBoolean;
|
|
9
|
+
scm: z.ZodString;
|
|
10
|
+
language: z.ZodString;
|
|
11
|
+
default_branch: z.ZodString;
|
|
12
|
+
web_url: z.ZodString;
|
|
13
|
+
created_on: z.ZodString;
|
|
14
|
+
updated_on: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const pullRequestSchema: z.ZodObject<{
|
|
17
|
+
id: z.ZodNumber;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
description: z.ZodString;
|
|
20
|
+
state: z.ZodString;
|
|
21
|
+
source_branch: z.ZodString;
|
|
22
|
+
destination_branch: z.ZodString;
|
|
23
|
+
author: z.ZodString;
|
|
24
|
+
close_source_branch: z.ZodBoolean;
|
|
25
|
+
comment_count: z.ZodNumber;
|
|
26
|
+
web_url: z.ZodString;
|
|
27
|
+
created_on: z.ZodString;
|
|
28
|
+
updated_on: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const branchSchema: z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
target_hash: z.ZodString;
|
|
33
|
+
target_date: z.ZodString;
|
|
34
|
+
target_message: z.ZodString;
|
|
35
|
+
target_author: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const commitSchema: z.ZodObject<{
|
|
38
|
+
hash: z.ZodString;
|
|
39
|
+
message: z.ZodString;
|
|
40
|
+
author_raw: z.ZodString;
|
|
41
|
+
date: z.ZodString;
|
|
42
|
+
web_url: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const tagSchema: z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
target_hash: z.ZodString;
|
|
47
|
+
target_date: z.ZodString;
|
|
48
|
+
message: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const pipelineSchema: z.ZodObject<{
|
|
51
|
+
uuid: z.ZodString;
|
|
52
|
+
build_number: z.ZodNumber;
|
|
53
|
+
state_name: z.ZodString;
|
|
54
|
+
result_name: z.ZodString;
|
|
55
|
+
target_branch: z.ZodString;
|
|
56
|
+
target_hash: z.ZodString;
|
|
57
|
+
creator: z.ZodString;
|
|
58
|
+
duration_seconds: z.ZodNumber;
|
|
59
|
+
created_on: z.ZodString;
|
|
60
|
+
completed_on: z.ZodString;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export declare const pipelineStepSchema: z.ZodObject<{
|
|
63
|
+
uuid: z.ZodString;
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
state_name: z.ZodString;
|
|
66
|
+
result_name: z.ZodString;
|
|
67
|
+
duration_seconds: z.ZodNumber;
|
|
68
|
+
started_on: z.ZodString;
|
|
69
|
+
completed_on: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const commentSchema: z.ZodObject<{
|
|
72
|
+
id: z.ZodNumber;
|
|
73
|
+
content: z.ZodString;
|
|
74
|
+
author: z.ZodString;
|
|
75
|
+
created_on: z.ZodString;
|
|
76
|
+
updated_on: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export declare const userSchema: z.ZodObject<{
|
|
79
|
+
uuid: z.ZodString;
|
|
80
|
+
username: z.ZodString;
|
|
81
|
+
display_name: z.ZodString;
|
|
82
|
+
type: z.ZodString;
|
|
83
|
+
web_url: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export declare const workspaceSchema: z.ZodObject<{
|
|
86
|
+
uuid: z.ZodString;
|
|
87
|
+
slug: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
type: z.ZodString;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const memberSchema: z.ZodObject<{
|
|
92
|
+
display_name: z.ZodString;
|
|
93
|
+
uuid: z.ZodString;
|
|
94
|
+
type: z.ZodString;
|
|
95
|
+
permission: z.ZodString;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export interface RawRepo {
|
|
98
|
+
uuid?: string;
|
|
99
|
+
slug?: string;
|
|
100
|
+
full_name?: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
is_private?: boolean;
|
|
104
|
+
scm?: string;
|
|
105
|
+
language?: string;
|
|
106
|
+
mainbranch?: {
|
|
107
|
+
name?: string;
|
|
108
|
+
};
|
|
109
|
+
links?: {
|
|
110
|
+
html?: {
|
|
111
|
+
href?: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
created_on?: string;
|
|
115
|
+
updated_on?: string;
|
|
116
|
+
}
|
|
117
|
+
export declare const mapRepository: (r: RawRepo) => {
|
|
118
|
+
uuid: string;
|
|
119
|
+
slug: string;
|
|
120
|
+
full_name: string;
|
|
121
|
+
name: string;
|
|
122
|
+
description: string;
|
|
123
|
+
is_private: boolean;
|
|
124
|
+
scm: string;
|
|
125
|
+
language: string;
|
|
126
|
+
default_branch: string;
|
|
127
|
+
web_url: string;
|
|
128
|
+
created_on: string;
|
|
129
|
+
updated_on: string;
|
|
130
|
+
};
|
|
131
|
+
export interface RawPR {
|
|
132
|
+
id?: number;
|
|
133
|
+
title?: string;
|
|
134
|
+
description?: string;
|
|
135
|
+
state?: string;
|
|
136
|
+
source?: {
|
|
137
|
+
branch?: {
|
|
138
|
+
name?: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
destination?: {
|
|
142
|
+
branch?: {
|
|
143
|
+
name?: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
author?: {
|
|
147
|
+
display_name?: string;
|
|
148
|
+
};
|
|
149
|
+
close_source_branch?: boolean;
|
|
150
|
+
comment_count?: number;
|
|
151
|
+
links?: {
|
|
152
|
+
html?: {
|
|
153
|
+
href?: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
created_on?: string;
|
|
157
|
+
updated_on?: string;
|
|
158
|
+
}
|
|
159
|
+
export declare const mapPullRequest: (pr: RawPR) => {
|
|
160
|
+
id: number;
|
|
161
|
+
title: string;
|
|
162
|
+
description: string;
|
|
163
|
+
state: string;
|
|
164
|
+
source_branch: string;
|
|
165
|
+
destination_branch: string;
|
|
166
|
+
author: string;
|
|
167
|
+
close_source_branch: boolean;
|
|
168
|
+
comment_count: number;
|
|
169
|
+
web_url: string;
|
|
170
|
+
created_on: string;
|
|
171
|
+
updated_on: string;
|
|
172
|
+
};
|
|
173
|
+
export interface RawBranch {
|
|
174
|
+
name?: string;
|
|
175
|
+
target?: {
|
|
176
|
+
hash?: string;
|
|
177
|
+
date?: string;
|
|
178
|
+
message?: string;
|
|
179
|
+
author?: {
|
|
180
|
+
raw?: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export declare const mapBranch: (b: RawBranch) => {
|
|
185
|
+
name: string;
|
|
186
|
+
target_hash: string;
|
|
187
|
+
target_date: string;
|
|
188
|
+
target_message: string;
|
|
189
|
+
target_author: string;
|
|
190
|
+
};
|
|
191
|
+
export interface RawCommit {
|
|
192
|
+
hash?: string;
|
|
193
|
+
message?: string;
|
|
194
|
+
author?: {
|
|
195
|
+
raw?: string;
|
|
196
|
+
};
|
|
197
|
+
date?: string;
|
|
198
|
+
links?: {
|
|
199
|
+
html?: {
|
|
200
|
+
href?: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export declare const mapCommit: (c: RawCommit) => {
|
|
205
|
+
hash: string;
|
|
206
|
+
message: string;
|
|
207
|
+
author_raw: string;
|
|
208
|
+
date: string;
|
|
209
|
+
web_url: string;
|
|
210
|
+
};
|
|
211
|
+
export interface RawTag {
|
|
212
|
+
name?: string;
|
|
213
|
+
target?: {
|
|
214
|
+
hash?: string;
|
|
215
|
+
date?: string;
|
|
216
|
+
};
|
|
217
|
+
message?: string;
|
|
218
|
+
}
|
|
219
|
+
export declare const mapTag: (t: RawTag) => {
|
|
220
|
+
name: string;
|
|
221
|
+
target_hash: string;
|
|
222
|
+
target_date: string;
|
|
223
|
+
message: string;
|
|
224
|
+
};
|
|
225
|
+
export interface RawPipeline {
|
|
226
|
+
uuid?: string;
|
|
227
|
+
build_number?: number;
|
|
228
|
+
state?: {
|
|
229
|
+
name?: string;
|
|
230
|
+
result?: {
|
|
231
|
+
name?: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
target?: {
|
|
235
|
+
ref_name?: string;
|
|
236
|
+
commit?: {
|
|
237
|
+
hash?: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
creator?: {
|
|
241
|
+
display_name?: string;
|
|
242
|
+
};
|
|
243
|
+
duration_in_seconds?: number;
|
|
244
|
+
created_on?: string;
|
|
245
|
+
completed_on?: string;
|
|
246
|
+
}
|
|
247
|
+
export declare const mapPipeline: (p: RawPipeline) => {
|
|
248
|
+
uuid: string;
|
|
249
|
+
build_number: number;
|
|
250
|
+
state_name: string;
|
|
251
|
+
result_name: string;
|
|
252
|
+
target_branch: string;
|
|
253
|
+
target_hash: string;
|
|
254
|
+
creator: string;
|
|
255
|
+
duration_seconds: number;
|
|
256
|
+
created_on: string;
|
|
257
|
+
completed_on: string;
|
|
258
|
+
};
|
|
259
|
+
export interface RawPipelineStep {
|
|
260
|
+
uuid?: string;
|
|
261
|
+
name?: string;
|
|
262
|
+
state?: {
|
|
263
|
+
name?: string;
|
|
264
|
+
result?: {
|
|
265
|
+
name?: string;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
duration_in_seconds?: number;
|
|
269
|
+
started_on?: string;
|
|
270
|
+
completed_on?: string;
|
|
271
|
+
}
|
|
272
|
+
export declare const mapPipelineStep: (s: RawPipelineStep) => {
|
|
273
|
+
uuid: string;
|
|
274
|
+
name: string;
|
|
275
|
+
state_name: string;
|
|
276
|
+
result_name: string;
|
|
277
|
+
duration_seconds: number;
|
|
278
|
+
started_on: string;
|
|
279
|
+
completed_on: string;
|
|
280
|
+
};
|
|
281
|
+
export interface RawComment {
|
|
282
|
+
id?: number;
|
|
283
|
+
content?: {
|
|
284
|
+
raw?: string;
|
|
285
|
+
};
|
|
286
|
+
user?: {
|
|
287
|
+
display_name?: string;
|
|
288
|
+
};
|
|
289
|
+
created_on?: string;
|
|
290
|
+
updated_on?: string;
|
|
291
|
+
}
|
|
292
|
+
export declare const mapComment: (c: RawComment) => {
|
|
293
|
+
id: number;
|
|
294
|
+
content: string;
|
|
295
|
+
author: string;
|
|
296
|
+
created_on: string;
|
|
297
|
+
updated_on: string;
|
|
298
|
+
};
|
|
299
|
+
export interface RawUser {
|
|
300
|
+
uuid?: string;
|
|
301
|
+
username?: string;
|
|
302
|
+
display_name?: string;
|
|
303
|
+
type?: string;
|
|
304
|
+
links?: {
|
|
305
|
+
html?: {
|
|
306
|
+
href?: string;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export declare const mapUser: (u: RawUser) => {
|
|
311
|
+
uuid: string;
|
|
312
|
+
username: string;
|
|
313
|
+
display_name: string;
|
|
314
|
+
type: string;
|
|
315
|
+
web_url: string;
|
|
316
|
+
};
|
|
317
|
+
export interface RawWorkspace {
|
|
318
|
+
uuid?: string;
|
|
319
|
+
slug?: string;
|
|
320
|
+
name?: string;
|
|
321
|
+
type?: string;
|
|
322
|
+
}
|
|
323
|
+
export declare const mapWorkspace: (w: RawWorkspace) => {
|
|
324
|
+
uuid: string;
|
|
325
|
+
slug: string;
|
|
326
|
+
name: string;
|
|
327
|
+
type: string;
|
|
328
|
+
};
|
|
329
|
+
export interface RawMember {
|
|
330
|
+
user?: {
|
|
331
|
+
display_name?: string;
|
|
332
|
+
uuid?: string;
|
|
333
|
+
type?: string;
|
|
334
|
+
};
|
|
335
|
+
permission?: string;
|
|
336
|
+
}
|
|
337
|
+
export declare const mapMember: (m: RawMember) => {
|
|
338
|
+
display_name: string;
|
|
339
|
+
uuid: string;
|
|
340
|
+
type: string;
|
|
341
|
+
permission: string;
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;iBAa3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAa5B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;iBAKpB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;iBAWzB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;iBAQ7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;iBAMrB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;iBAK1B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;iBAKvB,CAAC;AAIH,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE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,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACtC;AAED,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO;;;;;;CAMhC,CAAC;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,GAAI,GAAG,YAAY;;;;;CAK1C,CAAC;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,GAAI,GAAG,SAAS;;;;;CAKpC,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// --- Shared schemas ---
|
|
3
|
+
export const repositorySchema = z.object({
|
|
4
|
+
uuid: z.string().describe('Repository UUID'),
|
|
5
|
+
slug: z.string().describe('Repository slug'),
|
|
6
|
+
full_name: z.string().describe('Full name in "workspace/repo" format'),
|
|
7
|
+
name: z.string().describe('Repository name'),
|
|
8
|
+
description: z.string().describe('Repository description'),
|
|
9
|
+
is_private: z.boolean().describe('Whether the repository is private'),
|
|
10
|
+
scm: z.string().describe('Source control type (e.g., "git")'),
|
|
11
|
+
language: z.string().describe('Primary programming language'),
|
|
12
|
+
default_branch: z.string().describe('Default branch name'),
|
|
13
|
+
web_url: z.string().describe('URL to the repository on Bitbucket'),
|
|
14
|
+
created_on: z.string().describe('Created ISO 8601 timestamp'),
|
|
15
|
+
updated_on: z.string().describe('Updated ISO 8601 timestamp'),
|
|
16
|
+
});
|
|
17
|
+
export const pullRequestSchema = z.object({
|
|
18
|
+
id: z.number().int().describe('Pull request ID'),
|
|
19
|
+
title: z.string().describe('Pull request title'),
|
|
20
|
+
description: z.string().describe('Pull request description in Markdown'),
|
|
21
|
+
state: z.string().describe('PR state: OPEN, MERGED, DECLINED, or SUPERSEDED'),
|
|
22
|
+
source_branch: z.string().describe('Source branch name'),
|
|
23
|
+
destination_branch: z.string().describe('Destination branch name'),
|
|
24
|
+
author: z.string().describe('Author display name'),
|
|
25
|
+
close_source_branch: z.boolean().describe('Whether source branch is deleted after merge'),
|
|
26
|
+
comment_count: z.number().int().describe('Number of comments'),
|
|
27
|
+
web_url: z.string().describe('URL to the pull request on Bitbucket'),
|
|
28
|
+
created_on: z.string().describe('Created ISO 8601 timestamp'),
|
|
29
|
+
updated_on: z.string().describe('Updated ISO 8601 timestamp'),
|
|
30
|
+
});
|
|
31
|
+
export const branchSchema = z.object({
|
|
32
|
+
name: z.string().describe('Branch name'),
|
|
33
|
+
target_hash: z.string().describe('SHA of the branch HEAD commit'),
|
|
34
|
+
target_date: z.string().describe('Date of the HEAD commit'),
|
|
35
|
+
target_message: z.string().describe('Commit message of the HEAD commit'),
|
|
36
|
+
target_author: z.string().describe('Author of the HEAD commit'),
|
|
37
|
+
});
|
|
38
|
+
export const commitSchema = z.object({
|
|
39
|
+
hash: z.string().describe('Full commit SHA'),
|
|
40
|
+
message: z.string().describe('Full commit message'),
|
|
41
|
+
author_raw: z.string().describe('Author in "Name <email>" format'),
|
|
42
|
+
date: z.string().describe('Authored ISO 8601 timestamp'),
|
|
43
|
+
web_url: z.string().describe('URL to the commit on Bitbucket'),
|
|
44
|
+
});
|
|
45
|
+
export const tagSchema = z.object({
|
|
46
|
+
name: z.string().describe('Tag name'),
|
|
47
|
+
target_hash: z.string().describe('SHA of the tagged commit'),
|
|
48
|
+
target_date: z.string().describe('Date of the tagged commit'),
|
|
49
|
+
message: z.string().describe('Tag message'),
|
|
50
|
+
});
|
|
51
|
+
export const pipelineSchema = z.object({
|
|
52
|
+
uuid: z.string().describe('Pipeline UUID'),
|
|
53
|
+
build_number: z.number().int().describe('Pipeline build number'),
|
|
54
|
+
state_name: z.string().describe('Pipeline state (e.g., COMPLETED, IN_PROGRESS, PENDING)'),
|
|
55
|
+
result_name: z.string().describe('Pipeline result (e.g., SUCCESSFUL, FAILED, STOPPED) or empty if in progress'),
|
|
56
|
+
target_branch: z.string().describe('Target branch name'),
|
|
57
|
+
target_hash: z.string().describe('Target commit SHA'),
|
|
58
|
+
creator: z.string().describe('Display name of the pipeline creator'),
|
|
59
|
+
duration_seconds: z.number().int().describe('Duration in seconds or 0 if not finished'),
|
|
60
|
+
created_on: z.string().describe('Created ISO 8601 timestamp'),
|
|
61
|
+
completed_on: z.string().describe('Completed ISO 8601 timestamp or empty string'),
|
|
62
|
+
});
|
|
63
|
+
export const pipelineStepSchema = z.object({
|
|
64
|
+
uuid: z.string().describe('Step UUID'),
|
|
65
|
+
name: z.string().describe('Step name'),
|
|
66
|
+
state_name: z.string().describe('Step state (e.g., COMPLETED, IN_PROGRESS, PENDING)'),
|
|
67
|
+
result_name: z.string().describe('Step result (e.g., SUCCESSFUL, FAILED) or empty if in progress'),
|
|
68
|
+
duration_seconds: z.number().int().describe('Duration in seconds or 0 if not finished'),
|
|
69
|
+
started_on: z.string().describe('Started ISO 8601 timestamp or empty string'),
|
|
70
|
+
completed_on: z.string().describe('Completed ISO 8601 timestamp or empty string'),
|
|
71
|
+
});
|
|
72
|
+
export const commentSchema = z.object({
|
|
73
|
+
id: z.number().int().describe('Comment ID'),
|
|
74
|
+
content: z.string().describe('Comment content in Markdown'),
|
|
75
|
+
author: z.string().describe('Author display name'),
|
|
76
|
+
created_on: z.string().describe('Created ISO 8601 timestamp'),
|
|
77
|
+
updated_on: z.string().describe('Updated ISO 8601 timestamp'),
|
|
78
|
+
});
|
|
79
|
+
export const userSchema = z.object({
|
|
80
|
+
uuid: z.string().describe('User UUID'),
|
|
81
|
+
username: z.string().describe('Username (account_id for Atlassian accounts)'),
|
|
82
|
+
display_name: z.string().describe('Display name'),
|
|
83
|
+
type: z.string().describe('Account type (e.g., "user")'),
|
|
84
|
+
web_url: z.string().describe('URL to the user profile on Bitbucket'),
|
|
85
|
+
});
|
|
86
|
+
export const workspaceSchema = z.object({
|
|
87
|
+
uuid: z.string().describe('Workspace UUID'),
|
|
88
|
+
slug: z.string().describe('Workspace slug'),
|
|
89
|
+
name: z.string().describe('Workspace name'),
|
|
90
|
+
type: z.string().describe('Workspace type'),
|
|
91
|
+
});
|
|
92
|
+
export const memberSchema = z.object({
|
|
93
|
+
display_name: z.string().describe('Member display name'),
|
|
94
|
+
uuid: z.string().describe('Member UUID'),
|
|
95
|
+
type: z.string().describe('Account type'),
|
|
96
|
+
permission: z.string().describe('Workspace permission level (e.g., "owner", "collaborator", "member")'),
|
|
97
|
+
});
|
|
98
|
+
export const mapRepository = (r) => ({
|
|
99
|
+
uuid: r.uuid ?? '',
|
|
100
|
+
slug: r.slug ?? '',
|
|
101
|
+
full_name: r.full_name ?? '',
|
|
102
|
+
name: r.name ?? r.slug ?? '',
|
|
103
|
+
description: r.description ?? '',
|
|
104
|
+
is_private: r.is_private ?? false,
|
|
105
|
+
scm: r.scm ?? '',
|
|
106
|
+
language: r.language ?? '',
|
|
107
|
+
default_branch: r.mainbranch?.name ?? '',
|
|
108
|
+
web_url: r.links?.html?.href ?? '',
|
|
109
|
+
created_on: r.created_on ?? '',
|
|
110
|
+
updated_on: r.updated_on ?? '',
|
|
111
|
+
});
|
|
112
|
+
export const mapPullRequest = (pr) => ({
|
|
113
|
+
id: pr.id ?? 0,
|
|
114
|
+
title: pr.title ?? '',
|
|
115
|
+
description: pr.description ?? '',
|
|
116
|
+
state: pr.state ?? '',
|
|
117
|
+
source_branch: pr.source?.branch?.name ?? '',
|
|
118
|
+
destination_branch: pr.destination?.branch?.name ?? '',
|
|
119
|
+
author: pr.author?.display_name ?? '',
|
|
120
|
+
close_source_branch: pr.close_source_branch ?? false,
|
|
121
|
+
comment_count: pr.comment_count ?? 0,
|
|
122
|
+
web_url: pr.links?.html?.href ?? '',
|
|
123
|
+
created_on: pr.created_on ?? '',
|
|
124
|
+
updated_on: pr.updated_on ?? '',
|
|
125
|
+
});
|
|
126
|
+
export const mapBranch = (b) => ({
|
|
127
|
+
name: b.name ?? '',
|
|
128
|
+
target_hash: b.target?.hash ?? '',
|
|
129
|
+
target_date: b.target?.date ?? '',
|
|
130
|
+
target_message: (b.target?.message ?? '').trim(),
|
|
131
|
+
target_author: b.target?.author?.raw ?? '',
|
|
132
|
+
});
|
|
133
|
+
export const mapCommit = (c) => ({
|
|
134
|
+
hash: c.hash ?? '',
|
|
135
|
+
message: (c.message ?? '').trim(),
|
|
136
|
+
author_raw: c.author?.raw ?? '',
|
|
137
|
+
date: c.date ?? '',
|
|
138
|
+
web_url: c.links?.html?.href ?? '',
|
|
139
|
+
});
|
|
140
|
+
export const mapTag = (t) => ({
|
|
141
|
+
name: t.name ?? '',
|
|
142
|
+
target_hash: t.target?.hash ?? '',
|
|
143
|
+
target_date: t.target?.date ?? '',
|
|
144
|
+
message: (t.message ?? '').trim(),
|
|
145
|
+
});
|
|
146
|
+
export const mapPipeline = (p) => ({
|
|
147
|
+
uuid: p.uuid ?? '',
|
|
148
|
+
build_number: p.build_number ?? 0,
|
|
149
|
+
state_name: p.state?.name ?? '',
|
|
150
|
+
result_name: p.state?.result?.name ?? '',
|
|
151
|
+
target_branch: p.target?.ref_name ?? '',
|
|
152
|
+
target_hash: p.target?.commit?.hash ?? '',
|
|
153
|
+
creator: p.creator?.display_name ?? '',
|
|
154
|
+
duration_seconds: p.duration_in_seconds ?? 0,
|
|
155
|
+
created_on: p.created_on ?? '',
|
|
156
|
+
completed_on: p.completed_on ?? '',
|
|
157
|
+
});
|
|
158
|
+
export const mapPipelineStep = (s) => ({
|
|
159
|
+
uuid: s.uuid ?? '',
|
|
160
|
+
name: s.name ?? '',
|
|
161
|
+
state_name: s.state?.name ?? '',
|
|
162
|
+
result_name: s.state?.result?.name ?? '',
|
|
163
|
+
duration_seconds: s.duration_in_seconds ?? 0,
|
|
164
|
+
started_on: s.started_on ?? '',
|
|
165
|
+
completed_on: s.completed_on ?? '',
|
|
166
|
+
});
|
|
167
|
+
export const mapComment = (c) => ({
|
|
168
|
+
id: c.id ?? 0,
|
|
169
|
+
content: c.content?.raw ?? '',
|
|
170
|
+
author: c.user?.display_name ?? '',
|
|
171
|
+
created_on: c.created_on ?? '',
|
|
172
|
+
updated_on: c.updated_on ?? '',
|
|
173
|
+
});
|
|
174
|
+
export const mapUser = (u) => ({
|
|
175
|
+
uuid: u.uuid ?? '',
|
|
176
|
+
username: u.username ?? '',
|
|
177
|
+
display_name: u.display_name ?? '',
|
|
178
|
+
type: u.type ?? '',
|
|
179
|
+
web_url: u.links?.html?.href ?? '',
|
|
180
|
+
});
|
|
181
|
+
export const mapWorkspace = (w) => ({
|
|
182
|
+
uuid: w.uuid ?? '',
|
|
183
|
+
slug: w.slug ?? '',
|
|
184
|
+
name: w.name ?? '',
|
|
185
|
+
type: w.type ?? '',
|
|
186
|
+
});
|
|
187
|
+
export const mapMember = (m) => ({
|
|
188
|
+
display_name: m.user?.display_name ?? '',
|
|
189
|
+
uuid: m.user?.uuid ?? '',
|
|
190
|
+
type: m.user?.type ?? '',
|
|
191
|
+
permission: m.permission ?? '',
|
|
192
|
+
});
|
|
193
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAyB;AAEzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,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,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;CACnB,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAY,EAAE,EAAE,CAAC,CAAC;IAC1C,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,IAAI,EAAE;IACxC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE;IACxB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,EAAE;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchCode: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
search_query: z.ZodString;
|
|
5
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
results: z.ZodArray<z.ZodObject<{
|
|
9
|
+
file: z.ZodString;
|
|
10
|
+
repo: z.ZodString;
|
|
11
|
+
content_matches: z.ZodArray<z.ZodObject<{
|
|
12
|
+
lines: z.ZodString;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
//# sourceMappingURL=search-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-code.d.ts","sourceRoot":"","sources":["../../src/tools/search-code.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;kBAkDrB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
const extractRepoSlug = (href) => {
|
|
5
|
+
// href format: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/src/{hash}/{path}
|
|
6
|
+
const parts = href.split('/repositories/')[1]?.split('/');
|
|
7
|
+
return parts?.[1] ?? '';
|
|
8
|
+
};
|
|
9
|
+
export const searchCode = defineTool({
|
|
10
|
+
name: 'search_code',
|
|
11
|
+
displayName: 'Search Code',
|
|
12
|
+
description: 'Search for code across all repositories in a Bitbucket workspace. Returns matching file paths and content snippets.',
|
|
13
|
+
summary: 'Search code in a workspace',
|
|
14
|
+
icon: 'search',
|
|
15
|
+
group: 'Source',
|
|
16
|
+
input: z.object({
|
|
17
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
18
|
+
search_query: z.string().describe('Search query string'),
|
|
19
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
20
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
21
|
+
}),
|
|
22
|
+
output: z.object({
|
|
23
|
+
results: z
|
|
24
|
+
.array(z.object({
|
|
25
|
+
file: z.string().describe('File path'),
|
|
26
|
+
repo: z.string().describe('Repository slug'),
|
|
27
|
+
content_matches: z
|
|
28
|
+
.array(z.object({
|
|
29
|
+
lines: z.string().describe('Matched lines'),
|
|
30
|
+
}))
|
|
31
|
+
.describe('Content match segments'),
|
|
32
|
+
}))
|
|
33
|
+
.describe('Search results'),
|
|
34
|
+
}),
|
|
35
|
+
handle: async (params) => {
|
|
36
|
+
const query = {
|
|
37
|
+
search_query: params.search_query,
|
|
38
|
+
page: params.page,
|
|
39
|
+
pagelen: params.pagelen,
|
|
40
|
+
};
|
|
41
|
+
const data = await api(`/workspaces/${params.workspace}/search/code`, { query });
|
|
42
|
+
const results = (data.values ?? []).map(item => {
|
|
43
|
+
const filePath = item.file?.path ?? '';
|
|
44
|
+
const selfHref = item.file?.links?.self?.href ?? '';
|
|
45
|
+
const repo = extractRepoSlug(selfHref);
|
|
46
|
+
const contentMatches = (item.content_matches ?? []).map(match => {
|
|
47
|
+
const lines = (match.lines ?? []).map(line => (line.segments ?? []).map(s => s.text ?? '').join('')).join('\n');
|
|
48
|
+
return { lines };
|
|
49
|
+
});
|
|
50
|
+
return { file: filePath, repo, content_matches: contentMatches };
|
|
51
|
+
});
|
|
52
|
+
return { results };
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=search-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-code.js","sourceRoot":"","sources":["../../src/tools/search-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAc1C,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE;IAC/C,+FAA+F;IAC/F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1D,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,qHAAqH;IACvH,OAAO,EAAE,4BAA4B;IACrC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE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AG,CAAC,IAAI,CAAC,EAAE;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;YACpD,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACvC,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBAC9D,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChH,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;QACnE,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updatePullRequest: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
repo_slug: z.ZodString;
|
|
5
|
+
pull_request_id: z.ZodNumber;
|
|
6
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
destination_branch: z.ZodOptional<z.ZodString>;
|
|
9
|
+
close_source_branch: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
description: z.ZodString;
|
|
15
|
+
state: z.ZodString;
|
|
16
|
+
source_branch: z.ZodString;
|
|
17
|
+
destination_branch: z.ZodString;
|
|
18
|
+
author: z.ZodString;
|
|
19
|
+
close_source_branch: z.ZodBoolean;
|
|
20
|
+
comment_count: z.ZodNumber;
|
|
21
|
+
web_url: z.ZodString;
|
|
22
|
+
created_on: z.ZodString;
|
|
23
|
+
updated_on: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
//# sourceMappingURL=update-pull-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-pull-request.d.ts","sourceRoot":"","sources":["../../src/tools/update-pull-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;kBAoC5B,CAAC"}
|