renovate 43.208.0 → 43.208.2
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/config/validation.js +2 -2
- package/dist/config/validation.js.map +1 -1
- package/dist/config-validator.js +1 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +3 -3
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/crate/schema.js +2 -2
- package/dist/modules/datasource/crate/schema.js.map +1 -1
- package/dist/modules/datasource/elm-package/index.js +2 -2
- package/dist/modules/datasource/elm-package/index.js.map +1 -1
- package/dist/modules/datasource/elm-package/schema.js +2 -2
- package/dist/modules/datasource/elm-package/schema.js.map +1 -1
- package/dist/modules/datasource/helm/index.js.map +1 -1
- package/dist/modules/datasource/helm/schema.js.map +1 -1
- package/dist/modules/manager/composer/schema.js.map +1 -1
- package/dist/modules/manager/github-actions/community.js +5 -5
- package/dist/modules/manager/github-actions/community.js.map +1 -1
- package/dist/modules/manager/vendir/extract.js.map +1 -1
- package/dist/modules/manager/vendir/schema.js.map +1 -1
- package/dist/modules/platform/gitlab/pr-cache.js +2 -2
- package/dist/modules/platform/gitlab/pr-cache.js.map +1 -1
- package/dist/modules/platform/gitlab/schema.js +10 -10
- package/dist/modules/platform/gitlab/schema.js.map +1 -1
- package/dist/modules/platform/scm-manager/schema.js +17 -17
- package/dist/modules/platform/scm-manager/schema.js.map +1 -1
- package/dist/modules/platform/scm-manager/scm-manager-helper.js +7 -7
- package/dist/modules/platform/scm-manager/scm-manager-helper.js.map +1 -1
- package/dist/util/cache/repository/impl/base.js +2 -2
- package/dist/util/cache/repository/impl/base.js.map +1 -1
- package/dist/util/cache/repository/schema.js +2 -2
- package/dist/util/cache/repository/schema.js.map +1 -1
- package/dist/util/emoji.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +1 -1
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +2 -2
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["baseUrl"],"sources":["../../../../lib/modules/datasource/elm-package/index.ts"],"sourcesContent":["import { ZodError } from 'zod/v4';\nimport { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as elmVersioning from '../../versioning/elm/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["baseUrl"],"sources":["../../../../lib/modules/datasource/elm-package/index.ts"],"sourcesContent":["import { ZodError } from 'zod/v4';\nimport { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as elmVersioning from '../../versioning/elm/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { ElmPackageReleases } from './schema.ts';\n\nexport class ElmPackageDatasource extends Datasource {\n static readonly id = 'elm-package';\n\n constructor() {\n super(ElmPackageDatasource.id);\n }\n\n override readonly customRegistrySupport = false;\n\n override readonly defaultRegistryUrls = ['https://package.elm-lang.org'];\n\n override readonly defaultVersioning = elmVersioning.id;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the Unix timestamp in the results.';\n\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'The source URL is determined from the package name using the GitHub pattern.';\n\n async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore if -- should never happen */\n if (!registryUrl) {\n return null;\n }\n const baseUrl = registryUrl;\n const pkgUrl = joinUrlParts(\n baseUrl,\n 'packages',\n packageName,\n 'releases.json',\n );\n\n const { val: result, err } = await this.http\n .getJsonSafe(pkgUrl, ElmPackageReleases)\n .onError((err) => {\n logger.debug(\n {\n url: pkgUrl,\n datasource: ElmPackageDatasource.id,\n packageName,\n err,\n },\n 'Error fetching elm package releases',\n );\n })\n .unwrap();\n\n if (err instanceof ZodError) {\n logger.debug({ err }, 'elm-package: validation error');\n return null;\n }\n\n if (err) {\n this.handleGenericErrors(err);\n }\n\n // Elm packages must be published from GitHub - the package name IS the GitHub repo path\n // (e.g., \"elm/core\" is published from github.com/elm/core)\n // This is enforced by the `elm publish` command\n if (packageName.includes('/')) {\n result.sourceUrl = `https://github.com/${packageName}`;\n }\n\n return result;\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${ElmPackageDatasource.id}`,\n key: `${config.registryUrl}:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAa,uBAAb,MAAa,6BAA6B,WAAW;CACnD,OAAgB,KAAK;CAErB,cAAc;EACZ,MAAM,qBAAqB,EAAE;CAC/B;CAEA,wBAA0C;CAE1C,sBAAwC,CAAC,8BAA8B;CAEvE,oBAAsC;CAEtC,0BAA4C;CAC5C,uBACE;CAEF,mBAAqC;CACrC,gBACE;CAEF,MAAM,aAAa,EACjB,aACA,eACmD;;EAEnD,IAAI,CAAC,aACH,OAAO;EAGT,MAAM,SAAS,aACbA,aACA,YACA,aACA,eACF;EAEA,MAAM,EAAE,KAAK,QAAQ,QAAQ,MAAM,KAAK,KACrC,YAAY,QAAQ,kBAAkB,EACtC,SAAS,QAAQ;GAChB,OAAO,MACL;IACE,KAAK;IACL,YAAY,qBAAqB;IACjC;IACA;GACF,GACA,qCACF;EACF,CAAC,EACA,OAAO;EAEV,IAAI,eAAe,UAAU;GAC3B,OAAO,MAAM,EAAE,IAAI,GAAG,+BAA+B;GACrD,OAAO;EACT;EAEA,IAAI,KACF,KAAK,oBAAoB,GAAG;EAM9B,IAAI,YAAY,SAAS,GAAG,GAC1B,OAAO,YAAY,sBAAsB;EAG3C,OAAO;CACT;CAEA,YAAY,QAA0D;EACpE,OAAO,UACL;GACE,WAAW,cAAc,qBAAqB;GAC9C,KAAK,GAAG,OAAO,YAAY,GAAG,OAAO;GACrC,UAAU;EACZ,SACM,KAAK,aAAa,MAAM,CAChC;CACF;AACF"}
|
|
@@ -5,13 +5,13 @@ import { z } from "zod/v4";
|
|
|
5
5
|
* Response from package.elm-lang.org/packages/{author}/{package}/releases.json
|
|
6
6
|
* Maps version strings to Unix timestamps
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const ElmPackageReleases = z.record(z.string(), z.number()).refine((obj) => Object.keys(obj).length > 0, "No releases found").transform((releases) => {
|
|
9
9
|
return { releases: Object.entries(releases).map(([version, timestamp]) => ({
|
|
10
10
|
version,
|
|
11
11
|
releaseTimestamp: asTimestamp(timestamp)
|
|
12
12
|
})) };
|
|
13
13
|
});
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export { ElmPackageReleases };
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/datasource/elm-package/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport type { ReleaseResult } from '../types.ts';\n\n/**\n * Response from package.elm-lang.org/packages/{author}/{package}/releases.json\n * Maps version strings to Unix timestamps\n */\nexport const
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/datasource/elm-package/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { asTimestamp } from '../../../util/timestamp.ts';\nimport type { ReleaseResult } from '../types.ts';\n\n/**\n * Response from package.elm-lang.org/packages/{author}/{package}/releases.json\n * Maps version strings to Unix timestamps\n */\nexport const ElmPackageReleases = z\n .record(z.string(), z.number())\n .refine((obj) => Object.keys(obj).length > 0, 'No releases found')\n .transform((releases): ReleaseResult => {\n return {\n releases: Object.entries(releases).map(([version, timestamp]) => ({\n version,\n releaseTimestamp: asTimestamp(timestamp),\n })),\n };\n });\n\nexport type ElmPackageReleases = Record<string, number>;\n"],"mappings":";;;;;;;AAQA,MAAa,qBAAqB,EAC/B,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B,QAAQ,QAAQ,OAAO,KAAK,GAAG,EAAE,SAAS,GAAG,mBAAmB,EAChE,WAAW,aAA4B;CACtC,OAAO,EACL,UAAU,OAAO,QAAQ,QAAQ,EAAE,KAAK,CAAC,SAAS,gBAAgB;EAChE;EACA,kBAAkB,YAAY,SAAS;CACzC,EAAE,EACJ;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["helmVersioning.id"],"sources":["../../../../lib/modules/datasource/helm/index.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { ensureTrailingSlash } from '../../../util/url.ts';\nimport * as helmVersioning from '../../versioning/helm/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["helmVersioning.id"],"sources":["../../../../lib/modules/datasource/helm/index.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { ensureTrailingSlash } from '../../../util/url.ts';\nimport * as helmVersioning from '../../versioning/helm/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { HelmRepository } from './schema.ts';\n\nexport class HelmDatasource extends Datasource {\n static readonly id = 'helm';\n\n constructor() {\n super(HelmDatasource.id);\n }\n\n override readonly defaultRegistryUrls = ['https://charts.helm.sh/stable'];\n\n override readonly defaultConfig = {\n commitMessageTopic: 'Helm release {{depName}}',\n };\n\n override readonly defaultVersioning = helmVersioning.id;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timstamp is determined from the `created` field in the results.';\n override readonly sourceUrlSupport = 'package';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `home` field or the `sources` field in the results.';\n\n private async _getRepositoryData(\n helmRepository: string,\n ): Promise<HelmRepository> {\n const { val, err } = await this.http\n .getYamlSafe(\n 'index.yaml',\n { baseUrl: ensureTrailingSlash(helmRepository) },\n HelmRepository,\n )\n .unwrap();\n\n if (err) {\n this.handleGenericErrors(err);\n }\n\n return val;\n }\n\n getRepositoryData(helmRepository: string): Promise<HelmRepository> {\n return withCache(\n {\n namespace: `datasource-${HelmDatasource.id}`,\n key: `repository-data:${helmRepository}`,\n },\n () => this._getRepositoryData(helmRepository),\n );\n }\n\n async getReleases({\n packageName,\n registryUrl: helmRepository,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next 3 -- should never happen */\n if (!helmRepository) {\n return null;\n }\n\n const repositoryData = await this.getRepositoryData(helmRepository);\n const releases = repositoryData[packageName];\n if (!releases) {\n logger.debug(\n { dependency: packageName },\n `Entry ${packageName} doesn't exist in index.yaml from ${helmRepository}`,\n );\n return null;\n }\n return releases;\n }\n}\n"],"mappings":";;;;;;;AAQA,IAAa,iBAAb,MAAa,uBAAuB,WAAW;CAC7C,OAAgB,KAAK;CAErB,cAAc;EACZ,MAAM,eAAe,EAAE;CACzB;CAEA,sBAAwC,CAAC,+BAA+B;CAExE,gBAAkC,EAChC,oBAAoB,2BACtB;CAEA,oBAAsCA;CAEtC,0BAA4C;CAC5C,uBACE;CACF,mBAAqC;CACrC,gBACE;CAEF,MAAc,mBACZ,gBACyB;EACzB,MAAM,EAAE,KAAK,QAAQ,MAAM,KAAK,KAC7B,YACC,cACA,EAAE,SAAS,oBAAoB,cAAc,EAAE,GAC/C,cACF,EACC,OAAO;EAEV,IAAI,KACF,KAAK,oBAAoB,GAAG;EAG9B,OAAO;CACT;CAEA,kBAAkB,gBAAiD;EACjE,OAAO,UACL;GACE,WAAW,cAAc,eAAe;GACxC,KAAK,mBAAmB;EAC1B,SACM,KAAK,mBAAmB,cAAc,CAC9C;CACF;CAEA,MAAM,YAAY,EAChB,aACA,aAAa,kBACsC;;EAEnD,IAAI,CAAC,gBACH,OAAO;EAIT,MAAM,YAAW,MADY,KAAK,kBAAkB,cAAc,GAClC;EAChC,IAAI,CAAC,UAAU;GACb,OAAO,MACL,EAAE,YAAY,YAAY,GAC1B,SAAS,YAAY,oCAAoC,gBAC3D;GACA,OAAO;EACT;EACA,OAAO;CACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/datasource/helm/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { parseGitUrl } from '../../../util/git/url.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { LooseRecord } from '../../../util/schema-utils/index.ts';\nimport { MaybeTimestamp } from '../../../util/timestamp.ts';\nimport type { Release } from '../types.ts';\n\nconst HelmRelease = z.object({\n version: z.string(),\n created: MaybeTimestamp,\n digest: z.string().optional().catch(undefined),\n home: z.string().optional().catch(undefined),\n sources: z.array(z.string()).catch([]),\n urls: z.array(z.string()).catch([]),\n});\ntype HelmRelease = z.infer<typeof HelmRelease>;\n\nconst chartRepo = regEx(/charts?|helm|helm-charts/i);\n\nfunction isPossibleChartRepo(url: string): boolean {\n if (detectPlatform(url) === null) {\n return false;\n }\n\n const parsed = parseGitUrl(url);\n return chartRepo.test(parsed.name);\n}\n\nconst githubRelease = regEx(\n /^(https:\\/\\/github\\.com\\/[^/]+\\/[^/]+)\\/releases\\//,\n);\n\nfunction getSourceUrl(release: HelmRelease): string | undefined {\n // it's a github release :)\n const [githubUrl] = release.urls;\n const releaseMatch = githubRelease.exec(githubUrl);\n if (releaseMatch) {\n return releaseMatch[1];\n }\n\n if (release.home && isPossibleChartRepo(release.home)) {\n return release.home;\n }\n\n for (const url of release.sources) {\n if (isPossibleChartRepo(url)) {\n return url;\n }\n }\n\n // fallback\n return release.sources[0];\n}\n\nexport const HelmRepository = z\n .object({\n entries: LooseRecord(\n z.string(),\n HelmRelease.array()\n .min(1)\n .transform((helmReleases) => {\n const latestRelease = helmReleases[0];\n const homepage = latestRelease.home;\n const sourceUrl = getSourceUrl(latestRelease);\n const releases = helmReleases.map(\n ({\n version,\n created: releaseTimestamp,\n digest: newDigest,\n }): Release => ({\n version,\n releaseTimestamp,\n newDigest,\n }),\n );\n return { homepage, sourceUrl, releases };\n }),\n ),\n })\n .transform(({ entries }) => entries);\n\nexport type
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/datasource/helm/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { parseGitUrl } from '../../../util/git/url.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { LooseRecord } from '../../../util/schema-utils/index.ts';\nimport { MaybeTimestamp } from '../../../util/timestamp.ts';\nimport type { Release } from '../types.ts';\n\nconst HelmRelease = z.object({\n version: z.string(),\n created: MaybeTimestamp,\n digest: z.string().optional().catch(undefined),\n home: z.string().optional().catch(undefined),\n sources: z.array(z.string()).catch([]),\n urls: z.array(z.string()).catch([]),\n});\ntype HelmRelease = z.infer<typeof HelmRelease>;\n\nconst chartRepo = regEx(/charts?|helm|helm-charts/i);\n\nfunction isPossibleChartRepo(url: string): boolean {\n if (detectPlatform(url) === null) {\n return false;\n }\n\n const parsed = parseGitUrl(url);\n return chartRepo.test(parsed.name);\n}\n\nconst githubRelease = regEx(\n /^(https:\\/\\/github\\.com\\/[^/]+\\/[^/]+)\\/releases\\//,\n);\n\nfunction getSourceUrl(release: HelmRelease): string | undefined {\n // it's a github release :)\n const [githubUrl] = release.urls;\n const releaseMatch = githubRelease.exec(githubUrl);\n if (releaseMatch) {\n return releaseMatch[1];\n }\n\n if (release.home && isPossibleChartRepo(release.home)) {\n return release.home;\n }\n\n for (const url of release.sources) {\n if (isPossibleChartRepo(url)) {\n return url;\n }\n }\n\n // fallback\n return release.sources[0];\n}\n\nexport const HelmRepository = z\n .object({\n entries: LooseRecord(\n z.string(),\n HelmRelease.array()\n .min(1)\n .transform((helmReleases) => {\n const latestRelease = helmReleases[0];\n const homepage = latestRelease.home;\n const sourceUrl = getSourceUrl(latestRelease);\n const releases = helmReleases.map(\n ({\n version,\n created: releaseTimestamp,\n digest: newDigest,\n }): Release => ({\n version,\n releaseTimestamp,\n newDigest,\n }),\n );\n return { homepage, sourceUrl, releases };\n }),\n ),\n })\n .transform(({ entries }) => entries);\n\nexport type HelmRepository = z.infer<typeof HelmRepository>;\n"],"mappings":";;;;;;;AAQA,MAAM,cAAc,EAAE,OAAO;CAC3B,SAAS,EAAE,OAAO;CAClB,SAAS;CACT,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAA,CAAS;CAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAA,CAAS;CAC3C,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;CACrC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC;AAGD,MAAM,YAAY,MAAM,2BAA2B;AAEnD,SAAS,oBAAoB,KAAsB;CACjD,IAAI,eAAe,GAAG,MAAM,MAC1B,OAAO;CAGT,MAAM,SAAS,YAAY,GAAG;CAC9B,OAAO,UAAU,KAAK,OAAO,IAAI;AACnC;AAEA,MAAM,gBAAgB,MACpB,oDACF;AAEA,SAAS,aAAa,SAA0C;CAE9D,MAAM,CAAC,aAAa,QAAQ;CAC5B,MAAM,eAAe,cAAc,KAAK,SAAS;CACjD,IAAI,cACF,OAAO,aAAa;CAGtB,IAAI,QAAQ,QAAQ,oBAAoB,QAAQ,IAAI,GAClD,OAAO,QAAQ;CAGjB,KAAK,MAAM,OAAO,QAAQ,SACxB,IAAI,oBAAoB,GAAG,GACzB,OAAO;CAKX,OAAO,QAAQ,QAAQ;AACzB;AAEA,MAAa,iBAAiB,EAC3B,OAAO,EACN,SAAS,YACP,EAAE,OAAO,GACT,YAAY,MAAM,EACf,IAAI,CAAC,EACL,WAAW,iBAAiB;CAC3B,MAAM,gBAAgB,aAAa;CAcnC,OAAO;EAAE,UAbQ,cAAc;EAaZ,WAZD,aAAa,aAYJ;EAAG,UAXb,aAAa,KAC3B,EACC,SACA,SAAS,kBACT,QAAQ,iBACM;GACd;GACA;GACA;EACF,EAEmC;CAAE;AACzC,CAAC,CACL,EACF,CAAC,EACA,WAAW,EAAE,cAAc,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":["semverComposer"],"sources":["../../../../lib/modules/manager/composer/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport {\n Json,\n LooseArray,\n LooseRecord,\n withDebugMessage,\n} from '../../../util/schema-utils/index.ts';\nimport { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags/index.ts';\nimport { GitTagsDatasource } from '../../datasource/git-tags/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport { PackagistDatasource } from '../../datasource/packagist/index.ts';\nimport { api as semverComposer } from '../../versioning/composer/index.ts';\nimport type { PackageDependency, PackageFileContent } from '../types.ts';\nimport type { ComposerManagerData } from './types.ts';\n\nexport const ComposerRepo = z.object({\n type: z.literal('composer'),\n /**\n * The regUrl is expected to be a base URL. GitLab composer repository installation guide specifies\n * to use a base URL containing packages.json. Composer still works in this scenario by determining\n * whether to add / remove packages.json from the URL.\n *\n * See https://github.com/composer/composer/blob/750a92b4b7aecda0e5b2f9b963f1cb1421900675/src/Composer/Repository/ComposerRepository.php#L815\n */\n url: z.string().transform((url) => url.replace(/\\/packages\\.json$/, '')),\n});\nexport type ComposerRepo = z.infer<typeof ComposerRepo>;\n\nexport const GitRepo = z.object({\n type: z.enum(['vcs', 'git']).transform(() => 'git' as const),\n url: z.string(),\n name: z.string().optional(),\n});\nexport type GitRepo = z.infer<typeof GitRepo>;\n\nexport const PathRepo = z.object({\n type: z.literal('path'),\n url: z.string(),\n name: z.string().optional(),\n});\nexport type PathRepo = z.infer<typeof PathRepo>;\n\nexport const PackageRepo = z.object({\n type: z.literal('package'),\n});\n\nexport const Repo = z.discriminatedUnion('type', [\n ComposerRepo,\n GitRepo,\n PathRepo,\n PackageRepo,\n]);\nexport type Repo = z.infer<typeof ComposerRepo>;\n\nexport const NamedRepo = z.discriminatedUnion('type', [\n ComposerRepo,\n GitRepo.extend({ name: z.string() }),\n PathRepo.extend({ name: z.string() }),\n PackageRepo,\n]);\nexport type NamedRepo = z.infer<typeof NamedRepo>;\n\nconst DisablePackagist = z.object({ type: z.literal('disable-packagist') });\nexport type DisablePackagist = z.infer<typeof DisablePackagist>;\n\nconst bitbucketUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)bitbucket\\.org[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\n\nexport const ReposRecord = LooseRecord(z.union([Repo, z.literal(false)]), {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Composer: error parsing repositories object');\n },\n}).transform((repos) => {\n const result: (NamedRepo | DisablePackagist)[] = [];\n for (const [name, repo] of Object.entries(repos)) {\n if (repo === false) {\n if (name === 'packagist' || name === 'packagist.org') {\n result.push({ type: 'disable-packagist' });\n }\n continue;\n }\n\n if (repo.type === 'path' || repo.type === 'git') {\n result.push({ name, ...repo });\n continue;\n }\n\n if (repo.type === 'composer') {\n result.push(repo);\n continue;\n }\n }\n\n return result;\n});\nexport type ReposRecord = z.infer<typeof ReposRecord>;\n\nexport const ReposArray = LooseArray(\n z.union([\n Repo,\n z\n .union([\n z.object({ packagist: z.literal(false) }),\n z.object({ 'packagist.org': z.literal(false) }),\n ])\n .transform((): DisablePackagist => ({ type: 'disable-packagist' })),\n ]),\n {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Composer: error parsing repositories array');\n },\n },\n).transform((repos) => {\n const result: (NamedRepo | DisablePackagist)[] = [];\n for (let idx = 0; idx < repos.length; idx++) {\n const repo = repos[idx];\n if (repo.type === 'path' || repo.type === 'git') {\n result.push({ name: `__${idx}`, ...repo });\n } else {\n result.push(repo);\n }\n }\n return result;\n});\nexport type ReposArray = z.infer<typeof ReposArray>;\n\nexport const Repos = z\n .union([ReposRecord, ReposArray])\n .default([]) // Prevents warnings for packages without repositories field\n .catch(withDebugMessage([], 'Composer: invalid \"repositories\" field'))\n .transform((repos) => {\n let packagist = true;\n const repoUrls: string[] = [];\n const gitRepos: Record<string, GitRepo> = {};\n const pathRepos: Record<string, PathRepo> = {};\n\n for (const repo of repos) {\n if (repo.type === 'composer') {\n repoUrls.push(repo.url);\n } else if (repo.type === 'git') {\n gitRepos[repo.name] = repo;\n } else if (repo.type === 'path') {\n pathRepos[repo.name] = repo;\n } else if (repo.type === 'disable-packagist') {\n packagist = false;\n }\n }\n\n if (packagist && repoUrls.length) {\n repoUrls.push('https://repo.packagist.org');\n }\n const registryUrls = repoUrls.length ? repoUrls : null;\n\n return { registryUrls, gitRepos, pathRepos };\n });\nexport type Repos = z.infer<typeof Repos>;\n\nconst RequireDefs = LooseRecord(z.string().transform((x) => x.trim())).catch(\n {},\n);\n\nexport const PackageFile = z\n .object({\n type: z.string().optional(),\n config: z\n .object({\n platform: z.object({\n php: z.string(),\n }),\n })\n .nullable()\n .catch(null),\n repositories: Repos,\n require: RequireDefs,\n 'require-dev': RequireDefs,\n })\n .transform(\n ({\n type: composerJsonType,\n config,\n repositories,\n require,\n 'require-dev': requireDev,\n }) => ({\n composerJsonType,\n config,\n repositories,\n require,\n requireDev,\n }),\n );\nexport type PackageFile = z.infer<typeof PackageFile>;\n\nconst LockedPackage = z.object({\n name: z.string(),\n version: z.string(),\n});\ntype LockedPackage = z.infer<typeof LockedPackage>;\n\nexport const Lockfile = z\n .object({\n 'plugin-api-version': z.string().optional(),\n packages: LooseArray(LockedPackage).catch([]),\n 'packages-dev': LooseArray(LockedPackage).catch([]),\n })\n .transform(\n ({\n 'plugin-api-version': pluginApiVersion,\n packages,\n 'packages-dev': packagesDev,\n }) => ({ pluginApiVersion, packages, packagesDev }),\n );\nexport type Lockfile = z.infer<typeof Lockfile>;\n\nexport const ComposerExtract = z\n .object({\n content: z.string(),\n fileName: z.string(),\n })\n .transform(({ content, fileName }) => {\n const lockfileName = fileName.replace(/\\.json$/, '.lock');\n return {\n file: content,\n lockfileName,\n lockfile: lockfileName,\n };\n })\n .pipe(\n z.object({\n file: Json.pipe(PackageFile),\n lockfileName: z.string(),\n lockfile: z\n .string()\n .transform((lockfileName) => readLocalFile(lockfileName, 'utf8'))\n .pipe(\n z.union([\n z.null(),\n z\n .string()\n .pipe(Json)\n .pipe(Lockfile)\n .nullable()\n .catch(withDebugMessage(null, 'Composer: does not match schema')),\n ]),\n ),\n }),\n )\n .transform(({ file, lockfile, lockfileName }) => {\n const { composerJsonType, require, requireDev } = file;\n const { registryUrls, gitRepos, pathRepos } = file.repositories;\n\n const deps: PackageDependency[] = [];\n\n const profiles = [\n {\n depType: 'require',\n req: require,\n locked: lockfile?.packages ?? [],\n },\n {\n depType: 'require-dev',\n req: requireDev,\n locked: lockfile?.packagesDev ?? [],\n },\n ];\n\n for (const { depType, req, locked } of profiles) {\n for (const [depName, currentValue] of Object.entries(req)) {\n if (depName === 'php') {\n deps.push({\n depType,\n depName,\n currentValue,\n datasource: GithubTagsDatasource.id,\n packageName: 'containerbase/php-prebuild',\n });\n continue;\n }\n\n if (pathRepos[depName]) {\n deps.push({\n depType,\n depName,\n currentValue,\n skipReason: 'path-dependency',\n });\n continue;\n }\n\n const dep: PackageDependency = {\n depType,\n depName,\n currentValue,\n };\n\n if (!depName.includes('/')) {\n dep.skipReason = 'unsupported';\n }\n\n const lockedDep = locked.find((item) => item.name === depName);\n if (lockedDep && semverComposer.isVersion(lockedDep.version)) {\n dep.lockedVersion = lockedDep.version.replace(regEx(/^v/i), '');\n }\n\n const gitRepo = gitRepos[depName];\n if (gitRepo) {\n const bitbucketMatchGroups = bitbucketUrlRegex.exec(\n gitRepo.url,\n )?.groups;\n\n if (bitbucketMatchGroups) {\n dep.datasource = BitbucketTagsDatasource.id;\n dep.packageName = bitbucketMatchGroups.packageName;\n deps.push(dep);\n continue;\n }\n\n dep.datasource = GitTagsDatasource.id;\n dep.packageName = gitRepo.url;\n deps.push(dep);\n continue;\n }\n\n dep.datasource = PackagistDatasource.id;\n\n if (registryUrls) {\n dep.registryUrls = registryUrls;\n }\n\n deps.push(dep);\n }\n }\n\n if (!deps.length) {\n return null;\n }\n\n const res: PackageFileContent<ComposerManagerData> = { deps };\n\n if (composerJsonType) {\n res.managerData = { composerJsonType };\n }\n\n if (require.php) {\n res.extractedConstraints = { php: require.php };\n }\n\n if (lockfile) {\n res.lockFiles = [lockfileName];\n }\n\n return res;\n });\nexport type ComposerExtract = z.infer<typeof ComposerExtract>;\n"],"mappings":";;;;;;;;;;;AAkBA,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,QAAQ,UAAU;;;;;;;;CAQ1B,KAAK,EAAE,OAAO,EAAE,WAAW,QAAQ,IAAI,QAAQ,qBAAqB,EAAE,CAAC;AACzE,CAAC;AAGD,MAAa,UAAU,EAAE,OAAO;CAC9B,MAAM,EAAE,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,gBAAgB,KAAc;CAC3D,KAAK,EAAE,OAAO;CACd,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAGD,MAAa,WAAW,EAAE,OAAO;CAC/B,MAAM,EAAE,QAAQ,MAAM;CACtB,KAAK,EAAE,OAAO;CACd,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAGD,MAAa,cAAc,EA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AAI,YAAY,CAAC,YAAY;CAG/B,OAAO;AACT,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.js","names":["semverComposer"],"sources":["../../../../lib/modules/manager/composer/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport {\n Json,\n LooseArray,\n LooseRecord,\n withDebugMessage,\n} from '../../../util/schema-utils/index.ts';\nimport { BitbucketTagsDatasource } from '../../datasource/bitbucket-tags/index.ts';\nimport { GitTagsDatasource } from '../../datasource/git-tags/index.ts';\nimport { GithubTagsDatasource } from '../../datasource/github-tags/index.ts';\nimport { PackagistDatasource } from '../../datasource/packagist/index.ts';\nimport { api as semverComposer } from '../../versioning/composer/index.ts';\nimport type { PackageDependency, PackageFileContent } from '../types.ts';\nimport type { ComposerManagerData } from './types.ts';\n\nexport const ComposerRepo = z.object({\n type: z.literal('composer'),\n /**\n * The regUrl is expected to be a base URL. GitLab composer repository installation guide specifies\n * to use a base URL containing packages.json. Composer still works in this scenario by determining\n * whether to add / remove packages.json from the URL.\n *\n * See https://github.com/composer/composer/blob/750a92b4b7aecda0e5b2f9b963f1cb1421900675/src/Composer/Repository/ComposerRepository.php#L815\n */\n url: z.string().transform((url) => url.replace(/\\/packages\\.json$/, '')),\n});\nexport type ComposerRepo = z.infer<typeof ComposerRepo>;\n\nexport const GitRepo = z.object({\n type: z.enum(['vcs', 'git']).transform(() => 'git' as const),\n url: z.string(),\n name: z.string().optional(),\n});\nexport type GitRepo = z.infer<typeof GitRepo>;\n\nexport const PathRepo = z.object({\n type: z.literal('path'),\n url: z.string(),\n name: z.string().optional(),\n});\nexport type PathRepo = z.infer<typeof PathRepo>;\n\nexport const PackageRepo = z.object({\n type: z.literal('package'),\n});\n\nexport const Repo = z.discriminatedUnion('type', [\n ComposerRepo,\n GitRepo,\n PathRepo,\n PackageRepo,\n]);\nexport type Repo = z.infer<typeof Repo>;\n\nexport const NamedRepo = z.discriminatedUnion('type', [\n ComposerRepo,\n GitRepo.extend({ name: z.string() }),\n PathRepo.extend({ name: z.string() }),\n PackageRepo,\n]);\nexport type NamedRepo = z.infer<typeof NamedRepo>;\n\nconst DisablePackagist = z.object({ type: z.literal('disable-packagist') });\nexport type DisablePackagist = z.infer<typeof DisablePackagist>;\n\nconst bitbucketUrlRegex = regEx(\n /^(?:https:\\/\\/|git@)bitbucket\\.org[/:](?<packageName>[^/]+\\/[^/]+?)(?:\\.git)?$/,\n);\n\nexport const ReposRecord = LooseRecord(z.union([Repo, z.literal(false)]), {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Composer: error parsing repositories object');\n },\n}).transform((repos) => {\n const result: (NamedRepo | DisablePackagist)[] = [];\n for (const [name, repo] of Object.entries(repos)) {\n if (repo === false) {\n if (name === 'packagist' || name === 'packagist.org') {\n result.push({ type: 'disable-packagist' });\n }\n continue;\n }\n\n if (repo.type === 'path' || repo.type === 'git') {\n result.push({ name, ...repo });\n continue;\n }\n\n if (repo.type === 'composer') {\n result.push(repo);\n continue;\n }\n }\n\n return result;\n});\nexport type ReposRecord = z.infer<typeof ReposRecord>;\n\nexport const ReposArray = LooseArray(\n z.union([\n Repo,\n z\n .union([\n z.object({ packagist: z.literal(false) }),\n z.object({ 'packagist.org': z.literal(false) }),\n ])\n .transform((): DisablePackagist => ({ type: 'disable-packagist' })),\n ]),\n {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Composer: error parsing repositories array');\n },\n },\n).transform((repos) => {\n const result: (NamedRepo | DisablePackagist)[] = [];\n for (let idx = 0; idx < repos.length; idx++) {\n const repo = repos[idx];\n if (repo.type === 'path' || repo.type === 'git') {\n result.push({ name: `__${idx}`, ...repo });\n } else {\n result.push(repo);\n }\n }\n return result;\n});\nexport type ReposArray = z.infer<typeof ReposArray>;\n\nexport const Repos = z\n .union([ReposRecord, ReposArray])\n .default([]) // Prevents warnings for packages without repositories field\n .catch(withDebugMessage([], 'Composer: invalid \"repositories\" field'))\n .transform((repos) => {\n let packagist = true;\n const repoUrls: string[] = [];\n const gitRepos: Record<string, GitRepo> = {};\n const pathRepos: Record<string, PathRepo> = {};\n\n for (const repo of repos) {\n if (repo.type === 'composer') {\n repoUrls.push(repo.url);\n } else if (repo.type === 'git') {\n gitRepos[repo.name] = repo;\n } else if (repo.type === 'path') {\n pathRepos[repo.name] = repo;\n } else if (repo.type === 'disable-packagist') {\n packagist = false;\n }\n }\n\n if (packagist && repoUrls.length) {\n repoUrls.push('https://repo.packagist.org');\n }\n const registryUrls = repoUrls.length ? repoUrls : null;\n\n return { registryUrls, gitRepos, pathRepos };\n });\nexport type Repos = z.infer<typeof Repos>;\n\nconst RequireDefs = LooseRecord(z.string().transform((x) => x.trim())).catch(\n {},\n);\n\nexport const PackageFile = z\n .object({\n type: z.string().optional(),\n config: z\n .object({\n platform: z.object({\n php: z.string(),\n }),\n })\n .nullable()\n .catch(null),\n repositories: Repos,\n require: RequireDefs,\n 'require-dev': RequireDefs,\n })\n .transform(\n ({\n type: composerJsonType,\n config,\n repositories,\n require,\n 'require-dev': requireDev,\n }) => ({\n composerJsonType,\n config,\n repositories,\n require,\n requireDev,\n }),\n );\nexport type PackageFile = z.infer<typeof PackageFile>;\n\nconst LockedPackage = z.object({\n name: z.string(),\n version: z.string(),\n});\ntype LockedPackage = z.infer<typeof LockedPackage>;\n\nexport const Lockfile = z\n .object({\n 'plugin-api-version': z.string().optional(),\n packages: LooseArray(LockedPackage).catch([]),\n 'packages-dev': LooseArray(LockedPackage).catch([]),\n })\n .transform(\n ({\n 'plugin-api-version': pluginApiVersion,\n packages,\n 'packages-dev': packagesDev,\n }) => ({ pluginApiVersion, packages, packagesDev }),\n );\nexport type Lockfile = z.infer<typeof Lockfile>;\n\nexport const ComposerExtract = z\n .object({\n content: z.string(),\n fileName: z.string(),\n })\n .transform(({ content, fileName }) => {\n const lockfileName = fileName.replace(/\\.json$/, '.lock');\n return {\n file: content,\n lockfileName,\n lockfile: lockfileName,\n };\n })\n .pipe(\n z.object({\n file: Json.pipe(PackageFile),\n lockfileName: z.string(),\n lockfile: z\n .string()\n .transform((lockfileName) => readLocalFile(lockfileName, 'utf8'))\n .pipe(\n z.union([\n z.null(),\n z\n .string()\n .pipe(Json)\n .pipe(Lockfile)\n .nullable()\n .catch(withDebugMessage(null, 'Composer: does not match schema')),\n ]),\n ),\n }),\n )\n .transform(({ file, lockfile, lockfileName }) => {\n const { composerJsonType, require, requireDev } = file;\n const { registryUrls, gitRepos, pathRepos } = file.repositories;\n\n const deps: PackageDependency[] = [];\n\n const profiles = [\n {\n depType: 'require',\n req: require,\n locked: lockfile?.packages ?? [],\n },\n {\n depType: 'require-dev',\n req: requireDev,\n locked: lockfile?.packagesDev ?? [],\n },\n ];\n\n for (const { depType, req, locked } of profiles) {\n for (const [depName, currentValue] of Object.entries(req)) {\n if (depName === 'php') {\n deps.push({\n depType,\n depName,\n currentValue,\n datasource: GithubTagsDatasource.id,\n packageName: 'containerbase/php-prebuild',\n });\n continue;\n }\n\n if (pathRepos[depName]) {\n deps.push({\n depType,\n depName,\n currentValue,\n skipReason: 'path-dependency',\n });\n continue;\n }\n\n const dep: PackageDependency = {\n depType,\n depName,\n currentValue,\n };\n\n if (!depName.includes('/')) {\n dep.skipReason = 'unsupported';\n }\n\n const lockedDep = locked.find((item) => item.name === depName);\n if (lockedDep && semverComposer.isVersion(lockedDep.version)) {\n dep.lockedVersion = lockedDep.version.replace(regEx(/^v/i), '');\n }\n\n const gitRepo = gitRepos[depName];\n if (gitRepo) {\n const bitbucketMatchGroups = bitbucketUrlRegex.exec(\n gitRepo.url,\n )?.groups;\n\n if (bitbucketMatchGroups) {\n dep.datasource = BitbucketTagsDatasource.id;\n dep.packageName = bitbucketMatchGroups.packageName;\n deps.push(dep);\n continue;\n }\n\n dep.datasource = GitTagsDatasource.id;\n dep.packageName = gitRepo.url;\n deps.push(dep);\n continue;\n }\n\n dep.datasource = PackagistDatasource.id;\n\n if (registryUrls) {\n dep.registryUrls = registryUrls;\n }\n\n deps.push(dep);\n }\n }\n\n if (!deps.length) {\n return null;\n }\n\n const res: PackageFileContent<ComposerManagerData> = { deps };\n\n if (composerJsonType) {\n res.managerData = { composerJsonType };\n }\n\n if (require.php) {\n res.extractedConstraints = { php: require.php };\n }\n\n if (lockfile) {\n res.lockFiles = [lockfileName];\n }\n\n return res;\n });\nexport type ComposerExtract = z.infer<typeof ComposerExtract>;\n"],"mappings":";;;;;;;;;;;AAkBA,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,QAAQ,UAAU;;;;;;;;CAQ1B,KAAK,EAAE,OAAO,EAAE,WAAW,QAAQ,IAAI,QAAQ,qBAAqB,EAAE,CAAC;AACzE,CAAC;AAGD,MAAa,UAAU,EAAE,OAAO;CAC9B,MAAM,EAAE,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,gBAAgB,KAAc;CAC3D,KAAK,EAAE,OAAO;CACd,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAGD,MAAa,WAAW,EAAE,OAAO;CAC/B,MAAM,EAAE,QAAQ,MAAM;CACtB,KAAK,EAAE,OAAO;CACd,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAGD,MAAa,cAAc,EAAE,OAAO,EAClC,MAAM,EAAE,QAAQ,SAAS,EAC3B,CAAC;AAED,MAAa,OAAO,EAAE,mBAAmB,QAAQ;CAC/C;CACA;CACA;CACA;AACF,CAAC;AAGwB,EAAE,mBAAmB,QAAQ;CACpD;CACA,QAAQ,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;CACnC,SAAS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;CACpC;AACF,CAAC;AAGwB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,mBAAmB,EAAE,CAAC;AAG1E,MAAM,oBAAoB,MACxB,gFACF;AAEA,MAAa,cAAc,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,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F;EAEA,IAAI,CAAC,QAAQ,SAAS,GAAG,GACvB,IAAI,aAAa;EAGnB,MAAM,YAAY,OAAO,MAAM,SAAS,KAAK,SAAS,OAAO;EAC7D,IAAI,aAAaA,IAAe,UAAU,UAAU,OAAO,GACzD,IAAI,gBAAgB,UAAU,QAAQ,QAAQ,MAAM,KAAK,GAAG,EAAE;EAGhE,MAAM,UAAU,SAAS;EACzB,IAAI,SAAS;GACX,MAAM,uBAAuB,kBAAkB,KAC7C,QAAQ,GACV,GAAG;GAEH,IAAI,sBAAsB;IACxB,IAAI,aAAa,wBAAwB;IACzC,IAAI,cAAc,qBAAqB;IACvC,KAAK,KAAK,GAAG;IACb;GACF;GAEA,IAAI,aAAa,kBAAkB;GACnC,IAAI,cAAc,QAAQ;GAC1B,KAAK,KAAK,GAAG;GACb;EACF;EAEA,IAAI,aAAa,oBAAoB;EAErC,IAAI,cACF,IAAI,eAAe;EAGrB,KAAK,KAAK,GAAG;CACf;CAGF,IAAI,CAAC,KAAK,QACR,OAAO;CAGT,MAAM,MAA+C,EAAE,KAAK;CAE5D,IAAI,kBACF,IAAI,cAAc,EAAE,iBAAiB;CAGvC,IAAI,QAAQ,KACV,IAAI,uBAAuB,EAAE,KAAK,QAAQ,IAAI;CAGhD,IAAI,UACF,IAAI,YAAY,CAAC,YAAY;CAG/B,OAAO;AACT,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { z } from "zod/v4";
|
|
|
11
11
|
function actionSchema(name, { isInvalid, withSchema, ...cfg }) {
|
|
12
12
|
return z.object({
|
|
13
13
|
uses: matchAction(name),
|
|
14
|
-
with: withSchema ??
|
|
14
|
+
with: withSchema ?? VersionVal
|
|
15
15
|
}).transform(({ with: { val, ...meta } }) => ({
|
|
16
16
|
...cfg,
|
|
17
17
|
...meta,
|
|
@@ -44,8 +44,8 @@ function parseValue(currentValue, isInvalid) {
|
|
|
44
44
|
function valSchema(key) {
|
|
45
45
|
return z.object({ [key]: z.string().optional() }).transform((val) => ({ val: val[key] }));
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
47
|
+
const VersionVal = z.object({ version: z.string().optional() }).transform((val) => ({ val: val.version }));
|
|
48
|
+
const InstallBinaryWith = z.object({
|
|
49
49
|
repo: z.string(),
|
|
50
50
|
tag: z.string()
|
|
51
51
|
}).transform(({ repo, tag }) => ({
|
|
@@ -92,7 +92,7 @@ const communityActions = {
|
|
|
92
92
|
"jaxxstorm/action-install-gh-release": {
|
|
93
93
|
datasource: GithubReleasesDatasource.id,
|
|
94
94
|
packageName: "",
|
|
95
|
-
withSchema:
|
|
95
|
+
withSchema: InstallBinaryWith
|
|
96
96
|
},
|
|
97
97
|
"oven-sh/setup-bun": {
|
|
98
98
|
datasource: NpmDatasource.id,
|
|
@@ -126,7 +126,7 @@ const communityActions = {
|
|
|
126
126
|
"sigoden/install-binary": {
|
|
127
127
|
datasource: GithubReleasesDatasource.id,
|
|
128
128
|
packageName: "",
|
|
129
|
-
withSchema:
|
|
129
|
+
withSchema: InstallBinaryWith
|
|
130
130
|
},
|
|
131
131
|
"zizmorcore/zizmor-action": {
|
|
132
132
|
datasource: DockerDatasource.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"community.js","names":["condaVersioning.id"],"sources":["../../../../lib/modules/manager/github-actions/community.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nimport { escapeRegExp, regEx } from '../../../util/regex.ts';\nimport { DockerDatasource } from '../../datasource/docker/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { NpmDatasource } from '../../datasource/npm/index.ts';\nimport { PypiDatasource } from '../../datasource/pypi/index.ts';\nimport { RubyVersionDatasource } from '../../datasource/ruby-version/index.ts';\nimport * as condaVersioning from '../../versioning/conda/index.ts';\nimport * as npmVersioning from '../../versioning/npm/index.ts';\nimport type { PackageDependency } from '../types.ts';\n\nexport interface CommunityActionConfig {\n datasource: string;\n depName?: string;\n packageName: string;\n versioning?: string;\n extractVersion?: string;\n\n /**\n * should return `true` if the version is invalid and should be skipped\n */\n isInvalid?: (value: string) => boolean;\n\n withSchema?: z.ZodType<{ val: string | undefined } & Record<string, unknown>>;\n}\n\ntype ActionSchema = z.ZodType<PackageDependency>;\n\nfunction actionSchema(\n name: string,\n { isInvalid, withSchema, ...cfg }: CommunityActionConfig,\n): ActionSchema {\n return z\n .object({\n uses: matchAction(name),\n with: withSchema ??
|
|
1
|
+
{"version":3,"file":"community.js","names":["condaVersioning.id"],"sources":["../../../../lib/modules/manager/github-actions/community.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nimport { escapeRegExp, regEx } from '../../../util/regex.ts';\nimport { DockerDatasource } from '../../datasource/docker/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { NpmDatasource } from '../../datasource/npm/index.ts';\nimport { PypiDatasource } from '../../datasource/pypi/index.ts';\nimport { RubyVersionDatasource } from '../../datasource/ruby-version/index.ts';\nimport * as condaVersioning from '../../versioning/conda/index.ts';\nimport * as npmVersioning from '../../versioning/npm/index.ts';\nimport type { PackageDependency } from '../types.ts';\n\nexport interface CommunityActionConfig {\n datasource: string;\n depName?: string;\n packageName: string;\n versioning?: string;\n extractVersion?: string;\n\n /**\n * should return `true` if the version is invalid and should be skipped\n */\n isInvalid?: (value: string) => boolean;\n\n withSchema?: z.ZodType<{ val: string | undefined } & Record<string, unknown>>;\n}\n\ntype ActionSchema = z.ZodType<PackageDependency>;\n\nfunction actionSchema(\n name: string,\n { isInvalid, withSchema, ...cfg }: CommunityActionConfig,\n): ActionSchema {\n return z\n .object({\n uses: matchAction(name),\n with: withSchema ?? VersionVal,\n })\n .transform(\n ({ with: { val, ...meta } }): PackageDependency => ({\n ...cfg,\n ...meta,\n ...parseValue(val, isInvalid),\n }),\n )\n .transform((dep) => {\n dep.depName ??= dep.packageName;\n return dep;\n });\n}\n\nfunction matchAction(action: string): z.ZodString {\n return z\n .string()\n .regex(regEx(`(?:https?://[^/]+/)?${escapeRegExp(action)}(?:@.+)?$`));\n}\n\nfunction parseValue(\n currentValue: string | undefined,\n isInvalid?: (val: string) => boolean,\n): PackageDependency {\n if (!currentValue) {\n return {\n skipStage: 'extract',\n skipReason: 'unspecified-version',\n depType: 'uses-with',\n };\n }\n if (isInvalid?.(currentValue) === true) {\n return {\n skipStage: 'extract',\n skipReason: 'invalid-version',\n depType: 'uses-with',\n currentValue,\n };\n }\n return { currentValue, depType: 'uses-with' };\n}\n\nfunction valSchema(key: string): z.ZodType<{ val: string | undefined }> {\n return z\n .object({ [key]: z.string().optional() })\n .transform((val) => ({ val: val[key] }));\n}\n\nconst VersionVal = z\n .object({ version: z.string().optional() })\n .transform((val) => ({ val: val.version }));\n\nconst InstallBinaryWith = z\n .object({ repo: z.string(), tag: z.string() })\n .transform(({ repo, tag }) => ({ packageName: repo, val: tag }));\n\n/**\n * Community contributed actions with known version input schemas.\n */\nexport const communityActions: Record<string, CommunityActionConfig> = {\n // https://github.com/aquasecurity/setup-trivy\n 'aquasecurity/setup-trivy': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'aquasecurity/trivy',\n },\n // https://github.com/aquasecurity/trivy-action\n 'aquasecurity/trivy-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'aquasecurity/trivy',\n },\n // https://github.com/astral-sh/setup-uv\n 'astral-sh/setup-uv': {\n datasource: GithubReleasesDatasource.id,\n versioning: npmVersioning.id,\n packageName: 'astral-sh/uv',\n },\n 'denoland/setup-deno': {\n datasource: NpmDatasource.id,\n packageName: 'deno',\n withSchema: valSchema('deno-version'),\n },\n // https://github.com/docker/setup-docker-action\n 'docker/setup-docker-action': {\n datasource: GithubReleasesDatasource.id,\n depName: 'docker/setup-docker-action',\n packageName: 'moby/moby',\n extractVersion: '^docker-(?<version>.+)$',\n },\n 'golangci/golangci-lint-action': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'golangci/golangci-lint',\n },\n 'jakebailey/pyright-action': {\n datasource: NpmDatasource.id,\n packageName: 'pyright',\n isInvalid: (val) => val === 'PATH',\n },\n 'jaxxstorm/action-install-gh-release': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined from `repo` input\n withSchema: InstallBinaryWith,\n },\n 'oven-sh/setup-bun': {\n datasource: NpmDatasource.id,\n packageName: 'bun',\n withSchema: valSchema('bun-version'),\n },\n 'pdm-project/setup-pdm': {\n datasource: PypiDatasource.id,\n packageName: 'pdm',\n },\n 'pnpm/action-setup': {\n datasource: NpmDatasource.id,\n packageName: 'pnpm',\n },\n 'prefix-dev/setup-pixi': {\n datasource: GithubReleasesDatasource.id,\n versioning: condaVersioning.id,\n packageName: 'prefix-dev/pixi',\n withSchema: valSchema('pixi-version'),\n },\n // https://github.com/pypa/hatch/tree/install\n 'pypa/hatch': {\n datasource: GithubReleasesDatasource.id,\n packageName: 'pypa/hatch',\n // Strip hatch- prefix from release tags\n extractVersion: '^hatch-(?<version>.+)$',\n },\n 'ruby/setup-ruby': {\n datasource: RubyVersionDatasource.id,\n packageName: 'ruby',\n withSchema: valSchema('ruby-version'),\n },\n 'sigoden/install-binary': {\n datasource: GithubReleasesDatasource.id,\n packageName: '', // determined from `repo` input\n withSchema: InstallBinaryWith,\n },\n 'zizmorcore/zizmor-action': {\n datasource: DockerDatasource.id,\n packageName: 'ghcr.io/zizmorcore/zizmor',\n },\n};\n\nexport const CommunityActions = z.union(\n Object.entries(communityActions).map(([name, cfg]) =>\n actionSchema(name, cfg),\n ) as [ActionSchema, ActionSchema, ...ActionSchema[]],\n);\n"],"mappings":";;;;;;;;;;AA6BA,SAAS,aACP,MACA,EAAE,WAAW,YAAY,GAAG,OACd;CACd,OAAO,EACJ,OAAO;EACN,MAAM,YAAY,IAAI;EACtB,MAAM,cAAc;CACtB,CAAC,EACA,WACE,EAAE,MAAM,EAAE,KAAK,GAAG,cAAiC;EAClD,GAAG;EACH,GAAG;EACH,GAAG,WAAW,KAAK,SAAS;CAC9B,EACF,EACC,WAAW,QAAQ;EAClB,IAAI,YAAY,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Y,cAAc;EAC1B,aAAa;EACb,YAAY,QAAQ,QAAQ;CAC9B;CACA,uCAAuC;EACrC,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY;CACd;CACA,qBAAqB;EACnB,YAAY,cAAc;EAC1B,aAAa;EACb,YAAY,UAAU,aAAa;CACrC;CACA,yBAAyB;EACvB,YAAY,eAAe;EAC3B,aAAa;CACf;CACA,qBAAqB;EACnB,YAAY,cAAc;EAC1B,aAAa;CACf;CACA,yBAAyB;EACvB,YAAY,yBAAyB;EACrC,YAAYA;EACZ,aAAa;EACb,YAAY,UAAU,cAAc;CACtC;CAEA,cAAc;EACZ,YAAY,yBAAyB;EACrC,aAAa;EAEb,gBAAgB;CAClB;CACA,mBAAmB;EACjB,YAAY,sBAAsB;EAClC,aAAa;EACb,YAAY,UAAU,cAAc;CACtC;CACA,0BAA0B;EACxB,YAAY,yBAAyB;EACrC,aAAa;EACb,YAAY;CACd;CACA,4BAA4B;EAC1B,YAAY,iBAAiB;EAC7B,aAAa;CACf;AACF;AAEA,MAAa,mBAAmB,EAAE,MAChC,OAAO,QAAQ,gBAAgB,EAAE,KAAK,CAAC,MAAM,SAC3C,aAAa,MAAM,GAAG,CACxB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/vendir/extract.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { getHttpUrl } from '../../../util/git/url.ts';\nimport { parseSingleYaml } from '../../../util/yaml.ts';\nimport { GitRefsDatasource } from '../../datasource/git-refs/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { HelmDatasource } from '../../datasource/helm/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport { isOCIRegistry, removeOCIPrefix } from '../helmv3/oci.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types.ts';\nimport type {\n
|
|
1
|
+
{"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/vendir/extract.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { getHttpUrl } from '../../../util/git/url.ts';\nimport { parseSingleYaml } from '../../../util/yaml.ts';\nimport { GitRefsDatasource } from '../../datasource/git-refs/index.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { HelmDatasource } from '../../datasource/helm/index.ts';\nimport { getDep } from '../dockerfile/extract.ts';\nimport { isOCIRegistry, removeOCIPrefix } from '../helmv3/oci.ts';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types.ts';\nimport type {\n GitRef,\n GithubRelease,\n HelmChart,\n HttpRelease,\n} from './schema.ts';\nimport { Vendir } from './schema.ts';\n\nexport function extractHelmChart(\n helmChart: HelmChart,\n aliases?: Record<string, string>,\n): PackageDependency {\n if (isOCIRegistry(helmChart.repository.url)) {\n const dep = getDep(\n `${removeOCIPrefix(helmChart.repository.url)}/${helmChart.name}:${helmChart.version}`,\n false,\n aliases,\n );\n return {\n ...dep,\n depName: helmChart.name,\n depType: 'HelmChart',\n // https://github.com/helm/helm/issues/10312\n // https://github.com/helm/helm/issues/10678\n pinDigests: false,\n };\n }\n return {\n depName: helmChart.name,\n currentValue: helmChart.version,\n depType: 'HelmChart',\n registryUrls: [helmChart.repository.url],\n datasource: HelmDatasource.id,\n };\n}\n\nexport function extractGitSource(gitSource: GitRef): PackageDependency {\n const httpUrl = getHttpUrl(gitSource.url);\n return {\n depName: httpUrl,\n depType: 'GitSource',\n currentValue: gitSource.ref,\n datasource: GitRefsDatasource.id,\n };\n}\n\nexport function extractGithubReleaseSource(\n githubRelease: GithubRelease,\n): PackageDependency {\n return {\n depName: githubRelease.slug,\n packageName: githubRelease.slug,\n depType: 'GithubRelease',\n currentValue: githubRelease.tag,\n datasource: GithubReleasesDatasource.id,\n };\n}\n\nexport function extractHttpReleaseSource(\n httpRelease: HttpRelease,\n): PackageDependency {\n return {\n packageName: httpRelease.url,\n currentValue: 'latest',\n depType: 'HttpSource',\n skipReason: 'unsupported-datasource',\n };\n}\n\nexport function parseVendir(\n content: string,\n packageFile?: string,\n): Vendir | null {\n try {\n return parseSingleYaml(content, {\n customSchema: Vendir,\n removeTemplates: true,\n });\n } catch {\n logger.debug({ packageFile }, 'Error parsing vendir.yml file');\n return null;\n }\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n config: ExtractConfig,\n): PackageFileContent | null {\n logger.trace(`vendir.extractPackageFile(${packageFile})`);\n const deps: PackageDependency[] = [];\n\n const pkg = parseVendir(content, packageFile);\n if (!pkg) {\n return null;\n }\n\n // grab the helm charts\n const contents = pkg.directories.flatMap((directory) => directory.contents);\n for (const content of contents) {\n // v8 ignore else -- hard to test\n if ('helmChart' in content && content.helmChart) {\n const dep = extractHelmChart(content.helmChart, config.registryAliases);\n deps.push(dep);\n } else if ('git' in content && content.git) {\n const dep = extractGitSource(content.git);\n deps.push(dep);\n } else if ('githubRelease' in content && content.githubRelease) {\n const dep = extractGithubReleaseSource(content.githubRelease);\n deps.push(dep);\n }\n // v8 ignore else -- hard to test\n else if ('http' in content && content.http) {\n const dep = extractHttpReleaseSource(content.http);\n deps.push(dep);\n }\n }\n\n if (!deps.length) {\n return null;\n }\n return { deps };\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgB,iBACd,WACA,SACmB;CACnB,IAAI,cAAc,UAAU,WAAW,GAAG,GAMxC,OAAO;EACL,GANU,OACV,GAAG,gBAAgB,UAAU,WAAW,GAAG,EAAE,GAAG,UAAU,KAAK,GAAG,UAAU,WAC5E,OACA,OAGK;EACL,SAAS,UAAU;EACnB,SAAS;EAGT,YAAY;CACd;CAEF,OAAO;EACL,SAAS,UAAU;EACnB,cAAc,UAAU;EACxB,SAAS;EACT,cAAc,CAAC,UAAU,WAAW,GAAG;EACvC,YAAY,eAAe;CAC7B;AACF;AAEA,SAAgB,iBAAiB,WAAsC;CAErE,OAAO;EACL,SAFc,WAAW,UAAU,GAEp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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/vendir/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { regEx } from '../../../util/regex.ts';\nimport { LooseArray } from '../../../util/schema-utils/index.ts';\n\nexport const VendirResource = z.object({\n apiVersion: z.literal('vendir.k14s.io/v1alpha1'),\n kind: z.literal('Config'),\n});\n\nexport const GitRef = z.object({\n ref: z.string(),\n url: z.string().regex(regEx(/^(?:ssh|https?):\\/\\/.+/)),\n depth: z.number().optional(),\n});\n\nexport const GithubRelease = z.object({\n slug: z.string(),\n tag: z.string(),\n});\n\nexport const HelmChart = z.object({\n name: z.string(),\n version: z.string(),\n repository: z.object({\n url: z.string().regex(regEx(/^(?:oci|https?):\\/\\/.+/)),\n }),\n});\n\nexport const HelmChartContent = z.object({\n path: z.string(),\n helmChart: HelmChart,\n});\n\nexport const GitRefContent = z.object({\n path: z.string(),\n git: GitRef,\n});\n\nexport const GithubReleaseContent = z.object({\n path: z.string(),\n githubRelease: GithubRelease,\n});\n\nexport const HttpRelease = z.object({\n url: z.string(),\n});\n\nexport const HttpContent = z.object({\n path: z.string(),\n http: HttpRelease,\n});\n\nexport const Contents = z.union([\n HelmChartContent,\n GitRefContent,\n GithubReleaseContent,\n HttpContent,\n]);\n\nexport const Vendir = VendirResource.extend({\n directories: z.array(\n z.object({\n path: z.string(),\n contents: LooseArray(Contents),\n }),\n ),\n});\n\nexport type
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/vendir/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { regEx } from '../../../util/regex.ts';\nimport { LooseArray } from '../../../util/schema-utils/index.ts';\n\nexport const VendirResource = z.object({\n apiVersion: z.literal('vendir.k14s.io/v1alpha1'),\n kind: z.literal('Config'),\n});\n\nexport const GitRef = z.object({\n ref: z.string(),\n url: z.string().regex(regEx(/^(?:ssh|https?):\\/\\/.+/)),\n depth: z.number().optional(),\n});\n\nexport const GithubRelease = z.object({\n slug: z.string(),\n tag: z.string(),\n});\n\nexport const HelmChart = z.object({\n name: z.string(),\n version: z.string(),\n repository: z.object({\n url: z.string().regex(regEx(/^(?:oci|https?):\\/\\/.+/)),\n }),\n});\n\nexport const HelmChartContent = z.object({\n path: z.string(),\n helmChart: HelmChart,\n});\n\nexport const GitRefContent = z.object({\n path: z.string(),\n git: GitRef,\n});\n\nexport const GithubReleaseContent = z.object({\n path: z.string(),\n githubRelease: GithubRelease,\n});\n\nexport const HttpRelease = z.object({\n url: z.string(),\n});\n\nexport const HttpContent = z.object({\n path: z.string(),\n http: HttpRelease,\n});\n\nexport const Contents = z.union([\n HelmChartContent,\n GitRefContent,\n GithubReleaseContent,\n HttpContent,\n]);\n\nexport const Vendir = VendirResource.extend({\n directories: z.array(\n z.object({\n path: z.string(),\n contents: LooseArray(Contents),\n }),\n ),\n});\n\nexport type Vendir = z.infer<typeof Vendir>;\nexport type HelmChart = z.infer<typeof HelmChart>;\nexport type GitRef = z.infer<typeof GitRef>;\nexport type GithubRelease = z.infer<typeof GithubRelease>;\nexport type HttpRelease = z.infer<typeof HttpRelease>;\n"],"mappings":";;;;AAIA,MAAa,iBAAiB,EAAE,OAAO;CACrC,YAAY,EAAE,QAAQ,yBAAyB;CAC/C,MAAM,EAAE,QAAQ,QAAQ;AAC1B,CAAC;AAED,MAAa,SAAS,EAAE,OAAO;CAC7B,KAAK,EAAE,OAAO;CACd,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,wBAAwB,CAAC;CACrD,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC;AAED,MAAa,gBAAgB,EAAE,OAAO;CACpC,MAAM,EAAE,OAAO;CACf,KAAK,EAAE,OAAO;AAChB,CAAC;AAED,MAAa,YAAY,EAAE,OAAO;CAChC,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO;CAClB,YAAY,EAAE,OAAO,EACnB,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,wBAAwB,CAAC,EACvD,CAAC;AACH,CAAC;AAED,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,EAAE,OAAO;CACf,WAAW;AACb,CAAC;AAED,MAAa,gBAAgB,EAAE,OAAO;CACpC,MAAM,EAAE,OAAO;CACf,KAAK;AACP,CAAC;AAED,MAAa,uBAAuB,EAAE,OAAO;CAC3C,MAAM,EAAE,OAAO;CACf,eAAe;AACjB,CAAC;AAED,MAAa,cAAc,EAAE,OAAO,EAClC,KAAK,EAAE,OAAO,EAChB,CAAC;AAED,MAAa,cAAc,EAAE,OAAO;CAClC,MAAM,EAAE,OAAO;CACf,MAAM;AACR,CAAC;AAED,MAAa,WAAW,EAAE,MAAM;CAC9B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,SAAS,eAAe,OAAO,EAC1C,aAAa,EAAE,MACb,EAAE,OAAO;CACP,MAAM,EAAE,OAAO;CACf,UAAU,WAAW,QAAQ;AAC/B,CAAC,CACH,EACF,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { logger } from "../../../logger/index.js";
|
|
|
4
4
|
import { getQueryString } from "../../../util/url.js";
|
|
5
5
|
import { getCache } from "../../../util/cache/repository/index.js";
|
|
6
6
|
import { repoCacheProvider } from "../../../util/http/cache/repository-http-cache-provider.js";
|
|
7
|
-
import {
|
|
7
|
+
import { GitLabMergeRequests } from "./schema.js";
|
|
8
8
|
import { prInfo } from "./utils.js";
|
|
9
9
|
//#region lib/modules/platform/gitlab/pr-cache.ts
|
|
10
10
|
var GitlabPrCache = class GitlabPrCache {
|
|
@@ -82,7 +82,7 @@ var GitlabPrCache = class GitlabPrCache {
|
|
|
82
82
|
}
|
|
83
83
|
if (!this.ignorePrAuthor) searchParams.scope = "created_by_me";
|
|
84
84
|
const query = getQueryString(searchParams);
|
|
85
|
-
const { body: items } = await http.getJson(`/projects/${this.repo}/merge_requests?${query}`, opts,
|
|
85
|
+
const { body: items } = await http.getJson(`/projects/${this.repo}/merge_requests?${query}`, opts, GitLabMergeRequests);
|
|
86
86
|
if (items.length) {
|
|
87
87
|
for (const item of items) {
|
|
88
88
|
const id = item.iid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-cache.js","names":["memCache.get"],"sources":["../../../../lib/modules/platform/gitlab/pr-cache.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport * as memCache from '../../../util/cache/memory/index.ts';\nimport { getCache } from '../../../util/cache/repository/index.ts';\nimport { repoCacheProvider } from '../../../util/http/cache/repository-http-cache-provider.ts';\nimport type {\n GitlabHttp,\n GitlabHttpOptions,\n} from '../../../util/http/gitlab.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { getQueryString } from '../../../util/url.ts';\nimport {
|
|
1
|
+
{"version":3,"file":"pr-cache.js","names":["memCache.get"],"sources":["../../../../lib/modules/platform/gitlab/pr-cache.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport * as memCache from '../../../util/cache/memory/index.ts';\nimport { getCache } from '../../../util/cache/repository/index.ts';\nimport { repoCacheProvider } from '../../../util/http/cache/repository-http-cache-provider.ts';\nimport type {\n GitlabHttp,\n GitlabHttpOptions,\n} from '../../../util/http/gitlab.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { getQueryString } from '../../../util/url.ts';\nimport { GitLabMergeRequests } from './schema.ts';\nimport type { GitlabPr, GitlabPrCacheData } from './types.ts';\nimport { prInfo } from './utils.ts';\n\nexport class GitlabPrCache {\n private items: GitlabPr[] = [];\n private cache: GitlabPrCacheData;\n private repo: string;\n private ignorePrAuthor: boolean;\n\n private constructor(\n repo: string,\n author: string | null,\n ignorePrAuthor: boolean,\n ) {\n this.repo = repo;\n this.ignorePrAuthor = ignorePrAuthor;\n const repoCache = getCache();\n repoCache.platform ??= {};\n repoCache.platform.gitlab ??= {};\n\n let pullRequestCache = repoCache.platform.gitlab\n .pullRequestsCache as GitlabPrCacheData;\n if (!pullRequestCache) {\n logger.debug('Initializing new PR cache at repository cache');\n pullRequestCache = {\n items: {},\n updated_at: null,\n author,\n };\n } else if (pullRequestCache.author !== author) {\n logger.debug('Resetting PR cache because authors do not match');\n pullRequestCache = {\n items: {},\n updated_at: null,\n author,\n };\n } else if (pullRequestCache.updated_at?.match(regEx(/\\.\\d\\d\\dZ$/))) {\n logger.debug('Resetting PR cache of older format');\n pullRequestCache = {\n items: {},\n updated_at: null,\n author,\n };\n }\n repoCache.platform.gitlab.pullRequestsCache = pullRequestCache;\n this.cache = pullRequestCache;\n this.updateItems();\n }\n\n private static async init(\n http: GitlabHttp,\n repo: string,\n author: string | null,\n ignorePrAuthor: boolean,\n ): Promise<GitlabPrCache> {\n const res = new GitlabPrCache(repo, author, ignorePrAuthor);\n const isSynced = memCache.get<true | undefined>('gitlab-pr-cache-synced');\n\n if (!isSynced) {\n await res.sync(http);\n memCache.set('gitlab-pr-cache-synced', true);\n }\n\n return res;\n }\n\n private getPrs(): GitlabPr[] {\n return this.items;\n }\n\n static async getPrs(\n http: GitlabHttp,\n repo: string,\n author: string | null,\n ignorePrAuthor: boolean,\n ): Promise<GitlabPr[]> {\n const prCache = await GitlabPrCache.init(\n http,\n repo,\n author,\n ignorePrAuthor,\n );\n return prCache.getPrs();\n }\n\n private setPr(pr: GitlabPr): void {\n logger.debug(`Adding PR #${pr.number} to the PR cache`);\n this.cache.items[pr.number] = pr;\n this.updateItems();\n }\n\n static async setPr(\n http: GitlabHttp,\n repo: string,\n author: string | null,\n item: GitlabPr,\n ignorePrAuthor: boolean,\n ): Promise<void> {\n const prCache = await GitlabPrCache.init(\n http,\n repo,\n author,\n ignorePrAuthor,\n );\n prCache.setPr(item);\n }\n\n private async sync(http: GitlabHttp): Promise<GitlabPrCache> {\n logger.debug('Syncing PR list');\n\n const searchParams: Record<string, string> = {\n per_page: '100',\n order_by: 'updated_at',\n sort: 'desc',\n };\n\n const opts: GitlabHttpOptions = { paginate: true };\n\n const updated_after = this.cache.updated_at;\n if (updated_after) {\n opts.cacheProvider = repoCacheProvider;\n searchParams.updated_after = updated_after;\n }\n\n if (!this.ignorePrAuthor) {\n searchParams.scope = 'created_by_me';\n }\n\n const query: string | null = getQueryString(searchParams);\n const { body: items } = await http.getJson(\n `/projects/${this.repo}/merge_requests?${query}`,\n opts,\n GitLabMergeRequests,\n );\n\n if (items.length) {\n for (const item of items) {\n const id = item.iid;\n this.cache.items[id] = prInfo(item);\n }\n\n const [{ updated_at }] = items;\n this.cache.updated_at = updated_at.replace(regEx(/\\.\\d\\d\\dZ$/), 'Z');\n }\n\n this.updateItems();\n\n return this;\n }\n\n /**\n * Ensure the pr cache starts with the most recent PRs.\n */\n private updateItems(): void {\n this.items = Object.values(this.cache.items).sort(\n (a, b) => b.number - a.number,\n );\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,gBAAb,MAAa,cAAc;CACzB,QAA4B,CAAC;CAC7B;CACA;CACA;CAEA,YACE,MACA,QACA,gBACA;EACA,KAAK,OAAO;EACZ,KAAK,iBAAiB;EACtB,MAAM,YAAY,SAAS;EAC3B,UAAU,aAAa,CAAC;EACxB,UAAU,SAAS,WAAW,CAAC;EAE/B,IAAI,mBAAmB,UAAU,SAAS,OACvC;EACH,IAAI,CAAC,kBAAkB;GACrB,OAAO,MAAM,+CAA+C;GAC5D,mBAAmB;IACjB,OAAO,CAAC;IACR,YAAY;IACZ;GACF;EACF,OAAO,IAAI,iBAAiB,WAAW,QAAQ;GAC7C,OAAO,MAAM,iDAAiD;GAC9D,mBAAmB;IACjB,OAAO,CAAC;IACR,YAAY;IACZ;GACF;EACF,OAAO,IAAI,iBAAiB,YAAY,MAAM,MAAM,YAAY,CAAC,GAAG;GAClE,OAAO,MAAM,oCAAoC;GACjD,mBAAmB;IACjB,OAAO,CAAC;IACR,YAAY;IACZ;GACF;EACF;EACA,UAAU,SAAS,OAAO,oBAAoB;EAC9C,KAAK,QAAQ;EACb,KAAK,YAAY;CACnB;CAEA,aAAqB,KACnB,MACA,MACA,QACA,gBACwB;EACxB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;;CAKA,cAA4B;EAC1B,KAAK,QAAQ,OAAO,OAAO,KAAK,MAAM,KAAK,EAAE,MAC1C,GAAG,MAAM,EAAE,SAAS,EAAE,MACzB;CACF;AACF"}
|
|
@@ -2,12 +2,12 @@ import { LooseArray } from "../../../util/schema-utils/index.js";
|
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
//#region lib/modules/platform/gitlab/schema.ts
|
|
4
4
|
const LastPipelineId = z.object({ last_pipeline: z.object({ id: z.number() }) }).transform(({ last_pipeline }) => last_pipeline.id);
|
|
5
|
-
const
|
|
5
|
+
const GitlabUser = z.object({
|
|
6
6
|
id: z.number(),
|
|
7
7
|
username: z.string()
|
|
8
8
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const LongCommitSha = z.string().transform((val) => val);
|
|
10
|
+
const GitLabMergeRequest = z.object({
|
|
11
11
|
iid: z.number(),
|
|
12
12
|
title: z.string(),
|
|
13
13
|
description: z.string().nullable(),
|
|
@@ -18,18 +18,18 @@ const GitLabMergeRequestSchema = z.object({
|
|
|
18
18
|
updated_at: z.string(),
|
|
19
19
|
diverged_commits_count: z.number().optional(),
|
|
20
20
|
merge_status: z.string().optional(),
|
|
21
|
-
assignee:
|
|
22
|
-
assignees: LooseArray(
|
|
23
|
-
reviewers: LooseArray(
|
|
21
|
+
assignee: GitlabUser.nullish(),
|
|
22
|
+
assignees: LooseArray(GitlabUser).catch([]),
|
|
23
|
+
reviewers: LooseArray(GitlabUser).catch([]),
|
|
24
24
|
labels: z.array(z.string()).optional(),
|
|
25
|
-
sha:
|
|
25
|
+
sha: LongCommitSha.nullish(),
|
|
26
26
|
head_pipeline: z.object({
|
|
27
27
|
status: z.string(),
|
|
28
|
-
sha:
|
|
28
|
+
sha: LongCommitSha
|
|
29
29
|
}).nullish()
|
|
30
30
|
});
|
|
31
|
-
const
|
|
31
|
+
const GitLabMergeRequests = z.array(GitLabMergeRequest);
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
33
|
+
export { GitLabMergeRequests, LastPipelineId };
|
|
34
34
|
|
|
35
35
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/platform/gitlab/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport type { LongCommitSha } from '../../../util/git/types.ts';\nimport { LooseArray } from '../../../util/schema-utils/index.ts';\n\nexport const LastPipelineId = z\n .object({\n last_pipeline: z.object({\n id: z.number(),\n }),\n })\n .transform(({ last_pipeline }) => last_pipeline.id);\n\nconst
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/platform/gitlab/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport type { LongCommitSha } from '../../../util/git/types.ts';\nimport { LooseArray } from '../../../util/schema-utils/index.ts';\n\nexport const LastPipelineId = z\n .object({\n last_pipeline: z.object({\n id: z.number(),\n }),\n })\n .transform(({ last_pipeline }) => last_pipeline.id);\n\nconst GitlabUser = z.object({\n id: z.number(),\n username: z.string(),\n});\n\nconst LongCommitSha = z.string().transform((val) => val as LongCommitSha);\n\nexport const GitLabMergeRequest = z.object({\n iid: z.number(),\n title: z.string(),\n description: z.string().nullable(),\n state: z.string(),\n source_branch: z.string(),\n target_branch: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n diverged_commits_count: z.number().optional(),\n merge_status: z.string().optional(),\n assignee: GitlabUser.nullish(),\n assignees: LooseArray(GitlabUser).catch([]),\n reviewers: LooseArray(GitlabUser).catch([]),\n labels: z.array(z.string()).optional(),\n sha: LongCommitSha.nullish(),\n head_pipeline: z\n .object({\n status: z.string(),\n sha: LongCommitSha,\n })\n .nullish(),\n});\n\nexport const GitLabMergeRequests = z.array(GitLabMergeRequest);\nexport type GitLabMergeRequest = z.infer<typeof GitLabMergeRequest>;\n"],"mappings":";;;AAIA,MAAa,iBAAiB,EAC3B,OAAO,EACN,eAAe,EAAE,OAAO,EACtB,IAAI,EAAE,OAAO,EACf,CAAC,EACH,CAAC,EACA,WAAW,EAAE,oBAAoB,cAAc,EAAE;AAEpD,MAAM,aAAa,EAAE,OAAO;CAC1B,IAAI,EAAE,OAAO;CACb,UAAU,EAAE,OAAO;AACrB,CAAC;AAED,MAAM,gBAAgB,EAAE,OAAO,EAAE,WAAW,QAAQ,GAAoB;AAExE,MAAa,qBAAqB,EAAE,OAAO;CACzC,KAAK,EAAE,OAAO;CACd,OAAO,EAAE,OAAO;CAChB,aAAa,EAAE,OAAO,EAAE,SAAS;CACjC,OAAO,EAAE,OAAO;CAChB,eAAe,EAAE,OAAO;CACxB,eAAe,EAAE,OAAO;CACxB,YAAY,EAAE,OAAO;CACrB,YAAY,EAAE,OAAO;CACrB,wBAAwB,EAAE,OAAO,EAAE,SAAS;CAC5C,cAAc,EAAE,OAAO,EAAE,SAAS;CAClC,UAAU,WAAW,QAAQ;CAC7B,WAAW,WAAW,UAAU,EAAE,MAAM,CAAC,CAAC;CAC1C,WAAW,WAAW,UAAU,EAAE,MAAM,CAAC,CAAC;CAC1C,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;CACrC,KAAK,cAAc,QAAQ;CAC3B,eAAe,EACZ,OAAO;EACN,QAAQ,EAAE,OAAO;EACjB,KAAK;CACP,CAAC,EACA,QAAQ;AACb,CAAC;AAED,MAAa,sBAAsB,EAAE,MAAM,kBAAkB"}
|
|
@@ -6,27 +6,27 @@ const User = z.object({
|
|
|
6
6
|
displayName: z.string(),
|
|
7
7
|
name: z.string()
|
|
8
8
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const DefaultBranch = z.object({ defaultBranch: z.string() });
|
|
10
|
+
const Link = z.object({
|
|
11
11
|
href: z.string(),
|
|
12
12
|
name: z.string().optional().nullable(),
|
|
13
13
|
templated: z.boolean().optional().nullable()
|
|
14
14
|
});
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const Links = z.record(z.string(), z.union([Link, z.array(Link)]));
|
|
16
|
+
const PrState = z.enum([
|
|
17
17
|
"DRAFT",
|
|
18
18
|
"OPEN",
|
|
19
19
|
"REJECTED",
|
|
20
20
|
"MERGED"
|
|
21
21
|
]);
|
|
22
|
-
const
|
|
22
|
+
const PrMergeMethod = z.enum([
|
|
23
23
|
"MERGE_COMMIT",
|
|
24
24
|
"REBASE",
|
|
25
25
|
"FAST_FORWARD_IF_POSSIBLE",
|
|
26
26
|
"FAST_FORWARD_ONLY",
|
|
27
27
|
"SQUASH"
|
|
28
28
|
]);
|
|
29
|
-
const
|
|
29
|
+
const PullRequest = z.object({
|
|
30
30
|
id: z.string(),
|
|
31
31
|
author: z.object({
|
|
32
32
|
mail: z.string().optional().nullable(),
|
|
@@ -44,7 +44,7 @@ const PullRequestSchema = z.object({
|
|
|
44
44
|
description: z.string().optional().nullable(),
|
|
45
45
|
creationDate: z.string(),
|
|
46
46
|
lastModified: z.string().optional().nullable(),
|
|
47
|
-
status:
|
|
47
|
+
status: PrState,
|
|
48
48
|
reviewer: z.array(z.object({
|
|
49
49
|
id: z.string(),
|
|
50
50
|
displayName: z.string(),
|
|
@@ -56,37 +56,37 @@ const PullRequestSchema = z.object({
|
|
|
56
56
|
todo: z.number(),
|
|
57
57
|
done: z.number()
|
|
58
58
|
}),
|
|
59
|
-
_links:
|
|
59
|
+
_links: Links,
|
|
60
60
|
_embedded: z.object({ defaultConfig: z.object({
|
|
61
|
-
mergeStrategy:
|
|
61
|
+
mergeStrategy: PrMergeMethod,
|
|
62
62
|
deleteBranchOnMerge: z.boolean()
|
|
63
63
|
}) })
|
|
64
64
|
});
|
|
65
|
-
const
|
|
65
|
+
const RepoType = z.enum([
|
|
66
66
|
"git",
|
|
67
67
|
"svn",
|
|
68
68
|
"hg"
|
|
69
69
|
]);
|
|
70
|
-
const
|
|
70
|
+
const Repo = z.object({
|
|
71
71
|
contact: z.string().optional().nullable(),
|
|
72
72
|
creationDate: z.string().optional().nullable(),
|
|
73
73
|
description: z.string().optional().nullable(),
|
|
74
74
|
lastModified: z.string().optional().nullable(),
|
|
75
75
|
namespace: z.string(),
|
|
76
76
|
name: z.string(),
|
|
77
|
-
type:
|
|
77
|
+
type: RepoType,
|
|
78
78
|
archived: z.boolean(),
|
|
79
79
|
exporting: z.boolean(),
|
|
80
80
|
healthCheckRunning: z.boolean(),
|
|
81
|
-
_links:
|
|
81
|
+
_links: Links
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const Paged = z.object({
|
|
84
84
|
page: z.number(),
|
|
85
85
|
pageTotal: z.number()
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
const
|
|
87
|
+
const PagedPullRequest = Paged.extend({ _embedded: z.object({ pullRequests: z.array(PullRequest) }) });
|
|
88
|
+
const PagedRepo = Paged.extend({ _embedded: z.object({ repositories: z.array(Repo) }) });
|
|
89
89
|
//#endregion
|
|
90
|
-
export {
|
|
90
|
+
export { DefaultBranch, PagedPullRequest, PagedRepo, PullRequest, Repo, User };
|
|
91
91
|
|
|
92
92
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/platform/scm-manager/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { EmailAddress } from '../../../util/schema-utils/index.ts';\n\nexport const User = z.object({\n mail: EmailAddress,\n displayName: z.string(),\n name: z.string(),\n});\nexport type User = z.infer<typeof User>;\n\nexport const
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/platform/scm-manager/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { EmailAddress } from '../../../util/schema-utils/index.ts';\n\nexport const User = z.object({\n mail: EmailAddress,\n displayName: z.string(),\n name: z.string(),\n});\nexport type User = z.infer<typeof User>;\n\nexport const DefaultBranch = z.object({\n defaultBranch: z.string(),\n});\n\nexport const Link = z.object({\n href: z.string(),\n name: z.string().optional().nullable(),\n templated: z.boolean().optional().nullable(),\n});\nexport type Link = z.infer<typeof Link>;\n\nexport const Links = z.record(z.string(), z.union([Link, z.array(Link)]));\nexport type Links = z.infer<typeof Links>;\n\nexport const PrState = z.enum(['DRAFT', 'OPEN', 'REJECTED', 'MERGED']);\nexport type PrState = z.infer<typeof PrState>;\n\nexport const PrMergeMethod = z.enum([\n 'MERGE_COMMIT',\n 'REBASE',\n 'FAST_FORWARD_IF_POSSIBLE',\n 'FAST_FORWARD_ONLY',\n 'SQUASH',\n]);\nexport type PrMergeMethod = z.infer<typeof PrMergeMethod>;\n\nexport const PullRequest = z.object({\n id: z.string(),\n author: z\n .object({\n mail: z.string().optional().nullable(),\n displayName: z.string(),\n id: z.string(),\n })\n .optional()\n .nullable(),\n reviser: z\n .object({\n id: z.string().optional().nullable(),\n displayName: z.string().optional().nullable(),\n })\n .optional()\n .nullable(),\n closeDate: z.string().optional().nullable(),\n source: z.string(),\n target: z.string(),\n title: z.string(),\n description: z.string().optional().nullable(),\n creationDate: z.string(),\n lastModified: z.string().optional().nullable(),\n status: PrState,\n reviewer: z\n .array(\n z.object({\n id: z.string(),\n displayName: z.string(),\n mail: z.string().optional().nullable(),\n approved: z.boolean(),\n }),\n )\n .optional()\n .nullable(),\n labels: z.string().array(),\n tasks: z.object({\n todo: z.number(),\n done: z.number(),\n }),\n _links: Links,\n _embedded: z.object({\n defaultConfig: z.object({\n mergeStrategy: PrMergeMethod,\n deleteBranchOnMerge: z.boolean(),\n }),\n }),\n});\nexport type PullRequest = z.infer<typeof PullRequest>;\n\nconst RepoType = z.enum(['git', 'svn', 'hg']);\n\nexport const Repo = z.object({\n contact: z.string().optional().nullable(),\n creationDate: z.string().optional().nullable(),\n description: z.string().optional().nullable(),\n lastModified: z.string().optional().nullable(),\n namespace: z.string(),\n name: z.string(),\n type: RepoType,\n archived: z.boolean(),\n exporting: z.boolean(),\n healthCheckRunning: z.boolean(),\n _links: Links,\n});\nexport type Repo = z.infer<typeof Repo>;\n\nconst Paged = z.object({\n page: z.number(),\n pageTotal: z.number(),\n});\n\nexport const PagedPullRequest = Paged.extend({\n _embedded: z.object({\n pullRequests: z.array(PullRequest),\n }),\n});\n\nexport const PagedRepo = Paged.extend({\n _embedded: z.object({\n repositories: z.array(Repo),\n }),\n});\n"],"mappings":";;;AAGA,MAAa,OAAO,EAAE,OAAO;CAC3B,MAAM;CACN,aAAa,EAAE,OAAO;CACtB,MAAM,EAAE,OAAO;AACjB,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EACpC,eAAe,EAAE,OAAO,EAC1B,CAAC;AAED,MAAa,OAAO,EAAE,OAAO;CAC3B,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;CACrC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;AAC7C,CAAC;AAGD,MAAa,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;AAGxE,MAAa,UAAU,EAAE,KAAK;CAAC;CAAS;CAAQ;CAAY;AAAQ,CAAC;AAGrE,MAAa,gBAAgB,EAAE,KAAK;CAClC;CACA;CACA;CACA;CACA;AACF,CAAC;AAGD,MAAa,cAAc,EAAE,OAAO;CAClC,IAAI,EAAE,OAAO;CACb,QAAQ,EACL,OAAO;EACN,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;EACrC,aAAa,EAAE,OAAO;EACtB,IAAI,EAAE,OAAO;CACf,CAAC,EACA,SAAS,EACT,SAAS;CACZ,SAAS,EACN,OAAO;EACN,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;EACnC,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;CAC9C,CAAC,EACA,SAAS,EACT,SAAS;CACZ,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;CAC1C,QAAQ,EAAE,OAAO;CACjB,QAAQ,EAAE,OAAO;CACjB,OAAO,EAA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C;AAED,MAAa,YAAY,MAAM,OAAO,EACpC,WAAW,EAAE,OAAO,EAClB,cAAc,EAAE,MAAM,IAAI,EAC5B,CAAC,EACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScmManagerHttp } from "../../../util/http/scm-manager.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DefaultBranch, PagedPullRequest, PagedRepo, PullRequest, Repo, User } from "./schema.js";
|
|
3
3
|
//#region lib/modules/platform/scm-manager/scm-manager-helper.ts
|
|
4
4
|
const scmManagerHttp = new ScmManagerHttp();
|
|
5
5
|
const URLS = {
|
|
@@ -26,20 +26,20 @@ async function getCurrentUser(token) {
|
|
|
26
26
|
}, User)).body;
|
|
27
27
|
}
|
|
28
28
|
async function getRepo(repoPath) {
|
|
29
|
-
return (await scmManagerHttp.getJson(URLS.REPO(repoPath), { headers: { accept: CONTENT_TYPES.REPOSITORY } },
|
|
29
|
+
return (await scmManagerHttp.getJson(URLS.REPO(repoPath), { headers: { accept: CONTENT_TYPES.REPOSITORY } }, Repo)).body;
|
|
30
30
|
}
|
|
31
31
|
async function getAllRepos() {
|
|
32
|
-
return (await scmManagerHttp.getJson(URLS.ALL_REPOS, { headers: { accept: CONTENT_TYPES.REPOSITORIES } },
|
|
32
|
+
return (await scmManagerHttp.getJson(URLS.ALL_REPOS, { headers: { accept: CONTENT_TYPES.REPOSITORIES } }, PagedRepo)).body._embedded.repositories;
|
|
33
33
|
}
|
|
34
34
|
async function getDefaultBranch(repo) {
|
|
35
35
|
const defaultBranchUrl = repo._links.defaultBranch;
|
|
36
|
-
return (await scmManagerHttp.getJson(defaultBranchUrl.href, { headers: { accept: CONTENT_TYPES.GIT_CONFIG } },
|
|
36
|
+
return (await scmManagerHttp.getJson(defaultBranchUrl.href, { headers: { accept: CONTENT_TYPES.GIT_CONFIG } }, DefaultBranch)).body.defaultBranch;
|
|
37
37
|
}
|
|
38
38
|
async function getAllRepoPrs(repoPath, ignorePrAuthor) {
|
|
39
|
-
return (await scmManagerHttp.getJson(ignorePrAuthor ? URLS.ALL_PULLREQUESTS_WITH_PAGINATION(repoPath) : URLS.MY_PULLREQUESTS_WITH_PAGINATION(repoPath), { headers: { accept: CONTENT_TYPES.PULLREQUESTS } },
|
|
39
|
+
return (await scmManagerHttp.getJson(ignorePrAuthor ? URLS.ALL_PULLREQUESTS_WITH_PAGINATION(repoPath) : URLS.MY_PULLREQUESTS_WITH_PAGINATION(repoPath), { headers: { accept: CONTENT_TYPES.PULLREQUESTS } }, PagedPullRequest)).body._embedded.pullRequests;
|
|
40
40
|
}
|
|
41
41
|
async function getRepoPr(repoPath, id) {
|
|
42
|
-
return (await scmManagerHttp.getJson(URLS.PULLREQUEST_BY_ID(repoPath, id), { headers: { accept: CONTENT_TYPES.PULLREQUEST } },
|
|
42
|
+
return (await scmManagerHttp.getJson(URLS.PULLREQUEST_BY_ID(repoPath, id), { headers: { accept: CONTENT_TYPES.PULLREQUEST } }, PullRequest)).body;
|
|
43
43
|
}
|
|
44
44
|
async function createScmPr(repoPath, params) {
|
|
45
45
|
const createPrResponse = await scmManagerHttp.postJson(URLS.PULLREQUESTS(repoPath), {
|
|
@@ -49,7 +49,7 @@ async function createScmPr(repoPath, params) {
|
|
|
49
49
|
accept: CONTENT_TYPES.PULLREQUEST
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
return (await scmManagerHttp.getJson(createPrResponse.headers.location, { headers: { accept: CONTENT_TYPES.PULLREQUEST } },
|
|
52
|
+
return (await scmManagerHttp.getJson(createPrResponse.headers.location, { headers: { accept: CONTENT_TYPES.PULLREQUEST } }, PullRequest)).body;
|
|
53
53
|
}
|
|
54
54
|
async function updateScmPr(repoPath, id, params) {
|
|
55
55
|
const currentPr = await getRepoPr(repoPath, id);
|