@cat-indev/catops-cli 0.0.1-alpha.39 → 0.0.1-alpha.41
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 +197 -0
- package/dist/services/azdo-api.js +1 -1
- package/dist/services/azdo-api.js.map +1 -1
- package/dist/services/azdo-workspace.d.ts +5 -2
- package/dist/services/azdo-workspace.js +51 -2
- package/dist/services/azdo-workspace.js.map +1 -1
- package/dist/services/git.d.ts +327 -8
- package/dist/services/git.js +517 -17
- package/dist/services/git.js.map +1 -1
- package/package.json +1 -1
package/dist/services/git.d.ts
CHANGED
|
@@ -1,9 +1,328 @@
|
|
|
1
1
|
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare function
|
|
8
|
-
export
|
|
9
|
-
|
|
2
|
+
export interface GitCommon {
|
|
3
|
+
/** retry/timeout/dryRun para esta llamada puntual (ver shell.exec). */
|
|
4
|
+
exec?: ExecOptions;
|
|
5
|
+
}
|
|
6
|
+
/** True si el objeto solo contiene claves de ExecOptions (retry/timeout/dryRun/env...). */
|
|
7
|
+
export declare function isBareExec(value: unknown): value is ExecOptions;
|
|
8
|
+
export interface GitCloneOptions extends GitCommon {
|
|
9
|
+
/** `--branch <name>`: rama a clonar en lugar de la default. */
|
|
10
|
+
branch?: string;
|
|
11
|
+
/** `--depth <n>`: clon shallow con n historias. */
|
|
12
|
+
depth?: number;
|
|
13
|
+
/** `--bare`: clon sin working tree (para repos remotos de despliegue). */
|
|
14
|
+
bare?: boolean;
|
|
15
|
+
/** `--single-branch`: clona solo la rama indicada, sin las demás refs. */
|
|
16
|
+
singleBranch?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function clone(url: string, targetPath: string, opts?: GitCloneOptions | ExecOptions): Promise<ExecResult>;
|
|
19
|
+
export interface GitCheckoutOptions extends GitCommon {
|
|
20
|
+
/** `-b`: crear la rama y pasarse a ella. */
|
|
21
|
+
create?: boolean;
|
|
22
|
+
/** `--track`: crear la rama con upstream hacia una remota. */
|
|
23
|
+
track?: boolean;
|
|
24
|
+
/** `-f`: descartar cambios locales en conflicto. */
|
|
25
|
+
force?: boolean;
|
|
26
|
+
/** `--detach`: dejar HEAD en detached. */
|
|
27
|
+
detach?: boolean;
|
|
28
|
+
/** Rama/commit base cuando se crea (`git checkout -b dev origin/dev`). */
|
|
29
|
+
startPoint?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function checkout(branch: string, opts?: GitCheckoutOptions | ExecOptions): Promise<ExecResult>;
|
|
32
|
+
export interface GitBranchOptions extends GitCommon {
|
|
33
|
+
/** Crea una rama: `git branch <create> [startPoint]`. */
|
|
34
|
+
create?: string;
|
|
35
|
+
/** Punto de partida al crear la rama. */
|
|
36
|
+
startPoint?: string;
|
|
37
|
+
/** `-f`: recrea/reapunta la rama existente. */
|
|
38
|
+
forceCreate?: boolean;
|
|
39
|
+
/** Borra una rama con `-d` (solo si está fusionada). */
|
|
40
|
+
delete?: string;
|
|
41
|
+
/** Borra con `-D`, ignorando estado de fusión. */
|
|
42
|
+
forceDelete?: string;
|
|
43
|
+
/** `--show-current`: imprime la rama actual. */
|
|
44
|
+
showCurrent?: boolean;
|
|
45
|
+
/** `-a`: lista también ramas remotas. */
|
|
46
|
+
all?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare function branch(opts?: GitBranchOptions | ExecOptions): Promise<ExecResult>;
|
|
49
|
+
export interface GitBranchCreateOptions extends GitCommon {
|
|
50
|
+
/** Punto de partida al crear (`git branch <name> <startPoint>`). */
|
|
51
|
+
startPoint?: string;
|
|
52
|
+
/** `-f`: recrea/reapunta una rama existente. */
|
|
53
|
+
force?: boolean;
|
|
54
|
+
/** `--track`: deja configurado el upstream hacia `startPoint` (o el remoto). */
|
|
55
|
+
track?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function branchCreate(name: string, opts?: GitBranchCreateOptions | ExecOptions): Promise<ExecResult>;
|
|
58
|
+
export interface GitBranchDeleteOptions extends GitCommon {
|
|
59
|
+
/** `-D` en vez de `-d`: borra aunque la rama no esté fusionada. */
|
|
60
|
+
force?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare function branchDelete(name: string, opts?: GitBranchDeleteOptions | ExecOptions): Promise<ExecResult>;
|
|
63
|
+
export interface GitBranchRenameOptions extends GitCommon {
|
|
64
|
+
/** Si se omite, renombra la rama actual. */
|
|
65
|
+
oldName?: string;
|
|
66
|
+
/** `-M` en vez de `-m`: renombra aunque el nuevo nombre exista. */
|
|
67
|
+
force?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export declare function branchRename(newName: string, opts?: GitBranchRenameOptions | ExecOptions): Promise<ExecResult>;
|
|
70
|
+
export interface GitBranchListOptions extends GitCommon {
|
|
71
|
+
/** `-a`: ramas locales y remotas. */
|
|
72
|
+
all?: boolean;
|
|
73
|
+
/** `-r`: solo ramas remotas. */
|
|
74
|
+
remote?: boolean;
|
|
75
|
+
/** `--merged [commit]`: solo ramas ya fusionadas en commit. */
|
|
76
|
+
merged?: boolean | string;
|
|
77
|
+
/** `--no-merged [commit]`: solo ramas NO fusionadas en commit. */
|
|
78
|
+
noMerged?: boolean | string;
|
|
79
|
+
/** `--contains <commit>`: ramas que contienen el commit. */
|
|
80
|
+
contains?: string;
|
|
81
|
+
/** `-vv`: muestra SHA y upstream de cada rama. */
|
|
82
|
+
verbose?: boolean;
|
|
83
|
+
/** `--sort=<clave>` (ej. "-committerdate", "authordate"). */
|
|
84
|
+
sort?: string;
|
|
85
|
+
/** Patrón de filtro para `git branch --list <pattern>`. */
|
|
86
|
+
pattern?: string;
|
|
87
|
+
}
|
|
88
|
+
export declare function branchList(opts?: GitBranchListOptions | ExecOptions): Promise<ExecResult>;
|
|
89
|
+
export declare function branchShowCurrent(opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
90
|
+
export interface GitBranchUpstreamOptions extends GitCommon {
|
|
91
|
+
/** Upstream a asignar (ej. "origin/main"). */
|
|
92
|
+
upstream: string;
|
|
93
|
+
/** Rama a la que aplicar; si se omite, la actual. */
|
|
94
|
+
name?: string;
|
|
95
|
+
}
|
|
96
|
+
export declare function branchSetUpstream(opts?: GitBranchUpstreamOptions | ExecOptions): Promise<ExecResult>;
|
|
97
|
+
export declare function branchUnsetUpstream(name?: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
98
|
+
export interface GitPullOptions extends GitCommon {
|
|
99
|
+
/** Origin/repositorio a traer (`git pull <remote>`). */
|
|
100
|
+
remote?: string;
|
|
101
|
+
/** Rama/refspec a traer (`git pull origin main`). */
|
|
102
|
+
branch?: string;
|
|
103
|
+
/** `--rebase`: reaplica el trabajo local sobre el remoto. */
|
|
104
|
+
rebase?: boolean;
|
|
105
|
+
/** `--no-rebase`: fuerza merge en vez de rebase. */
|
|
106
|
+
noRebase?: boolean;
|
|
107
|
+
/** `--ff-only`: solo avanza si se puede hacer fast-forward. */
|
|
108
|
+
ffOnly?: boolean;
|
|
109
|
+
/** `--no-ff`: crea commit de merge aunque haya fast-forward. */
|
|
110
|
+
noFF?: boolean;
|
|
111
|
+
/** `--prune`: borra refs remotas que desaparecieron. */
|
|
112
|
+
prune?: boolean;
|
|
113
|
+
/** `--tags`: trae también las etiquetas. */
|
|
114
|
+
tags?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export declare function pull(opts?: GitPullOptions | ExecOptions): Promise<ExecResult>;
|
|
117
|
+
export interface GitFetchOptions extends GitCommon {
|
|
118
|
+
/** Remote a fetchear; al indicarlo se omite `--all`. */
|
|
119
|
+
remote?: string;
|
|
120
|
+
/** Rama específica a fetchear. */
|
|
121
|
+
branch?: string;
|
|
122
|
+
/** `--depth <n>`: solo las n historias más recientes. */
|
|
123
|
+
depth?: number;
|
|
124
|
+
/** `--unshallow`: convierte un clon shallow en completo. */
|
|
125
|
+
unshallow?: boolean;
|
|
126
|
+
/** `--prune`: borra refs remotas huérfanas. */
|
|
127
|
+
prune?: boolean;
|
|
128
|
+
/** `--tags`: descarga también las etiquetas. */
|
|
129
|
+
tags?: boolean;
|
|
130
|
+
/** `--all` (default true si no se indica remote). */
|
|
131
|
+
all?: boolean;
|
|
132
|
+
}
|
|
133
|
+
export declare function fetch(opts?: GitFetchOptions | ExecOptions): Promise<ExecResult>;
|
|
134
|
+
export interface GitAddOptions extends GitCommon {
|
|
135
|
+
/** `-A`: agrega también archivos borrados/renombrados del working tree. */
|
|
136
|
+
all?: boolean;
|
|
137
|
+
/** `-u`: solo actualiza archivos ya rastreados. */
|
|
138
|
+
update?: boolean;
|
|
139
|
+
/** `-f`: agrega archivos ignorados por .gitignore. */
|
|
140
|
+
force?: boolean;
|
|
141
|
+
}
|
|
142
|
+
export declare function add(files: string[] | string, opts?: GitAddOptions | ExecOptions): Promise<ExecResult>;
|
|
143
|
+
export interface GitCommitOptions extends GitCommon {
|
|
144
|
+
/** Archivos a agregar automáticamente antes del commit (o "."). */
|
|
145
|
+
files?: string[] | string;
|
|
146
|
+
/** `-a`: hace add de los archivos modificados/eliminados rastreados. */
|
|
147
|
+
all?: boolean;
|
|
148
|
+
/** `--allow-empty`: permite commit sin cambios. */
|
|
149
|
+
allowEmpty?: boolean;
|
|
150
|
+
/** `--amend`: reemplaza el último commit en vez de crear uno nuevo. */
|
|
151
|
+
amend?: boolean;
|
|
152
|
+
}
|
|
153
|
+
/** Versión tipo: se traen los archivos indicados (si hay) y se commitea. */
|
|
154
|
+
export declare function commit(message: string, ...rest: Array<string[] | string | GitCommitOptions>): Promise<ExecResult>;
|
|
155
|
+
export interface GitPushOptions extends GitCommon {
|
|
156
|
+
/** Remote destino (ej. "origin"). */
|
|
157
|
+
remote?: string;
|
|
158
|
+
/** Rama/refspec a publicar (ej. "main"). */
|
|
159
|
+
branch?: string;
|
|
160
|
+
/** `--tags`: publica también las etiquetas. */
|
|
161
|
+
tags?: boolean;
|
|
162
|
+
/** `--force`: fuerza el push descartando conflicto remoto. */
|
|
163
|
+
force?: boolean;
|
|
164
|
+
/** `--force-with-lease`: fuerza solo si el remoto no avanzó desde nuestro fetch. */
|
|
165
|
+
forceWithLease?: boolean;
|
|
166
|
+
/** `-u`: setea el upstream para próximos pull/push sin argumentos. */
|
|
167
|
+
setUpstream?: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** `git.push("origin", "main")` o `git.push({ remote: "origin", branch: "main", force: true })`. */
|
|
170
|
+
export declare function push(...rawArgs: Array<string | GitPushOptions>): Promise<ExecResult>;
|
|
171
|
+
export interface GitTagOptions extends GitCommon {
|
|
172
|
+
/** `-m <mgs>` con `-a`: crea una tag anotada con mensaje. */
|
|
173
|
+
message?: string;
|
|
174
|
+
/** `-a`: fuerza tag anotada (suele combinarse con message). */
|
|
175
|
+
annotated?: boolean;
|
|
176
|
+
/** `-f`: reemplaza una tag existente. */
|
|
177
|
+
force?: boolean;
|
|
178
|
+
}
|
|
179
|
+
export declare function tag(name: string, opts?: GitTagOptions | ExecOptions): Promise<ExecResult>;
|
|
180
|
+
export declare function tagDelete(name: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
181
|
+
export interface GitTagListOptions extends GitCommon {
|
|
182
|
+
/** Patrón de filtro (ej. "v1.*"). */
|
|
183
|
+
pattern?: string;
|
|
184
|
+
/** `--sort=-creatordate`: ordena por fecha de creación. */
|
|
185
|
+
sort?: string;
|
|
186
|
+
}
|
|
187
|
+
export declare function tagList(opts?: GitTagListOptions | ExecOptions): Promise<ExecResult>;
|
|
188
|
+
export interface GitMergeOptions extends GitCommon {
|
|
189
|
+
/** `-m <msg>`: mensaje del commit de merge. */
|
|
190
|
+
message?: string;
|
|
191
|
+
/** `--no-edit`: usa el mensaje default sin abrir editor. */
|
|
192
|
+
noEdit?: boolean;
|
|
193
|
+
/** `--ff-only`: aborta si no se puede hacer fast-forward. */
|
|
194
|
+
ffOnly?: boolean;
|
|
195
|
+
/** `--no-ff`: crea commit de merge aunque haya fast-forward. */
|
|
196
|
+
noFF?: boolean;
|
|
197
|
+
/** `--abort`: aborta un merge en conflicto. */
|
|
198
|
+
abort?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/** `merge("develop", { noEdit: true })`, `merge({ abort: true })` o `merge("main", { ffOnly: true })`. */
|
|
201
|
+
export declare function merge(...rawArgs: Array<string | GitMergeOptions>): Promise<ExecResult>;
|
|
202
|
+
export interface GitRebaseOptions extends GitCommon {
|
|
203
|
+
/** Rama base (`git rebase main`). */
|
|
204
|
+
branch?: string;
|
|
205
|
+
/** `--onto <base>`: base concreta para reaplicar. */
|
|
206
|
+
onto?: string;
|
|
207
|
+
/** `--interactive`: abre editor para reordenar commits. */
|
|
208
|
+
interactive?: boolean;
|
|
209
|
+
/** `--continue`: continúa tras resolver conflictos. */
|
|
210
|
+
continue?: boolean;
|
|
211
|
+
/** `--abort`: aborta el rebase en curso. */
|
|
212
|
+
abort?: boolean;
|
|
213
|
+
/** `--skip`: salta el commit conflictivo. */
|
|
214
|
+
skip?: boolean;
|
|
215
|
+
}
|
|
216
|
+
export declare function rebase(opts?: GitRebaseOptions | ExecOptions): Promise<ExecResult>;
|
|
217
|
+
export interface GitStatusOptions extends GitCommon {
|
|
218
|
+
/** `-s`: salida corta. */
|
|
219
|
+
short?: boolean;
|
|
220
|
+
/** `-b`: muestra la rama actual (con -s). */
|
|
221
|
+
branch?: boolean;
|
|
222
|
+
/** `--porcelain`: salida estable para scripting. */
|
|
223
|
+
porcelain?: boolean;
|
|
224
|
+
/** `--untracked-files=no|normal|all`. */
|
|
225
|
+
untrackedFiles?: "no" | "normal" | "all";
|
|
226
|
+
}
|
|
227
|
+
export declare function status(opts?: GitStatusOptions | ExecOptions): Promise<ExecResult>;
|
|
228
|
+
export interface GitLogOptions extends GitCommon {
|
|
229
|
+
/** `--max-count <n>`: limita a los n commits más recientes. */
|
|
230
|
+
maxCount?: number;
|
|
231
|
+
/** `--since <fecha>`: commits desde una fecha/expresión. */
|
|
232
|
+
since?: string;
|
|
233
|
+
/** `--until <fecha>`: commits hasta una fecha/expresión. */
|
|
234
|
+
until?: string;
|
|
235
|
+
/** `--author <patron>`: filtra por autor. */
|
|
236
|
+
author?: string;
|
|
237
|
+
/** `--oneline`: resumen de una línea por commit. */
|
|
238
|
+
oneline?: boolean;
|
|
239
|
+
/** `--graph`: muestra el grafo de ramas. */
|
|
240
|
+
graph?: boolean;
|
|
241
|
+
/** `--all`: incluye todas las ramas. */
|
|
242
|
+
allBranches?: boolean;
|
|
243
|
+
/** `--pretty=format:<fmt>`: formato personalizado (NOTA: usa %h, %s, %an, ...). */
|
|
244
|
+
format?: string;
|
|
245
|
+
/** Rama o rango a consultar. */
|
|
246
|
+
branch?: string;
|
|
247
|
+
}
|
|
248
|
+
export declare function log(opts?: GitLogOptions | ExecOptions): Promise<ExecResult>;
|
|
249
|
+
export interface GitDiffOptions extends GitCommon {
|
|
250
|
+
/** `--cached`: diff del índice (staged). */
|
|
251
|
+
cached?: boolean;
|
|
252
|
+
/** `--stat`: resumen de archivos cambiados. */
|
|
253
|
+
stat?: boolean;
|
|
254
|
+
/** `--name-only`: solo nombres de archivos. */
|
|
255
|
+
nameOnly?: boolean;
|
|
256
|
+
/** Archivos/rangos a comparar. */
|
|
257
|
+
files?: string[] | string;
|
|
258
|
+
}
|
|
259
|
+
export declare function diff(opts?: GitDiffOptions | ExecOptions): Promise<ExecResult>;
|
|
260
|
+
export interface GitShowOptions extends GitCommon {
|
|
261
|
+
/** `--stat`: resumen de archivos del commit. */
|
|
262
|
+
stat?: boolean;
|
|
263
|
+
/** `--name-only`: solo nombres de archivos. */
|
|
264
|
+
nameOnly?: boolean;
|
|
265
|
+
}
|
|
266
|
+
export declare function show(ref: string, opts?: GitShowOptions | ExecOptions): Promise<ExecResult>;
|
|
267
|
+
export interface GitRemoteOptions extends GitCommon {
|
|
268
|
+
/** `-v`: lista remotes con sus URLs. */
|
|
269
|
+
verbose?: boolean;
|
|
270
|
+
/** `git remote show <name>`: detalle de un remote. */
|
|
271
|
+
show?: string;
|
|
272
|
+
/** `git remote get-url <name>`. */
|
|
273
|
+
getUrl?: string;
|
|
274
|
+
}
|
|
275
|
+
export declare function remote(opts?: GitRemoteOptions | ExecOptions): Promise<ExecResult>;
|
|
276
|
+
export declare function remoteAdd(name: string, url: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
277
|
+
export declare function remoteRemove(name: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
278
|
+
export declare function remoteSetUrl(name: string, url: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
279
|
+
export interface GitStashOptions extends GitCommon {
|
|
280
|
+
/** `-m <msg>`: mensaje descriptivo del stash. */
|
|
281
|
+
message?: string;
|
|
282
|
+
/** `-k`: mantiene el índice (deja staged lo que estaba staged). */
|
|
283
|
+
keepIndex?: boolean;
|
|
284
|
+
/** `-u`: incluye archivos untracked. */
|
|
285
|
+
includeUntracked?: boolean;
|
|
286
|
+
/** `-q`: sin salida. */
|
|
287
|
+
quiet?: boolean;
|
|
288
|
+
}
|
|
289
|
+
export declare function stashPush(opts?: GitStashOptions | ExecOptions): Promise<ExecResult>;
|
|
290
|
+
export interface GitStashIndexOptions extends GitCommon {
|
|
291
|
+
/** Índice del stash: `stash@{n}`. */
|
|
292
|
+
index?: number;
|
|
293
|
+
}
|
|
294
|
+
export declare function stashPop(opts?: GitStashIndexOptions | ExecOptions): Promise<ExecResult>;
|
|
295
|
+
export declare function stashApply(opts?: GitStashIndexOptions | ExecOptions): Promise<ExecResult>;
|
|
296
|
+
export declare function stashList(opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
297
|
+
export declare function stashDrop(opts?: GitStashIndexOptions | ExecOptions): Promise<ExecResult>;
|
|
298
|
+
export interface GitResetOptions extends GitCommon {
|
|
299
|
+
/** `--soft | --mixed | --hard`. */
|
|
300
|
+
mode?: "soft" | "mixed" | "hard";
|
|
301
|
+
/** Commit al que volver (por defecto HEAD). */
|
|
302
|
+
commit?: string;
|
|
303
|
+
}
|
|
304
|
+
export declare function reset(opts?: GitResetOptions | ExecOptions): Promise<ExecResult>;
|
|
305
|
+
export interface GitInitOptions extends GitCommon {
|
|
306
|
+
/** `--bare`: repo sin working tree. */
|
|
307
|
+
bare?: boolean;
|
|
308
|
+
/** `-b <name>`: rama inicial (ej. "main"). */
|
|
309
|
+
initialBranch?: string;
|
|
310
|
+
}
|
|
311
|
+
export declare function init(opts?: GitInitOptions | ExecOptions): Promise<ExecResult>;
|
|
312
|
+
export declare function configGet(name: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
313
|
+
export declare function configSet(name: string, value: string, opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
314
|
+
export declare function configList(opts?: GitCommon | ExecOptions): Promise<ExecResult>;
|
|
315
|
+
export interface GitRevParseOptions extends GitCommon {
|
|
316
|
+
/** Ref a resolver (por defecto "HEAD"). */
|
|
317
|
+
ref?: string;
|
|
318
|
+
/** `--short`: SHA abreviado. */
|
|
319
|
+
short?: boolean;
|
|
320
|
+
/** `--verify`: falla si el ref no existe. */
|
|
321
|
+
verify?: boolean;
|
|
322
|
+
/** `--abbrev-ref`: nombre corto de la rama (branch actual). */
|
|
323
|
+
abbrevRef?: boolean;
|
|
324
|
+
/** `--show-toplevel`: ruta absoluta de la raíz del repo. */
|
|
325
|
+
showTopLevel?: boolean;
|
|
326
|
+
}
|
|
327
|
+
/** `revParse()`, `revParse("HEAD~1")` o `revParse({ short: true })`. */
|
|
328
|
+
export declare function revParse(...rawArgs: Array<string | GitRevParseOptions>): Promise<ExecResult>;
|