@paklo/core 0.12.0 → 0.13.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.
@@ -1,4 +1,4 @@
1
- import { p as SecurityVulnerability } from "./index-BfwWezjJ.mjs";
1
+ import { p as SecurityVulnerability } from "./index-BKTxy7XU.mjs";
2
2
  import { z } from "zod";
3
3
  import { Hono } from "hono";
4
4
 
@@ -1214,14 +1214,25 @@ declare const DependabotSourceSchema: z.ZodObject<{
1214
1214
  'api-endpoint': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1215
1215
  }, z.core.$strip>;
1216
1216
  type DependabotSource = z.infer<typeof DependabotSourceSchema>;
1217
- declare const DependabotExistingPRSchema: z.ZodObject<{
1217
+ declare const DependabotExistingPrDependencySchema: z.ZodObject<{
1218
1218
  'dependency-name': z.ZodString;
1219
1219
  'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1220
1220
  directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1221
1221
  removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1222
1222
  }, z.core.$strip>;
1223
- type DependabotExistingPR = z.infer<typeof DependabotExistingPRSchema>;
1224
- declare const DependabotExistingGroupPRSchema: z.ZodObject<{
1223
+ type DependabotExistingPrDependency = z.infer<typeof DependabotExistingPrDependencySchema>;
1224
+ declare const DependabotExistingPrSchema: z.ZodObject<{
1225
+ 'pr-number': z.ZodNumber;
1226
+ dependencies: z.ZodArray<z.ZodObject<{
1227
+ 'dependency-name': z.ZodString;
1228
+ 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1229
+ directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1230
+ removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1231
+ }, z.core.$strip>>;
1232
+ }, z.core.$strip>;
1233
+ type DependabotExistingPr = z.infer<typeof DependabotExistingPrSchema>;
1234
+ declare const DependabotExistingGroupPrSchema: z.ZodObject<{
1235
+ 'pr-number': z.ZodNumber;
1225
1236
  'dependency-group-name': z.ZodString;
1226
1237
  dependencies: z.ZodArray<z.ZodObject<{
1227
1238
  'dependency-name': z.ZodString;
@@ -1230,7 +1241,7 @@ declare const DependabotExistingGroupPRSchema: z.ZodObject<{
1230
1241
  removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1231
1242
  }, z.core.$strip>>;
1232
1243
  }, z.core.$strip>;
1233
- type DependabotExistingGroupPR = z.infer<typeof DependabotExistingGroupPRSchema>;
1244
+ type DependabotExistingGroupPr = z.infer<typeof DependabotExistingGroupPrSchema>;
1234
1245
  declare const DependabotAllowedSchema: z.ZodObject<{
1235
1246
  'dependency-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1236
1247
  'dependency-type': z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1320,6 +1331,7 @@ type DependabotCommitOptions = z.infer<typeof DependabotCommitOptionsSchema>;
1320
1331
  declare const DependabotExperimentsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
1321
1332
  type DependabotExperiments = z.infer<typeof DependabotExperimentsSchema>;
1322
1333
  declare const DependabotPackageManagerSchema: z.ZodEnum<{
1334
+ hex: "hex";
1323
1335
  bundler: "bundler";
1324
1336
  cargo: "cargo";
1325
1337
  composer: "composer";
@@ -1332,7 +1344,6 @@ declare const DependabotPackageManagerSchema: z.ZodEnum<{
1332
1344
  go_modules: "go_modules";
1333
1345
  gradle: "gradle";
1334
1346
  maven: "maven";
1335
- hex: "hex";
1336
1347
  nuget: "nuget";
1337
1348
  npm_and_yarn: "npm_and_yarn";
1338
1349
  pip: "pip";
@@ -1351,21 +1362,24 @@ declare const DependabotPackageManagerSchema: z.ZodEnum<{
1351
1362
  opentofu: "opentofu";
1352
1363
  }>;
1353
1364
  type DependabotPackageManager = z.infer<typeof DependabotPackageManagerSchema>;
1354
- declare const DEPENDABOT_COMMANDS: readonly ["graph", "version", "recreate"];
1365
+ declare const DEPENDABOT_COMMANDS: readonly ["update", "version", "recreate", "graph"];
1355
1366
  declare const DependabotCommandSchema: z.ZodEnum<{
1356
1367
  version: "version";
1357
- graph: "graph";
1368
+ update: "update";
1358
1369
  recreate: "recreate";
1370
+ graph: "graph";
1359
1371
  }>;
1360
1372
  type DependabotCommand = z.infer<typeof DependabotCommandSchema>;
1361
1373
  declare const DependabotJobConfigSchema: z.ZodObject<{
1362
1374
  id: z.ZodString;
1363
1375
  command: z.ZodOptional<z.ZodEnum<{
1364
1376
  version: "version";
1365
- graph: "graph";
1377
+ update: "update";
1366
1378
  recreate: "recreate";
1379
+ graph: "graph";
1367
1380
  }>>;
1368
1381
  'package-manager': z.ZodEnum<{
1382
+ hex: "hex";
1369
1383
  bundler: "bundler";
1370
1384
  cargo: "cargo";
1371
1385
  composer: "composer";
@@ -1378,7 +1392,6 @@ declare const DependabotJobConfigSchema: z.ZodObject<{
1378
1392
  go_modules: "go_modules";
1379
1393
  gradle: "gradle";
1380
1394
  maven: "maven";
1381
- hex: "hex";
1382
1395
  nuget: "nuget";
1383
1396
  npm_and_yarn: "npm_and_yarn";
1384
1397
  pip: "pip";
@@ -1417,13 +1430,17 @@ declare const DependabotJobConfigSchema: z.ZodObject<{
1417
1430
  }, z.core.$strip>>>>;
1418
1431
  dependencies: z.ZodNullable<z.ZodArray<z.ZodString>>;
1419
1432
  'dependency-group-to-refresh': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1420
- 'existing-pull-requests': z.ZodArray<z.ZodArray<z.ZodObject<{
1421
- 'dependency-name': z.ZodString;
1422
- 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1423
- directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1424
- removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1425
- }, z.core.$strip>>>;
1433
+ 'existing-pull-requests': z.ZodArray<z.ZodObject<{
1434
+ 'pr-number': z.ZodNumber;
1435
+ dependencies: z.ZodArray<z.ZodObject<{
1436
+ 'dependency-name': z.ZodString;
1437
+ 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1438
+ directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1439
+ removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1440
+ }, z.core.$strip>>;
1441
+ }, z.core.$strip>>;
1426
1442
  'existing-group-pull-requests': z.ZodArray<z.ZodObject<{
1443
+ 'pr-number': z.ZodNumber;
1427
1444
  'dependency-group-name': z.ZodString;
1428
1445
  dependencies: z.ZodArray<z.ZodObject<{
1429
1446
  'dependency-name': z.ZodString;
@@ -1494,10 +1511,12 @@ declare const DependabotJobFileSchema: z.ZodObject<{
1494
1511
  id: z.ZodString;
1495
1512
  command: z.ZodOptional<z.ZodEnum<{
1496
1513
  version: "version";
1497
- graph: "graph";
1514
+ update: "update";
1498
1515
  recreate: "recreate";
1516
+ graph: "graph";
1499
1517
  }>>;
1500
1518
  'package-manager': z.ZodEnum<{
1519
+ hex: "hex";
1501
1520
  bundler: "bundler";
1502
1521
  cargo: "cargo";
1503
1522
  composer: "composer";
@@ -1510,7 +1529,6 @@ declare const DependabotJobFileSchema: z.ZodObject<{
1510
1529
  go_modules: "go_modules";
1511
1530
  gradle: "gradle";
1512
1531
  maven: "maven";
1513
- hex: "hex";
1514
1532
  nuget: "nuget";
1515
1533
  npm_and_yarn: "npm_and_yarn";
1516
1534
  pip: "pip";
@@ -1549,13 +1567,17 @@ declare const DependabotJobFileSchema: z.ZodObject<{
1549
1567
  }, z.core.$strip>>>>;
1550
1568
  dependencies: z.ZodNullable<z.ZodArray<z.ZodString>>;
1551
1569
  'dependency-group-to-refresh': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1552
- 'existing-pull-requests': z.ZodArray<z.ZodArray<z.ZodObject<{
1553
- 'dependency-name': z.ZodString;
1554
- 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1555
- directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1556
- removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1557
- }, z.core.$strip>>>;
1570
+ 'existing-pull-requests': z.ZodArray<z.ZodObject<{
1571
+ 'pr-number': z.ZodNumber;
1572
+ dependencies: z.ZodArray<z.ZodObject<{
1573
+ 'dependency-name': z.ZodString;
1574
+ 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1575
+ directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1576
+ removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1577
+ }, z.core.$strip>>;
1578
+ }, z.core.$strip>>;
1558
1579
  'existing-group-pull-requests': z.ZodArray<z.ZodObject<{
1580
+ 'pr-number': z.ZodNumber;
1559
1581
  'dependency-group-name': z.ZodString;
1560
1582
  dependencies: z.ZodArray<z.ZodObject<{
1561
1583
  'dependency-name': z.ZodString;
@@ -1633,20 +1655,15 @@ type FileFetcherInput = {
1633
1655
  type FileUpdaterInput = FetchedFiles & {
1634
1656
  job: DependabotJobConfig;
1635
1657
  };
1636
- declare const DependabotPersistedPrSchema: z.ZodUnion<[z.ZodArray<z.ZodObject<{
1637
- 'dependency-name': z.ZodString;
1638
- 'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1639
- directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1640
- removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1641
- }, z.core.$strip>>, z.ZodObject<{
1642
- 'dependency-group-name': z.ZodString;
1658
+ declare const DependabotPersistedPrSchema: z.ZodObject<{
1643
1659
  dependencies: z.ZodArray<z.ZodObject<{
1644
1660
  'dependency-name': z.ZodString;
1645
1661
  'dependency-version': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1646
1662
  directory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1647
1663
  removed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1648
1664
  }, z.core.$strip>>;
1649
- }, z.core.$strip>]>;
1665
+ 'dependency-group-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
1666
+ }, z.core.$strip>;
1650
1667
  type DependabotPersistedPr = z.infer<typeof DependabotPersistedPrSchema>;
1651
1668
  //#endregion
1652
1669
  //#region src/dependabot/branch-name.d.ts
@@ -1661,8 +1678,8 @@ declare function getBranchNameForUpdate({
1661
1678
  packageEcosystem: PackageEcosystem;
1662
1679
  targetBranchName?: string;
1663
1680
  directory?: string;
1664
- dependencyGroupName?: string;
1665
- dependencies: DependabotExistingPR[];
1681
+ dependencyGroupName?: string | null;
1682
+ dependencies: DependabotExistingPrDependency[];
1666
1683
  separator?: string;
1667
1684
  }): string;
1668
1685
  declare function sanitizeRef(refParts: (string | undefined)[], separator: string): string;
@@ -1676,18 +1693,12 @@ declare function sanitizeRef(refParts: (string | undefined)[], separator: string
1676
1693
  * Either a single `directory` or multiple `directories` can be specified.
1677
1694
  */
1678
1695
  type MakeDirectoryKeyOptions = {
1679
- /** The package ecosystem (e.g., 'npm', 'pip', 'bundler') */
1680
- ecosystem: string;
1681
- /** Single directory path (optional if directories is provided) */
1682
- directory?: string | null;
1683
- /** Multiple directory paths (optional if directory is provided) */
1696
+ /** The package ecosystem (e.g., 'npm', 'pip', 'bundler') */ecosystem: string; /** Single directory path (optional if directories is provided) */
1697
+ directory?: string | null; /** Multiple directory paths (optional if directory is provided) */
1684
1698
  directories?: string[];
1685
1699
  } | {
1686
- /** The package ecosystem using alternative naming convention */
1687
- 'package-ecosystem': string;
1688
- /** Single directory path (optional if directories is provided) */
1689
- directory?: string | null;
1690
- /** Multiple directory paths (optional if directory is provided) */
1700
+ /** The package ecosystem using alternative naming convention */'package-ecosystem': string; /** Single directory path (optional if directories is provided) */
1701
+ directory?: string | null; /** Multiple directory paths (optional if directory is provided) */
1691
1702
  directories?: string[];
1692
1703
  };
1693
1704
  /**
@@ -1779,19 +1790,16 @@ declare class DependabotJobBuilder {
1779
1790
  experiments: DependabotExperiments;
1780
1791
  systemAccessUser?: string;
1781
1792
  systemAccessToken?: string;
1782
- githubToken?: string;
1783
- /** Determines if verbose log messages are logged */
1793
+ githubToken?: string; /** Determines if verbose log messages are logged */
1784
1794
  debug: boolean;
1785
1795
  });
1786
1796
  /**
1787
1797
  * Create a dependabot update job that updates nothing, but will discover the dependency list for a package ecosystem
1788
1798
  */
1789
1799
  forDependenciesList({
1790
- id,
1791
- command
1800
+ id
1792
1801
  }: {
1793
1802
  id: string;
1794
- command: DependabotJobConfig['command'];
1795
1803
  }): DependabotJobBuilderOutput;
1796
1804
  /**
1797
1805
  * Create a dependabot update job that updates all dependencies for a package ecosystem
@@ -1805,10 +1813,10 @@ declare class DependabotJobBuilder {
1805
1813
  securityVulnerabilities
1806
1814
  }: {
1807
1815
  id: string;
1808
- command: DependabotJobConfig['command'];
1816
+ command: DependabotCommand;
1809
1817
  dependencyNamesToUpdate?: string[];
1810
- existingPullRequests: DependabotPersistedPr[];
1811
- pullRequestToUpdate?: DependabotPersistedPr;
1818
+ existingPullRequests: (DependabotExistingPr | DependabotExistingGroupPr)[];
1819
+ pullRequestToUpdate?: DependabotExistingPr | DependabotExistingGroupPr;
1812
1820
  securityVulnerabilities?: SecurityVulnerability[];
1813
1821
  }): DependabotJobBuilderOutput;
1814
1822
  }
@@ -2040,6 +2048,7 @@ declare const DependabotRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2040
2048
  }, z.core.$strip>>>;
2041
2049
  metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2042
2050
  ecosystem: z.ZodEnum<{
2051
+ hex: "hex";
2043
2052
  bundler: "bundler";
2044
2053
  cargo: "cargo";
2045
2054
  composer: "composer";
@@ -2052,7 +2061,6 @@ declare const DependabotRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2052
2061
  go_modules: "go_modules";
2053
2062
  gradle: "gradle";
2054
2063
  maven: "maven";
2055
- hex: "hex";
2056
2064
  nuget: "nuget";
2057
2065
  npm_and_yarn: "npm_and_yarn";
2058
2066
  pip: "pip";
@@ -2108,6 +2116,7 @@ declare const DependabotRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2108
2116
  }, z.core.$strip>>;
2109
2117
  }, z.core.$strip>>>;
2110
2118
  }, z.core.$strip>;
2119
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2111
2120
  }, z.core.$strip>;
2112
2121
  }, z.core.$strip>, z.ZodObject<{
2113
2122
  type: z.ZodLiteral<"record_ecosystem_versions">;
@@ -2144,6 +2153,7 @@ declare const DependabotRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2144
2153
  data: z.ZodArray<z.ZodObject<{
2145
2154
  cooldown: z.ZodObject<{
2146
2155
  ecosystem_name: z.ZodEnum<{
2156
+ hex: "hex";
2147
2157
  bundler: "bundler";
2148
2158
  cargo: "cargo";
2149
2159
  composer: "composer";
@@ -2156,7 +2166,6 @@ declare const DependabotRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2156
2166
  go_modules: "go_modules";
2157
2167
  gradle: "gradle";
2158
2168
  maven: "maven";
2159
- hex: "hex";
2160
2169
  nuget: "nuget";
2161
2170
  npm_and_yarn: "npm_and_yarn";
2162
2171
  pip: "pip";
@@ -2245,19 +2254,15 @@ type CreateApiServerAppOptions = {
2245
2254
  * Base path for the endpoints.
2246
2255
  * @default `/api/update_jobs`
2247
2256
  */
2248
- basePath?: string;
2249
- /** Handler function for authenticating requests. */
2250
- authenticate: AuthenticatorFunc;
2251
- /** Function for getting a dependabot job by ID. */
2252
- getJob: GetJobFunc;
2253
- /** Function for getting dependabot credentials by job ID. */
2257
+ basePath?: string; /** Handler function for authenticating requests. */
2258
+ authenticate: AuthenticatorFunc; /** Function for getting a dependabot job by ID. */
2259
+ getJob: GetJobFunc; /** Function for getting dependabot credentials by job ID. */
2254
2260
  getCredentials: GetCredentialsFunc;
2255
2261
  /**
2256
2262
  * Optional function for inspecting raw dependabot requests.
2257
2263
  * Should only be used for troubleshooting.
2258
2264
  * */
2259
- inspect?: InspectRequestFunc;
2260
- /** Handler function for processing the operations. */
2265
+ inspect?: InspectRequestFunc; /** Handler function for processing the operations. */
2261
2266
  handle: HandlerFunc;
2262
2267
  };
2263
2268
  /**
@@ -2359,6 +2364,7 @@ declare const DependabotDependencySubmissionSchema: z.ZodObject<{
2359
2364
  }, z.core.$strip>>>;
2360
2365
  metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2361
2366
  ecosystem: z.ZodEnum<{
2367
+ hex: "hex";
2362
2368
  bundler: "bundler";
2363
2369
  cargo: "cargo";
2364
2370
  composer: "composer";
@@ -2371,7 +2377,6 @@ declare const DependabotDependencySubmissionSchema: z.ZodObject<{
2371
2377
  go_modules: "go_modules";
2372
2378
  gradle: "gradle";
2373
2379
  maven: "maven";
2374
- hex: "hex";
2375
2380
  nuget: "nuget";
2376
2381
  npm_and_yarn: "npm_and_yarn";
2377
2382
  pip: "pip";
@@ -2427,6 +2432,7 @@ declare const DependabotDependencySubmissionSchema: z.ZodObject<{
2427
2432
  }, z.core.$strip>>;
2428
2433
  }, z.core.$strip>>>;
2429
2434
  }, z.core.$strip>;
2435
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2430
2436
  }, z.core.$strip>;
2431
2437
  type DependabotDependencySubmission = z.infer<typeof DependabotDependencySubmissionSchema>;
2432
2438
  declare const DependabotCreatePullRequestSchema: z.ZodObject<{
@@ -2632,6 +2638,7 @@ type DependabotRecordEcosystemMeta = z.infer<typeof DependabotRecordEcosystemMet
2632
2638
  declare const DependabotRecordCooldownMetaSchema: z.ZodObject<{
2633
2639
  cooldown: z.ZodObject<{
2634
2640
  ecosystem_name: z.ZodEnum<{
2641
+ hex: "hex";
2635
2642
  bundler: "bundler";
2636
2643
  cargo: "cargo";
2637
2644
  composer: "composer";
@@ -2644,7 +2651,6 @@ declare const DependabotRecordCooldownMetaSchema: z.ZodObject<{
2644
2651
  go_modules: "go_modules";
2645
2652
  gradle: "gradle";
2646
2653
  maven: "maven";
2647
- hex: "hex";
2648
2654
  nuget: "nuget";
2649
2655
  npm_and_yarn: "npm_and_yarn";
2650
2656
  pip: "pip";
@@ -2694,10 +2700,10 @@ type DependabotMetric = z.infer<typeof DependabotMetricSchema>;
2694
2700
  declare function normalizeFilePath(path: string): string;
2695
2701
  declare function normalizeBranchName(branch: string): string;
2696
2702
  declare function normalizeBranchName(branch?: string): string | undefined;
2697
- declare function getDependencyNames(dependencies: DependabotPersistedPr): string[];
2703
+ declare function getDependencyNames(pr: DependabotPersistedPr): string[];
2698
2704
  declare function areEqual(a: string[], b: string[]): boolean;
2699
2705
  declare function getPullRequestCloseReason(data: DependabotClosePullRequest): string | undefined;
2700
- declare function getPullRequestDependencies(data: DependabotCreatePullRequest): DependabotPersistedPr;
2706
+ declare function getPersistedPr(data: DependabotCreatePullRequest): DependabotPersistedPr;
2701
2707
  declare function getPullRequestDescription({
2702
2708
  packageManager,
2703
2709
  body,
@@ -2709,6 +2715,74 @@ declare function getPullRequestDescription({
2709
2715
  dependencies: DependabotDependency[];
2710
2716
  maxDescriptionLength?: number;
2711
2717
  }): string;
2718
+ /**
2719
+ * Determines if a new pull request should supersede an existing pull request.
2720
+ *
2721
+ * Follows GitHub Dependabot's superseding logic:
2722
+ * - **Grouped PRs**: Supersede if same group name AND any dependency version changed
2723
+ * - **Single dependency PRs**: Supersede if updating the exact same dependency with a different version
2724
+ * - **Different scopes**: PRs with different dependency sets don't supersede each other
2725
+ *
2726
+ * A new PR supersedes an old PR when:
2727
+ * 1. Both are for the same group (same `dependency-group-name`), OR
2728
+ * Both update the exact same set of dependencies (same dependency names)
2729
+ * 2. AND at least one dependency has a different version
2730
+ *
2731
+ * This prevents incorrect superseding when PRs update overlapping but different dependency sets.
2732
+ *
2733
+ * @param oldPr - The existing pull request's dependency data
2734
+ * @param newPr - The new pull request's dependency data
2735
+ * @returns `true` if the new PR should supersede the old PR, `false` otherwise
2736
+ *
2737
+ * @example
2738
+ * ```ts
2739
+ * // Single dependency - same dependency, different version: SUPERSEDE
2740
+ * const oldPr = {
2741
+ * 'dependency-group-name': null,
2742
+ * dependencies: [{ 'dependency-name': 'lodash', 'dependency-version': '4.17.20' }]
2743
+ * };
2744
+ * const newPr = {
2745
+ * 'dependency-group-name': null,
2746
+ * dependencies: [{ 'dependency-name': 'lodash', 'dependency-version': '4.17.21' }]
2747
+ * };
2748
+ * shouldSupersede(oldPr, newPr); // returns true
2749
+ * ```
2750
+ *
2751
+ * @example
2752
+ * ```ts
2753
+ * // Different dependency sets - overlap but different scope: DON'T SUPERSEDE
2754
+ * const oldPr = {
2755
+ * 'dependency-group-name': null,
2756
+ * dependencies: [
2757
+ * { 'dependency-name': 'lodash', 'dependency-version': '4.17.20' },
2758
+ * { 'dependency-name': 'express', 'dependency-version': '4.18.0' }
2759
+ * ]
2760
+ * };
2761
+ * const newPr = {
2762
+ * 'dependency-group-name': null,
2763
+ * dependencies: [
2764
+ * { 'dependency-name': 'lodash', 'dependency-version': '4.17.21' },
2765
+ * { 'dependency-name': 'react', 'dependency-version': '18.0.0' }
2766
+ * ]
2767
+ * };
2768
+ * shouldSupersede(oldPr, newPr); // returns false - different dependency sets
2769
+ * ```
2770
+ *
2771
+ * @example
2772
+ * ```ts
2773
+ * // Same group - version changed: SUPERSEDE
2774
+ * const oldPr = {
2775
+ * 'dependency-group-name': 'production',
2776
+ * dependencies: [{ 'dependency-name': 'lodash', 'dependency-version': '4.17.20' }]
2777
+ * };
2778
+ * const newPr = {
2779
+ * 'dependency-group-name': 'production',
2780
+ * dependencies: [{ 'dependency-name': 'lodash', 'dependency-version': '4.17.21' }]
2781
+ * };
2782
+ * shouldSupersede(oldPr, newPr); // returns true - same group, version changed
2783
+ * ```
2784
+ */
2785
+ declare function shouldSupersede(oldPr: DependabotPersistedPr, newPr: DependabotPersistedPr): boolean;
2712
2786
  //#endregion
2713
- export { DependabotJobBuilder as $, DependabotRequirementSchema as $t, DependabotRecordCooldownMeta as A, DependabotRegistry as An, DependabotDependency as At, DependabotRecordUpdateJobWarning as B, parseDependabotConfig as Bn, DependabotGroupRuleJob as Bt, DependabotIncrementMetricSchema as C, DependabotGroup as Cn, DependabotCommandSchema as Ct, DependabotMarkAsProcessedSchema as D, DependabotMultiEcosystemGroup as Dn, DependabotConditionSchema as Dt, DependabotMarkAsProcessed as E, DependabotIgnoreConditionSchema as En, DependabotCondition as Et, DependabotRecordEcosystemVersionsSchema as F, DependabotUpdateSchema as Fn, DependabotExistingPRSchema as Ft, DependabotUpdatePullRequestSchema as G, convertPlaceholder as Gn, DependabotJobFileSchema as Gt, DependabotUpdateDependencyList as H, parseUpdates as Hn, DependabotJobConfig as Ht, DependabotRecordUpdateJobError as I, PackageEcosystem as In, DependabotExperiments as It, DependabotRequestSchema as J, DEPENDABOT_DEFAULT_AUTHOR_NAME as Jn, DependabotPersistedPr as Jt, CreateApiServerAppOptions as K, extractPlaceholder as Kn, DependabotPackageManager as Kt, DependabotRecordUpdateJobErrorSchema as L, PackageEcosystemSchema as Ln, DependabotExperimentsSchema as Lt, DependabotRecordEcosystemMeta as M, DependabotSchedule as Mn, DependabotExistingGroupPR as Mt, DependabotRecordEcosystemMetaSchema as N, DependabotScheduleSchema as Nn, DependabotExistingGroupPRSchema as Nt, DependabotMetric as O, DependabotMultiEcosystemGroupSchema as On, DependabotCredential as Ot, DependabotRecordEcosystemVersions as P, DependabotUpdate as Pn, DependabotExistingPR as Pt, createApiServerApp as Q, DependabotRequirement as Qt, DependabotRecordUpdateJobUnknownError as R, VersioningStrategy as Rn, DependabotGroupJob as Rt, DependabotIncrementMetric as S, DependabotCooldownSchema as Sn, DependabotCommand as St, DependabotJobErrorSchema as T, DependabotIgnoreCondition as Tn, DependabotCommitOptionsSchema as Tt, DependabotUpdateDependencyListSchema as U, validateConfiguration as Un, DependabotJobConfigSchema as Ut, DependabotRecordUpdateJobWarningSchema as V, parseRegistries as Vn, DependabotGroupRuleJobSchema as Vt, DependabotUpdatePullRequest as W, VariableFinderFn as Wn, DependabotJobFile as Wt, DependabotRequestTypeSchema as X, DependabotProxyConfig as Xt, DependabotRequestType as Y, GitAuthor as Yn, DependabotPersistedPrSchema as Yt, DependabotTokenType as Z, DependabotProxyConfigSchema as Zt, DependabotDependencySubmissionSchema as _, DependabotCommitMessage as _n, CertificateAuthority as _t, getPullRequestDescription as a, DependabotSourceProvider as an, mapGroupsFromDependabotConfigToJobConfig as at, DependabotEcosystemVersionManager as b, DependabotConfigSchema as bn, DependabotAllowed as bt, DependabotClosePullRequest as c, FetchedFiles as cn, mapSecurityAdvisories as ct, DependabotClosePullRequestSchema as d, BETA_ECOSYSTEMS as dn, DEFAULT_EXPERIMENTS as dt, DependabotRequirementSource as en, DependabotJobBuilderOutput as et, DependabotCreatePullRequest as f, CONFIG_FILE_NAMES as fn, parseExperiments as ft, DependabotDependencySubmission as g, DependabotAllowConditionSchema as gn, sanitizeRef as gt, DependabotDependencyFileSchema as h, DependabotAllowCondition as hn, getBranchNameForUpdate as ht, getPullRequestDependencies as i, DependabotSource as in, mapExperiments as it, DependabotRecordCooldownMetaSchema as j, DependabotRegistrySchema as jn, DependabotDependencySchema as jt, DependabotMetricSchema as k, DependabotPullRequestBranchName as kn, DependabotCredentialSchema as kt, DependabotClosePullRequestReason as l, FileFetcherInput as ln, mapSourceFromDependabotConfigToJobConfig as lt, DependabotDependencyFile as m, CONFIG_FILE_PATHS_GITHUB as mn, makeDirectoryKey as mt, getDependencyNames as n, DependabotSecurityAdvisory as nn, mapAllowedUpdatesFromDependabotConfigToJobConfig as nt, normalizeBranchName as o, DependabotSourceProviderSchema as on, mapIgnoreConditionsFromDependabotConfigToJobConfig as ot, DependabotCreatePullRequestSchema as p, CONFIG_FILE_PATHS_AZURE as pn, setExperiment as pt, DependabotRequest as q, DEPENDABOT_DEFAULT_AUTHOR_EMAIL as qn, DependabotPackageManagerSchema as qt, getPullRequestCloseReason as r, DependabotSecurityAdvisorySchema as rn, mapCredentials as rt, normalizeFilePath as s, DependabotSourceSchema as sn, mapPackageEcosystemToPackageManager as st, areEqual as t, DependabotRequirementSourceSchema as tn, DependabotSourceInfo as tt, DependabotClosePullRequestReasonEnum as u, FileUpdaterInput as un, mapVersionStrategyToRequirementsUpdateStrategy as ut, DependabotEcosystemMeta as v, DependabotCommitMessageSchema as vn, CertificateAuthoritySchema as vt, DependabotJobError as w, DependabotGroupSchema as wn, DependabotCommitOptions as wt, DependabotEcosystemVersionManagerSchema as x, DependabotCooldown as xn, DependabotAllowedSchema as xt, DependabotEcosystemMetaSchema as y, DependabotConfig as yn, DEPENDABOT_COMMANDS as yt, DependabotRecordUpdateJobUnknownErrorSchema as z, VersioningStrategySchema as zn, DependabotGroupJobSchema as zt };
2714
- //# sourceMappingURL=index-flzaUkHI.d.mts.map
2787
+ export { createApiServerApp as $, DependabotProxyConfig as $t, DependabotMetricSchema as A, DependabotMultiEcosystemGroup as An, DependabotCredentialSchema as At, DependabotRecordUpdateJobUnknownErrorSchema as B, PackageEcosystemSchema as Bn, DependabotExperimentsSchema as Bt, DependabotIncrementMetric as C, DependabotConfigSchema as Cn, DependabotCommand as Ct, DependabotMarkAsProcessed as D, DependabotGroupSchema as Dn, DependabotCondition as Dt, DependabotJobErrorSchema as E, DependabotGroup as En, DependabotCommitOptionsSchema as Et, DependabotRecordEcosystemVersions as F, DependabotSchedule as Fn, DependabotExistingPr as Ft, DependabotUpdatePullRequest as G, parseUpdates as Gn, DependabotJobConfig as Gt, DependabotRecordUpdateJobWarningSchema as H, VersioningStrategySchema as Hn, DependabotGroupJobSchema as Ht, DependabotRecordEcosystemVersionsSchema as I, DependabotScheduleSchema as In, DependabotExistingPrDependency as It, DependabotRequest as J, convertPlaceholder as Jn, DependabotJobFileSchema as Jt, DependabotUpdatePullRequestSchema as K, validateConfiguration as Kn, DependabotJobConfigSchema as Kt, DependabotRecordUpdateJobError as L, DependabotUpdate as Ln, DependabotExistingPrDependencySchema as Lt, DependabotRecordCooldownMetaSchema as M, DependabotPullRequestBranchName as Mn, DependabotDependencySchema as Mt, DependabotRecordEcosystemMeta as N, DependabotRegistry as Nn, DependabotExistingGroupPr as Nt, DependabotMarkAsProcessedSchema as O, DependabotIgnoreCondition as On, DependabotConditionSchema as Ot, DependabotRecordEcosystemMetaSchema as P, DependabotRegistrySchema as Pn, DependabotExistingGroupPrSchema as Pt, DependabotTokenType as Q, GitAuthor as Qn, DependabotPersistedPrSchema as Qt, DependabotRecordUpdateJobErrorSchema as R, DependabotUpdateSchema as Rn, DependabotExistingPrSchema as Rt, DependabotEcosystemVersionManagerSchema as S, DependabotConfig as Sn, DependabotAllowedSchema as St, DependabotJobError as T, DependabotCooldownSchema as Tn, DependabotCommitOptions as Tt, DependabotUpdateDependencyList as U, parseDependabotConfig as Un, DependabotGroupRuleJob as Ut, DependabotRecordUpdateJobWarning as V, VersioningStrategy as Vn, DependabotGroupJob as Vt, DependabotUpdateDependencyListSchema as W, parseRegistries as Wn, DependabotGroupRuleJobSchema as Wt, DependabotRequestType as X, DEPENDABOT_DEFAULT_AUTHOR_EMAIL as Xn, DependabotPackageManagerSchema as Xt, DependabotRequestSchema as Y, extractPlaceholder as Yn, DependabotPackageManager as Yt, DependabotRequestTypeSchema as Z, DEPENDABOT_DEFAULT_AUTHOR_NAME as Zn, DependabotPersistedPr as Zt, DependabotDependencySubmission as _, CONFIG_FILE_PATHS_GITHUB as _n, sanitizeRef as _t, getPullRequestDescription as a, DependabotSecurityAdvisory as an, mapExperiments as at, DependabotEcosystemMetaSchema as b, DependabotCommitMessage as bn, DEPENDABOT_COMMANDS as bt, shouldSupersede as c, DependabotSourceProvider as cn, mapPackageEcosystemToPackageManager as ct, DependabotClosePullRequestReasonEnum as d, FetchedFiles as dn, mapVersionStrategyToRequirementsUpdateStrategy as dt, DependabotProxyConfigSchema as en, DependabotJobBuilder as et, DependabotClosePullRequestSchema as f, FileFetcherInput as fn, DEFAULT_EXPERIMENTS as ft, DependabotDependencyFileSchema as g, CONFIG_FILE_PATHS_AZURE as gn, getBranchNameForUpdate as gt, DependabotDependencyFile as h, CONFIG_FILE_NAMES as hn, makeDirectoryKey as ht, getPullRequestCloseReason as i, DependabotRequirementSourceSchema as in, mapCredentials as it, DependabotRecordCooldownMeta as j, DependabotMultiEcosystemGroupSchema as jn, DependabotDependency as jt, DependabotMetric as k, DependabotIgnoreConditionSchema as kn, DependabotCredential as kt, DependabotClosePullRequest as l, DependabotSourceProviderSchema as ln, mapSecurityAdvisories as lt, DependabotCreatePullRequestSchema as m, BETA_ECOSYSTEMS as mn, setExperiment as mt, getDependencyNames as n, DependabotRequirementSchema as nn, DependabotSourceInfo as nt, normalizeBranchName as o, DependabotSecurityAdvisorySchema as on, mapGroupsFromDependabotConfigToJobConfig as ot, DependabotCreatePullRequest as p, FileUpdaterInput as pn, parseExperiments as pt, CreateApiServerAppOptions as q, VariableFinderFn as qn, DependabotJobFile as qt, getPersistedPr as r, DependabotRequirementSource as rn, mapAllowedUpdatesFromDependabotConfigToJobConfig as rt, normalizeFilePath as s, DependabotSource as sn, mapIgnoreConditionsFromDependabotConfigToJobConfig as st, areEqual as t, DependabotRequirement as tn, DependabotJobBuilderOutput as tt, DependabotClosePullRequestReason as u, DependabotSourceSchema as un, mapSourceFromDependabotConfigToJobConfig as ut, DependabotDependencySubmissionSchema as v, DependabotAllowCondition as vn, CertificateAuthority as vt, DependabotIncrementMetricSchema as w, DependabotCooldown as wn, DependabotCommandSchema as wt, DependabotEcosystemVersionManager as x, DependabotCommitMessageSchema as xn, DependabotAllowed as xt, DependabotEcosystemMeta as y, DependabotAllowConditionSchema as yn, CertificateAuthoritySchema as yt, DependabotRecordUpdateJobUnknownError as z, PackageEcosystem as zn, DependabotExperiments as zt };
2788
+ //# sourceMappingURL=index-CviS_2Dy.d.mts.map
@@ -412,15 +412,19 @@ const DependabotSourceSchema = z.object({
412
412
  hostname: z.string().nullish(),
413
413
  "api-endpoint": z.string().nullish()
414
414
  });
415
- const DependabotExistingPRSchema = z.object({
415
+ const DependabotExistingPrDependencySchema = z.object({
416
416
  "dependency-name": z.string(),
417
417
  "dependency-version": z.string().nullish(),
418
418
  directory: z.string().nullish(),
419
419
  removed: z.boolean().nullish()
420
420
  });
421
- const DependabotExistingGroupPRSchema = z.object({
421
+ const DependabotExistingPrSchema = z.object({
422
+ "pr-number": z.number(),
423
+ dependencies: DependabotExistingPrDependencySchema.array()
424
+ });
425
+ const DependabotExistingGroupPrSchema = DependabotExistingPrSchema.extend({
422
426
  "dependency-group-name": z.string(),
423
- dependencies: DependabotExistingPRSchema.array()
427
+ dependencies: DependabotExistingPrDependencySchema.array()
424
428
  });
425
429
  const DependabotAllowedSchema = z.object({
426
430
  "dependency-name": z.string().nullish(),
@@ -508,9 +512,10 @@ const DependabotPackageManagerSchema = z.enum([
508
512
  "opentofu"
509
513
  ]);
510
514
  const DEPENDABOT_COMMANDS = [
511
- "graph",
515
+ "update",
512
516
  "version",
513
- "recreate"
517
+ "recreate",
518
+ "graph"
514
519
  ];
515
520
  const DependabotCommandSchema = z.enum(DEPENDABOT_COMMANDS);
516
521
  const DependabotJobConfigSchema = z.object({
@@ -522,8 +527,8 @@ const DependabotJobConfigSchema = z.object({
522
527
  "dependency-groups": DependabotGroupJobSchema.array().nullish(),
523
528
  dependencies: z.string().array().nullable(),
524
529
  "dependency-group-to-refresh": z.string().nullish(),
525
- "existing-pull-requests": DependabotExistingPRSchema.array().array(),
526
- "existing-group-pull-requests": DependabotExistingGroupPRSchema.array(),
530
+ "existing-pull-requests": DependabotExistingPrSchema.array(),
531
+ "existing-group-pull-requests": DependabotExistingGroupPrSchema.array(),
527
532
  experiments: DependabotExperimentsSchema,
528
533
  "ignore-conditions": DependabotConditionSchema.array(),
529
534
  "lockfile-only": z.boolean(),
@@ -546,8 +551,8 @@ const DependabotJobConfigSchema = z.object({
546
551
  "exclude-paths": z.string().array().optional()
547
552
  });
548
553
  const DependabotJobFileSchema = z.object({ job: DependabotJobConfigSchema });
549
- const DependabotPersistedPrSchema = DependabotExistingPRSchema.array().or(DependabotExistingGroupPRSchema);
554
+ const DependabotPersistedPrSchema = DependabotExistingGroupPrSchema.omit({ "pr-number": true }).extend({ "dependency-group-name": z.string().nullish() });
550
555
 
551
556
  //#endregion
552
- export { DependabotConfigSchema as A, parseDependabotConfig as B, DependabotSourceSchema as C, CONFIG_FILE_PATHS_GITHUB as D, CONFIG_FILE_PATHS_AZURE as E, DependabotRegistrySchema as F, extractPlaceholder as G, parseUpdates as H, DependabotScheduleSchema as I, makeDirectoryKey as K, DependabotUpdateSchema as L, DependabotGroupSchema as M, DependabotIgnoreConditionSchema as N, DependabotAllowConditionSchema as O, DependabotMultiEcosystemGroupSchema as P, PackageEcosystemSchema as R, DependabotSourceProviderSchema as S, CONFIG_FILE_NAMES as T, validateConfiguration as U, parseRegistries as V, convertPlaceholder as W, DependabotPersistedPrSchema as _, DependabotCommitOptionsSchema as a, DependabotRequirementSourceSchema as b, DependabotDependencySchema as c, DependabotExperimentsSchema as d, DependabotGroupJobSchema as f, DependabotPackageManagerSchema as g, DependabotJobFileSchema as h, DependabotCommandSchema as i, DependabotCooldownSchema as j, DependabotCommitMessageSchema as k, DependabotExistingGroupPRSchema as l, DependabotJobConfigSchema as m, DEPENDABOT_COMMANDS as n, DependabotConditionSchema as o, DependabotGroupRuleJobSchema as p, DependabotAllowedSchema as r, DependabotCredentialSchema as s, CertificateAuthoritySchema as t, DependabotExistingPRSchema as u, DependabotProxyConfigSchema as v, BETA_ECOSYSTEMS as w, DependabotSecurityAdvisorySchema as x, DependabotRequirementSchema as y, VersioningStrategySchema as z };
553
- //# sourceMappingURL=job-ClEevC5P.mjs.map
557
+ export { DependabotCommitMessageSchema as A, VersioningStrategySchema as B, DependabotSourceProviderSchema as C, CONFIG_FILE_PATHS_AZURE as D, CONFIG_FILE_NAMES as E, DependabotMultiEcosystemGroupSchema as F, convertPlaceholder as G, parseRegistries as H, DependabotRegistrySchema as I, extractPlaceholder as K, DependabotScheduleSchema as L, DependabotCooldownSchema as M, DependabotGroupSchema as N, CONFIG_FILE_PATHS_GITHUB as O, DependabotIgnoreConditionSchema as P, DependabotUpdateSchema as R, DependabotSecurityAdvisorySchema as S, BETA_ECOSYSTEMS as T, parseUpdates as U, parseDependabotConfig as V, validateConfiguration as W, DependabotPackageManagerSchema as _, DependabotCommitOptionsSchema as a, DependabotRequirementSchema as b, DependabotDependencySchema as c, DependabotExistingPrSchema as d, DependabotExperimentsSchema as f, DependabotJobFileSchema as g, DependabotJobConfigSchema as h, DependabotCommandSchema as i, DependabotConfigSchema as j, DependabotAllowConditionSchema as k, DependabotExistingGroupPrSchema as l, DependabotGroupRuleJobSchema as m, DEPENDABOT_COMMANDS as n, DependabotConditionSchema as o, DependabotGroupJobSchema as p, makeDirectoryKey as q, DependabotAllowedSchema as r, DependabotCredentialSchema as s, CertificateAuthoritySchema as t, DependabotExistingPrDependencySchema as u, DependabotPersistedPrSchema as v, DependabotSourceSchema as w, DependabotRequirementSourceSchema as x, DependabotProxyConfigSchema as y, PackageEcosystemSchema as z };
558
+ //# sourceMappingURL=job-CNRfJDsF.mjs.map