diff --git a/src/backend/common/infrastructure/config/client/index.ts b/src/backend/common/infrastructure/config/client/index.ts index e5c69058..2060db26 100644 --- a/src/backend/common/infrastructure/config/client/index.ts +++ b/src/backend/common/infrastructure/config/client/index.ts @@ -1,6 +1,6 @@ import * as z from "zod"; import {playTransformOptionsSchema} from "../../../../../core/Transform.ts"; -import {commonConfigSchema, requestRetryOptionsSchema, MonitorOptions} from "../common.ts"; +import {commonConfigSchema, requestRetryOptionsSchema, monitorOptionsSchema} from "../common.ts"; import {retentionConfigDurationValueSchema} from "../database.ts"; /** @@ -125,6 +125,7 @@ export const nowPlayingOptionsSchema = z.object({ export type NowPlayingOptions = z.infer; export const commonClientOptionsSchema = z.object({ + ...monitorOptionsSchema.shape, ...requestRetryOptionsSchema.shape, ...upstreamRefreshOptionsSchema.shape, diff --git a/src/backend/common/infrastructure/config/common.ts b/src/backend/common/infrastructure/config/common.ts index 350afa34..40898142 100644 --- a/src/backend/common/infrastructure/config/common.ts +++ b/src/backend/common/infrastructure/config/common.ts @@ -125,12 +125,16 @@ export const pollingOptionsSchema = z.object({ }); export type PollingOptions = z.infer; -export interface MonitorOptions { + +export const monitorOptionsSchema = z.object({ /** * Set the default behavior for wether this component should automatically monitor any activity, or scrobble, it encounters * * @default true - * @examples [true, false] */ - autoMonitor?: boolean -} + autoMonitor: z.boolean().optional().meta({ + default: true, + description: 'Set the default behavior for wether this component should automatically monitor any activity, or scrobble, it encounters' + }) +}) +export type MonitorOptions = z.infer; \ No newline at end of file diff --git a/src/backend/common/infrastructure/config/source/index.ts b/src/backend/common/infrastructure/config/source/index.ts index b932c40d..77695a5b 100644 --- a/src/backend/common/infrastructure/config/source/index.ts +++ b/src/backend/common/infrastructure/config/source/index.ts @@ -1,5 +1,5 @@ import * as z from "zod"; -import {requestRetryOptionsSchema, commonConfigSchema, MonitorOptions} from "../common.ts"; +import {requestRetryOptionsSchema, commonConfigSchema, monitorOptionsSchema} from "../common.ts"; import {retentionConfigDurationValueSchema} from "../database.ts"; import {playTransformOptionsSchema} from "../../../../../core/Transform.ts"; @@ -74,6 +74,7 @@ export const fileLogOptionsSchema = z.object({ }); export const commonSourceOptionsSchema = z.object({ + ...monitorOptionsSchema.shape, ...sourceRetryOptionsSchema.shape, /** * * If this source has INGRESS to MS (sends a payload, rather than MS GETTING requesting a payload) then setting this option to true will make MS log the payload JSON to DEBUG output