@paklo/core 0.12.1 → 0.14.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/azure/index.d.mts +54 -65
- package/dist/azure/index.mjs +74 -68
- package/dist/azure/index.mjs.map +1 -1
- package/dist/dependabot/index.d.mts +3 -3
- package/dist/dependabot/index.mjs +3 -3
- package/dist/{index-BfwWezjJ.d.mts → ghsa-CqXOLQSp.d.mts} +1 -2
- package/dist/github/index.d.mts +1 -1
- package/dist/github/index.mjs +2 -2
- package/dist/github/index.mjs.map +1 -1
- package/dist/hono.d.mts +0 -1
- package/dist/{job-ClEevC5P.mjs → job-Bb9WiMwE.mjs} +19 -12
- package/dist/job-Bb9WiMwE.mjs.map +1 -0
- package/dist/keygen.d.mts +1 -3
- package/dist/logger.d.mts +1 -2
- package/dist/logger.mjs +41 -2
- package/dist/logger.mjs.map +1 -0
- package/dist/usage.d.mts +1 -1
- package/dist/usage.mjs +1 -1
- package/dist/{dependabot-DAdoJJp4.mjs → utils-BVmUgc0p.mjs} +110 -25
- package/dist/utils-BVmUgc0p.mjs.map +1 -0
- package/dist/{index-rsiHDQ5U.d.mts → utils-CFTIkIwf.d.mts} +174 -90
- package/package.json +9 -9
- package/dist/dependabot-DAdoJJp4.mjs.map +0 -1
- package/dist/job-ClEevC5P.mjs.map +0 -1
- package/dist/logger-3Qfh9NUj.mjs +0 -42
- package/dist/logger-3Qfh9NUj.mjs.map +0 -1
package/dist/azure/index.d.mts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../
|
|
1
|
+
import { Ft as DependabotExistingPr, G as DependabotUpdatePullRequest, Nt as DependabotExistingGroupPr, Sn as DependabotConfig, Zt as DependabotPersistedPr, p as DependabotCreatePullRequest, qn as VariableFinderFn } from "../utils-CFTIkIwf.mjs";
|
|
2
|
+
import "../ghsa-CqXOLQSp.mjs";
|
|
3
|
+
import "../dependabot/index.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { KyInstance } from "ky";
|
|
5
6
|
|
|
6
7
|
//#region src/azure/url-parts.d.ts
|
|
7
8
|
type AzureDevOpsOrganizationUrl = {
|
|
8
|
-
/** URL of the organization. This may lack the project name */
|
|
9
|
-
|
|
10
|
-
/** Organization
|
|
11
|
-
|
|
12
|
-
/** Organization API endpoint URL */
|
|
13
|
-
'api-endpoint': string;
|
|
14
|
-
/** Organization name/slug */
|
|
15
|
-
organization: string;
|
|
16
|
-
/** Virtual directory if present (on-premises only) */
|
|
9
|
+
/** URL of the organization. This may lack the project name */value: URL; /** Organization URL hostname */
|
|
10
|
+
hostname: string; /** Organization API endpoint URL */
|
|
11
|
+
'api-endpoint': string; /** Organization name/slug */
|
|
12
|
+
organization: string; /** Virtual directory if present (on-premises only) */
|
|
17
13
|
'virtual-directory'?: string;
|
|
18
14
|
/**
|
|
19
15
|
* Organization Identity API URL (different from the API endpoint).
|
|
@@ -21,39 +17,31 @@ type AzureDevOpsOrganizationUrl = {
|
|
|
21
17
|
*/
|
|
22
18
|
'identity-api-url': URL;
|
|
23
19
|
};
|
|
24
|
-
type
|
|
20
|
+
type AzureDevOpsRepositoryUrl = AzureDevOpsOrganizationUrl & {
|
|
25
21
|
/**
|
|
26
22
|
* Project ID or Name.
|
|
27
23
|
* This value is not URL-encoded, clients must encode it when constructing URLs.
|
|
28
24
|
*/
|
|
29
25
|
project: string;
|
|
30
|
-
};
|
|
31
|
-
type AzureDevOpsRepositoryUrl = AzureDevOpsProjectUrl & {
|
|
32
26
|
/**
|
|
33
27
|
* Repository ID or Name.
|
|
34
28
|
* This value is not URL-encoded, clients must encode it when constructing URLs.
|
|
35
29
|
*/
|
|
36
|
-
repository: string;
|
|
37
|
-
/** Slug of the repository e.g. `contoso/prj1/_git/repo1`, `tfs/contoso/prj1/_git/repo1` */
|
|
30
|
+
repository: string; /** Slug of the repository e.g. `contoso/prj1/_git/repo1`, `tfs/contoso/prj1/_git/repo1` */
|
|
38
31
|
'repository-slug': string;
|
|
39
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Extract organization details from any Azure DevOps URL.
|
|
35
|
+
* Accepts organization, project, or repository URLs.
|
|
36
|
+
*/
|
|
40
37
|
declare function extractOrganizationUrl({
|
|
41
38
|
organizationUrl
|
|
42
39
|
}: {
|
|
43
40
|
organizationUrl: string;
|
|
44
41
|
}): AzureDevOpsOrganizationUrl;
|
|
45
|
-
declare function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}: {
|
|
49
|
-
organizationUrl: string;
|
|
50
|
-
project: string;
|
|
51
|
-
}): AzureDevOpsProjectUrl;
|
|
52
|
-
declare function extractRepositoryUrl({
|
|
53
|
-
organizationUrl,
|
|
54
|
-
project,
|
|
55
|
-
repository
|
|
56
|
-
}: {
|
|
42
|
+
declare function extractRepositoryUrl(options: {
|
|
43
|
+
repositoryUrl: string;
|
|
44
|
+
} | {
|
|
57
45
|
organizationUrl: string;
|
|
58
46
|
project: string;
|
|
59
47
|
repository: string;
|
|
@@ -71,21 +59,21 @@ declare class BaseAzureDevOpsClient {
|
|
|
71
59
|
//#endregion
|
|
72
60
|
//#region src/azure/client/types.d.ts
|
|
73
61
|
declare const AzdoVersionControlChangeTypeSchema: z.ZodEnum<{
|
|
74
|
-
all: "all";
|
|
75
|
-
branch: "branch";
|
|
76
|
-
delete: "delete";
|
|
77
62
|
none: "none";
|
|
78
63
|
add: "add";
|
|
79
64
|
edit: "edit";
|
|
80
65
|
encoding: "encoding";
|
|
81
66
|
rename: "rename";
|
|
67
|
+
delete: "delete";
|
|
82
68
|
undelete: "undelete";
|
|
69
|
+
branch: "branch";
|
|
83
70
|
merge: "merge";
|
|
84
71
|
lock: "lock";
|
|
85
72
|
rollback: "rollback";
|
|
86
73
|
sourceRename: "sourceRename";
|
|
87
74
|
targetRename: "targetRename";
|
|
88
75
|
property: "property";
|
|
76
|
+
all: "all";
|
|
89
77
|
}>;
|
|
90
78
|
type AzdoVersionControlChangeType = z.infer<typeof AzdoVersionControlChangeTypeSchema>;
|
|
91
79
|
declare const AZDO_PULL_REQUEST_MERGE_STRATEGIES: readonly ["noFastForward", "squash", "rebase", "rebaseMerge"];
|
|
@@ -248,21 +236,21 @@ declare const AzdoGitRefUpdateResultSchema: z.ZodObject<{
|
|
|
248
236
|
type AzdoGitRefUpdateResult = z.infer<typeof AzdoGitRefUpdateResultSchema>;
|
|
249
237
|
declare const AzdoGitChangeSchema: z.ZodObject<{
|
|
250
238
|
changeType: z.ZodEnum<{
|
|
251
|
-
all: "all";
|
|
252
|
-
branch: "branch";
|
|
253
|
-
delete: "delete";
|
|
254
239
|
none: "none";
|
|
255
240
|
add: "add";
|
|
256
241
|
edit: "edit";
|
|
257
242
|
encoding: "encoding";
|
|
258
243
|
rename: "rename";
|
|
244
|
+
delete: "delete";
|
|
259
245
|
undelete: "undelete";
|
|
246
|
+
branch: "branch";
|
|
260
247
|
merge: "merge";
|
|
261
248
|
lock: "lock";
|
|
262
249
|
rollback: "rollback";
|
|
263
250
|
sourceRename: "sourceRename";
|
|
264
251
|
targetRename: "targetRename";
|
|
265
252
|
property: "property";
|
|
253
|
+
all: "all";
|
|
266
254
|
}>;
|
|
267
255
|
item: z.ZodOptional<z.ZodObject<{
|
|
268
256
|
path: z.ZodString;
|
|
@@ -291,21 +279,21 @@ declare const AzdoGitCommitRefSchema: z.ZodObject<{
|
|
|
291
279
|
}, z.core.$strip>>;
|
|
292
280
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
293
281
|
changeType: z.ZodEnum<{
|
|
294
|
-
all: "all";
|
|
295
|
-
branch: "branch";
|
|
296
|
-
delete: "delete";
|
|
297
282
|
none: "none";
|
|
298
283
|
add: "add";
|
|
299
284
|
edit: "edit";
|
|
300
285
|
encoding: "encoding";
|
|
301
286
|
rename: "rename";
|
|
287
|
+
delete: "delete";
|
|
302
288
|
undelete: "undelete";
|
|
289
|
+
branch: "branch";
|
|
303
290
|
merge: "merge";
|
|
304
291
|
lock: "lock";
|
|
305
292
|
rollback: "rollback";
|
|
306
293
|
sourceRename: "sourceRename";
|
|
307
294
|
targetRename: "targetRename";
|
|
308
295
|
property: "property";
|
|
296
|
+
all: "all";
|
|
309
297
|
}>;
|
|
310
298
|
item: z.ZodOptional<z.ZodObject<{
|
|
311
299
|
path: z.ZodString;
|
|
@@ -336,21 +324,21 @@ declare const AzdoGitPushSchema: z.ZodObject<{
|
|
|
336
324
|
}, z.core.$strip>>;
|
|
337
325
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
338
326
|
changeType: z.ZodEnum<{
|
|
339
|
-
all: "all";
|
|
340
|
-
branch: "branch";
|
|
341
|
-
delete: "delete";
|
|
342
327
|
none: "none";
|
|
343
328
|
add: "add";
|
|
344
329
|
edit: "edit";
|
|
345
330
|
encoding: "encoding";
|
|
346
331
|
rename: "rename";
|
|
332
|
+
delete: "delete";
|
|
347
333
|
undelete: "undelete";
|
|
334
|
+
branch: "branch";
|
|
348
335
|
merge: "merge";
|
|
349
336
|
lock: "lock";
|
|
350
337
|
rollback: "rollback";
|
|
351
338
|
sourceRename: "sourceRename";
|
|
352
339
|
targetRename: "targetRename";
|
|
353
340
|
property: "property";
|
|
341
|
+
all: "all";
|
|
354
342
|
}>;
|
|
355
343
|
item: z.ZodOptional<z.ZodObject<{
|
|
356
344
|
path: z.ZodString;
|
|
@@ -395,21 +383,21 @@ declare const AzdoGitPushCreateSchema: z.ZodObject<{
|
|
|
395
383
|
}, z.core.$strip>>;
|
|
396
384
|
changes: z.ZodArray<z.ZodObject<{
|
|
397
385
|
changeType: z.ZodEnum<{
|
|
398
|
-
all: "all";
|
|
399
|
-
branch: "branch";
|
|
400
|
-
delete: "delete";
|
|
401
386
|
none: "none";
|
|
402
387
|
add: "add";
|
|
403
388
|
edit: "edit";
|
|
404
389
|
encoding: "encoding";
|
|
405
390
|
rename: "rename";
|
|
391
|
+
delete: "delete";
|
|
406
392
|
undelete: "undelete";
|
|
393
|
+
branch: "branch";
|
|
407
394
|
merge: "merge";
|
|
408
395
|
lock: "lock";
|
|
409
396
|
rollback: "rollback";
|
|
410
397
|
sourceRename: "sourceRename";
|
|
411
398
|
targetRename: "targetRename";
|
|
412
399
|
property: "property";
|
|
400
|
+
all: "all";
|
|
413
401
|
}>;
|
|
414
402
|
item: z.ZodOptional<z.ZodObject<{
|
|
415
403
|
path: z.ZodString;
|
|
@@ -436,21 +424,21 @@ declare const AzdoGitCommitDiffsSchema: z.ZodObject<{
|
|
|
436
424
|
baseCommit: z.ZodString;
|
|
437
425
|
changes: z.ZodArray<z.ZodObject<{
|
|
438
426
|
changeType: z.ZodEnum<{
|
|
439
|
-
all: "all";
|
|
440
|
-
branch: "branch";
|
|
441
|
-
delete: "delete";
|
|
442
427
|
none: "none";
|
|
443
428
|
add: "add";
|
|
444
429
|
edit: "edit";
|
|
445
430
|
encoding: "encoding";
|
|
446
431
|
rename: "rename";
|
|
432
|
+
delete: "delete";
|
|
447
433
|
undelete: "undelete";
|
|
434
|
+
branch: "branch";
|
|
448
435
|
merge: "merge";
|
|
449
436
|
lock: "lock";
|
|
450
437
|
rollback: "rollback";
|
|
451
438
|
sourceRename: "sourceRename";
|
|
452
439
|
targetRename: "targetRename";
|
|
453
440
|
property: "property";
|
|
441
|
+
all: "all";
|
|
454
442
|
}>;
|
|
455
443
|
item: z.ZodOptional<z.ZodObject<{
|
|
456
444
|
path: z.ZodString;
|
|
@@ -482,21 +470,21 @@ declare const AzdoRepositoryItemSchema: z.ZodObject<{
|
|
|
482
470
|
}, z.core.$strip>>;
|
|
483
471
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
484
472
|
changeType: z.ZodEnum<{
|
|
485
|
-
all: "all";
|
|
486
|
-
branch: "branch";
|
|
487
|
-
delete: "delete";
|
|
488
473
|
none: "none";
|
|
489
474
|
add: "add";
|
|
490
475
|
edit: "edit";
|
|
491
476
|
encoding: "encoding";
|
|
492
477
|
rename: "rename";
|
|
478
|
+
delete: "delete";
|
|
493
479
|
undelete: "undelete";
|
|
480
|
+
branch: "branch";
|
|
494
481
|
merge: "merge";
|
|
495
482
|
lock: "lock";
|
|
496
483
|
rollback: "rollback";
|
|
497
484
|
sourceRename: "sourceRename";
|
|
498
485
|
targetRename: "targetRename";
|
|
499
486
|
property: "property";
|
|
487
|
+
all: "all";
|
|
500
488
|
}>;
|
|
501
489
|
item: z.ZodOptional<z.ZodObject<{
|
|
502
490
|
path: z.ZodString;
|
|
@@ -551,21 +539,21 @@ declare const AzdoPullRequestSchema: z.ZodObject<{
|
|
|
551
539
|
}, z.core.$strip>>;
|
|
552
540
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
553
541
|
changeType: z.ZodEnum<{
|
|
554
|
-
all: "all";
|
|
555
|
-
branch: "branch";
|
|
556
|
-
delete: "delete";
|
|
557
542
|
none: "none";
|
|
558
543
|
add: "add";
|
|
559
544
|
edit: "edit";
|
|
560
545
|
encoding: "encoding";
|
|
561
546
|
rename: "rename";
|
|
547
|
+
delete: "delete";
|
|
562
548
|
undelete: "undelete";
|
|
549
|
+
branch: "branch";
|
|
563
550
|
merge: "merge";
|
|
564
551
|
lock: "lock";
|
|
565
552
|
rollback: "rollback";
|
|
566
553
|
sourceRename: "sourceRename";
|
|
567
554
|
targetRename: "targetRename";
|
|
568
555
|
property: "property";
|
|
556
|
+
all: "all";
|
|
569
557
|
}>;
|
|
570
558
|
item: z.ZodOptional<z.ZodObject<{
|
|
571
559
|
path: z.ZodString;
|
|
@@ -594,21 +582,21 @@ declare const AzdoPullRequestSchema: z.ZodObject<{
|
|
|
594
582
|
}, z.core.$strip>>;
|
|
595
583
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
596
584
|
changeType: z.ZodEnum<{
|
|
597
|
-
all: "all";
|
|
598
|
-
branch: "branch";
|
|
599
|
-
delete: "delete";
|
|
600
585
|
none: "none";
|
|
601
586
|
add: "add";
|
|
602
587
|
edit: "edit";
|
|
603
588
|
encoding: "encoding";
|
|
604
589
|
rename: "rename";
|
|
590
|
+
delete: "delete";
|
|
605
591
|
undelete: "undelete";
|
|
592
|
+
branch: "branch";
|
|
606
593
|
merge: "merge";
|
|
607
594
|
lock: "lock";
|
|
608
595
|
rollback: "rollback";
|
|
609
596
|
sourceRename: "sourceRename";
|
|
610
597
|
targetRename: "targetRename";
|
|
611
598
|
property: "property";
|
|
599
|
+
all: "all";
|
|
612
600
|
}>;
|
|
613
601
|
item: z.ZodOptional<z.ZodObject<{
|
|
614
602
|
path: z.ZodString;
|
|
@@ -959,10 +947,11 @@ declare function buildPullRequestProperties(packageManager: string, dependencies
|
|
|
959
947
|
name: string;
|
|
960
948
|
value: string;
|
|
961
949
|
}[];
|
|
962
|
-
declare function
|
|
963
|
-
declare function
|
|
950
|
+
declare function parsePullRequestProps(pr: AzdoPrExtractedWithProperties): DependabotExistingPr | DependabotExistingGroupPr;
|
|
951
|
+
declare function parsePullRequestProperties(pullRequests: AzdoPrExtractedWithProperties[], packageManager: string): (DependabotExistingPr | DependabotExistingGroupPr)[];
|
|
952
|
+
declare function getPullRequestForDependencyNames(existingPullRequests: AzdoPrExtractedWithProperties[], packageManager: string, dependencyNames: string[], dependencyGroupName?: string | null): AzdoPrExtractedWithProperties | undefined;
|
|
964
953
|
declare function getPullRequestChangedFiles(data: DependabotCreatePullRequest | DependabotUpdatePullRequest): {
|
|
965
|
-
changeType: "
|
|
954
|
+
changeType: "add" | "edit" | "delete";
|
|
966
955
|
path: string;
|
|
967
956
|
content: string | undefined;
|
|
968
957
|
encoding: "utf-8" | "base64";
|
|
@@ -1242,21 +1231,21 @@ declare const AzdoEventCodePushResourceSchema: z.ZodObject<{
|
|
|
1242
1231
|
}, z.core.$strip>>;
|
|
1243
1232
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1244
1233
|
changeType: z.ZodEnum<{
|
|
1245
|
-
all: "all";
|
|
1246
|
-
branch: "branch";
|
|
1247
|
-
delete: "delete";
|
|
1248
1234
|
none: "none";
|
|
1249
1235
|
add: "add";
|
|
1250
1236
|
edit: "edit";
|
|
1251
1237
|
encoding: "encoding";
|
|
1252
1238
|
rename: "rename";
|
|
1239
|
+
delete: "delete";
|
|
1253
1240
|
undelete: "undelete";
|
|
1241
|
+
branch: "branch";
|
|
1254
1242
|
merge: "merge";
|
|
1255
1243
|
lock: "lock";
|
|
1256
1244
|
rollback: "rollback";
|
|
1257
1245
|
sourceRename: "sourceRename";
|
|
1258
1246
|
targetRename: "targetRename";
|
|
1259
1247
|
property: "property";
|
|
1248
|
+
all: "all";
|
|
1260
1249
|
}>;
|
|
1261
1250
|
item: z.ZodOptional<z.ZodObject<{
|
|
1262
1251
|
path: z.ZodString;
|
|
@@ -1477,21 +1466,21 @@ declare const AzdoEventSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1477
1466
|
}, z.core.$strip>>;
|
|
1478
1467
|
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1479
1468
|
changeType: z.ZodEnum<{
|
|
1480
|
-
all: "all";
|
|
1481
|
-
branch: "branch";
|
|
1482
|
-
delete: "delete";
|
|
1483
1469
|
none: "none";
|
|
1484
1470
|
add: "add";
|
|
1485
1471
|
edit: "edit";
|
|
1486
1472
|
encoding: "encoding";
|
|
1487
1473
|
rename: "rename";
|
|
1474
|
+
delete: "delete";
|
|
1488
1475
|
undelete: "undelete";
|
|
1476
|
+
branch: "branch";
|
|
1489
1477
|
merge: "merge";
|
|
1490
1478
|
lock: "lock";
|
|
1491
1479
|
rollback: "rollback";
|
|
1492
1480
|
sourceRename: "sourceRename";
|
|
1493
1481
|
targetRename: "targetRename";
|
|
1494
1482
|
property: "property";
|
|
1483
|
+
all: "all";
|
|
1495
1484
|
}>;
|
|
1496
1485
|
item: z.ZodOptional<z.ZodObject<{
|
|
1497
1486
|
path: z.ZodString;
|
|
@@ -1723,5 +1712,5 @@ declare const AzdoEventSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1723
1712
|
}, z.core.$strip>], "eventType">>;
|
|
1724
1713
|
type AzdoEvent = z.infer<typeof AzdoEventSchema>;
|
|
1725
1714
|
//#endregion
|
|
1726
|
-
export { ANONYMOUS_USER_ID, API_VERSION, API_VERSION_PREVIEW, AZDO_PULL_REQUEST_MERGE_STRATEGIES, AzdoCommentThreadStatus, AzdoCommentThreadStatusSchema, AzdoCommentType, AzdoCommentTypeSchema, AzdoConnectionData, AzdoConnectionDataSchema, AzdoEvent, AzdoEventCodePushResource, AzdoEventCodePushResourceSchema, AzdoEventPullRequestCommentEventResource, AzdoEventPullRequestCommentEventResourceSchema, AzdoEventPullRequestResource, AzdoEventPullRequestResourceSchema, AzdoEventRepositoryCreatedResource, AzdoEventRepositoryCreatedResourceSchema, AzdoEventRepositoryDeletedResource, AzdoEventRepositoryDeletedResourceSchema, AzdoEventRepositoryRenamedResource, AzdoEventRepositoryRenamedResourceSchema, AzdoEventRepositorySchema, AzdoEventRepositoryStatusChangedResource, AzdoEventRepositoryStatusChangedResourceSchema, AzdoEventSchema, AzdoEventType, AzdoEventTypeSchema, AzdoFileChange, AzdoGitBranchStats, AzdoGitBranchStatsSchema, AzdoGitChange, AzdoGitChangeSchema, AzdoGitCommitDiffs, AzdoGitCommitDiffsSchema, AzdoGitCommitRef, AzdoGitCommitRefSchema, AzdoGitPush, AzdoGitPushCreate, AzdoGitPushCreateSchema, AzdoGitPushSchema, AzdoGitRef, AzdoGitRefSchema, AzdoGitRefUpdate, AzdoGitRefUpdateResult, AzdoGitRefUpdateResultSchema, AzdoGitRefUpdateSchema, AzdoGitUserDate, AzdoGitUserDateSchema, AzdoIdentity, AzdoIdentityRef, AzdoIdentityRefSchema, AzdoIdentityRefWithVote, AzdoIdentityRefWithVoteSchema, AzdoIdentitySchema, AzdoPrExtractedWithProperties, AzdoProject, AzdoProjectSchema, AzdoProperties, AzdoPropertiesSchema, AzdoPullRequest, AzdoPullRequestAsyncStatus, AzdoPullRequestAsyncStatusSchema, AzdoPullRequestComment, AzdoPullRequestCommentSchema, AzdoPullRequestCommentThread, AzdoPullRequestCommentThreadSchema, AzdoPullRequestMergeStrategy, AzdoPullRequestMergeStrategySchema, AzdoPullRequestSchema, AzdoPullRequestStatus, AzdoPullRequestStatusSchema, AzdoRepository, AzdoRepositoryItem, AzdoRepositoryItemSchema, AzdoRepositorySchema, AzdoResponse, AzdoSubscription, AzdoSubscriptionSchema, AzdoSubscriptionsQuery, AzdoSubscriptionsQueryInputFilter, AzdoSubscriptionsQueryInputFilterSchema, AzdoSubscriptionsQueryResponse, AzdoSubscriptionsQueryResponseSchema, AzdoSubscriptionsQuerySchema, AzdoVersionControlChangeType, AzdoVersionControlChangeTypeSchema, AzureDevOpsClient, AzureDevOpsClientWrapper, type AzureDevOpsOrganizationUrl, type
|
|
1715
|
+
export { ANONYMOUS_USER_ID, API_VERSION, API_VERSION_PREVIEW, AZDO_PULL_REQUEST_MERGE_STRATEGIES, AzdoCommentThreadStatus, AzdoCommentThreadStatusSchema, AzdoCommentType, AzdoCommentTypeSchema, AzdoConnectionData, AzdoConnectionDataSchema, AzdoEvent, AzdoEventCodePushResource, AzdoEventCodePushResourceSchema, AzdoEventPullRequestCommentEventResource, AzdoEventPullRequestCommentEventResourceSchema, AzdoEventPullRequestResource, AzdoEventPullRequestResourceSchema, AzdoEventRepositoryCreatedResource, AzdoEventRepositoryCreatedResourceSchema, AzdoEventRepositoryDeletedResource, AzdoEventRepositoryDeletedResourceSchema, AzdoEventRepositoryRenamedResource, AzdoEventRepositoryRenamedResourceSchema, AzdoEventRepositorySchema, AzdoEventRepositoryStatusChangedResource, AzdoEventRepositoryStatusChangedResourceSchema, AzdoEventSchema, AzdoEventType, AzdoEventTypeSchema, AzdoFileChange, AzdoGitBranchStats, AzdoGitBranchStatsSchema, AzdoGitChange, AzdoGitChangeSchema, AzdoGitCommitDiffs, AzdoGitCommitDiffsSchema, AzdoGitCommitRef, AzdoGitCommitRefSchema, AzdoGitPush, AzdoGitPushCreate, AzdoGitPushCreateSchema, AzdoGitPushSchema, AzdoGitRef, AzdoGitRefSchema, AzdoGitRefUpdate, AzdoGitRefUpdateResult, AzdoGitRefUpdateResultSchema, AzdoGitRefUpdateSchema, AzdoGitUserDate, AzdoGitUserDateSchema, AzdoIdentity, AzdoIdentityRef, AzdoIdentityRefSchema, AzdoIdentityRefWithVote, AzdoIdentityRefWithVoteSchema, AzdoIdentitySchema, AzdoPrExtractedWithProperties, AzdoProject, AzdoProjectSchema, AzdoProperties, AzdoPropertiesSchema, AzdoPullRequest, AzdoPullRequestAsyncStatus, AzdoPullRequestAsyncStatusSchema, AzdoPullRequestComment, AzdoPullRequestCommentSchema, AzdoPullRequestCommentThread, AzdoPullRequestCommentThreadSchema, AzdoPullRequestMergeStrategy, AzdoPullRequestMergeStrategySchema, AzdoPullRequestSchema, AzdoPullRequestStatus, AzdoPullRequestStatusSchema, AzdoRepository, AzdoRepositoryItem, AzdoRepositoryItemSchema, AzdoRepositorySchema, AzdoResponse, AzdoSubscription, AzdoSubscriptionSchema, AzdoSubscriptionsQuery, AzdoSubscriptionsQueryInputFilter, AzdoSubscriptionsQueryInputFilterSchema, AzdoSubscriptionsQueryResponse, AzdoSubscriptionsQueryResponseSchema, AzdoSubscriptionsQuerySchema, AzdoVersionControlChangeType, AzdoVersionControlChangeTypeSchema, AzureDevOpsClient, AzureDevOpsClientWrapper, type AzureDevOpsOrganizationUrl, type AzureDevOpsRepositoryUrl, PR_DESCRIPTION_MAX_LENGTH, PR_PROPERTY_DEPENDABOT_DEPENDENCIES, PR_PROPERTY_DEPENDABOT_PACKAGE_MANAGER, PR_PROPERTY_MICROSOFT_GIT_SOURCE_REF_NAME, buildPullRequestProperties, extractOrganizationUrl, extractRepositoryUrl, getDependabotConfig, getPullRequestChangedFiles, getPullRequestForDependencyNames, parsePullRequestProperties, parsePullRequestProps };
|
|
1727
1716
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/azure/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as getDependencyNames, o as normalizeBranchName, s as normalizeFilePath, t as areEqual } from "../
|
|
1
|
+
import { logger } from "../logger.mjs";
|
|
2
|
+
import { D as CONFIG_FILE_PATHS_AZURE, V as parseDependabotConfig, u as DependabotExistingPrDependencySchema, v as DependabotPersistedPrSchema } from "../job-Bb9WiMwE.mjs";
|
|
3
|
+
import { n as getDependencyNames, o as normalizeBranchName, s as normalizeFilePath, t as areEqual } from "../utils-BVmUgc0p.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import ky, { isHTTPError } from "ky";
|
|
6
6
|
import * as path from "node:path";
|
|
@@ -27,12 +27,12 @@ var BaseAzureDevOpsClient = class {
|
|
|
27
27
|
constructor(client) {
|
|
28
28
|
this.client = client;
|
|
29
29
|
}
|
|
30
|
-
makeUrl(path
|
|
30
|
+
makeUrl(path, params, apiVersion = API_VERSION) {
|
|
31
31
|
if (typeof params === "string") {
|
|
32
32
|
apiVersion = params;
|
|
33
33
|
params = {};
|
|
34
34
|
}
|
|
35
|
-
return `${path
|
|
35
|
+
return `${path}?${Object.entries({
|
|
36
36
|
"api-version": apiVersion,
|
|
37
37
|
...params
|
|
38
38
|
}).filter(([, value]) => value).map(([key, value]) => `${key}=${value}`).join("&")}`;
|
|
@@ -53,10 +53,10 @@ var ConnectionClient = class extends BaseAzureDevOpsClient {
|
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/azure/client/client-git.ts
|
|
55
55
|
var GitClient = class extends BaseAzureDevOpsClient {
|
|
56
|
-
async getItem(projectIdOrName, repositoryIdOrName, path
|
|
56
|
+
async getItem(projectIdOrName, repositoryIdOrName, path, includeContent = true, latestProcessedChange = true) {
|
|
57
57
|
try {
|
|
58
58
|
return await this.client.get(this.makeUrl(`${encodeURIComponent(projectIdOrName)}/_apis/git/repositories/${encodeURIComponent(repositoryIdOrName)}/items`, {
|
|
59
|
-
path
|
|
59
|
+
path,
|
|
60
60
|
includeContent,
|
|
61
61
|
latestProcessedChange
|
|
62
62
|
})).json();
|
|
@@ -280,16 +280,16 @@ var AzureDevOpsClient = class AzureDevOpsClient {
|
|
|
280
280
|
Accept: "application/json"
|
|
281
281
|
},
|
|
282
282
|
hooks: {
|
|
283
|
-
beforeRequest: [async (request, options
|
|
283
|
+
beforeRequest: [async (request, options) => {
|
|
284
284
|
if (debug) logger.debug(`🌎 🠊 [${request.method}] ${request.url}`);
|
|
285
285
|
}],
|
|
286
|
-
afterResponse: [async (request, options
|
|
286
|
+
afterResponse: [async (request, options, response) => {
|
|
287
287
|
if (debug) {
|
|
288
288
|
logger.debug(`🌎 🠈 [${response.status}] ${response.statusText}`);
|
|
289
289
|
if (request.body) logger.debug(`REQUEST: ${JSON.stringify(request.body)}`);
|
|
290
290
|
}
|
|
291
291
|
}],
|
|
292
|
-
beforeRetry: [async ({ request, options
|
|
292
|
+
beforeRetry: [async ({ request, options, error, retryCount }) => {
|
|
293
293
|
if (debug && isHTTPError(error)) logger.debug(`⏳ Retrying failed request with status code: ${error.response.status}`);
|
|
294
294
|
}]
|
|
295
295
|
},
|
|
@@ -563,16 +563,29 @@ function buildPullRequestProperties(packageManager, dependencies) {
|
|
|
563
563
|
value: JSON.stringify(dependencies)
|
|
564
564
|
}];
|
|
565
565
|
}
|
|
566
|
+
function parsePullRequestProps(pr) {
|
|
567
|
+
const parsed = z.union([DependabotPersistedPrSchema, DependabotExistingPrDependencySchema.array()]).parse(JSON.parse(pr.properties.find((p) => p.name === PR_PROPERTY_DEPENDABOT_DEPENDENCIES).value));
|
|
568
|
+
if (Array.isArray(parsed)) return {
|
|
569
|
+
"pr-number": pr.pullRequestId,
|
|
570
|
+
dependencies: parsed
|
|
571
|
+
};
|
|
572
|
+
else return {
|
|
573
|
+
"pr-number": pr.pullRequestId,
|
|
574
|
+
...parsed
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
function filterPullRequestsByPackageManager(pr, packageManager) {
|
|
578
|
+
return pr.properties?.find((p) => p.name === PR_PROPERTY_DEPENDABOT_PACKAGE_MANAGER && p.value === packageManager);
|
|
579
|
+
}
|
|
566
580
|
function parsePullRequestProperties(pullRequests, packageManager) {
|
|
567
|
-
return
|
|
568
|
-
return pr.properties?.find((p) => p.name === PR_PROPERTY_DEPENDABOT_PACKAGE_MANAGER && (packageManager === null || p.value === packageManager));
|
|
569
|
-
}).map((pr) => {
|
|
570
|
-
return [pr.pullRequestId, DependabotPersistedPrSchema.parse(JSON.parse(pr.properties.find((p) => p.name === PR_PROPERTY_DEPENDABOT_DEPENDENCIES).value))];
|
|
571
|
-
}));
|
|
581
|
+
return pullRequests.filter((pr) => filterPullRequestsByPackageManager(pr, packageManager)).map(parsePullRequestProps);
|
|
572
582
|
}
|
|
573
|
-
function getPullRequestForDependencyNames(existingPullRequests, packageManager, dependencyNames) {
|
|
574
|
-
return existingPullRequests.find((pr) => {
|
|
575
|
-
|
|
583
|
+
function getPullRequestForDependencyNames(existingPullRequests, packageManager, dependencyNames, dependencyGroupName) {
|
|
584
|
+
return existingPullRequests.filter((pr) => filterPullRequestsByPackageManager(pr, packageManager)).find((pr) => {
|
|
585
|
+
const parsedPr = parsePullRequestProps(pr);
|
|
586
|
+
const prGroupName = "dependency-group-name" in parsedPr ? parsedPr["dependency-group-name"] : null;
|
|
587
|
+
if (dependencyGroupName) return prGroupName === dependencyGroupName;
|
|
588
|
+
return !prGroupName && areEqual(getDependencyNames(parsedPr), dependencyNames);
|
|
576
589
|
});
|
|
577
590
|
}
|
|
578
591
|
function getPullRequestChangedFiles(data) {
|
|
@@ -1220,13 +1233,28 @@ const AzdoEventSchema = z.object({
|
|
|
1220
1233
|
|
|
1221
1234
|
//#endregion
|
|
1222
1235
|
//#region src/azure/url-parts.ts
|
|
1236
|
+
/**
|
|
1237
|
+
* Extract organization details from any Azure DevOps URL.
|
|
1238
|
+
* Accepts organization, project, or repository URLs.
|
|
1239
|
+
*/
|
|
1223
1240
|
function extractOrganizationUrl({ organizationUrl }) {
|
|
1224
1241
|
const value = new URL(organizationUrl);
|
|
1225
1242
|
const protocol = value.protocol.slice(0, -1);
|
|
1243
|
+
if (protocol !== "https" && protocol !== "http") throw new Error(`Invalid URL protocol: '${protocol}'. Only 'http' and 'https' are supported.`);
|
|
1226
1244
|
let { hostname } = value;
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
const
|
|
1245
|
+
const visualStudioMatch = hostname.match(/^(\S+)\.visualstudio\.com$/i);
|
|
1246
|
+
if (visualStudioMatch) hostname = "dev.azure.com";
|
|
1247
|
+
const allSegments = value.pathname.split("/").filter(Boolean);
|
|
1248
|
+
const gitIndex = allSegments.indexOf("_git");
|
|
1249
|
+
const segments = gitIndex >= 0 ? allSegments.slice(0, gitIndex) : allSegments;
|
|
1250
|
+
let organization;
|
|
1251
|
+
let virtualDirectory;
|
|
1252
|
+
if (visualStudioMatch) organization = visualStudioMatch[1];
|
|
1253
|
+
else if (segments.length >= 2 && hostname !== "dev.azure.com") {
|
|
1254
|
+
virtualDirectory = segments[0];
|
|
1255
|
+
organization = segments[1];
|
|
1256
|
+
} else if (segments.length >= 1) organization = segments[0];
|
|
1257
|
+
else throw new Error(`Error parsing organization from url: '${organizationUrl}'.`);
|
|
1230
1258
|
const apiEndpoint = `${protocol}://${hostname}${value.port ? `:${value.port}` : ""}/${virtualDirectory ? `${virtualDirectory}/` : ""}`;
|
|
1231
1259
|
const identityApiUrl = hostname === "dev.azure.com" || hostname.endsWith(".visualstudio.com") ? new URL(`https://vssps.dev.azure.com/${organization}/`) : value;
|
|
1232
1260
|
return {
|
|
@@ -1238,58 +1266,36 @@ function extractOrganizationUrl({ organizationUrl }) {
|
|
|
1238
1266
|
"identity-api-url": identityApiUrl
|
|
1239
1267
|
};
|
|
1240
1268
|
}
|
|
1241
|
-
function
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1269
|
+
function extractRepositoryUrl(options) {
|
|
1270
|
+
let project;
|
|
1271
|
+
let repository;
|
|
1272
|
+
let extracted;
|
|
1273
|
+
if ("repositoryUrl" in options) {
|
|
1274
|
+
const url = new URL(options.repositoryUrl);
|
|
1275
|
+
if (!url.pathname.includes("/_git/")) throw new Error(`Invalid repository URL: '${options.repositoryUrl}'. URL must contain '/_git/'.`);
|
|
1276
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
1277
|
+
const gitIndex = segments.indexOf("_git");
|
|
1278
|
+
if (gitIndex === -1 || gitIndex >= segments.length - 1) throw new Error(`Invalid repository URL: '${options.repositoryUrl}'. Repository name must follow '/_git/'.`);
|
|
1279
|
+
project = decodeURIComponent(segments[gitIndex - 1]);
|
|
1280
|
+
repository = decodeURIComponent(segments.slice(gitIndex + 1).join("/"));
|
|
1281
|
+
const orgSegments = segments.slice(0, gitIndex - 1);
|
|
1282
|
+
const orgPath = orgSegments.length > 0 ? `/${orgSegments.join("/")}/` : "/";
|
|
1283
|
+
extracted = extractOrganizationUrl({ organizationUrl: `${url.protocol}//${url.host}${orgPath}` });
|
|
1284
|
+
} else {
|
|
1285
|
+
project = decodeURIComponent(options.project);
|
|
1286
|
+
repository = decodeURIComponent(options.repository);
|
|
1287
|
+
extracted = extractOrganizationUrl({ organizationUrl: options.organizationUrl });
|
|
1288
|
+
}
|
|
1289
|
+
const virtualDirectory = extracted["virtual-directory"];
|
|
1290
|
+
const repoSlug = `${virtualDirectory ? `${virtualDirectory}/` : ""}${extracted.organization}/${encodeURI(project)}/_git/${encodeURI(repository)}`;
|
|
1257
1291
|
return {
|
|
1258
1292
|
...extracted,
|
|
1259
|
-
|
|
1293
|
+
project,
|
|
1294
|
+
repository,
|
|
1260
1295
|
"repository-slug": repoSlug
|
|
1261
1296
|
};
|
|
1262
1297
|
}
|
|
1263
|
-
/**
|
|
1264
|
-
* Extract organization name from organization URL
|
|
1265
|
-
*
|
|
1266
|
-
* @param organizationUrl
|
|
1267
|
-
*
|
|
1268
|
-
* @returns organization name
|
|
1269
|
-
*/
|
|
1270
|
-
function extractOrganization(organizationUrl) {
|
|
1271
|
-
const { hostname, pathname } = new URL(organizationUrl);
|
|
1272
|
-
if (hostname.endsWith(".visualstudio.com")) return hostname.split(".")[0];
|
|
1273
|
-
const pathSegments = pathname.split("/").filter((segment) => segment !== "");
|
|
1274
|
-
if (pathSegments.length >= 2 && hostname !== "dev.azure.com") return pathSegments[1];
|
|
1275
|
-
if (pathSegments.length >= 1) return pathSegments[0];
|
|
1276
|
-
throw new Error(`Error parsing organization from organization url: '${organizationUrl}'.`);
|
|
1277
|
-
}
|
|
1278
|
-
/**
|
|
1279
|
-
* Extract virtual directory from organization URL
|
|
1280
|
-
*
|
|
1281
|
-
* Virtual Directories are sometimes used in on-premises
|
|
1282
|
-
* @param organizationUrl
|
|
1283
|
-
*
|
|
1284
|
-
* @returns virtual directory
|
|
1285
|
-
*
|
|
1286
|
-
* @example URLs typically are like this:`https://server.domain.com/tfs/x/` and `tfs` is the virtual directory
|
|
1287
|
-
*/
|
|
1288
|
-
function extractVirtualDirectory(organizationUrl) {
|
|
1289
|
-
const path$1 = organizationUrl.pathname.split("/");
|
|
1290
|
-
return path$1.length === 4 ? path$1[1] : void 0;
|
|
1291
|
-
}
|
|
1292
1298
|
|
|
1293
1299
|
//#endregion
|
|
1294
|
-
export { ANONYMOUS_USER_ID, API_VERSION, API_VERSION_PREVIEW, AZDO_PULL_REQUEST_MERGE_STRATEGIES, AzdoCommentThreadStatusSchema, AzdoCommentTypeSchema, AzdoConnectionDataSchema, AzdoEventCodePushResourceSchema, AzdoEventPullRequestCommentEventResourceSchema, AzdoEventPullRequestResourceSchema, AzdoEventRepositoryCreatedResourceSchema, AzdoEventRepositoryDeletedResourceSchema, AzdoEventRepositoryRenamedResourceSchema, AzdoEventRepositorySchema, AzdoEventRepositoryStatusChangedResourceSchema, AzdoEventSchema, AzdoEventTypeSchema, AzdoGitBranchStatsSchema, AzdoGitChangeSchema, AzdoGitCommitDiffsSchema, AzdoGitCommitRefSchema, AzdoGitPushCreateSchema, AzdoGitPushSchema, AzdoGitRefSchema, AzdoGitRefUpdateResultSchema, AzdoGitRefUpdateSchema, AzdoGitUserDateSchema, AzdoIdentityRefSchema, AzdoIdentityRefWithVoteSchema, AzdoIdentitySchema, AzdoProjectSchema, AzdoPropertiesSchema, AzdoPullRequestAsyncStatusSchema, AzdoPullRequestCommentSchema, AzdoPullRequestCommentThreadSchema, AzdoPullRequestMergeStrategySchema, AzdoPullRequestSchema, AzdoPullRequestStatusSchema, AzdoRepositoryItemSchema, AzdoRepositorySchema, AzdoSubscriptionSchema, AzdoSubscriptionsQueryInputFilterSchema, AzdoSubscriptionsQueryResponseSchema, AzdoSubscriptionsQuerySchema, AzdoVersionControlChangeTypeSchema, AzureDevOpsClient, AzureDevOpsClientWrapper, PR_DESCRIPTION_MAX_LENGTH, PR_PROPERTY_DEPENDABOT_DEPENDENCIES, PR_PROPERTY_DEPENDABOT_PACKAGE_MANAGER, PR_PROPERTY_MICROSOFT_GIT_SOURCE_REF_NAME, buildPullRequestProperties, extractOrganizationUrl,
|
|
1300
|
+
export { ANONYMOUS_USER_ID, API_VERSION, API_VERSION_PREVIEW, AZDO_PULL_REQUEST_MERGE_STRATEGIES, AzdoCommentThreadStatusSchema, AzdoCommentTypeSchema, AzdoConnectionDataSchema, AzdoEventCodePushResourceSchema, AzdoEventPullRequestCommentEventResourceSchema, AzdoEventPullRequestResourceSchema, AzdoEventRepositoryCreatedResourceSchema, AzdoEventRepositoryDeletedResourceSchema, AzdoEventRepositoryRenamedResourceSchema, AzdoEventRepositorySchema, AzdoEventRepositoryStatusChangedResourceSchema, AzdoEventSchema, AzdoEventTypeSchema, AzdoGitBranchStatsSchema, AzdoGitChangeSchema, AzdoGitCommitDiffsSchema, AzdoGitCommitRefSchema, AzdoGitPushCreateSchema, AzdoGitPushSchema, AzdoGitRefSchema, AzdoGitRefUpdateResultSchema, AzdoGitRefUpdateSchema, AzdoGitUserDateSchema, AzdoIdentityRefSchema, AzdoIdentityRefWithVoteSchema, AzdoIdentitySchema, AzdoProjectSchema, AzdoPropertiesSchema, AzdoPullRequestAsyncStatusSchema, AzdoPullRequestCommentSchema, AzdoPullRequestCommentThreadSchema, AzdoPullRequestMergeStrategySchema, AzdoPullRequestSchema, AzdoPullRequestStatusSchema, AzdoRepositoryItemSchema, AzdoRepositorySchema, AzdoSubscriptionSchema, AzdoSubscriptionsQueryInputFilterSchema, AzdoSubscriptionsQueryResponseSchema, AzdoSubscriptionsQuerySchema, AzdoVersionControlChangeTypeSchema, AzureDevOpsClient, AzureDevOpsClientWrapper, PR_DESCRIPTION_MAX_LENGTH, PR_PROPERTY_DEPENDABOT_DEPENDENCIES, PR_PROPERTY_DEPENDABOT_PACKAGE_MANAGER, PR_PROPERTY_MICROSOFT_GIT_SOURCE_REF_NAME, buildPullRequestProperties, extractOrganizationUrl, extractRepositoryUrl, getDependabotConfig, getPullRequestChangedFiles, getPullRequestForDependencyNames, parsePullRequestProperties, parsePullRequestProps };
|
|
1295
1301
|
//# sourceMappingURL=index.mjs.map
|