renovate 44.68.3 → 44.69.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,9 +1,16 @@
1
1
  import { logger } from "../../../logger/index.js";
2
2
  import { ensureTrailingSlash } from "../../../util/url.js";
3
+ import { find } from "../../../util/host-rules.js";
4
+ import { parseSingleYaml } from "../../../util/yaml.js";
5
+ import { ExternalHostError } from "../../../types/errors/external-host-error.js";
3
6
  import { id } from "../../versioning/helm/index.js";
4
7
  import { withCache } from "../../../util/cache/package/with-cache.js";
5
8
  import { Datasource } from "../datasource.js";
9
+ import { getS3Client, parseS3Url } from "../../../util/s3.js";
10
+ import { streamToString } from "../../../util/streams.js";
6
11
  import { HelmRepository } from "./schema.js";
12
+ import { Readable } from "node:stream";
13
+ import { GetObjectCommand } from "@aws-sdk/client-s3";
7
14
  //#region lib/modules/datasource/helm/index.ts
8
15
  var HelmDatasource = class HelmDatasource extends Datasource {
9
16
  static id = "helm";
@@ -18,7 +25,11 @@ var HelmDatasource = class HelmDatasource extends Datasource {
18
25
  sourceUrlSupport = "package";
19
26
  sourceUrlNote = "The source URL is determined from the `home` field or the `sources` field in the results.";
20
27
  async _getRepositoryData(helmRepository) {
21
- const { val, err } = await this.http.getYamlSafe("index.yaml", { baseUrl: ensureTrailingSlash(helmRepository) }, HelmRepository).unwrap();
28
+ const baseUrl = ensureTrailingSlash(helmRepository);
29
+ const indexUrl = `${baseUrl}index.yaml`;
30
+ const s3Url = parseS3Url(indexUrl);
31
+ if (s3Url) return await getS3RepositoryData(s3Url, indexUrl);
32
+ const { val, err } = await this.http.getYamlSafe("index.yaml", { baseUrl }, HelmRepository).unwrap();
22
33
  if (err) this.handleGenericErrors(err);
23
34
  return val;
24
35
  }
@@ -39,6 +50,58 @@ var HelmDatasource = class HelmDatasource extends Datasource {
39
50
  return releases;
40
51
  }
41
52
  };
53
+ async function getS3RepositoryData(s3Url, indexUrl) {
54
+ const client = getS3Client(void 0, void 0, getS3Credentials(indexUrl));
55
+ let res;
56
+ try {
57
+ res = await client.send(new GetObjectCommand(s3Url));
58
+ } catch (err) {
59
+ throw classifyS3Error(err, indexUrl);
60
+ }
61
+ if (res.DeleteMarker) {
62
+ logger.debug({ indexUrl }, "Helm S3 lookup error: DeleteMarker encountered");
63
+ throw new Error(`No index.yaml found at ${indexUrl}`);
64
+ }
65
+ if (!(res.Body instanceof Readable)) {
66
+ logger.debug({ indexUrl }, "Helm S3 lookup error: unsupported Body type");
67
+ throw new Error(`Unsupported S3 response body for ${indexUrl}`);
68
+ }
69
+ return parseSingleYaml(await streamToString(res.Body), { customSchema: HelmRepository });
70
+ }
71
+ /**
72
+ * Only a missing object means "this chart repository has no releases", so that
73
+ * error is rethrown as-is and the lookup resolves to `null`.
74
+ * Everything else becomes an `ExternalHostError` to abort the run, otherwise a
75
+ * transient S3 failure looks like a deleted chart and closes open PRs.
76
+ */
77
+ function classifyS3Error(err, indexUrl) {
78
+ if (err.name === "NotFound" || err.name === "NoSuchKey") {
79
+ logger.debug({ indexUrl }, "Helm S3 lookup error: object not found");
80
+ return err;
81
+ }
82
+ if (err.name === "CredentialsProviderError" || err.$metadata?.httpStatusCode === 403) logger.debug({
83
+ indexUrl,
84
+ err
85
+ }, "Helm S3 lookup error: credentials error, check \"AWS_ACCESS_KEY_ID\" and \"AWS_SECRET_ACCESS_KEY\" variables or the matching `hostRules` entry");
86
+ else if (err.message === "Region is missing") logger.debug({ indexUrl }, "Helm S3 lookup error: missing region, check \"AWS_REGION\" variable");
87
+ else logger.debug({
88
+ indexUrl,
89
+ err
90
+ }, "Helm S3 lookup error: unknown error");
91
+ return new ExternalHostError(err, HelmDatasource.id);
92
+ }
93
+ function getS3Credentials(indexUrl) {
94
+ const { username, password, token } = find({
95
+ hostType: HelmDatasource.id,
96
+ url: indexUrl
97
+ });
98
+ if (!username || !password) return;
99
+ return {
100
+ accessKeyId: username,
101
+ secretAccessKey: password,
102
+ sessionToken: token
103
+ };
104
+ }
42
105
  //#endregion
43
106
  export { HelmDatasource };
44
107
 
@@ -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 { 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 -- 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,CAAC,CACA,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,EAAA,CAClC;EAChC,IAAI,CAAC,UAAU;GACb,OAAO,MACL,EAAE,YAAY,YAAY,GAC1B,SAAS,YAAY,oCAAoC,gBAC3D;GACA,OAAO;EACT;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"index.js","names":["helmVersioning.id","hostRules.find"],"sources":["../../../../lib/modules/datasource/helm/index.ts"],"sourcesContent":["import { Readable } from 'node:stream';\nimport type {\n GetObjectCommandOutput,\n S3ClientConfig,\n} from '@aws-sdk/client-s3';\nimport { GetObjectCommand } from '@aws-sdk/client-s3';\nimport { logger } from '../../../logger/index.ts';\nimport { ExternalHostError } from '../../../types/errors/external-host-error.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport * as hostRules from '../../../util/host-rules.ts';\nimport type { S3UrlParts } from '../../../util/s3.ts';\nimport { getS3Client, parseS3Url } from '../../../util/s3.ts';\nimport { streamToString } from '../../../util/streams.ts';\nimport { ensureTrailingSlash } from '../../../util/url.ts';\nimport { parseSingleYaml } from '../../../util/yaml.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 baseUrl = ensureTrailingSlash(helmRepository);\n const indexUrl = `${baseUrl}index.yaml`;\n\n const s3Url = parseS3Url(indexUrl);\n if (s3Url) {\n return await getS3RepositoryData(s3Url, indexUrl);\n }\n\n const { val, err } = await this.http\n .getYamlSafe('index.yaml', { baseUrl }, HelmRepository)\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 -- 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\nasync function getS3RepositoryData(\n s3Url: S3UrlParts,\n indexUrl: string,\n): Promise<HelmRepository> {\n const client = getS3Client(undefined, undefined, getS3Credentials(indexUrl));\n\n let res: GetObjectCommandOutput;\n try {\n res = await client.send(new GetObjectCommand(s3Url));\n } catch (err) {\n throw classifyS3Error(err, indexUrl);\n }\n\n if (res.DeleteMarker) {\n logger.debug(\n { indexUrl },\n 'Helm S3 lookup error: DeleteMarker encountered',\n );\n throw new Error(`No index.yaml found at ${indexUrl}`);\n }\n\n if (!(res.Body instanceof Readable)) {\n logger.debug({ indexUrl }, 'Helm S3 lookup error: unsupported Body type');\n throw new Error(`Unsupported S3 response body for ${indexUrl}`);\n }\n\n return parseSingleYaml(await streamToString(res.Body), {\n customSchema: HelmRepository,\n });\n}\n\n/**\n * Only a missing object means \"this chart repository has no releases\", so that\n * error is rethrown as-is and the lookup resolves to `null`.\n * Everything else becomes an `ExternalHostError` to abort the run, otherwise a\n * transient S3 failure looks like a deleted chart and closes open PRs.\n */\nfunction classifyS3Error(\n // `name` holds the S3 error code, `message` holds server-supplied prose\n err: Error & { $metadata?: { httpStatusCode?: number } },\n indexUrl: string,\n): Error {\n if (err.name === 'NotFound' || err.name === 'NoSuchKey') {\n logger.debug({ indexUrl }, 'Helm S3 lookup error: object not found');\n return err;\n }\n\n if (\n err.name === 'CredentialsProviderError' ||\n err.$metadata?.httpStatusCode === 403\n ) {\n logger.debug(\n { indexUrl, err },\n 'Helm S3 lookup error: credentials error, check \"AWS_ACCESS_KEY_ID\" and \"AWS_SECRET_ACCESS_KEY\" variables or the matching `hostRules` entry',\n );\n } else if (err.message === 'Region is missing') {\n // Thrown client-side by the SDK region resolver, so this string is stable\n logger.debug(\n { indexUrl },\n 'Helm S3 lookup error: missing region, check \"AWS_REGION\" variable',\n );\n } else {\n logger.debug({ indexUrl, err }, 'Helm S3 lookup error: unknown error');\n }\n\n return new ExternalHostError(err, HelmDatasource.id);\n}\n\nfunction getS3Credentials(\n indexUrl: string,\n): S3ClientConfig['credentials'] | undefined {\n const { username, password, token } = hostRules.find({\n hostType: HelmDatasource.id,\n url: indexUrl,\n });\n\n // Fall back to the default AWS credential provider chain\n if (!username || !password) {\n return undefined;\n }\n\n return {\n accessKeyId: username,\n secretAccessKey: password,\n sessionToken: token,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,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,UAAU,oBAAoB,cAAc;EAClD,MAAM,WAAW,GAAG,QAAQ;EAE5B,MAAM,QAAQ,WAAW,QAAQ;EACjC,IAAI,OACF,OAAO,MAAM,oBAAoB,OAAO,QAAQ;EAGlD,MAAM,EAAE,KAAK,QAAQ,MAAM,KAAK,KAC7B,YAAY,cAAc,EAAE,QAAQ,GAAG,cAAc,CAAC,CACtD,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,EAAA,CAClC;EAChC,IAAI,CAAC,UAAU;GACb,OAAO,MACL,EAAE,YAAY,YAAY,GAC1B,SAAS,YAAY,oCAAoC,gBAC3D;GACA,OAAO;EACT;EACA,OAAO;CACT;AACF;AAEA,eAAe,oBACb,OACA,UACyB;CACzB,MAAM,SAAS,YAAY,KAAA,GAAW,KAAA,GAAW,iBAAiB,QAAQ,CAAC;CAE3E,IAAI;CACJ,IAAI;EACF,MAAM,MAAM,OAAO,KAAK,IAAI,iBAAiB,KAAK,CAAC;CACrD,SAAS,KAAK;EACZ,MAAM,gBAAgB,KAAK,QAAQ;CACrC;CAEA,IAAI,IAAI,cAAc;EACpB,OAAO,MACL,EAAE,SAAS,GACX,gDACF;EACA,MAAM,IAAI,MAAM,0BAA0B,UAAU;CACtD;CAEA,IAAI,EAAE,IAAI,gBAAgB,WAAW;EACnC,OAAO,MAAM,EAAE,SAAS,GAAG,6CAA6C;EACxE,MAAM,IAAI,MAAM,oCAAoC,UAAU;CAChE;CAEA,OAAO,gBAAgB,MAAM,eAAe,IAAI,IAAI,GAAG,EACrD,cAAc,eAChB,CAAC;AACH;;;;;;;AAQA,SAAS,gBAEP,KACA,UACO;CACP,IAAI,IAAI,SAAS,cAAc,IAAI,SAAS,aAAa;EACvD,OAAO,MAAM,EAAE,SAAS,GAAG,wCAAwC;EACnE,OAAO;CACT;CAEA,IACE,IAAI,SAAS,8BACb,IAAI,WAAW,mBAAmB,KAElC,OAAO,MACL;EAAE;EAAU;CAAI,GAChB,gJACF;MACK,IAAI,IAAI,YAAY,qBAEzB,OAAO,MACL,EAAE,SAAS,GACX,qEACF;MAEA,OAAO,MAAM;EAAE;EAAU;CAAI,GAAG,qCAAqC;CAGvE,OAAO,IAAI,kBAAkB,KAAK,eAAe,EAAE;AACrD;AAEA,SAAS,iBACP,UAC2C;CAC3C,MAAM,EAAE,UAAU,UAAU,UAAUC,KAAe;EACnD,UAAU,eAAe;EACzB,KAAK;CACP,CAAC;CAGD,IAAI,CAAC,YAAY,CAAC,UAChB;CAGF,OAAO;EACL,aAAa;EACb,iBAAiB;EACjB,cAAc;CAChB;AACF"}
package/dist/util/s3.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S3Client } from "@aws-sdk/client-s3";
1
+ import { S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
2
2
  //#region lib/util/s3.d.ts
3
- declare function getS3Client(s3Endpoint?: string, s3PathStyle?: boolean): S3Client;
3
+ declare function getS3Client(s3Endpoint?: string, s3PathStyle?: boolean, credentials?: S3ClientConfig['credentials']): S3Client;
4
4
  interface S3UrlParts {
5
5
  Bucket: string;
6
6
  Key: string;
package/dist/util/s3.js CHANGED
@@ -4,17 +4,20 @@ import { isString, isUndefined } from "@sindresorhus/is";
4
4
  import { S3Client } from "@aws-sdk/client-s3";
5
5
  //#region lib/util/s3.ts
6
6
  let s3Instance;
7
- function getS3Client(s3Endpoint, s3PathStyle) {
8
- if (!s3Instance) {
9
- const endpoint = s3Endpoint ?? GlobalConfig.get("s3Endpoint");
10
- const forcePathStyle = isUndefined(s3PathStyle) ? !!GlobalConfig.get("s3PathStyle") : s3PathStyle;
11
- s3Instance = new S3Client({
12
- ...endpoint && { endpoint },
13
- ...forcePathStyle && { forcePathStyle: true }
14
- });
15
- }
7
+ function getS3Client(s3Endpoint, s3PathStyle, credentials) {
8
+ if (credentials) return newS3Client(s3Endpoint, s3PathStyle, credentials);
9
+ s3Instance ??= newS3Client(s3Endpoint, s3PathStyle);
16
10
  return s3Instance;
17
11
  }
12
+ function newS3Client(s3Endpoint, s3PathStyle, credentials) {
13
+ const endpoint = s3Endpoint ?? GlobalConfig.get("s3Endpoint");
14
+ const forcePathStyle = isUndefined(s3PathStyle) ? !!GlobalConfig.get("s3PathStyle") : s3PathStyle;
15
+ return new S3Client({
16
+ ...endpoint && { endpoint },
17
+ ...forcePathStyle && { forcePathStyle: true },
18
+ ...credentials && { credentials }
19
+ });
20
+ }
18
21
  function parseS3Url(rawUrl) {
19
22
  const parsedUrl = isString(rawUrl) ? parseUrl(rawUrl) : rawUrl;
20
23
  if (parsedUrl === null) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"s3.js","names":[],"sources":["../../lib/util/s3.ts"],"sourcesContent":["// Singleton S3 instance initialized on-demand.\nimport { S3Client } from '@aws-sdk/client-s3';\nimport { isString, isUndefined } from '@sindresorhus/is';\nimport { GlobalConfig } from '../config/global.ts';\nimport { parseUrl } from './url.ts';\n\nlet s3Instance: S3Client | undefined;\nexport function getS3Client(\n // Only needed if GlobalConfig is not initialized due to some error\n s3Endpoint?: string,\n s3PathStyle?: boolean,\n): S3Client {\n if (!s3Instance) {\n const endpoint = s3Endpoint ?? GlobalConfig.get('s3Endpoint');\n const forcePathStyle = isUndefined(s3PathStyle)\n ? !!GlobalConfig.get('s3PathStyle')\n : s3PathStyle;\n s3Instance = new S3Client({\n ...(endpoint && { endpoint }),\n ...(forcePathStyle && { forcePathStyle: true }),\n });\n }\n return s3Instance;\n}\n\nexport interface S3UrlParts {\n Bucket: string;\n Key: string;\n}\n\nexport function parseS3Url(rawUrl: URL | string): S3UrlParts | null {\n const parsedUrl = isString(rawUrl) ? parseUrl(rawUrl) : rawUrl;\n if (parsedUrl === null) {\n return null;\n }\n if (parsedUrl.protocol !== 's3:') {\n return null;\n }\n return {\n Bucket: parsedUrl.host,\n Key: parsedUrl.pathname.substring(1),\n };\n}\n"],"mappings":";;;;;AAMA,IAAI;AACJ,SAAgB,YAEd,YACA,aACU;CACV,IAAI,CAAC,YAAY;EACf,MAAM,WAAW,cAAc,aAAa,IAAI,YAAY;EAC5D,MAAM,iBAAiB,YAAY,WAAW,IAC1C,CAAC,CAAC,aAAa,IAAI,aAAa,IAChC;EACJ,aAAa,IAAI,SAAS;GACxB,GAAI,YAAY,EAAE,SAAS;GAC3B,GAAI,kBAAkB,EAAE,gBAAgB,KAAK;EAC/C,CAAC;CACH;CACA,OAAO;AACT;AAOA,SAAgB,WAAW,QAAyC;CAClE,MAAM,YAAY,SAAS,MAAM,IAAI,SAAS,MAAM,IAAI;CACxD,IAAI,cAAc,MAChB,OAAO;CAET,IAAI,UAAU,aAAa,OACzB,OAAO;CAET,OAAO;EACL,QAAQ,UAAU;EAClB,KAAK,UAAU,SAAS,UAAU,CAAC;CACrC;AACF"}
1
+ {"version":3,"file":"s3.js","names":[],"sources":["../../lib/util/s3.ts"],"sourcesContent":["// Singleton S3 instance initialized on-demand.\nimport type { S3ClientConfig } from '@aws-sdk/client-s3';\nimport { S3Client } from '@aws-sdk/client-s3';\nimport { isString, isUndefined } from '@sindresorhus/is';\nimport { GlobalConfig } from '../config/global.ts';\nimport { parseUrl } from './url.ts';\n\nlet s3Instance: S3Client | undefined;\nexport function getS3Client(\n // Only needed if GlobalConfig is not initialized due to some error\n s3Endpoint?: string,\n s3PathStyle?: boolean,\n credentials?: S3ClientConfig['credentials'],\n): S3Client {\n // Credentials come from host rules, so such clients must not be shared\n if (credentials) {\n return newS3Client(s3Endpoint, s3PathStyle, credentials);\n }\n\n s3Instance ??= newS3Client(s3Endpoint, s3PathStyle);\n return s3Instance;\n}\n\nfunction newS3Client(\n s3Endpoint: string | undefined,\n s3PathStyle: boolean | undefined,\n credentials?: S3ClientConfig['credentials'],\n): S3Client {\n const endpoint = s3Endpoint ?? GlobalConfig.get('s3Endpoint');\n const forcePathStyle = isUndefined(s3PathStyle)\n ? !!GlobalConfig.get('s3PathStyle')\n : s3PathStyle;\n return new S3Client({\n ...(endpoint && { endpoint }),\n ...(forcePathStyle && { forcePathStyle: true }),\n ...(credentials && { credentials }),\n });\n}\n\nexport interface S3UrlParts {\n Bucket: string;\n Key: string;\n}\n\nexport function parseS3Url(rawUrl: URL | string): S3UrlParts | null {\n const parsedUrl = isString(rawUrl) ? parseUrl(rawUrl) : rawUrl;\n if (parsedUrl === null) {\n return null;\n }\n if (parsedUrl.protocol !== 's3:') {\n return null;\n }\n return {\n Bucket: parsedUrl.host,\n Key: parsedUrl.pathname.substring(1),\n };\n}\n"],"mappings":";;;;;AAOA,IAAI;AACJ,SAAgB,YAEd,YACA,aACA,aACU;CAEV,IAAI,aACF,OAAO,YAAY,YAAY,aAAa,WAAW;CAGzD,eAAe,YAAY,YAAY,WAAW;CAClD,OAAO;AACT;AAEA,SAAS,YACP,YACA,aACA,aACU;CACV,MAAM,WAAW,cAAc,aAAa,IAAI,YAAY;CAC5D,MAAM,iBAAiB,YAAY,WAAW,IAC1C,CAAC,CAAC,aAAa,IAAI,aAAa,IAChC;CACJ,OAAO,IAAI,SAAS;EAClB,GAAI,YAAY,EAAE,SAAS;EAC3B,GAAI,kBAAkB,EAAE,gBAAgB,KAAK;EAC7C,GAAI,eAAe,EAAE,YAAY;CACnC,CAAC;AACH;AAOA,SAAgB,WAAW,QAAyC;CAClE,MAAM,YAAY,SAAS,MAAM,IAAI,SAAS,MAAM,IAAI;CACxD,IAAI,cAAc,MAChB,OAAO;CAET,IAAI,UAAU,aAAa,OACzB,OAAO;CAET,OAAO;EACL,QAAQ,UAAU;EAClB,KAAK,UAAU,SAAS,UAAU,CAAC;CACrC;AACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "renovate",
3
3
  "description": "Automated dependency updates. Flexible so you don't need to be.",
4
- "version": "44.68.3",
4
+ "version": "44.69.0",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$id": "https://docs.renovatebot.com/renovate-schema.json",
3
- "title": "JSON schema for Renovate 44.68.3 config files (https://renovatebot.com/)",
3
+ "title": "JSON schema for Renovate 44.69.0 config files (https://renovatebot.com/)",
4
4
  "$schema": "http://json-schema.org/draft-07/schema#",
5
- "x-renovate-version": "44.68.3",
5
+ "x-renovate-version": "44.69.0",
6
6
  "allowComments": true,
7
7
  "type": "object",
8
8
  "definitions": {