@microsoft/kiota-abstractions
Advanced tools
Comparing version 1.0.0-preview.48 to 1.0.0-preview.49
@@ -15,2 +15,3 @@ import type { ErrorMappings, PrimitiveTypesForDeserialization, RequestAdapter, SendMethods } from "./requestAdapter"; | ||
uriTemplate: string; | ||
enumObject?: EnumObject; | ||
} | ||
@@ -32,4 +33,5 @@ export interface RequestsMetadata { | ||
} | ||
type EnumObject<T extends Record<string, unknown> = Record<string, unknown>> = T; | ||
export type KeysToExcludeForNavigationMetadata = KeysOfRequestsMetadata | "toDeleteRequestInformation" | "toGetRequestInformation" | "toHeadRequestInformation" | "toOptionsRequestInformation" | "toPatchRequestInformation" | "toPostRequestInformation" | "toPutRequestInformation" | "withUrl"; | ||
export {}; | ||
//# sourceMappingURL=apiClientProxifier.d.ts.map |
@@ -96,2 +96,12 @@ "use strict"; | ||
return requestAdapter.sendCollection(requestInfo, metadata.responseBodyFactory, metadata.errorMappings); | ||
case "sendEnum": | ||
if (!metadata.enumObject) { | ||
throw new Error("couldn't find response body factory"); | ||
} | ||
return requestAdapter.sendEnum(requestInfo, metadata.enumObject, metadata.errorMappings); | ||
case "sendCollectionOfEnum": | ||
if (!metadata.enumObject) { | ||
throw new Error("couldn't find response body factory"); | ||
} | ||
return requestAdapter.sendCollectionOfEnum(requestInfo, metadata.enumObject, metadata.errorMappings); | ||
case "sendCollectionOfPrimitive": | ||
@@ -98,0 +108,0 @@ if (!metadata.responseBodyFactory) { |
@@ -59,2 +59,22 @@ import type { DateOnly } from "./dateOnly"; | ||
/** | ||
* Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum response model. | ||
* | ||
* @template EnumObject - The type of the enum object. Must extend Record<string, unknown>. | ||
* @param {RequestInformation} requestInfo - The request info to execute. | ||
* @param {EnumObject} enumObject - The Enum object expected in the response. | ||
* @param {ErrorMappings | undefined} errorMappings - the error factories mapping to use in case of a failed request. | ||
* @returns {Promise<EnumObject[keyof EnumObject] | undefined>} - A promise that resolves to the response of the request, or undefined if an error occurred. | ||
*/ | ||
sendEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject] | undefined>; | ||
/** | ||
* Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. | ||
* | ||
* @template EnumObject - The type of the enum objects. Must extend Record<string, unknown>. | ||
* @param {RequestInformation} requestInfo - The request info to execute. | ||
* @param {EnumObject} enumObject - The Enum object expected in the response. | ||
* @param {ErrorMappings | undefined} errorMappings - the error factories mapping to use in case of a failed request. | ||
* @returns {Promise<EnumObject[keyof EnumObject][] | undefined>} - with the deserialized response model collection. | ||
*/ | ||
sendCollectionOfEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject][] | undefined>; | ||
/** | ||
* Enables the backing store proxies for the SerializationWriters and ParseNodes in use. | ||
@@ -61,0 +81,0 @@ * @param backingStoreFactory the backing store factory to use. |
@@ -15,2 +15,3 @@ import type { ErrorMappings, PrimitiveTypesForDeserialization, RequestAdapter, SendMethods } from "./requestAdapter"; | ||
uriTemplate: string; | ||
enumObject?: EnumObject; | ||
} | ||
@@ -32,4 +33,5 @@ export interface RequestsMetadata { | ||
} | ||
type EnumObject<T extends Record<string, unknown> = Record<string, unknown>> = T; | ||
export type KeysToExcludeForNavigationMetadata = KeysOfRequestsMetadata | "toDeleteRequestInformation" | "toGetRequestInformation" | "toHeadRequestInformation" | "toOptionsRequestInformation" | "toPatchRequestInformation" | "toPostRequestInformation" | "toPutRequestInformation" | "withUrl"; | ||
export {}; | ||
//# sourceMappingURL=apiClientProxifier.d.ts.map |
@@ -93,2 +93,12 @@ import { getPathParameters } from "./getPathParameters"; | ||
return requestAdapter.sendCollection(requestInfo, metadata.responseBodyFactory, metadata.errorMappings); | ||
case "sendEnum": | ||
if (!metadata.enumObject) { | ||
throw new Error("couldn't find response body factory"); | ||
} | ||
return requestAdapter.sendEnum(requestInfo, metadata.enumObject, metadata.errorMappings); | ||
case "sendCollectionOfEnum": | ||
if (!metadata.enumObject) { | ||
throw new Error("couldn't find response body factory"); | ||
} | ||
return requestAdapter.sendCollectionOfEnum(requestInfo, metadata.enumObject, metadata.errorMappings); | ||
case "sendCollectionOfPrimitive": | ||
@@ -95,0 +105,0 @@ if (!metadata.responseBodyFactory) { |
@@ -59,2 +59,22 @@ import type { DateOnly } from "./dateOnly"; | ||
/** | ||
* Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum response model. | ||
* | ||
* @template EnumObject - The type of the enum object. Must extend Record<string, unknown>. | ||
* @param {RequestInformation} requestInfo - The request info to execute. | ||
* @param {EnumObject} enumObject - The Enum object expected in the response. | ||
* @param {ErrorMappings | undefined} errorMappings - the error factories mapping to use in case of a failed request. | ||
* @returns {Promise<EnumObject[keyof EnumObject] | undefined>} - A promise that resolves to the response of the request, or undefined if an error occurred. | ||
*/ | ||
sendEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject] | undefined>; | ||
/** | ||
* Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. | ||
* | ||
* @template EnumObject - The type of the enum objects. Must extend Record<string, unknown>. | ||
* @param {RequestInformation} requestInfo - The request info to execute. | ||
* @param {EnumObject} enumObject - The Enum object expected in the response. | ||
* @param {ErrorMappings | undefined} errorMappings - the error factories mapping to use in case of a failed request. | ||
* @returns {Promise<EnumObject[keyof EnumObject][] | undefined>} - with the deserialized response model collection. | ||
*/ | ||
sendCollectionOfEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject][] | undefined>; | ||
/** | ||
* Enables the backing store proxies for the SerializationWriters and ParseNodes in use. | ||
@@ -61,0 +81,0 @@ * @param backingStoreFactory the backing store factory to use. |
{ | ||
"name": "@microsoft/kiota-abstractions", | ||
"version": "1.0.0-preview.48", | ||
"version": "1.0.0-preview.49", | ||
"description": "Core abstractions for kiota generated libraries in TypeScript and JavaScript", | ||
@@ -47,3 +47,3 @@ "main": "dist/cjs/src/index.js", | ||
}, | ||
"gitHead": "5ce4f291d27a8142a6df0716a38e06a765fb6563" | ||
"gitHead": "985036391e8a9823e363f5c2fde486ae9186ea0a" | ||
} |
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
706123
8099