diff --git a/package-lock.json b/package-lock.json index bea5addd35..82baea13bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@humanwhocodes/gitignore-to-minimatch": "1.0.2", "@microsoft/tiktokenizer": "^1.0.10", "@sinclair/typebox": "^0.34.41", - "@vscode/copilot-api": "^0.2.9", + "@vscode/copilot-api": "^0.2.12", "@vscode/extension-telemetry": "^1.2.0", "@vscode/l10n": "^0.0.18", "@vscode/prompt-tsx": "^0.4.0-alpha.6", @@ -6620,9 +6620,9 @@ } }, "node_modules/@vscode/copilot-api": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@vscode/copilot-api/-/copilot-api-0.2.9.tgz", - "integrity": "sha512-3ueQTTJlaYMN2BygL/vT+Izde8uS6yThQYiBJMMNtGqy1w3VFvjJwlEWt+MzXXOrESnDMi7Q72eJCPtE7r4fWA==", + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@vscode/copilot-api/-/copilot-api-0.2.12.tgz", + "integrity": "sha512-b98amJsB0GZDSLBWs68HYeN3Mwy4VnvWAVd/arT4L7m6gdeEV9KrfoXjIZhsJMnUL6+JheECZjLpjp8u1iNjlw==", "license": "SEE LICENSE" }, "node_modules/@vscode/debugadapter": { diff --git a/package.json b/package.json index dbfffe099f..989461eb2e 100644 --- a/package.json +++ b/package.json @@ -5593,7 +5593,7 @@ "@humanwhocodes/gitignore-to-minimatch": "1.0.2", "@microsoft/tiktokenizer": "^1.0.10", "@sinclair/typebox": "^0.34.41", - "@vscode/copilot-api": "^0.2.9", + "@vscode/copilot-api": "^0.2.12", "@vscode/extension-telemetry": "^1.2.0", "@vscode/l10n": "^0.0.18", "@vscode/prompt-tsx": "^0.4.0-alpha.6", diff --git a/src/platform/networking/common/fetcherService.ts b/src/platform/networking/common/fetcherService.ts index a81cec9d3b..01f8b0a549 100644 --- a/src/platform/networking/common/fetcherService.ts +++ b/src/platform/networking/common/fetcherService.ts @@ -94,7 +94,7 @@ export interface FetchOptions { * the `Content-Type` header set to `application/json`. */ json?: unknown; - method?: 'GET' | 'POST'; + method?: 'GET' | 'POST' | 'PUT'; signal?: IAbortSignal; retryFallbacks?: boolean; expectJSON?: boolean; diff --git a/src/platform/networking/node/baseFetchFetcher.ts b/src/platform/networking/node/baseFetchFetcher.ts index 6ea4934fdf..5f7b819cca 100644 --- a/src/platform/networking/node/baseFetchFetcher.ts +++ b/src/platform/networking/node/baseFetchFetcher.ts @@ -38,8 +38,8 @@ export abstract class BaseFetchFetcher implements IFetcher { } const method = options.method || 'GET'; - if (method !== 'GET' && method !== 'POST') { - throw new Error(`Illegal arguments! 'method' must be either 'GET' or 'POST'!`); + if (method !== 'GET' && method !== 'POST' && method !== 'PUT') { + throw new Error(`Illegal arguments! 'method' must be 'GET', 'POST', or 'PUT'!`); } const signal = options.signal ?? new AbortController().signal; @@ -81,7 +81,7 @@ export abstract class BaseFetchFetcher implements IFetcher { return items; } - private async _fetch(url: string, method: 'GET' | 'POST', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise { + private async _fetch(url: string, method: 'GET' | 'POST' | 'PUT', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise { const resp = await this._fetchImpl(url, { method, headers, body, signal }); return new Response( resp.status, diff --git a/src/platform/networking/node/nodeFetcher.ts b/src/platform/networking/node/nodeFetcher.ts index 2a6e2db52e..a3d1281b67 100644 --- a/src/platform/networking/node/nodeFetcher.ts +++ b/src/platform/networking/node/nodeFetcher.ts @@ -43,8 +43,8 @@ export class NodeFetcher implements IFetcher { } const method = options.method || 'GET'; - if (method !== 'GET' && method !== 'POST') { - throw new Error(`Illegal arguments! 'method' must be either 'GET' or 'POST'!`); + if (method !== 'GET' && method !== 'POST' && method !== 'PUT') { + throw new Error(`Illegal arguments! 'method' must be 'GET', 'POST', or 'PUT'!`); } const signal = options.signal ?? new AbortController().signal; @@ -86,7 +86,7 @@ export class NodeFetcher implements IFetcher { return items; } - private _fetch(url: string, method: 'GET' | 'POST', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise { + private _fetch(url: string, method: 'GET' | 'POST' | 'PUT', headers: { [name: string]: string }, body: string | undefined, signal: AbortSignal): Promise { return new Promise((resolve, reject) => { const module = url.startsWith('https:') ? https : http; const req = module.request(url, { method, headers }, res => {