Skip to content

Commit

Permalink
fix Client v3: make httpClient optional (#869)
Browse files Browse the repository at this point in the history
* fix(httpClient): make in the new client httpClient optional

* Create four-humans-visit.md

* Update four-humans-visit.md

---------

Co-authored-by: Ajima Chukwuemeka <[email protected]>
  • Loading branch information
barbara79 and ajimae authored Dec 10, 2024
1 parent a432c2f commit c41025e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-humans-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@commercetools/ts-client": patch
---

fix client v3: make httpClient optional
16 changes: 8 additions & 8 deletions packages/sdk-client-v3/src/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export type AuthMiddlewareOptions = {
// For internal usage only
oauthUri?: string
tokenCache?: TokenCache
httpClient: Function
httpClient?: Function
httpClientOptions?: object
}

Expand Down Expand Up @@ -139,7 +139,7 @@ export type RefreshAuthMiddlewareOptions = {
tokenCache?: TokenCache,
// For internal usage only
oauthUri?: string
httpClient: Function
httpClient?: Function
httpClientOptions?: object
}

Expand All @@ -157,13 +157,13 @@ type requestBaseOptions = {

export type executeRequestOptions = requestBaseOptions & {
next: Next
httpClient: Function
httpClient?: Function
userOption?: AuthMiddlewareOptions | PasswordAuthMiddlewareOptions
}

export type AuthMiddlewareBaseOptions = requestBaseOptions & {
request: MiddlewareRequest
httpClient: Function
httpClient?: Function
}

export type Task = {
Expand All @@ -188,7 +188,7 @@ export type PasswordAuthMiddlewareOptions = {
tokenCache?: TokenCache,
// For internal usage only
oauthUri?: string
httpClient: Function
httpClient?: Function
httpClientOptions?: object
}

Expand All @@ -215,7 +215,7 @@ export type HttpMiddlewareOptions = {
timeout?: number
enableRetry?: boolean
retryConfig?: RetryOptions
httpClient: Function
httpClient?: Function
httpClientOptions?: object // will be passed as a second argument to your httpClient function for configuration
getAbortController?: () => AbortController
}
Expand All @@ -225,7 +225,7 @@ export type RetryOptions = RetryMiddlewareOptions
export type HttpOptions = {
url: string
clientOptions: HttpClientOptions
httpClient: Function
httpClient?: Function
}

export type LoggerMiddlewareOptions = {
Expand Down Expand Up @@ -306,7 +306,7 @@ export type HttpClientOptions = IClientOptions & Optional

export type HttpClientConfig = IClientOptions & {
url: string
httpClient: Function
httpClient?: Function
}

type TResponse = {
Expand Down

0 comments on commit c41025e

Please sign in to comment.