phonic
Version:
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPhonic-Co%2Fphonic-node) [ • 1.34 kB
JavaScript
// This file was auto-generated by Fern from our API Definition.
import { BearerAuthProvider } from "./auth/BearerAuthProvider.mjs";
import { mergeHeaders } from "./core/headers.mjs";
import * as core from "./core/index.mjs";
export function normalizeClientOptions(options) {
const headers = mergeHeaders({
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "phonic",
"X-Fern-SDK-Version": "0.32.9",
"User-Agent": "phonic/0.32.9",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
}, options === null || options === void 0 ? void 0 : options.headers);
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
}
export function normalizeClientOptionsWithAuth(options) {
var _a;
const normalized = normalizeClientOptions(options);
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
return normalized;
}
function withNoOpAuthProvider(options) {
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
}