@microsoft/kiota-http-fetchlibrary
Advanced tools
Comparing version 1.0.0-preview.43 to 1.0.0-preview.44
@@ -28,3 +28,3 @@ import { type AuthenticationProvider, type BackingStoreFactory, type DateOnly, type Duration, type ErrorMappings, type Parsable, type ParsableFactory, type ParseNodeFactory, type PrimitiveTypesForDeserialization, type PrimitiveTypesForDeserializationType, type RequestAdapter, type RequestInformation, type SerializationWriterFactory, type TimeOnly } from "@microsoft/kiota-abstractions"; | ||
private static readonly responseTypeAttributeKey; | ||
sendCollectionOfPrimitive: <ResponseType_1 extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionOfPrimitive: <ResponseType extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType[] | undefined>; | ||
sendCollection: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType[] | undefined>; | ||
@@ -34,3 +34,3 @@ private startTracingSpan; | ||
send: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitive: <ResponseType_1 extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendPrimitive: <ResponseType extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType | undefined>; | ||
sendNoResponseContent: (requestInfo: RequestInformation, errorMappings: ErrorMappings | undefined) => Promise<void>; | ||
@@ -37,0 +37,0 @@ enableBackingStore: (backingStoreFactory?: BackingStoreFactory | undefined) => void; |
@@ -11,4 +11,30 @@ import { Middleware } from "."; | ||
* @static | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation both parameters are optional. | ||
* if not provided, the default fetch implementation and middlewares will be used. | ||
* @param {(request: string, init?: RequestInit) => Promise < Response >} customFetch - a Fetch API implementation | ||
* @param {Middleware[]} middlewares - an aray of Middleware handlers | ||
* If middlewares param is undefined, the httpClient instance will use the default array of middlewares. | ||
* Set middlewares to `null` if you do not wish to use middlewares. | ||
* If custom fetch is undefined, the httpClient instance uses the `DefaultFetchHandler` | ||
* @returns a HttpClient instance | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with both customFetch and middlewares parameters provided | ||
* KiotaClientFactory.create(customFetch, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only customFetch parameter provided | ||
* KiotaClientFactory.create(customFetch); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only middlewares parameter provided | ||
* KiotaClientFactory.create(undefined, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with no parameters provided | ||
* KiotaClientFactory.create(); | ||
* ``` | ||
*/ | ||
@@ -15,0 +41,0 @@ static create(customFetch?: (request: string, init: RequestInit) => Promise<Response>, middlewares?: Middleware[]): HttpClient; |
@@ -14,4 +14,30 @@ "use strict"; | ||
* @static | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation both parameters are optional. | ||
* if not provided, the default fetch implementation and middlewares will be used. | ||
* @param {(request: string, init?: RequestInit) => Promise < Response >} customFetch - a Fetch API implementation | ||
* @param {Middleware[]} middlewares - an aray of Middleware handlers | ||
* If middlewares param is undefined, the httpClient instance will use the default array of middlewares. | ||
* Set middlewares to `null` if you do not wish to use middlewares. | ||
* If custom fetch is undefined, the httpClient instance uses the `DefaultFetchHandler` | ||
* @returns a HttpClient instance | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with both customFetch and middlewares parameters provided | ||
* KiotaClientFactory.create(customFetch, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only customFetch parameter provided | ||
* KiotaClientFactory.create(customFetch); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only middlewares parameter provided | ||
* KiotaClientFactory.create(undefined, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with no parameters provided | ||
* KiotaClientFactory.create(); | ||
* ``` | ||
*/ | ||
@@ -18,0 +44,0 @@ static create(customFetch = fetch, middlewares) { |
@@ -108,4 +108,4 @@ "use strict"; | ||
executeWithRedirect(url, fetchRequestInit, redirectCount, currentOptions, requestOptions, tracerName) { | ||
var _a; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
const response = yield ((_a = this.next) === null || _a === void 0 ? void 0 : _a.execute(url, fetchRequestInit, requestOptions)); | ||
@@ -112,0 +112,0 @@ if (!response) { |
@@ -128,4 +128,4 @@ "use strict"; | ||
executeWithRetry(url, fetchRequestInit, retryAttempts, currentOptions, requestOptions, tracerName) { | ||
var _a; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
const response = yield ((_a = this.next) === null || _a === void 0 ? void 0 : _a.execute(url, fetchRequestInit, requestOptions)); | ||
@@ -132,0 +132,0 @@ if (!response) { |
@@ -45,4 +45,4 @@ "use strict"; | ||
addValue(url, requestInit, requestOptions) { | ||
var _a; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
let currentOptions = this._options; | ||
@@ -49,0 +49,0 @@ if (requestOptions && requestOptions[userAgentHandlerOptions_1.UserAgentHandlerOptionsKey]) { |
@@ -34,3 +34,3 @@ /** | ||
values?(): IterableIterator<string>; | ||
/** Node-fetch extension */ | ||
/** Node extension */ | ||
raw?(): Record<string, string[]>; | ||
@@ -45,3 +45,3 @@ }; | ||
* Expected type in case of dom - ReadableStream | XMLHttpRequestBodyInit|null | ||
* Expected type in case of node-fetch - | Blob | Buffer | URLSearchParams | NodeJS.ReadableStream | string|null | ||
* Expected type in case of node.js - | Blob | Buffer | URLSearchParams | NodeJS.ReadableStream | string|null | ||
*/ | ||
@@ -48,0 +48,0 @@ body?: unknown; |
@@ -28,3 +28,3 @@ import { type AuthenticationProvider, type BackingStoreFactory, type DateOnly, type Duration, type ErrorMappings, type Parsable, type ParsableFactory, type ParseNodeFactory, type PrimitiveTypesForDeserialization, type PrimitiveTypesForDeserializationType, type RequestAdapter, type RequestInformation, type SerializationWriterFactory, type TimeOnly } from "@microsoft/kiota-abstractions"; | ||
private static readonly responseTypeAttributeKey; | ||
sendCollectionOfPrimitive: <ResponseType_1 extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionOfPrimitive: <ResponseType extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType[] | undefined>; | ||
sendCollection: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType[] | undefined>; | ||
@@ -34,3 +34,3 @@ private startTracingSpan; | ||
send: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitive: <ResponseType_1 extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendPrimitive: <ResponseType extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType | undefined>; | ||
sendNoResponseContent: (requestInfo: RequestInformation, errorMappings: ErrorMappings | undefined) => Promise<void>; | ||
@@ -37,0 +37,0 @@ enableBackingStore: (backingStoreFactory?: BackingStoreFactory | undefined) => void; |
@@ -11,4 +11,30 @@ import { Middleware } from "."; | ||
* @static | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation both parameters are optional. | ||
* if not provided, the default fetch implementation and middlewares will be used. | ||
* @param {(request: string, init?: RequestInit) => Promise < Response >} customFetch - a Fetch API implementation | ||
* @param {Middleware[]} middlewares - an aray of Middleware handlers | ||
* If middlewares param is undefined, the httpClient instance will use the default array of middlewares. | ||
* Set middlewares to `null` if you do not wish to use middlewares. | ||
* If custom fetch is undefined, the httpClient instance uses the `DefaultFetchHandler` | ||
* @returns a HttpClient instance | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with both customFetch and middlewares parameters provided | ||
* KiotaClientFactory.create(customFetch, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only customFetch parameter provided | ||
* KiotaClientFactory.create(customFetch); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only middlewares parameter provided | ||
* KiotaClientFactory.create(undefined, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with no parameters provided | ||
* KiotaClientFactory.create(); | ||
* ``` | ||
*/ | ||
@@ -15,0 +41,0 @@ static create(customFetch?: (request: string, init: RequestInit) => Promise<Response>, middlewares?: Middleware[]): HttpClient; |
@@ -11,4 +11,30 @@ import { MiddlewareFactory } from "."; | ||
* @static | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation | ||
* Returns an instance of HttpClient with the provided middlewares and custom fetch implementation both parameters are optional. | ||
* if not provided, the default fetch implementation and middlewares will be used. | ||
* @param {(request: string, init?: RequestInit) => Promise < Response >} customFetch - a Fetch API implementation | ||
* @param {Middleware[]} middlewares - an aray of Middleware handlers | ||
* If middlewares param is undefined, the httpClient instance will use the default array of middlewares. | ||
* Set middlewares to `null` if you do not wish to use middlewares. | ||
* If custom fetch is undefined, the httpClient instance uses the `DefaultFetchHandler` | ||
* @returns a HttpClient instance | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with both customFetch and middlewares parameters provided | ||
* KiotaClientFactory.create(customFetch, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only customFetch parameter provided | ||
* KiotaClientFactory.create(customFetch); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with only middlewares parameter provided | ||
* KiotaClientFactory.create(undefined, [middleware1, middleware2]); | ||
* ``` | ||
* @example | ||
* ```Typescript | ||
* // Example usage of KiotaClientFactory.create method with no parameters provided | ||
* KiotaClientFactory.create(); | ||
* ``` | ||
*/ | ||
@@ -15,0 +41,0 @@ static create(customFetch = fetch, middlewares) { |
@@ -34,3 +34,3 @@ /** | ||
values?(): IterableIterator<string>; | ||
/** Node-fetch extension */ | ||
/** Node extension */ | ||
raw?(): Record<string, string[]>; | ||
@@ -45,3 +45,3 @@ }; | ||
* Expected type in case of dom - ReadableStream | XMLHttpRequestBodyInit|null | ||
* Expected type in case of node-fetch - | Blob | Buffer | URLSearchParams | NodeJS.ReadableStream | string|null | ||
* Expected type in case of node.js - | Blob | Buffer | URLSearchParams | NodeJS.ReadableStream | string|null | ||
*/ | ||
@@ -48,0 +48,0 @@ body?: unknown; |
{ | ||
"name": "@microsoft/kiota-http-fetchlibrary", | ||
"version": "1.0.0-preview.43", | ||
"version": "1.0.0-preview.44", | ||
"description": "Kiota request adapter implementation with fetch", | ||
@@ -41,6 +41,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@microsoft/kiota-abstractions": "^1.0.0-preview.44", | ||
"@microsoft/kiota-abstractions": "^1.0.0-preview.45", | ||
"@opentelemetry/api": "^1.7.0", | ||
"guid-typescript": "^1.0.9", | ||
"node-fetch": "^2.7.0", | ||
"tslib": "^2.6.2" | ||
@@ -51,3 +50,3 @@ }, | ||
}, | ||
"gitHead": "98776bbe189b55218a14ba4759d0a3acd93297d8" | ||
"gitHead": "846e942d821f453da523061ba1ef950de3e9d913" | ||
} |
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
480157
4
7157
+ Addedtinyduration@3.3.1(transitive)
- Removednode-fetch@^2.7.0
- Removednode-fetch@2.7.0(transitive)
- Removedtinyduration@3.4.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)