@civitai/client 0.2.0-beta.42 → 0.2.0-beta.45

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.
@@ -3,8 +3,7 @@ import type { Client as CoreClient, Config as CoreConfig } from '../core/types';
3
3
  import type { Middleware } from './utils';
4
4
  export type ResponseStyle = 'data' | 'fields';
5
5
  export interface Config<T extends ClientOptions = ClientOptions>
6
- extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
7
- CoreConfig {
6
+ extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
8
7
  /**
9
8
  * Base URL for all requests made by this client.
10
9
  */
@@ -50,9 +49,9 @@ export interface RequestOptions<
50
49
  ThrowOnError extends boolean = boolean,
51
50
  Url extends string = string,
52
51
  > extends Config<{
53
- responseStyle: TResponseStyle;
54
- throwOnError: ThrowOnError;
55
- }> {
52
+ responseStyle: TResponseStyle;
53
+ throwOnError: ThrowOnError;
54
+ }> {
56
55
  /**
57
56
  * Any body that you want to add to your request.
58
57
  *
@@ -4,8 +4,7 @@ import type { Client as CoreClient, Config as CoreConfig } from '../core/types.g
4
4
  import type { Middleware } from './utils.gen';
5
5
  export type ResponseStyle = 'data' | 'fields';
6
6
  export interface Config<T extends ClientOptions = ClientOptions>
7
- extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
8
- CoreConfig {
7
+ extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
9
8
  /**
10
9
  * Base URL for all requests made by this client.
11
10
  */
@@ -51,7 +50,9 @@ export interface RequestOptions<
51
50
  TResponseStyle extends ResponseStyle = 'fields',
52
51
  ThrowOnError extends boolean = boolean,
53
52
  Url extends string = string,
54
- > extends Config<{
53
+ >
54
+ extends
55
+ Config<{
55
56
  responseStyle: TResponseStyle;
56
57
  throwOnError: ThrowOnError;
57
58
  }>,
@@ -162,7 +162,7 @@ export const mergeHeaders = (...headers) => {
162
162
  }
163
163
  }
164
164
  else if (value !== undefined) {
165
- // assume object headers are meant to be JSON stringified, i.e. their
165
+ // assume object headers are meant to be JSON stringified, i.e., their
166
166
  // content value in OpenAPI specification is 'application/json'
167
167
  mergedHeaders.set(key, typeof value === 'object' ? JSON.stringify(value) : value);
168
168
  }
@@ -83,7 +83,7 @@ export interface Config {
83
83
  requestValidator?: (data: unknown) => Promise<unknown>;
84
84
  /**
85
85
  * A function transforming response data before it's returned. This is useful
86
- * for post-processing data, e.g. converting ISO strings into Date objects.
86
+ * for post-processing data, e.g., converting ISO strings into Date objects.
87
87
  */
88
88
  responseTransformer?: (data: unknown) => Promise<unknown>;
89
89
  /**
@@ -75,7 +75,7 @@ export function getValidRequestBody(options) {
75
75
  const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
76
76
  return hasSerializedBody ? options.serializedBody : null;
77
77
  }
78
- // not all clients implement a serializedBody property (i.e. client-axios)
78
+ // not all clients implement a serializedBody property (i.e., client-axios)
79
79
  return options.body !== '' ? options.body : null;
80
80
  }
81
81
  // plain/text body