Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/fetch-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opensdks/fetch-links",
"version": "0.0.21",
"version": "0.0.22",
"type": "module",
"exports": {
".": {
Expand Down
6 changes: 5 additions & 1 deletion packages/runtime/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
BodySerializer,
FetchOptions,
FetchResponse,
HeadersOptions,
InitParam,
MaybeOptionalInit,
} from 'openapi-fetch'
Expand All @@ -24,7 +25,9 @@ import {HTTPError} from './HTTPError.js'
import type {FlattenOptions} from './utils.js'
import {flattenNestedObject} from './utils.js'

type _ClientOptions = NonNullable<Parameters<typeof _createClient>[0]>
type _ClientOptions = Omit<NonNullable<Parameters<typeof _createClient>[0]>, 'headers'> & {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think making headers optional globally across all SDKs in the runtime layer is a good idea. Sometimes header is required, and it's not just about authentication, such as API_VERSION etc.

We'd need to invest more effort into make it optional vs. required per sdk, not globally so

headers?: HeadersOptions
}

export interface ClientOptions extends _ClientOptions {
links?: Link[] | ((defaultLinks: Link[]) => Link[])
Expand All @@ -44,6 +47,7 @@ export function createClient<
Paths extends {},
Media extends MediaType = MediaType,
>({links: _links, ...clientOptions}: ClientOptions = {}) {

const defaultLinks = [
...(clientOptions.auth
? [authLink(clientOptions.auth, clientOptions.baseUrl ?? '')]
Expand Down
2 changes: 1 addition & 1 deletion sdks/sdk-openint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opensdks/sdk-openint",
"version": "0.1.13",
"version": "0.1.15",
"type": "module",
"exports": {
".": {
Expand Down
Loading