@microsoft/kiota-abstractions
Advanced tools
Comparing version 1.0.0-preview.41 to 1.0.0-preview.42
import type { ErrorMappings, PrimitiveTypesForDeserialization, RequestAdapter } from "./requestAdapter"; | ||
import { type RequestInformationSetContent } from "./requestInformation"; | ||
import type { ModelSerializerFunction, Parsable, ParsableFactory } from "./serialization"; | ||
export declare function apiClientProxifier<T extends object>(requestAdapter: RequestAdapter, pathParameters: Record<string, unknown>, urlTemplate: string, navigationMetadata?: Record<string, NavigationMetadata>, requestsMetadata?: RequestsMetadata): T; | ||
export declare function apiClientProxifier<T extends object>(requestAdapter: RequestAdapter, pathParameters: Record<string, unknown>, navigationMetadata?: Record<string, NavigationMetadata>, requestsMetadata?: RequestsMetadata): T; | ||
export interface RequestMetadata { | ||
@@ -14,2 +14,3 @@ requestBodyContentType?: string; | ||
queryParametersMapper?: Record<string, string>; | ||
uriTemplate: string; | ||
} | ||
@@ -27,3 +28,2 @@ export interface RequestsMetadata { | ||
export interface NavigationMetadata { | ||
uriTemplate: string; | ||
requestsMetadata?: RequestsMetadata; | ||
@@ -30,0 +30,0 @@ navigationMetadata?: Record<string, NavigationMetadata>; |
@@ -112,3 +112,3 @@ "use strict"; | ||
} | ||
function apiClientProxifier(requestAdapter, pathParameters, urlTemplate, navigationMetadata, requestsMetadata) { | ||
function apiClientProxifier(requestAdapter, pathParameters, navigationMetadata, requestsMetadata) { | ||
if (!requestAdapter) | ||
@@ -118,4 +118,2 @@ throw new Error("requestAdapter cannot be undefined"); | ||
throw new Error("pathParameters cannot be undefined"); | ||
if (!urlTemplate) | ||
throw new Error("urlTemplate cannot be undefined"); | ||
return new Proxy({}, { | ||
@@ -128,3 +126,3 @@ get(target, property) { | ||
throw new Error("rawUrl cannot be undefined"); | ||
return apiClientProxifier(requestAdapter, (0, getPathParameters_1.getPathParameters)(rawUrl), urlTemplate, navigationMetadata, requestsMetadata); | ||
return apiClientProxifier(requestAdapter, (0, getPathParameters_1.getPathParameters)(rawUrl), navigationMetadata, requestsMetadata); | ||
}; | ||
@@ -140,3 +138,3 @@ } | ||
return (requestConfiguration) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -146,3 +144,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -152,3 +150,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -158,3 +156,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -164,3 +162,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -170,19 +168,19 @@ }; | ||
return (requestConfiguration) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
}; | ||
case "toPatchRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toPutRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toDeleteRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toPostRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, httpMethod_1.HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
@@ -201,3 +199,3 @@ default: | ||
// navigation property | ||
return apiClientProxifier(requestAdapter, (0, getPathParameters_1.getPathParameters)(pathParameters), navigationCandidate.uriTemplate, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
return apiClientProxifier(requestAdapter, (0, getPathParameters_1.getPathParameters)(pathParameters), navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
} | ||
@@ -214,3 +212,3 @@ return (...argArray) => { | ||
} | ||
return apiClientProxifier(requestAdapter, downWardPathParameters, navigationCandidate.uriTemplate, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
return apiClientProxifier(requestAdapter, downWardPathParameters, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
}; | ||
@@ -217,0 +215,0 @@ } |
import type { ErrorMappings, PrimitiveTypesForDeserialization, RequestAdapter } from "./requestAdapter"; | ||
import { type RequestInformationSetContent } from "./requestInformation"; | ||
import type { ModelSerializerFunction, Parsable, ParsableFactory } from "./serialization"; | ||
export declare function apiClientProxifier<T extends object>(requestAdapter: RequestAdapter, pathParameters: Record<string, unknown>, urlTemplate: string, navigationMetadata?: Record<string, NavigationMetadata>, requestsMetadata?: RequestsMetadata): T; | ||
export declare function apiClientProxifier<T extends object>(requestAdapter: RequestAdapter, pathParameters: Record<string, unknown>, navigationMetadata?: Record<string, NavigationMetadata>, requestsMetadata?: RequestsMetadata): T; | ||
export interface RequestMetadata { | ||
@@ -14,2 +14,3 @@ requestBodyContentType?: string; | ||
queryParametersMapper?: Record<string, string>; | ||
uriTemplate: string; | ||
} | ||
@@ -27,3 +28,2 @@ export interface RequestsMetadata { | ||
export interface NavigationMetadata { | ||
uriTemplate: string; | ||
requestsMetadata?: RequestsMetadata; | ||
@@ -30,0 +30,0 @@ navigationMetadata?: Record<string, NavigationMetadata>; |
@@ -109,3 +109,3 @@ import { getPathParameters } from "./getPathParameters"; | ||
} | ||
export function apiClientProxifier(requestAdapter, pathParameters, urlTemplate, navigationMetadata, requestsMetadata) { | ||
export function apiClientProxifier(requestAdapter, pathParameters, navigationMetadata, requestsMetadata) { | ||
if (!requestAdapter) | ||
@@ -115,4 +115,2 @@ throw new Error("requestAdapter cannot be undefined"); | ||
throw new Error("pathParameters cannot be undefined"); | ||
if (!urlTemplate) | ||
throw new Error("urlTemplate cannot be undefined"); | ||
return new Proxy({}, { | ||
@@ -125,3 +123,3 @@ get(target, property) { | ||
throw new Error("rawUrl cannot be undefined"); | ||
return apiClientProxifier(requestAdapter, getPathParameters(rawUrl), urlTemplate, navigationMetadata, requestsMetadata); | ||
return apiClientProxifier(requestAdapter, getPathParameters(rawUrl), navigationMetadata, requestsMetadata); | ||
}; | ||
@@ -137,3 +135,3 @@ } | ||
return (requestConfiguration) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -143,3 +141,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -149,3 +147,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -155,3 +153,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -161,3 +159,3 @@ }; | ||
return (...args) => { | ||
const requestInfo = toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
const requestInfo = toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return sendAsync(requestAdapter, requestInfo, metadata); | ||
@@ -167,19 +165,19 @@ }; | ||
return (requestConfiguration) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.GET, undefined, undefined, requestConfiguration); | ||
}; | ||
case "toPatchRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PATCH, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toPutRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.PUT, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toDeleteRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.DELETE, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
case "toPostRequestInformation": | ||
return (...args) => { | ||
return toRequestInformation(urlTemplate, pathParameters, metadata, requestAdapter, HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
return toRequestInformation(metadata.uriTemplate, pathParameters, metadata, requestAdapter, HttpMethod.POST, args.length > 0 ? args[0] : undefined, getRequestMediaTypeUserDefinedValue(metadata, args), getRequestConfigurationValue(args)); | ||
}; | ||
@@ -198,3 +196,3 @@ default: | ||
// navigation property | ||
return apiClientProxifier(requestAdapter, getPathParameters(pathParameters), navigationCandidate.uriTemplate, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
return apiClientProxifier(requestAdapter, getPathParameters(pathParameters), navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
} | ||
@@ -211,3 +209,3 @@ return (...argArray) => { | ||
} | ||
return apiClientProxifier(requestAdapter, downWardPathParameters, navigationCandidate.uriTemplate, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
return apiClientProxifier(requestAdapter, downWardPathParameters, navigationCandidate.navigationMetadata, navigationCandidate.requestsMetadata); | ||
}; | ||
@@ -214,0 +212,0 @@ } |
{ | ||
"name": "@microsoft/kiota-abstractions", | ||
"version": "1.0.0-preview.41", | ||
"version": "1.0.0-preview.42", | ||
"description": "Core abstractions for kiota generated libraries in TypeScript and JavaScript", | ||
@@ -47,3 +47,3 @@ "main": "dist/cjs/src/index.js", | ||
}, | ||
"gitHead": "58ac05f9412be43055b8ff84645460fdd6b958a8" | ||
"gitHead": "e86e70a6cc77bb58b4f5d5bac5cc6eb87dbac271" | ||
} |
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
657001
7354