@opensdks/runtime
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -8,3 +8,3 @@ "use strict"; | ||
const openapi_fetch_1 = __importDefault(require("openapi-fetch")); | ||
const links_1 = require("@opensdks/links"); | ||
const fetch_links_1 = require("@opensdks/fetch-links"); | ||
const HTTPError_js_1 = require("./HTTPError.js"); | ||
@@ -15,6 +15,6 @@ // Should this be combined with createSDK? | ||
// Really do feel that they should be generated as well.. | ||
exports.defaultLinks = [(0, links_1.fetchLink)()]; | ||
exports.defaultLinks = [(0, fetch_links_1.fetchLink)()]; | ||
function createClient({ links: _links = exports.defaultLinks, ...clientOptions } = {}) { | ||
const links = typeof _links === 'function' ? _links(exports.defaultLinks) : _links; | ||
const customFetch = (url, init) => (0, links_1.applyLinks)(new Request(url, init), links); | ||
const customFetch = (url, init) => (0, fetch_links_1.applyLinks)(new Request(url, init), links); | ||
const client = (0, openapi_fetch_1.default)({ ...clientOptions, fetch: customFetch }); | ||
@@ -21,0 +21,0 @@ return { |
@@ -20,3 +20,3 @@ "use strict"; | ||
// export type * from 'openapi-typescript-helpers' | ||
__exportStar(require("@opensdks/links"), exports); | ||
__exportStar(require("@opensdks/fetch-links"), exports); | ||
__exportStar(require("./HTTPError.js"), exports); | ||
@@ -23,0 +23,0 @@ __exportStar(require("./createClient.js"), exports); |
@@ -9,3 +9,3 @@ import type {BodySerializer, FetchOptions, FetchResponse} from 'openapi-fetch' | ||
type Link, | ||
} from '@opensdks/links' | ||
} from '@opensdks/fetch-links' | ||
import {HTTPError} from './HTTPError.js' | ||
@@ -12,0 +12,0 @@ |
import _createClient from 'openapi-fetch'; | ||
import { applyLinks, fetchLink, } from '@opensdks/links'; | ||
import { applyLinks, fetchLink, } from '@opensdks/fetch-links'; | ||
import { HTTPError } from './HTTPError.js'; | ||
@@ -4,0 +4,0 @@ // Should this be combined with createSDK? |
import { createClient } from './createClient.js'; | ||
// export type * from 'openapi-typescript-helpers' | ||
export * from '@opensdks/links'; | ||
export * from '@opensdks/fetch-links'; | ||
export * from './HTTPError.js'; | ||
@@ -5,0 +5,0 @@ export * from './createClient.js'; |
import type {FetchResponse} from 'openapi-fetch' | ||
import type {HTTPMethod} from '@opensdks/links' | ||
import type {HTTPMethod} from '@opensdks/fetch-links' | ||
@@ -4,0 +4,0 @@ export class HTTPError<T> extends Error { |
@@ -6,3 +6,3 @@ import type {oas30, oas31} from 'openapi3-ts' | ||
// export type * from 'openapi-typescript-helpers' | ||
export * from '@opensdks/links' | ||
export * from '@opensdks/fetch-links' | ||
export * from './HTTPError.js' | ||
@@ -9,0 +9,0 @@ export * from './createClient.js' |
{ | ||
"name": "@opensdks/runtime", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"type": "module", | ||
@@ -37,3 +37,3 @@ "exports": { | ||
"openapi3-ts": "4.1.2", | ||
"@opensdks/links": "0.0.11" | ||
"@opensdks/fetch-links": "0.0.13" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
import type { BodySerializer, FetchOptions, FetchResponse } from 'openapi-fetch'; | ||
import _createClient from 'openapi-fetch'; | ||
import type { PathsWithMethod } from 'openapi-typescript-helpers'; | ||
import { type HTTPMethod, type Link } from '@opensdks/links'; | ||
import { type HTTPMethod, type Link } from '@opensdks/fetch-links'; | ||
type _ClientOptions = NonNullable<Parameters<typeof _createClient>[0]>; | ||
@@ -6,0 +6,0 @@ export interface ClientOptions extends _ClientOptions { |
import type { FetchResponse } from 'openapi-fetch'; | ||
import type { HTTPMethod } from '@opensdks/links'; | ||
import type { HTTPMethod } from '@opensdks/fetch-links'; | ||
export declare class HTTPError<T> extends Error { | ||
@@ -4,0 +4,0 @@ name: string; |
import type { oas30, oas31 } from 'openapi3-ts'; | ||
import type { ClientOptions, OpenAPIClient } from './createClient.js'; | ||
export * from '@opensdks/links'; | ||
export * from '@opensdks/fetch-links'; | ||
export * from './HTTPError.js'; | ||
@@ -5,0 +5,0 @@ export * from './createClient.js'; |
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
44376
+ Added@opensdks/fetch-links@0.0.13
+ Added@opensdks/fetch-links@0.0.13(transitive)
- Removed@opensdks/links@0.0.11
- Removed@opensdks/links@0.0.11(transitive)