From 12053da4256393b2250b3f0efaa148b19b7d70f5 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Sun, 17 Sep 2023 11:33:55 +0200 Subject: [PATCH] chore: marked apis public --- lib/config-host.module.ts | 4 ++++ lib/config.module.ts | 3 +++ lib/config.service.ts | 8 ++++++++ lib/interfaces/config-module-options.interface.ts | 3 +++ lib/types/config-object.type.ts | 3 +++ lib/types/config.type.ts | 3 +++ lib/utils/create-config-factory.util.ts | 3 +++ lib/utils/get-config-token.util.ts | 3 +++ lib/utils/get-registration-token.util.ts | 3 +++ lib/utils/merge-configs.util.ts | 3 +++ lib/utils/register-as.util.ts | 5 +++++ 11 files changed, 41 insertions(+) diff --git a/lib/config-host.module.ts b/lib/config-host.module.ts index 35a6e286..c467ee87 100644 --- a/lib/config-host.module.ts +++ b/lib/config-host.module.ts @@ -5,6 +5,10 @@ import { } from './config.constants'; import { ConfigService } from './config.service'; + +/** + * @publicApi + */ @Global() @Module({ providers: [ diff --git a/lib/config.module.ts b/lib/config.module.ts index 84b60c52..757d21a8 100644 --- a/lib/config.module.ts +++ b/lib/config.module.ts @@ -20,6 +20,9 @@ import { createConfigProvider } from './utils/create-config-factory.util'; import { getRegistrationToken } from './utils/get-registration-token.util'; import { mergeConfigObject } from './utils/merge-configs.util'; +/** + * @publicApi + */ @Module({ imports: [ConfigHostModule], providers: [ diff --git a/lib/config.service.ts b/lib/config.service.ts index 6d575b89..4f33f008 100644 --- a/lib/config.service.ts +++ b/lib/config.service.ts @@ -20,6 +20,10 @@ type ValidatedResult< T, > = WasValidated extends true ? T : T | undefined; + +/** + * @publicApi + */ export interface ConfigGetOptions { /** * If present, "get" method will try to automatically @@ -31,6 +35,10 @@ export interface ConfigGetOptions { type KeyOf = keyof T extends never ? string : keyof T; + +/** + * @publicApi + */ @Injectable() export class ConfigService< K = Record, diff --git a/lib/interfaces/config-module-options.interface.ts b/lib/interfaces/config-module-options.interface.ts index f8d3a443..90e149b9 100644 --- a/lib/interfaces/config-module-options.interface.ts +++ b/lib/interfaces/config-module-options.interface.ts @@ -1,6 +1,9 @@ import { ConfigFactory } from './config-factory.interface'; import { DotenvExpandOptions } from 'dotenv-expand' +/** + * @publicApi + */ export interface ConfigModuleOptions { /** * If "true", values from the process.env object will be cached in the memory. diff --git a/lib/types/config-object.type.ts b/lib/types/config-object.type.ts index 60d2b2a3..9dd608f9 100644 --- a/lib/types/config-object.type.ts +++ b/lib/types/config-object.type.ts @@ -1 +1,4 @@ +/** + * @publicApi + */ export type ConfigObject = Record; diff --git a/lib/types/config.type.ts b/lib/types/config.type.ts index a02969f5..a5adefb6 100644 --- a/lib/types/config.type.ts +++ b/lib/types/config.type.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export type ConfigType any> = T extends ( ...args: any ) => infer ReturnVal diff --git a/lib/utils/create-config-factory.util.ts b/lib/utils/create-config-factory.util.ts index f28c5f20..2c89467f 100644 --- a/lib/utils/create-config-factory.util.ts +++ b/lib/utils/create-config-factory.util.ts @@ -4,6 +4,9 @@ import { ConfigFactory } from '../interfaces'; import { getConfigToken } from './get-config-token.util'; import { ConfigFactoryKeyHost } from './register-as.util'; +/** + * @publicApi + */ export function createConfigProvider( factory: ConfigFactory & ConfigFactoryKeyHost, ): FactoryProvider { diff --git a/lib/utils/get-config-token.util.ts b/lib/utils/get-config-token.util.ts index cd63bc7f..99c213c4 100644 --- a/lib/utils/get-config-token.util.ts +++ b/lib/utils/get-config-token.util.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export function getConfigToken(token: string) { return `CONFIGURATION(${token})`; } diff --git a/lib/utils/get-registration-token.util.ts b/lib/utils/get-registration-token.util.ts index 727f4f5a..455d2956 100644 --- a/lib/utils/get-registration-token.util.ts +++ b/lib/utils/get-registration-token.util.ts @@ -1,5 +1,8 @@ import { PARTIAL_CONFIGURATION_KEY } from '../config.constants'; +/** + * @publicApi + */ export function getRegistrationToken(config: Record) { return config[PARTIAL_CONFIGURATION_KEY]; } diff --git a/lib/utils/merge-configs.util.ts b/lib/utils/merge-configs.util.ts index 232e3ea2..5dced500 100644 --- a/lib/utils/merge-configs.util.ts +++ b/lib/utils/merge-configs.util.ts @@ -1,5 +1,8 @@ import set from 'lodash/set'; +/** + * @publicApi + */ export function mergeConfigObject( host: Record, partial: Record, diff --git a/lib/utils/register-as.util.ts b/lib/utils/register-as.util.ts index af424a05..0cfc06a9 100644 --- a/lib/utils/register-as.util.ts +++ b/lib/utils/register-as.util.ts @@ -8,6 +8,9 @@ import { ConfigFactory } from '../interfaces'; import { ConfigObject } from '../types'; import { getConfigToken } from './get-config-token.util'; +/** + * @publicApi + */ export interface ConfigFactoryKeyHost { KEY: string; asProvider(): { @@ -18,6 +21,8 @@ export interface ConfigFactoryKeyHost { } /** + * @publicApi + * * Registers the configuration object behind a specified token. */ export function registerAs<