This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a949091
commit a1cef4b
Showing
5 changed files
with
46 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
import { | ||
Headers, | ||
ApiClient, | ||
Headers, | ||
CustomFetchApi, | ||
ApiClientLogger, | ||
ApiClientLogContentTypes, | ||
} from "@shopify/graphql-client"; | ||
|
||
export type StorefrontApiClientLogContentTypes = ApiClientLogContentTypes; | ||
|
||
export interface StorefrontApiClientConfig { | ||
readonly storeDomain: string; | ||
readonly apiVersion: string; | ||
readonly publicAccessToken: string | null; | ||
readonly privateAccessToken: string | null; | ||
readonly headers: Headers; | ||
readonly apiUrl: string; | ||
readonly clientName?: string; | ||
readonly retries?: number; | ||
} | ||
export type StorefrontApiClientConfig = { | ||
storeDomain: string; | ||
apiVersion: string; | ||
headers: Headers; | ||
apiUrl: string; | ||
retries?: number; | ||
clientName?: string; | ||
} & ( | ||
| { | ||
publicAccessToken?: never; | ||
privateAccessToken: string; | ||
} | ||
| { | ||
publicAccessToken: string; | ||
privateAccessToken?: never; | ||
} | ||
); | ||
|
||
export type StorefrontApiClientOptions = Omit< | ||
StorefrontApiClientConfig, | ||
"headers" | "apiUrl" | ||
> & { | ||
customFetchApi?: CustomFetchApi; | ||
logger?: ApiClientLogger<StorefrontApiClientLogContentTypes>; | ||
}; | ||
|
||
export type StorefrontApiClient = ApiClient<StorefrontApiClientConfig>; | ||
export type StorefrontApiClient = ApiClient< | ||
Readonly<StorefrontApiClientConfig> | ||
>; |