@microsoft/kiota-abstractions
Advanced tools
Comparing version 1.0.0-preview.34 to 1.0.0-preview.35
@@ -92,2 +92,9 @@ /** | ||
/** | ||
* Adds all headers from the request configuration value to the current headers collection. | ||
* Replaces any existing headers with the same key. | ||
* @param headers The headers to update the current headers with. | ||
* @throws Error if headers is null | ||
*/ | ||
addAllRaw(headers: Record<string, string | string[]>): void; | ||
/** | ||
* Gets the values for the header with the specified name. | ||
@@ -94,0 +101,0 @@ * @param key The name of the header to get the values for. |
@@ -190,2 +190,22 @@ "use strict"; | ||
/** | ||
* Adds all headers from the request configuration value to the current headers collection. | ||
* Replaces any existing headers with the same key. | ||
* @param headers The headers to update the current headers with. | ||
* @throws Error if headers is null | ||
*/ | ||
addAllRaw(headers) { | ||
if (!headers) { | ||
throw new Error("headers cannot be null"); | ||
} | ||
for (const header in headers) { | ||
const headerValues = headers[header]; | ||
if (Array.isArray(headerValues)) { | ||
this.add(header, ...headerValues); | ||
} | ||
else { | ||
this.add(header, headerValues); | ||
} | ||
} | ||
} | ||
/** | ||
* Gets the values for the header with the specified name. | ||
@@ -192,0 +212,0 @@ * @param key The name of the header to get the values for. |
@@ -1,2 +0,1 @@ | ||
import { Headers } from "./headers"; | ||
import type { RequestOption } from "./requestOption"; | ||
@@ -11,3 +10,3 @@ /** | ||
*/ | ||
headers?: Headers; | ||
headers?: Record<string, string | string[]>; | ||
/** | ||
@@ -14,0 +13,0 @@ * Request options |
@@ -39,3 +39,3 @@ import { Headers } from "./headers"; | ||
/** Adds the headers for the request. */ | ||
addRequestHeaders(source: Headers | undefined): void; | ||
addRequestHeaders(source: Record<string, string | string[]> | undefined): void; | ||
/** Adds the request options for the request. */ | ||
@@ -42,0 +42,0 @@ addRequestOptions(options: RequestOption[] | undefined): void; |
@@ -215,3 +215,3 @@ "use strict"; | ||
if (source) { | ||
this.headers.addAll(source); | ||
this.headers.addAllRaw(source); | ||
} | ||
@@ -218,0 +218,0 @@ } |
@@ -92,2 +92,9 @@ /** | ||
/** | ||
* Adds all headers from the request configuration value to the current headers collection. | ||
* Replaces any existing headers with the same key. | ||
* @param headers The headers to update the current headers with. | ||
* @throws Error if headers is null | ||
*/ | ||
addAllRaw(headers: Record<string, string | string[]>): void; | ||
/** | ||
* Gets the values for the header with the specified name. | ||
@@ -94,0 +101,0 @@ * @param key The name of the header to get the values for. |
@@ -187,2 +187,22 @@ import { createRecordWithCaseInsensitiveKeys } from "./recordWithCaseInsensitiveKeys"; | ||
/** | ||
* Adds all headers from the request configuration value to the current headers collection. | ||
* Replaces any existing headers with the same key. | ||
* @param headers The headers to update the current headers with. | ||
* @throws Error if headers is null | ||
*/ | ||
addAllRaw(headers) { | ||
if (!headers) { | ||
throw new Error("headers cannot be null"); | ||
} | ||
for (const header in headers) { | ||
const headerValues = headers[header]; | ||
if (Array.isArray(headerValues)) { | ||
this.add(header, ...headerValues); | ||
} | ||
else { | ||
this.add(header, headerValues); | ||
} | ||
} | ||
} | ||
/** | ||
* Gets the values for the header with the specified name. | ||
@@ -189,0 +209,0 @@ * @param key The name of the header to get the values for. |
@@ -1,2 +0,1 @@ | ||
import { Headers } from "./headers"; | ||
import type { RequestOption } from "./requestOption"; | ||
@@ -11,3 +10,3 @@ /** | ||
*/ | ||
headers?: Headers; | ||
headers?: Record<string, string | string[]>; | ||
/** | ||
@@ -14,0 +13,0 @@ * Request options |
@@ -39,3 +39,3 @@ import { Headers } from "./headers"; | ||
/** Adds the headers for the request. */ | ||
addRequestHeaders(source: Headers | undefined): void; | ||
addRequestHeaders(source: Record<string, string | string[]> | undefined): void; | ||
/** Adds the request options for the request. */ | ||
@@ -42,0 +42,0 @@ addRequestOptions(options: RequestOption[] | undefined): void; |
@@ -212,3 +212,3 @@ import { trace } from "@opentelemetry/api"; | ||
if (source) { | ||
this.headers.addAll(source); | ||
this.headers.addAllRaw(source); | ||
} | ||
@@ -215,0 +215,0 @@ } |
{ | ||
"name": "@microsoft/kiota-abstractions", | ||
"version": "1.0.0-preview.34", | ||
"version": "1.0.0-preview.35", | ||
"description": "Core abstractions for kiota generated libraries in TypeScript and JavaScript", | ||
@@ -47,3 +47,3 @@ "main": "dist/cjs/src/index.js", | ||
}, | ||
"gitHead": "c731ed89d43ad65f07917127e51d9c40c7042933" | ||
"gitHead": "eed2b52a966b30db66f9b1d0995fee8fe87a9bcd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
608757
6880