studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
53 lines (52 loc) • 2.39 kB
TypeScript
import { Effect } from '../../../effect.js';
import { AstroDB } from '../effect/index.js';
import { SDKCoreError } from '../errors.js';
import { SDKCore_CONFIG, type StudioCMSNotificationSettings } from './config.js';
declare const SDKCore_NotificationSettings_base: Effect.Service.Class<SDKCore_NotificationSettings, "studiocms/sdk/SDKCore/modules/notificationSettings", {
readonly dependencies: readonly [import("effect/Layer").Layer<AstroDB, never, never>, import("effect/Layer").Layer<SDKCore_CONFIG, never, never>];
readonly effect: Effect.Effect<{
site: {
/**
* Retrieves the site-wide notification settings.
* @returns An Effect that resolves to the current notification settings.
* @throws SDKCoreError when a database error occurs.
*/
get: () => Effect.Effect<import("./config-types.js").DynamicConfigEntry<StudioCMSNotificationSettings>, SDKCoreError, never>;
/**
* Updates the site-wide notification settings.
* @param settings - The new notification settings to be updated.
* @returns An Effect that resolves to the updated settings.
* @throws SDKCoreError when a database error occurs.
*/
update: (settings: Omit<StudioCMSNotificationSettings, "_config_version">) => Effect.Effect<import("./config-types.js").DynamicConfigEntry<StudioCMSNotificationSettings> | undefined, Error, never>;
};
}, never, SDKCore_CONFIG>;
}>;
/**
* Service class for managing notification settings in the StudioCMS SDK.
*
* @remarks
* This class provides methods to retrieve and update site-wide notification settings
* from the database. If settings do not exist, default values are inserted.
* All database operations are wrapped with error handling for `LibSQLDatabaseError`.
*
* @example
* ```typescript
* const settings = await SDKCore_NotificationSettings.site.get();
* await SDKCore_NotificationSettings.site.update({ ...newSettings });
* ```
*
* @service
* @module studiocms/sdk/SDKCore/modules/notificationSettings
*
* @dependencies
* - AstroDB.Default
*
* @effect
* - genLogger for logging effect operations
*
* @throws SDKCoreError when a database error occurs
*/
export declare class SDKCore_NotificationSettings extends SDKCore_NotificationSettings_base {
}
export {};