diff --git a/src/analyzer.ts b/src/analyzer.ts index d2bf1652..edb36ea9 100644 --- a/src/analyzer.ts +++ b/src/analyzer.ts @@ -1003,38 +1003,38 @@ export class Analyzer { Options extends CreateIdentityAnalyzerOptions ? IdentityAnalyzerDescription : Options extends CreateDelimiterAnalyzerOptions - ? DelimiterAnalyzerDescription - : Options extends CreateStemAnalyzerOptions - ? StemAnalyzerDescription - : Options extends CreateNormAnalyzerOptions - ? NormAnalyzerDescription - : Options extends CreateNgramAnalyzerOptions - ? NgramAnalyzerDescription - : Options extends CreateTextAnalyzerOptions - ? TextAnalyzerDescription - : Options extends CreateSegmentationAnalyzerOptions - ? SegmentationAnalyzerDescription - : Options extends CreateAqlAnalyzerOptions - ? AqlAnalyzerDescription - : Options extends CreatePipelineAnalyzerOptions - ? PipelineAnalyzerDescription - : Options extends CreateStopwordsAnalyzerOptions - ? StopwordsAnalyzerDescription - : Options extends CreateCollationAnalyzerOptions - ? CollationAnalyzerDescription - : Options extends CreateMinHashAnalyzerOptions - ? MinHashAnalyzerDescription - : Options extends CreateClassificationAnalyzerOptions - ? ClassificationAnalyzerDescription - : Options extends CreateNearestNeighborsAnalyzerOptions - ? NearestNeighborsAnalyzerDescription - : Options extends CreateGeoJsonAnalyzerOptions - ? GeoJsonAnalyzerDescription - : Options extends CreateGeoPointAnalyzerOptions - ? GeoPointAnalyzerDescription - : Options extends CreateGeoS2AnalyzerOptions - ? GeoS2AnalyzerDescription - : AnalyzerDescription + ? DelimiterAnalyzerDescription + : Options extends CreateStemAnalyzerOptions + ? StemAnalyzerDescription + : Options extends CreateNormAnalyzerOptions + ? NormAnalyzerDescription + : Options extends CreateNgramAnalyzerOptions + ? NgramAnalyzerDescription + : Options extends CreateTextAnalyzerOptions + ? TextAnalyzerDescription + : Options extends CreateSegmentationAnalyzerOptions + ? SegmentationAnalyzerDescription + : Options extends CreateAqlAnalyzerOptions + ? AqlAnalyzerDescription + : Options extends CreatePipelineAnalyzerOptions + ? PipelineAnalyzerDescription + : Options extends CreateStopwordsAnalyzerOptions + ? StopwordsAnalyzerDescription + : Options extends CreateCollationAnalyzerOptions + ? CollationAnalyzerDescription + : Options extends CreateMinHashAnalyzerOptions + ? MinHashAnalyzerDescription + : Options extends CreateClassificationAnalyzerOptions + ? ClassificationAnalyzerDescription + : Options extends CreateNearestNeighborsAnalyzerOptions + ? NearestNeighborsAnalyzerDescription + : Options extends CreateGeoJsonAnalyzerOptions + ? GeoJsonAnalyzerDescription + : Options extends CreateGeoPointAnalyzerOptions + ? GeoPointAnalyzerDescription + : Options extends CreateGeoS2AnalyzerOptions + ? GeoS2AnalyzerDescription + : AnalyzerDescription > { return this._db.request({ method: "POST", @@ -1061,7 +1061,7 @@ export class Analyzer { return this._db.request({ method: "DELETE", path: `/_api/analyzer/${encodeURIComponent(this._name)}`, - qs: { force }, + search: { force }, }); } } diff --git a/src/collection.ts b/src/collection.ts index a0bf554e..ce5ec49f 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -3603,17 +3603,17 @@ export class Collection = any> return computedValue; }); } - const qs: Record = {}; + const search: Record = {}; if (typeof waitForSyncReplication === "boolean") { - qs.waitForSyncReplication = waitForSyncReplication ? 1 : 0; + search.waitForSyncReplication = waitForSyncReplication ? 1 : 0; } if (typeof enforceReplicationFactor === "boolean") { - qs.enforceReplicationFactor = enforceReplicationFactor ? 1 : 0; + search.enforceReplicationFactor = enforceReplicationFactor ? 1 : 0; } return this._db.request({ method: "POST", path: "/_api/collection", - qs, + search, body: { ...opts, name: this._name, @@ -3668,7 +3668,7 @@ export class Collection = any> > { return this._db.request({ path: `/_api/collection/${encodeURIComponent(this._name)}/figures`, - qs: { details }, + search: { details }, }); } @@ -3691,7 +3691,7 @@ export class Collection = any> > { return this._db.request({ path: `/_api/collection/${encodeURIComponent(this._name)}/checksum`, - qs: options, + search: options, }); } @@ -3724,7 +3724,7 @@ export class Collection = any> return this._db.request({ method: "DELETE", path: `/_api/collection/${encodeURIComponent(this._name)}`, - qs: options, + search: options, }); } //#endregion @@ -3787,7 +3787,7 @@ export class Collection = any> return this._db.request({ method: "PUT", path: `/_api/document/${encodeURIComponent(this._name)}`, - qs: { onlyget: true }, + search: { onlyget: true }, allowDirtyRead, body: selectors, }); @@ -3841,7 +3841,7 @@ export class Collection = any> method: "POST", path: `/_api/document/${encodeURIComponent(this._name)}`, body: data, - qs: options, + search: options, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3853,7 +3853,7 @@ export class Collection = any> method: "POST", path: `/_api/document/${encodeURIComponent(this._name)}`, body: data, - qs: options, + search: options, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3875,7 +3875,7 @@ export class Collection = any> )}`, headers, body: newData, - qs: opts, + search: opts, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3890,7 +3890,7 @@ export class Collection = any> method: "PUT", path: `/_api/document/${encodeURIComponent(this._name)}`, body: newData, - qs: options, + search: options, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3912,7 +3912,7 @@ export class Collection = any> )}`, headers, body: newData, - qs: opts, + search: opts, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3929,7 +3929,7 @@ export class Collection = any> method: "PATCH", path: `/_api/document/${encodeURIComponent(this._name)}`, body: newData, - qs: options, + search: options, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3946,7 +3946,7 @@ export class Collection = any> _documentHandle(selector, this._name) )}`, headers, - qs: opts, + search: opts, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3961,7 +3961,7 @@ export class Collection = any> method: "DELETE", path: `/_api/document/${encodeURIComponent(this._name)}`, body: selectors, - qs: options, + search: options, }, (res) => (options?.silent ? undefined : res.parsedBody) ); @@ -3973,9 +3973,9 @@ export class Collection = any> type?: "documents" | "list" | "auto"; } = {} ): Promise { - const qs = { ...options, collection: this._name }; + const search = { ...options, collection: this._name }; if (Array.isArray(data)) { - qs.type = Array.isArray(data[0]) ? undefined : "documents"; + search.type = Array.isArray(data[0]) ? undefined : "documents"; const lines = data as any[]; data = lines.map((line) => JSON.stringify(line)).join("\r\n") + "\r\n"; } @@ -3984,7 +3984,7 @@ export class Collection = any> path: "/_api/import", body: data, isBinary: true, - qs, + search, }); } //#endregion @@ -3999,7 +3999,7 @@ export class Collection = any> return this._db.request({ path: `/_api/edges/${encodeURIComponent(this._name)}`, allowDirtyRead, - qs: { + search: { direction, vertex: _documentHandle(selector, this._name, false), }, @@ -4190,7 +4190,7 @@ export class Collection = any> return this._db.request( { path: "/_api/index", - qs: { collection: this._name }, + search: { collection: this._name }, }, (res) => res.parsedBody.indexes ); @@ -4215,7 +4215,7 @@ export class Collection = any> method: "POST", path: "/_api/index", body: options, - qs: { collection: this._name }, + search: { collection: this._name }, }); } diff --git a/src/connection.ts b/src/connection.ts index e2119fca..6d64665d 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -111,12 +111,6 @@ function generateStackTrace() { return err; } -/** - * Additional options for intercepting the request/response. These methods - * are primarily intended for tracking network related metrics. - */ -export type RequestInterceptors = {}; - /** * Options for performing a request with arangojs. */ @@ -183,7 +177,7 @@ export type RequestOptions = { /** * URL parameters to pass as part of the query string. */ - qs?: URLSearchParams | Record; + search?: URLSearchParams | Record; }; /** @@ -203,7 +197,7 @@ type Task = { expectBinary: boolean; timeout?: number; pathname: string; - qs?: URLSearchParams; + search?: URLSearchParams; headers: Headers; body: any; }; @@ -880,7 +874,7 @@ export class Connection { headers: requestHeaders, basePath, path, - qs: params, + search: params, }: RequestOptions, transform?: (res: ArangojsResponse) => T ): Promise { @@ -914,7 +908,7 @@ export class Connection { retryOnConflict, options: { pathname: joinPath(basePath || "", path || ""), - qs: + search: params && (params instanceof URLSearchParams ? params diff --git a/src/database.ts b/src/database.ts index 1c061685..52ba3200 100644 --- a/src/database.ts +++ b/src/database.ts @@ -1870,7 +1870,7 @@ export class Database { return this.request({ method: "GET", path: "/_api/version", - qs: { details }, + search: { details }, }); } @@ -2818,7 +2818,7 @@ export class Database { return this.request( { path: "/_api/collection", - qs: { excludeSystem }, + search: { excludeSystem }, }, (res) => res.parsedBody.result ); @@ -3659,7 +3659,7 @@ export class Database { return this.request( { path: `/_api/user/${encodeURIComponent(username)}/database`, - qs: { full }, + search: { full }, }, (res) => res.parsedBody.result ); @@ -4719,7 +4719,7 @@ export class Database { return this.request({ method: "DELETE", path: `/_api/aqlfunction/${encodeURIComponent(name)}`, - qs: { group }, + search: { group }, }); } //#endregion @@ -4745,7 +4745,7 @@ export class Database { listServices(excludeSystem: boolean = true): Promise { return this.request({ path: "/_api/foxx", - qs: { excludeSystem }, + search: { excludeSystem }, }); } @@ -4786,7 +4786,7 @@ export class Database { source: File | Blob | string, options: InstallServiceOptions = {} ): Promise { - const { configuration, dependencies, ...qs } = options; + const { configuration, dependencies, ...search } = options; const form = new FormData(); if (configuration) { form.append("configuration", JSON.stringify(configuration)); @@ -4802,7 +4802,7 @@ export class Database { body: form, method: "POST", path: "/_api/foxx", - qs: { ...qs, mount }, + search: { ...search, mount }, }); } @@ -4844,7 +4844,7 @@ export class Database { source: File | Blob | string, options: ReplaceServiceOptions = {} ): Promise { - const { configuration, dependencies, ...qs } = options; + const { configuration, dependencies, ...search } = options; const form = new FormData(); if (configuration) { form.append("configuration", JSON.stringify(configuration)); @@ -4860,7 +4860,7 @@ export class Database { body: form, method: "PUT", path: "/_api/foxx/service", - qs: { ...qs, mount }, + search: { ...search, mount }, }); } @@ -4902,7 +4902,7 @@ export class Database { source: File | Blob | string, options: UpgradeServiceOptions = {} ): Promise { - const { configuration, dependencies, ...qs } = options; + const { configuration, dependencies, ...search } = options; const form = new FormData(); if (configuration) { form.append("configuration", JSON.stringify(configuration)); @@ -4918,7 +4918,7 @@ export class Database { body: form, method: "PATCH", path: "/_api/foxx/service", - qs: { ...qs, mount }, + search: { ...search, mount }, }); } @@ -4942,7 +4942,7 @@ export class Database { { method: "DELETE", path: "/_api/foxx/service", - qs: { ...options, mount }, + search: { ...options, mount }, }, () => undefined ); @@ -4963,7 +4963,7 @@ export class Database { getService(mount: string): Promise { return this.request({ path: "/_api/foxx/service", - qs: { mount }, + search: { mount }, }); } @@ -5020,7 +5020,7 @@ export class Database { getServiceConfiguration(mount: string, minimal: boolean = false) { return this.request({ path: "/_api/foxx/configuration", - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5094,7 +5094,7 @@ export class Database { method: "PUT", path: "/_api/foxx/configuration", body: cfg, - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5168,7 +5168,7 @@ export class Database { method: "PATCH", path: "/_api/foxx/configuration", body: cfg, - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5225,7 +5225,7 @@ export class Database { getServiceDependencies(mount: string, minimal: boolean = false) { return this.request({ path: "/_api/foxx/dependencies", - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5308,7 +5308,7 @@ export class Database { method: "PUT", path: "/_api/foxx/dependencies", body: deps, - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5391,7 +5391,7 @@ export class Database { method: "PATCH", path: "/_api/foxx/dependencies", body: deps, - qs: { mount, minimal }, + search: { mount, minimal }, }); } @@ -5417,7 +5417,7 @@ export class Database { return this.request({ method: enabled ? "POST" : "DELETE", path: "/_api/foxx/development", - qs: { mount }, + search: { mount }, }); } @@ -5439,7 +5439,7 @@ export class Database { listServiceScripts(mount: string): Promise> { return this.request({ path: "/_api/foxx/scripts", - qs: { mount }, + search: { mount }, }); } @@ -5472,7 +5472,7 @@ export class Database { method: "POST", path: `/_api/foxx/scripts/${encodeURIComponent(name)}`, body: params, - qs: { mount }, + search: { mount }, }); } @@ -5749,7 +5749,7 @@ export class Database { return this.request({ method: "POST", path: "/_api/foxx/tests", - qs: { + search: { ...options, mount, }, @@ -5774,7 +5774,7 @@ export class Database { getServiceReadme(mount: string): Promise { return this.request({ path: "/_api/foxx/readme", - qs: { mount }, + search: { mount }, }); } @@ -5794,7 +5794,7 @@ export class Database { getServiceDocumentation(mount: string): Promise { return this.request({ path: "/_api/foxx/swagger", - qs: { mount }, + search: { mount }, }); } @@ -5815,7 +5815,7 @@ export class Database { return this.request({ method: "POST", path: "/_api/foxx/download", - qs: { mount }, + search: { mount }, expectBinary: true, }); } @@ -5845,7 +5845,7 @@ export class Database { { method: "POST", path: "/_api/foxx/commit", - qs: { replace }, + search: { replace }, }, () => undefined ); @@ -5969,7 +5969,7 @@ export class Database { return this.request( { path: "/_admin/log/entries", - qs: options, + search: options, }, (res) => res.parsedBody ); @@ -5995,7 +5995,7 @@ export class Database { return this.request( { path: "/_admin/log", - qs: options, + search: options, }, (res) => res.parsedBody.messages ); @@ -6112,7 +6112,7 @@ export class Database { { method: "DELETE", path: `/_api/job/expired`, - qs: { stamp: threshold / 1000 }, + search: { stamp: threshold / 1000 }, }, () => undefined ); diff --git a/src/graph.ts b/src/graph.ts index 0f99069e..ed212092 100644 --- a/src/graph.ts +++ b/src/graph.ts @@ -564,7 +564,7 @@ export class GraphVertexCollection = any> allowDirtyRead = undefined, graceful = false, rev, - ...qs + ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; @@ -574,7 +574,7 @@ export class GraphVertexCollection = any> this.graph.name )}/vertex/${encodeURI(_documentHandle(selector, this._name))}`, headers, - qs, + search, allowDirtyRead, }, (res) => res.parsedBody.vertex @@ -619,7 +619,7 @@ export class GraphVertexCollection = any> this.graph.name )}/vertex/${encodeURIComponent(this._name)}`, body: data, - qs: options, + search: options, }, (res) => mungeGharialResponse(res.parsedBody, "vertex") ); @@ -662,7 +662,7 @@ export class GraphVertexCollection = any> if (typeof options === "string") { options = { rev: options }; } - const { rev, ...qs } = options; + const { rev, ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; return this._db.request( @@ -672,7 +672,7 @@ export class GraphVertexCollection = any> this.graph.name )}/vertex/${encodeURI(_documentHandle(selector, this._name))}`, body: newValue, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "vertex") @@ -717,7 +717,7 @@ export class GraphVertexCollection = any> options = { rev: options }; } const headers: Record = {}; - const { rev, ...qs } = options; + const { rev, ...search } = options; if (rev) headers["if-match"] = rev; return this._db.request( { @@ -726,7 +726,7 @@ export class GraphVertexCollection = any> this.graph.name )}/vertex/${encodeURI(_documentHandle(selector, this._name))}`, body: newValue, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "vertex") @@ -772,7 +772,7 @@ export class GraphVertexCollection = any> options = { rev: options }; } const headers: Record = {}; - const { rev, ...qs } = options; + const { rev, ...search } = options; if (rev) headers["if-match"] = rev; return this._db.request( { @@ -780,7 +780,7 @@ export class GraphVertexCollection = any> path: `/_api/gharial/${encodeURIComponent( this.graph.name )}/vertex/${encodeURI(_documentHandle(selector, this._name))}`, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "removed") @@ -965,7 +965,7 @@ export class GraphEdgeCollection = any> allowDirtyRead = undefined, graceful = false, rev, - ...qs + ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; @@ -974,7 +974,7 @@ export class GraphEdgeCollection = any> path: `/_api/gharial/${encodeURIComponent( this.graph.name )}/edge/${encodeURI(_documentHandle(selector, this._name))}`, - qs, + search, allowDirtyRead, }, (res) => res.parsedBody.edge @@ -1018,7 +1018,7 @@ export class GraphEdgeCollection = any> this.graph.name )}/edge/${encodeURIComponent(this._name)}`, body: data, - qs: options, + search: options, }, (res) => mungeGharialResponse(res.parsedBody, "edge") ); @@ -1069,7 +1069,7 @@ export class GraphEdgeCollection = any> if (typeof options === "string") { options = { rev: options }; } - const { rev, ...qs } = options; + const { rev, ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; return this._db.request( @@ -1079,7 +1079,7 @@ export class GraphEdgeCollection = any> this.graph.name )}/edge/${encodeURI(_documentHandle(selector, this._name))}`, body: newValue, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "edge") @@ -1131,7 +1131,7 @@ export class GraphEdgeCollection = any> if (typeof options === "string") { options = { rev: options }; } - const { rev, ...qs } = options; + const { rev, ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; return this._db.request( @@ -1141,7 +1141,7 @@ export class GraphEdgeCollection = any> this.graph.name )}/edge/${encodeURI(_documentHandle(selector, this._name))}`, body: newValue, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "edge") @@ -1178,7 +1178,7 @@ export class GraphEdgeCollection = any> if (typeof options === "string") { options = { rev: options }; } - const { rev, ...qs } = options; + const { rev, ...search } = options; const headers: Record = {}; if (rev) headers["if-match"] = rev; return this._db.request( @@ -1187,7 +1187,7 @@ export class GraphEdgeCollection = any> path: `/_api/gharial/${encodeURIComponent( this.graph.name )}/edge/${encodeURI(_documentHandle(selector, this._name))}`, - qs, + search, headers, }, (res) => mungeGharialResponse(res.parsedBody, "removed") @@ -1310,7 +1310,7 @@ export class Graph { name: this._name, options: { ...opts, satellites: satellites?.map(collectionToString) }, }, - qs: { waitForSync }, + search: { waitForSync }, }, (res) => res.parsedBody.graph ); @@ -1335,7 +1335,7 @@ export class Graph { { method: "DELETE", path: `/_api/gharial/${encodeURIComponent(this._name)}`, - qs: { dropCollections }, + search: { dropCollections }, }, (res) => res.parsedBody.removed ); @@ -1482,7 +1482,7 @@ export class Graph { path: `/_api/gharial/${encodeURIComponent( this._name )}/vertex/${encodeURIComponent(collectionToString(collection))}`, - qs: { + search: { dropCollection, }, }, @@ -1749,7 +1749,7 @@ export class Graph { path: `/_api/gharial/${encodeURIComponent( this._name )}/edge/${encodeURIComponent(collectionToString(collection))}`, - qs: { + search: { dropCollection, }, }, diff --git a/src/lib/request.ts b/src/lib/request.ts index 1f1801da..f4227867 100644 --- a/src/lib/request.ts +++ b/src/lib/request.ts @@ -42,7 +42,7 @@ export interface ArangojsError extends Error { export type RequestOptions = { method: string; pathname: string; - qs?: URLSearchParams; + search?: URLSearchParams; headers: Headers; body: any; expectBinary: boolean; @@ -89,7 +89,7 @@ export function createRequest( return Object.assign( async function request({ method, - qs: searchParams, + search: searchParams, pathname: requestPath, headers: requestHeaders, body, diff --git a/src/route.ts b/src/route.ts index d62e61ae..7699ed1b 100644 --- a/src/route.ts +++ b/src/route.ts @@ -95,7 +95,7 @@ export class Route { * and returns the server response. * * @param path - Path relative to this route. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -107,14 +107,14 @@ export class Route { */ delete( path: string, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** * Performs a DELETE request against the given path relative to this route * and returns the server response. * - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -126,13 +126,13 @@ export class Route { * ``` */ delete( - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; delete(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [qs, headers] = args; - return this.request({ method: "DELETE", path, qs, headers }); + const [search, headers] = args; + return this.request({ method: "DELETE", path, search, headers }); } /** @@ -140,7 +140,7 @@ export class Route { * and returns the server response. * * @param path - Path relative to this route. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -152,14 +152,14 @@ export class Route { */ get( path: string, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** * Performs a GET request against the given path relative to this route * and returns the server response. * - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -171,13 +171,13 @@ export class Route { * ``` */ get( - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; get(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [qs, headers] = args; - return this.request({ method: "GET", path, qs, headers }); + const [search, headers] = args; + return this.request({ method: "GET", path, search, headers }); } /** @@ -185,7 +185,7 @@ export class Route { * and returns the server response. * * @param path - Path relative to this route. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -197,14 +197,14 @@ export class Route { */ head( path: string, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** * Performs a HEAD request against the given path relative to this route * and returns the server response. * - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -216,13 +216,13 @@ export class Route { * ``` */ head( - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; head(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [qs, headers] = args; - return this.request({ method: "HEAD", path, qs, headers }); + const [search, headers] = args; + return this.request({ method: "HEAD", path, search, headers }); } /** @@ -231,7 +231,7 @@ export class Route { * * @param path - Path relative to this route. * @param body - Body of the request object. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -244,7 +244,7 @@ export class Route { patch( path: string, body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** @@ -254,7 +254,7 @@ export class Route { * **Note**: `body` must not be a `string`. * * @param body - Body of the request object. Must not be a string. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -267,13 +267,13 @@ export class Route { */ patch( body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; patch(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [body, qs, headers] = args; - return this.request({ method: "PATCH", path, body, qs, headers }); + const [body, search, headers] = args; + return this.request({ method: "PATCH", path, body, search, headers }); } /** @@ -282,7 +282,7 @@ export class Route { * * @param path - Path relative to this route. * @param body - Body of the request object. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -298,7 +298,7 @@ export class Route { post( path: string, body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** @@ -308,7 +308,7 @@ export class Route { * **Note**: `body` must not be a `string`. * * @param body - Body of the request object. Must not be a string. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -324,13 +324,13 @@ export class Route { */ post( body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; post(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [body, qs, headers] = args; - return this.request({ method: "POST", path, body, qs, headers }); + const [body, search, headers] = args; + return this.request({ method: "POST", path, body, search, headers }); } /** @@ -339,7 +339,7 @@ export class Route { * * @param path - Path relative to this route. * @param body - Body of the request object. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -352,7 +352,7 @@ export class Route { put( path: string, body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; /** @@ -362,7 +362,7 @@ export class Route { * **Note**: `body` must not be a `string`. * * @param body - Body of the request object. Must not be a string. - * @param qs - Query string parameters for this request. + * @param search - Query string parameters for this request. * @param headers - Additional headers to send with this request. * * @example @@ -375,12 +375,12 @@ export class Route { */ put( body?: any, - qs?: URLSearchParams | Record, + search?: URLSearchParams | Record, headers?: Headers | Record ): Promise; put(...args: any[]): Promise { const path = typeof args[0] === "string" ? args.shift() : undefined; - const [body, qs, headers] = args; - return this.request({ method: "PUT", path, body, qs, headers }); + const [body, search, headers] = args; + return this.request({ method: "PUT", path, body, search, headers }); } }