@microsoft/kiota-http-fetchlibrary
Advanced tools
Comparing version 1.0.0-preview.35 to 1.0.0-preview.36
@@ -1,2 +0,2 @@ | ||
import { type AuthenticationProvider, type BackingStoreFactory, type Parsable, type ParsableFactory, type ParseNodeFactory, type RequestAdapter, type RequestInformation, type SerializationWriterFactory } from "@microsoft/kiota-abstractions"; | ||
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"; | ||
import { HttpClient } from "./httpClient"; | ||
@@ -25,9 +25,9 @@ import { type ObservabilityOptions } from "./observabilityOptions"; | ||
private static readonly responseTypeAttributeKey; | ||
sendCollectionOfPrimitiveAsync: <ResponseType_1>(requestInfo: RequestInformation, responseType: "string" | "number" | "boolean" | "Date", errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ModelType[] | undefined>; | ||
sendCollectionOfPrimitiveAsync: <ResponseType_1 extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType[] | undefined>; | ||
private startTracingSpan; | ||
static readonly eventResponseHandlerInvokedKey = "com.microsoft.kiota.response_handler_invoked"; | ||
sendAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitiveAsync: <ResponseType_1>(requestInfo: RequestInformation, responseType: "string" | "number" | "boolean" | "Date" | "ArrayBuffer", errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendNoResponseContentAsync: (requestInfo: RequestInformation, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<void>; | ||
sendAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitiveAsync: <ResponseType_1 extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendNoResponseContentAsync: (requestInfo: RequestInformation, errorMappings: ErrorMappings | undefined) => Promise<void>; | ||
enableBackingStore: (backingStoreFactory?: BackingStoreFactory | undefined) => void; | ||
@@ -34,0 +34,0 @@ private getRootParseNode; |
@@ -349,4 +349,3 @@ "use strict"; | ||
}); | ||
const statusCodeAsString = statusCode.toString(); | ||
if (!errorMappings || (!errorMappings[statusCodeAsString] && !(statusCode >= 400 && statusCode < 500 && errorMappings["4XX"]) && !(statusCode >= 500 && statusCode < 600 && errorMappings["5XX"]))) { | ||
if (!errorMappings || (!errorMappings[statusCode] && !(statusCode >= 400 && statusCode < 500 && errorMappings._4XX) && !(statusCode >= 500 && statusCode < 600 && errorMappings._5XX))) { | ||
spanForAttributes.setAttribute(FetchRequestAdapter.errorMappingFoundAttributeName, false); | ||
@@ -360,3 +359,3 @@ const error = new kiota_abstractions_1.DefaultApiError("the server returned an unexpected status code and no error class is registered for this code " + statusCode); | ||
spanForAttributes.setAttribute(FetchRequestAdapter.errorMappingFoundAttributeName, true); | ||
const factory = (_b = (_a = errorMappings[statusCodeAsString]) !== null && _a !== void 0 ? _a : (statusCode >= 400 && statusCode < 500 ? errorMappings["4XX"] : undefined)) !== null && _b !== void 0 ? _b : (statusCode >= 500 && statusCode < 600 ? errorMappings["5XX"] : undefined); | ||
const factory = (_b = (_a = errorMappings[statusCode]) !== null && _a !== void 0 ? _a : (statusCode >= 400 && statusCode < 500 ? errorMappings._4XX : undefined)) !== null && _b !== void 0 ? _b : (statusCode >= 500 && statusCode < 600 ? errorMappings._5XX : undefined); | ||
const rootNode = yield this.getRootParseNode(response); | ||
@@ -363,0 +362,0 @@ let error = api_1.trace.getTracer(this.observabilityOptions.getTracerInstrumentationName()).startActiveSpan("getObjectValue", (deserializeSpan) => { |
@@ -1,2 +0,2 @@ | ||
import { type AuthenticationProvider, type BackingStoreFactory, type Parsable, type ParsableFactory, type ParseNodeFactory, type RequestAdapter, type RequestInformation, type SerializationWriterFactory } from "@microsoft/kiota-abstractions"; | ||
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"; | ||
import { HttpClient } from "./httpClient"; | ||
@@ -25,9 +25,9 @@ import { type ObservabilityOptions } from "./observabilityOptions"; | ||
private static readonly responseTypeAttributeKey; | ||
sendCollectionOfPrimitiveAsync: <ResponseType_1>(requestInfo: RequestInformation, responseType: "string" | "number" | "boolean" | "Date", errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ModelType[] | undefined>; | ||
sendCollectionOfPrimitiveAsync: <ResponseType_1 extends string | number | boolean | DateOnly | Date | Duration | TimeOnly>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1[] | undefined>; | ||
sendCollectionAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserialization: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType[] | undefined>; | ||
private startTracingSpan; | ||
static readonly eventResponseHandlerInvokedKey = "com.microsoft.kiota.response_handler_invoked"; | ||
sendAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitiveAsync: <ResponseType_1>(requestInfo: RequestInformation, responseType: "string" | "number" | "boolean" | "Date" | "ArrayBuffer", errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendNoResponseContentAsync: (requestInfo: RequestInformation, errorMappings: Record<string, ParsableFactory<Parsable>> | undefined) => Promise<void>; | ||
sendAsync: <ModelType extends Parsable>(requestInfo: RequestInformation, deserializer: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined) => Promise<ModelType | undefined>; | ||
sendPrimitiveAsync: <ResponseType_1 extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined) => Promise<ResponseType_1 | undefined>; | ||
sendNoResponseContentAsync: (requestInfo: RequestInformation, errorMappings: ErrorMappings | undefined) => Promise<void>; | ||
enableBackingStore: (backingStoreFactory?: BackingStoreFactory | undefined) => void; | ||
@@ -34,0 +34,0 @@ private getRootParseNode; |
@@ -345,4 +345,3 @@ import { BackingStoreFactorySingleton, DefaultApiError, enableBackingStoreForParseNodeFactory, enableBackingStoreForSerializationWriterFactory, ParseNodeFactoryRegistry, ResponseHandlerOptionKey, SerializationWriterFactoryRegistry } from "@microsoft/kiota-abstractions"; | ||
}); | ||
const statusCodeAsString = statusCode.toString(); | ||
if (!errorMappings || (!errorMappings[statusCodeAsString] && !(statusCode >= 400 && statusCode < 500 && errorMappings["4XX"]) && !(statusCode >= 500 && statusCode < 600 && errorMappings["5XX"]))) { | ||
if (!errorMappings || (!errorMappings[statusCode] && !(statusCode >= 400 && statusCode < 500 && errorMappings._4XX) && !(statusCode >= 500 && statusCode < 600 && errorMappings._5XX))) { | ||
spanForAttributes.setAttribute(FetchRequestAdapter.errorMappingFoundAttributeName, false); | ||
@@ -356,3 +355,3 @@ const error = new DefaultApiError("the server returned an unexpected status code and no error class is registered for this code " + statusCode); | ||
spanForAttributes.setAttribute(FetchRequestAdapter.errorMappingFoundAttributeName, true); | ||
const factory = (_b = (_a = errorMappings[statusCodeAsString]) !== null && _a !== void 0 ? _a : (statusCode >= 400 && statusCode < 500 ? errorMappings["4XX"] : undefined)) !== null && _b !== void 0 ? _b : (statusCode >= 500 && statusCode < 600 ? errorMappings["5XX"] : undefined); | ||
const factory = (_b = (_a = errorMappings[statusCode]) !== null && _a !== void 0 ? _a : (statusCode >= 400 && statusCode < 500 ? errorMappings._4XX : undefined)) !== null && _b !== void 0 ? _b : (statusCode >= 500 && statusCode < 600 ? errorMappings._5XX : undefined); | ||
const rootNode = await this.getRootParseNode(response); | ||
@@ -359,0 +358,0 @@ let error = trace.getTracer(this.observabilityOptions.getTracerInstrumentationName()).startActiveSpan("getObjectValue", (deserializeSpan) => { |
{ | ||
"name": "@microsoft/kiota-http-fetchlibrary", | ||
"version": "1.0.0-preview.35", | ||
"version": "1.0.0-preview.36", | ||
"description": "Kiota request adapter implementation with fetch", | ||
@@ -28,5 +28,5 @@ "keywords": [ | ||
"scripts": { | ||
"build": "npm run build:cjs && npm run build:es", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc -b tsconfig.cjs.json", | ||
"build:es": "tsc -b tsconfig.es.json", | ||
"build:esm": "tsc -b tsconfig.es.json", | ||
"build:test": "tsc -b tsconfig.cjs.test.json && tsc -b tsconfig.es.test.json", | ||
@@ -42,3 +42,3 @@ "clean": "rm -r ./dist", | ||
"dependencies": { | ||
"@microsoft/kiota-abstractions": "^1.0.0-preview.36", | ||
"@microsoft/kiota-abstractions": "^1.0.0-preview.37", | ||
"@opentelemetry/api": "^1.2.0", | ||
@@ -52,3 +52,3 @@ "guid-typescript": "^1.0.9", | ||
}, | ||
"gitHead": "5ecae0ccedf98e8fbc63db23a0b0ca92ad396cbf" | ||
"gitHead": "0eaf0d73064a873397aca770944c1dea00264cac" | ||
} |
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
450321
6406