@4cloudguru/pipeline-task-ado 0.3.0 → 0.4.1

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/index.cjs CHANGED
@@ -9,8 +9,8 @@ function getBoolInputDefaultTrue(name) {
9
9
  const raw = task_js.getInput(name, false);
10
10
  return raw === void 0 || raw.trim() === "" ? true : raw.trim().toLowerCase() !== "false";
11
11
  }
12
- function buildAdoFetchOptions() {
13
- const resolved = pipelineTaskCore.resolveProxy(task_js.getHttpProxyConfiguration());
12
+ function buildAdoFetchOptions(url) {
13
+ const resolved = pipelineTaskCore.resolveProxy(task_js.getHttpProxyConfiguration(url));
14
14
  if (!resolved) return {};
15
15
  for (const secret of resolved.secrets) {
16
16
  task_js.setSecret(secret);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input/bool-input.ts","../src/http/ado-http.ts"],"names":["getInput","resolveProxy","getHttpProxyConfiguration","setSecret","ProxyAgent","createHttpClient","debug"],"mappings":";;;;;;;AAYO,SAAS,wBAAwB,IAAA,EAAuB;AAC7D,EAAA,MAAM,GAAA,GAAMA,gBAAA,CAAS,IAAA,EAAM,KAAK,CAAA;AAChC,EAAA,OAAO,GAAA,KAAQ,MAAA,IAAa,GAAA,CAAI,IAAA,EAAK,KAAM,EAAA,GAAK,IAAA,GAAO,GAAA,CAAI,IAAA,EAAK,CAAE,WAAA,EAAY,KAAM,OAAA;AACtF;ACOO,SAAS,oBAAA,GAAoC;AAClD,EAAA,MAAM,QAAA,GAAWC,6BAAA,CAAaC,iCAAA,EAA2B,CAAA;AACzD,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AAEvB,EAAA,KAAA,MAAW,MAAA,IAAU,SAAS,OAAA,EAAS;AACrC,IAAAC,iBAAA,CAAU,MAAM,CAAA;AAAA,EAClB;AAEA,EAAA,OAAO;AAAA;AAAA,IAEL,UAAA,EAAY,IAAIC,iBAAA,CAAW,QAAA,CAAS,QAAQ;AAAA,GAC9C;AACF;AAmBO,SAAS,oBAAoB,OAAA,EAA2C;AAC7E,EAAA,OAAOC,iCAAA,CAAiB;AAAA;AAAA,IAEtB,YAAA,EAAc,oBAAA;AAAA;AAAA;AAAA;AAAA,WAIdC,aAAA;AAAA,IACA,UAAU,OAAA,CAAQ,QAAA;AAAA,IAClB,GAAI,QAAQ,cAAA,GAAiB,EAAE,gBAAgB,OAAA,CAAQ,cAAA,KAAmB;AAAC,GAC5E,CAAA;AACH","file":"index.cjs","sourcesContent":["// The `.js` extension is load-bearing: azure-pipelines-task-lib is CommonJS with\n// no `exports` map, so under ESM resolution the extensionless subpath does not\n// resolve at all (ERR_MODULE_NOT_FOUND). CJS is unaffected either way.\nimport { getInput } from 'azure-pipelines-task-lib/task.js'\n\n/**\n * Reads a boolean input whose intended default is TRUE (fail-closed). It reads the\n * raw input rather than getBoolInput(name, false) so the default still holds on an\n * agent that does not materialize task.json defaultValues into the input env var\n * (where getBoolInput would silently return false): unset/empty -> true; any value\n * other than \"false\" (case-insensitive) -> true.\n */\nexport function getBoolInputDefaultTrue(name: string): boolean {\n const raw = getInput(name, false)\n return raw === undefined || raw.trim() === '' ? true : raw.trim().toLowerCase() !== 'false'\n}\n","import { debug, getHttpProxyConfiguration, setSecret } from 'azure-pipelines-task-lib/task.js'\nimport { ProxyAgent } from 'undici'\nimport {\n createHttpClient,\n resolveProxy,\n type HttpClient,\n type HttpMessages,\n type RedirectPolicy,\n} from '@4cloudguru/pipeline-task-core'\n\n/**\n * Per-attempt fetch init carrying the agent's proxy.\n *\n * The ordering is the security property, not an implementation detail: the\n * agent's masker matches registered literals rather than derivations of them,\n * and resolveProxy returns every spelling of the credential it produced —\n * including the percent-encoded form the dispatcher URL actually embeds, and\n * any userinfo already inside Agent.ProxyUrl. All of them must be registered\n * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.\n * resolveProxy cannot do it itself; the package it lives in does not import\n * the task lib. That obligation is the reason this function exists here.\n */\nexport function buildAdoFetchOptions(): RequestInit {\n const resolved = resolveProxy(getHttpProxyConfiguration())\n if (!resolved) return {}\n\n for (const secret of resolved.secrets) {\n setSecret(secret)\n }\n\n return {\n // @ts-expect-error Node's fetch accepts an undici dispatcher at runtime.\n dispatcher: new ProxyAgent(resolved.proxyUrl),\n }\n}\n\nexport interface AdoHttpClientOptions {\n /**\n * Failure text. Kept a parameter because it is the one genuinely per-task\n * part: the strings come from each task's own resource file via tasks.loc,\n * and \"registry request failed\" is wrong on a releases.hashicorp.com fetch.\n */\n messages: HttpMessages\n /**\n * Defaults to the core client's own same-host rule. Pass\n * anyRedirectPolicy(sameHostOnly, githubAssetRedirects) only for callers that\n * really do fetch GitHub release assets — enabling it estate-wide widens the\n * redirect surface for callers that never need it.\n */\n redirectPolicy?: RedirectPolicy\n}\n\n/** An HTTPS-pinned client wired to this agent's proxy, debug channel and text. */\nexport function createAdoHttpClient(options: AdoHttpClientOptions): HttpClient {\n return createHttpClient({\n // Re-evaluated per attempt, so a proxy change between retries is picked up.\n fetchOptions: buildAdoFetchOptions,\n // Passed by reference rather than wrapped: a forwarding lambda would be an\n // extra function no test can meaningfully reach, and task-lib's debug does\n // not close over `this`.\n debug,\n messages: options.messages,\n ...(options.redirectPolicy ? { redirectPolicy: options.redirectPolicy } : {}),\n })\n}\n"]}
1
+ {"version":3,"sources":["../src/input/bool-input.ts","../src/http/ado-http.ts"],"names":["getInput","resolveProxy","getHttpProxyConfiguration","setSecret","ProxyAgent","createHttpClient","debug"],"mappings":";;;;;;;AAYO,SAAS,wBAAwB,IAAA,EAAuB;AAC7D,EAAA,MAAM,GAAA,GAAMA,gBAAA,CAAS,IAAA,EAAM,KAAK,CAAA;AAChC,EAAA,OAAO,GAAA,KAAQ,MAAA,IAAa,GAAA,CAAI,IAAA,EAAK,KAAM,EAAA,GAAK,IAAA,GAAO,GAAA,CAAI,IAAA,EAAK,CAAE,WAAA,EAAY,KAAM,OAAA;AACtF;ACYO,SAAS,qBAAqB,GAAA,EAA2B;AAC9D,EAAA,MAAM,QAAA,GAAWC,6BAAA,CAAaC,iCAAA,CAA0B,GAAG,CAAC,CAAA;AAC5D,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AAEvB,EAAA,KAAA,MAAW,MAAA,IAAU,SAAS,OAAA,EAAS;AACrC,IAAAC,iBAAA,CAAU,MAAM,CAAA;AAAA,EAClB;AAEA,EAAA,OAAO;AAAA;AAAA,IAEL,UAAA,EAAY,IAAIC,iBAAA,CAAW,QAAA,CAAS,QAAQ;AAAA,GAC9C;AACF;AAmBO,SAAS,oBAAoB,OAAA,EAA2C;AAC7E,EAAA,OAAOC,iCAAA,CAAiB;AAAA;AAAA,IAEtB,YAAA,EAAc,oBAAA;AAAA;AAAA;AAAA;AAAA,WAIdC,aAAA;AAAA,IACA,UAAU,OAAA,CAAQ,QAAA;AAAA,IAClB,GAAI,QAAQ,cAAA,GAAiB,EAAE,gBAAgB,OAAA,CAAQ,cAAA,KAAmB;AAAC,GAC5E,CAAA;AACH","file":"index.cjs","sourcesContent":["// The `.js` extension is load-bearing: azure-pipelines-task-lib is CommonJS with\n// no `exports` map, so under ESM resolution the extensionless subpath does not\n// resolve at all (ERR_MODULE_NOT_FOUND). CJS is unaffected either way.\nimport { getInput } from 'azure-pipelines-task-lib/task.js'\n\n/**\n * Reads a boolean input whose intended default is TRUE (fail-closed). It reads the\n * raw input rather than getBoolInput(name, false) so the default still holds on an\n * agent that does not materialize task.json defaultValues into the input env var\n * (where getBoolInput would silently return false): unset/empty -> true; any value\n * other than \"false\" (case-insensitive) -> true.\n */\nexport function getBoolInputDefaultTrue(name: string): boolean {\n const raw = getInput(name, false)\n return raw === undefined || raw.trim() === '' ? true : raw.trim().toLowerCase() !== 'false'\n}\n","import { debug, getHttpProxyConfiguration, setSecret } from 'azure-pipelines-task-lib/task.js'\nimport { ProxyAgent } from 'undici'\nimport {\n createHttpClient,\n resolveProxy,\n type HttpClient,\n type HttpMessages,\n type RedirectPolicy,\n} from '@4cloudguru/pipeline-task-core'\n\n/**\n * Per-attempt fetch init carrying the agent's proxy.\n *\n * The ordering is the security property, not an implementation detail: the\n * agent's masker matches registered literals rather than derivations of them,\n * and resolveProxy returns every spelling of the credential it produced —\n * including the percent-encoded form the dispatcher URL actually embeds, and\n * any userinfo already inside Agent.ProxyUrl. All of them must be registered\n * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.\n * resolveProxy cannot do it itself; the package it lives in does not import\n * the task lib. That obligation is the reason this function exists here.\n *\n * `url` is the hop about to be issued. It is forwarded because half the ADO\n * proxy contract is a per-DESTINATION decision: getHttpProxyConfiguration only\n * evaluates Agent.ProxyBypassList when it is given a URL, and returns null for\n * a bypassed host. Dropping it proxies destinations the operator excluded.\n */\nexport function buildAdoFetchOptions(url?: string): RequestInit {\n const resolved = resolveProxy(getHttpProxyConfiguration(url))\n if (!resolved) return {}\n\n for (const secret of resolved.secrets) {\n setSecret(secret)\n }\n\n return {\n // @ts-expect-error Node's fetch accepts an undici dispatcher at runtime.\n dispatcher: new ProxyAgent(resolved.proxyUrl),\n }\n}\n\nexport interface AdoHttpClientOptions {\n /**\n * Failure text. Kept a parameter because it is the one genuinely per-task\n * part: the strings come from each task's own resource file via tasks.loc,\n * and \"registry request failed\" is wrong on a releases.hashicorp.com fetch.\n */\n messages: HttpMessages\n /**\n * Defaults to the core client's own same-host rule. Pass\n * anyRedirectPolicy(sameHostOnly, githubAssetRedirects) only for callers that\n * really do fetch GitHub release assets — enabling it estate-wide widens the\n * redirect surface for callers that never need it.\n */\n redirectPolicy?: RedirectPolicy\n}\n\n/** An HTTPS-pinned client wired to this agent's proxy, debug channel and text. */\nexport function createAdoHttpClient(options: AdoHttpClientOptions): HttpClient {\n return createHttpClient({\n // Re-evaluated per attempt, so a proxy change between retries is picked up.\n fetchOptions: buildAdoFetchOptions,\n // Passed by reference rather than wrapped: a forwarding lambda would be an\n // extra function no test can meaningfully reach, and task-lib's debug does\n // not close over `this`.\n debug,\n messages: options.messages,\n ...(options.redirectPolicy ? { redirectPolicy: options.redirectPolicy } : {}),\n })\n}\n"]}
package/dist/index.d.mts CHANGED
@@ -20,8 +20,13 @@ declare function getBoolInputDefaultTrue(name: string): boolean;
20
20
  * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.
21
21
  * resolveProxy cannot do it itself; the package it lives in does not import
22
22
  * the task lib. That obligation is the reason this function exists here.
23
+ *
24
+ * `url` is the hop about to be issued. It is forwarded because half the ADO
25
+ * proxy contract is a per-DESTINATION decision: getHttpProxyConfiguration only
26
+ * evaluates Agent.ProxyBypassList when it is given a URL, and returns null for
27
+ * a bypassed host. Dropping it proxies destinations the operator excluded.
23
28
  */
24
- declare function buildAdoFetchOptions(): RequestInit;
29
+ declare function buildAdoFetchOptions(url?: string): RequestInit;
25
30
  interface AdoHttpClientOptions {
26
31
  /**
27
32
  * Failure text. Kept a parameter because it is the one genuinely per-task
package/dist/index.d.ts CHANGED
@@ -20,8 +20,13 @@ declare function getBoolInputDefaultTrue(name: string): boolean;
20
20
  * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.
21
21
  * resolveProxy cannot do it itself; the package it lives in does not import
22
22
  * the task lib. That obligation is the reason this function exists here.
23
+ *
24
+ * `url` is the hop about to be issued. It is forwarded because half the ADO
25
+ * proxy contract is a per-DESTINATION decision: getHttpProxyConfiguration only
26
+ * evaluates Agent.ProxyBypassList when it is given a URL, and returns null for
27
+ * a bypassed host. Dropping it proxies destinations the operator excluded.
23
28
  */
24
- declare function buildAdoFetchOptions(): RequestInit;
29
+ declare function buildAdoFetchOptions(url?: string): RequestInit;
25
30
  interface AdoHttpClientOptions {
26
31
  /**
27
32
  * Failure text. Kept a parameter because it is the one genuinely per-task
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ function getBoolInputDefaultTrue(name) {
7
7
  const raw = getInput(name, false);
8
8
  return raw === void 0 || raw.trim() === "" ? true : raw.trim().toLowerCase() !== "false";
9
9
  }
10
- function buildAdoFetchOptions() {
11
- const resolved = resolveProxy(getHttpProxyConfiguration());
10
+ function buildAdoFetchOptions(url) {
11
+ const resolved = resolveProxy(getHttpProxyConfiguration(url));
12
12
  if (!resolved) return {};
13
13
  for (const secret of resolved.secrets) {
14
14
  setSecret(secret);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input/bool-input.ts","../src/http/ado-http.ts"],"names":[],"mappings":";;;;;AAYO,SAAS,wBAAwB,IAAA,EAAuB;AAC7D,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,IAAA,EAAM,KAAK,CAAA;AAChC,EAAA,OAAO,GAAA,KAAQ,MAAA,IAAa,GAAA,CAAI,IAAA,EAAK,KAAM,EAAA,GAAK,IAAA,GAAO,GAAA,CAAI,IAAA,EAAK,CAAE,WAAA,EAAY,KAAM,OAAA;AACtF;ACOO,SAAS,oBAAA,GAAoC;AAClD,EAAA,MAAM,QAAA,GAAW,YAAA,CAAa,yBAAA,EAA2B,CAAA;AACzD,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AAEvB,EAAA,KAAA,MAAW,MAAA,IAAU,SAAS,OAAA,EAAS;AACrC,IAAA,SAAA,CAAU,MAAM,CAAA;AAAA,EAClB;AAEA,EAAA,OAAO;AAAA;AAAA,IAEL,UAAA,EAAY,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ;AAAA,GAC9C;AACF;AAmBO,SAAS,oBAAoB,OAAA,EAA2C;AAC7E,EAAA,OAAO,gBAAA,CAAiB;AAAA;AAAA,IAEtB,YAAA,EAAc,oBAAA;AAAA;AAAA;AAAA;AAAA,IAId,KAAA;AAAA,IACA,UAAU,OAAA,CAAQ,QAAA;AAAA,IAClB,GAAI,QAAQ,cAAA,GAAiB,EAAE,gBAAgB,OAAA,CAAQ,cAAA,KAAmB;AAAC,GAC5E,CAAA;AACH","file":"index.js","sourcesContent":["// The `.js` extension is load-bearing: azure-pipelines-task-lib is CommonJS with\n// no `exports` map, so under ESM resolution the extensionless subpath does not\n// resolve at all (ERR_MODULE_NOT_FOUND). CJS is unaffected either way.\nimport { getInput } from 'azure-pipelines-task-lib/task.js'\n\n/**\n * Reads a boolean input whose intended default is TRUE (fail-closed). It reads the\n * raw input rather than getBoolInput(name, false) so the default still holds on an\n * agent that does not materialize task.json defaultValues into the input env var\n * (where getBoolInput would silently return false): unset/empty -> true; any value\n * other than \"false\" (case-insensitive) -> true.\n */\nexport function getBoolInputDefaultTrue(name: string): boolean {\n const raw = getInput(name, false)\n return raw === undefined || raw.trim() === '' ? true : raw.trim().toLowerCase() !== 'false'\n}\n","import { debug, getHttpProxyConfiguration, setSecret } from 'azure-pipelines-task-lib/task.js'\nimport { ProxyAgent } from 'undici'\nimport {\n createHttpClient,\n resolveProxy,\n type HttpClient,\n type HttpMessages,\n type RedirectPolicy,\n} from '@4cloudguru/pipeline-task-core'\n\n/**\n * Per-attempt fetch init carrying the agent's proxy.\n *\n * The ordering is the security property, not an implementation detail: the\n * agent's masker matches registered literals rather than derivations of them,\n * and resolveProxy returns every spelling of the credential it produced —\n * including the percent-encoded form the dispatcher URL actually embeds, and\n * any userinfo already inside Agent.ProxyUrl. All of them must be registered\n * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.\n * resolveProxy cannot do it itself; the package it lives in does not import\n * the task lib. That obligation is the reason this function exists here.\n */\nexport function buildAdoFetchOptions(): RequestInit {\n const resolved = resolveProxy(getHttpProxyConfiguration())\n if (!resolved) return {}\n\n for (const secret of resolved.secrets) {\n setSecret(secret)\n }\n\n return {\n // @ts-expect-error Node's fetch accepts an undici dispatcher at runtime.\n dispatcher: new ProxyAgent(resolved.proxyUrl),\n }\n}\n\nexport interface AdoHttpClientOptions {\n /**\n * Failure text. Kept a parameter because it is the one genuinely per-task\n * part: the strings come from each task's own resource file via tasks.loc,\n * and \"registry request failed\" is wrong on a releases.hashicorp.com fetch.\n */\n messages: HttpMessages\n /**\n * Defaults to the core client's own same-host rule. Pass\n * anyRedirectPolicy(sameHostOnly, githubAssetRedirects) only for callers that\n * really do fetch GitHub release assets — enabling it estate-wide widens the\n * redirect surface for callers that never need it.\n */\n redirectPolicy?: RedirectPolicy\n}\n\n/** An HTTPS-pinned client wired to this agent's proxy, debug channel and text. */\nexport function createAdoHttpClient(options: AdoHttpClientOptions): HttpClient {\n return createHttpClient({\n // Re-evaluated per attempt, so a proxy change between retries is picked up.\n fetchOptions: buildAdoFetchOptions,\n // Passed by reference rather than wrapped: a forwarding lambda would be an\n // extra function no test can meaningfully reach, and task-lib's debug does\n // not close over `this`.\n debug,\n messages: options.messages,\n ...(options.redirectPolicy ? { redirectPolicy: options.redirectPolicy } : {}),\n })\n}\n"]}
1
+ {"version":3,"sources":["../src/input/bool-input.ts","../src/http/ado-http.ts"],"names":[],"mappings":";;;;;AAYO,SAAS,wBAAwB,IAAA,EAAuB;AAC7D,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,IAAA,EAAM,KAAK,CAAA;AAChC,EAAA,OAAO,GAAA,KAAQ,MAAA,IAAa,GAAA,CAAI,IAAA,EAAK,KAAM,EAAA,GAAK,IAAA,GAAO,GAAA,CAAI,IAAA,EAAK,CAAE,WAAA,EAAY,KAAM,OAAA;AACtF;ACYO,SAAS,qBAAqB,GAAA,EAA2B;AAC9D,EAAA,MAAM,QAAA,GAAW,YAAA,CAAa,yBAAA,CAA0B,GAAG,CAAC,CAAA;AAC5D,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AAEvB,EAAA,KAAA,MAAW,MAAA,IAAU,SAAS,OAAA,EAAS;AACrC,IAAA,SAAA,CAAU,MAAM,CAAA;AAAA,EAClB;AAEA,EAAA,OAAO;AAAA;AAAA,IAEL,UAAA,EAAY,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ;AAAA,GAC9C;AACF;AAmBO,SAAS,oBAAoB,OAAA,EAA2C;AAC7E,EAAA,OAAO,gBAAA,CAAiB;AAAA;AAAA,IAEtB,YAAA,EAAc,oBAAA;AAAA;AAAA;AAAA;AAAA,IAId,KAAA;AAAA,IACA,UAAU,OAAA,CAAQ,QAAA;AAAA,IAClB,GAAI,QAAQ,cAAA,GAAiB,EAAE,gBAAgB,OAAA,CAAQ,cAAA,KAAmB;AAAC,GAC5E,CAAA;AACH","file":"index.js","sourcesContent":["// The `.js` extension is load-bearing: azure-pipelines-task-lib is CommonJS with\n// no `exports` map, so under ESM resolution the extensionless subpath does not\n// resolve at all (ERR_MODULE_NOT_FOUND). CJS is unaffected either way.\nimport { getInput } from 'azure-pipelines-task-lib/task.js'\n\n/**\n * Reads a boolean input whose intended default is TRUE (fail-closed). It reads the\n * raw input rather than getBoolInput(name, false) so the default still holds on an\n * agent that does not materialize task.json defaultValues into the input env var\n * (where getBoolInput would silently return false): unset/empty -> true; any value\n * other than \"false\" (case-insensitive) -> true.\n */\nexport function getBoolInputDefaultTrue(name: string): boolean {\n const raw = getInput(name, false)\n return raw === undefined || raw.trim() === '' ? true : raw.trim().toLowerCase() !== 'false'\n}\n","import { debug, getHttpProxyConfiguration, setSecret } from 'azure-pipelines-task-lib/task.js'\nimport { ProxyAgent } from 'undici'\nimport {\n createHttpClient,\n resolveProxy,\n type HttpClient,\n type HttpMessages,\n type RedirectPolicy,\n} from '@4cloudguru/pipeline-task-core'\n\n/**\n * Per-attempt fetch init carrying the agent's proxy.\n *\n * The ordering is the security property, not an implementation detail: the\n * agent's masker matches registered literals rather than derivations of them,\n * and resolveProxy returns every spelling of the credential it produced —\n * including the percent-encoded form the dispatcher URL actually embeds, and\n * any userinfo already inside Agent.ProxyUrl. All of them must be registered\n * BEFORE proxyUrl is handed to a dispatcher or interpolated into a message.\n * resolveProxy cannot do it itself; the package it lives in does not import\n * the task lib. That obligation is the reason this function exists here.\n *\n * `url` is the hop about to be issued. It is forwarded because half the ADO\n * proxy contract is a per-DESTINATION decision: getHttpProxyConfiguration only\n * evaluates Agent.ProxyBypassList when it is given a URL, and returns null for\n * a bypassed host. Dropping it proxies destinations the operator excluded.\n */\nexport function buildAdoFetchOptions(url?: string): RequestInit {\n const resolved = resolveProxy(getHttpProxyConfiguration(url))\n if (!resolved) return {}\n\n for (const secret of resolved.secrets) {\n setSecret(secret)\n }\n\n return {\n // @ts-expect-error Node's fetch accepts an undici dispatcher at runtime.\n dispatcher: new ProxyAgent(resolved.proxyUrl),\n }\n}\n\nexport interface AdoHttpClientOptions {\n /**\n * Failure text. Kept a parameter because it is the one genuinely per-task\n * part: the strings come from each task's own resource file via tasks.loc,\n * and \"registry request failed\" is wrong on a releases.hashicorp.com fetch.\n */\n messages: HttpMessages\n /**\n * Defaults to the core client's own same-host rule. Pass\n * anyRedirectPolicy(sameHostOnly, githubAssetRedirects) only for callers that\n * really do fetch GitHub release assets — enabling it estate-wide widens the\n * redirect surface for callers that never need it.\n */\n redirectPolicy?: RedirectPolicy\n}\n\n/** An HTTPS-pinned client wired to this agent's proxy, debug channel and text. */\nexport function createAdoHttpClient(options: AdoHttpClientOptions): HttpClient {\n return createHttpClient({\n // Re-evaluated per attempt, so a proxy change between retries is picked up.\n fetchOptions: buildAdoFetchOptions,\n // Passed by reference rather than wrapped: a forwarding lambda would be an\n // extra function no test can meaningfully reach, and task-lib's debug does\n // not close over `this`.\n debug,\n messages: options.messages,\n ...(options.redirectPolicy ? { redirectPolicy: options.redirectPolicy } : {}),\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4cloudguru/pipeline-task-ado",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Azure DevOps-specific task primitives shared by the Azure Pipelines task extensions.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
@@ -58,7 +58,7 @@
58
58
  }
59
59
  },
60
60
  "dependencies": {
61
- "@4cloudguru/pipeline-task-core": "^0.5.0"
61
+ "@4cloudguru/pipeline-task-core": "^0.6.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@commitlint/cli": "^21.2.1",