Home / Class/ Configuration Class — typescript-sdk Architecture

Configuration Class — typescript-sdk Architecture

Architecture documentation for the Configuration class in runtime.ts from the typescript-sdk codebase.

Entity Profile

Dependency Diagram

graph TD
  8bd4c013_69c0_5309_7c76_52771a6fb320["Configuration"]
  41b6b5c2_aa5b_90b9_c373_84e0a8cd9918["runtime.ts"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|defined in| 41b6b5c2_aa5b_90b9_c373_84e0a8cd9918
  c1c83d90_1a95_e337_3dbc_381d82ba2fb8["constructor()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| c1c83d90_1a95_e337_3dbc_381d82ba2fb8
  f84a2b97_9c71_9d5e_1681_b94a1a12082c["config()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| f84a2b97_9c71_9d5e_1681_b94a1a12082c
  3ee48f50_331e_51f7_ed32_996b7c6cdcd2["basePath()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| 3ee48f50_331e_51f7_ed32_996b7c6cdcd2
  7791491b_1665_d9fa_1839_e94528ccf729["fetchApi()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| 7791491b_1665_d9fa_1839_e94528ccf729
  667422cf_b1ce_1d2f_b751_a7a3291845b4["middleware()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| 667422cf_b1ce_1d2f_b751_a7a3291845b4
  bbf39db8_d5a4_16d2_e6ed_7bf789a1e2b8["queryParamsStringify()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| bbf39db8_d5a4_16d2_e6ed_7bf789a1e2b8
  dcb29175_3f54_8d88_51c2_89aa20f3ca29["username()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| dcb29175_3f54_8d88_51c2_89aa20f3ca29
  b42f34e7_dec1_a466_c5ee_d3f81298bc2e["password()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| b42f34e7_dec1_a466_c5ee_d3f81298bc2e
  b76a3e72_efd8_2111_6fdf_582aaea5ae2a["apiKey()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| b76a3e72_efd8_2111_6fdf_582aaea5ae2a
  abeb0f37_d775_a1a2_297f_0e0138fe4f47["accessToken()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| abeb0f37_d775_a1a2_297f_0e0138fe4f47
  7cee8ae4_431e_354c_2bd3_8554e54d6241["headers()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| 7cee8ae4_431e_354c_2bd3_8554e54d6241
  4acb0edd_61ef_25bd_21b3_984a941d976d["credentials()"]
  8bd4c013_69c0_5309_7c76_52771a6fb320 -->|method| 4acb0edd_61ef_25bd_21b3_984a941d976d

Relationship Graph

Source Code

src/runtime.ts lines 31–85

export class Configuration {
    constructor(private configuration: ConfigurationParameters = {}) {}

    set config(configuration: Configuration) {
        this.configuration = configuration;
    }

    get basePath(): string {
        return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
    }

    get fetchApi(): FetchAPI | undefined {
        return this.configuration.fetchApi;
    }

    get middleware(): Middleware[] {
        return this.configuration.middleware || [];
    }

    get queryParamsStringify(): (params: HTTPQuery) => string {
        return this.configuration.queryParamsStringify || querystring;
    }

    get username(): string | undefined {
        return this.configuration.username;
    }

    get password(): string | undefined {
        return this.configuration.password;
    }

    get apiKey(): ((name: string) => string | Promise<string>) | undefined {
        const apiKey = this.configuration.apiKey;
        if (apiKey) {
            return typeof apiKey === 'function' ? apiKey : () => apiKey;
        }
        return undefined;
    }

    get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
        const accessToken = this.configuration.accessToken;
        if (accessToken) {
            return typeof accessToken === 'function' ? accessToken : async () => accessToken;
        }
        return undefined;
    }

    get headers(): HTTPHeaders | undefined {
        return this.configuration.headers;
    }

    get credentials(): RequestCredentials | undefined {
        return this.configuration.credentials;
    }
}

Domain

Defined In

Frequently Asked Questions

What is the Configuration class?
Configuration is a class in the typescript-sdk codebase, defined in src/runtime.ts.
Where is Configuration defined?
Configuration is defined in src/runtime.ts at line 31.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free