@tstdl/base 0.90.78 → 0.90.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,8 @@ export type ApiClientHttpRequestContext = {
16
16
  };
17
17
  export declare const httpClientSymbol: unique symbol;
18
18
  export declare const apiDefinitionSymbol: unique symbol;
19
+ export declare const defaultOptions: ClientOptions;
20
+ export declare function setDefaultApiClientOptions(options: ClientOptions): void;
19
21
  export declare function compileClient<T extends ApiDefinition>(definition: T, options?: ClientOptions): ApiClient<T>;
20
22
  export declare function getHttpClientOfApiClient(apiClient: any): HttpClient;
21
23
  export declare function getApiDefinitionOfApiClient(apiClient: any): ApiDefinition;
@@ -6,7 +6,7 @@ import { resolveArgumentType } from '../../injector/interfaces.js';
6
6
  import { Schema } from '../../schema/index.js';
7
7
  import { ServerSentEvents } from '../../sse/server-sent-events.js';
8
8
  import { toArray } from '../../utils/array/array.js';
9
- import { objectEntries } from '../../utils/object/object.js';
9
+ import { copyObjectProperties, objectEntries } from '../../utils/object/object.js';
10
10
  import { toTitleCase } from '../../utils/string/title-case.js';
11
11
  import { isArray, isBlob, isDefined, isObject, isReadableStream, isString, isUint8Array, isUndefined } from '../../utils/type-guards.js';
12
12
  import { buildUrl } from '../../utils/url-builder.js';
@@ -15,8 +15,12 @@ import { normalizedApiDefinitionEndpointsEntries } from '../types.js';
15
15
  import { getFullApiEndpointResource } from '../utils.js';
16
16
  export const httpClientSymbol = Symbol('ApiTransport');
17
17
  export const apiDefinitionSymbol = Symbol('ApiDefinition');
18
+ export const defaultOptions = {};
19
+ export function setDefaultApiClientOptions(options) {
20
+ copyObjectProperties(options, defaultOptions);
21
+ }
18
22
  // eslint-disable-next-line max-lines-per-function
19
- export function compileClient(definition, options = {}) {
23
+ export function compileClient(definition, options = defaultOptions) {
20
24
  const { resource: path, endpoints } = definition;
21
25
  const constructedApiName = toTitleCase(path[0] ?? '');
22
26
  const apiName = `${constructedApiName}ApiClient`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.90.78",
3
+ "version": "0.90.79",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"