studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
131 lines (130 loc) • 5.77 kB
TypeScript
import { Effect } from '../../../effect.js';
import { AstroDB, SDKCore_Users } from '../effect/index.js';
import { SDKCore_CLEAR } from './clear.js';
import { SDKCore_UPDATE } from './update.js';
declare const SDKCore_DELETE_base: Effect.Service.Class<SDKCore_DELETE, "studiocms/sdk/SDKCore/modules/delete", {
readonly dependencies: readonly [import("effect/Layer").Layer<AstroDB, never, never>, import("effect/Layer").Layer<SDKCore_CLEAR, never, import("../utils.js").CacheContext>, import("effect/Layer").Layer<SDKCore_Users, never, never>, import("effect/Layer").Layer<SDKCore_UPDATE, never, import("../utils.js").CacheContext>];
readonly effect: Effect.Effect<{
/**
* Deletes a page from the database.
*
* @param id - The ID of the page to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the page.
*/
page: (id: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a page content from the database.
*
* @param id - The ID of the page content to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the page content.
*/
pageContent: (id: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a page content lang from the database.
*
* @param id - The ID of the page content to delete.
* @param lang - The lang of the page content to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the page content lang.
*/
pageContentLang: (id: string, lang: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a tag from the database.
*
* @param id - The ID of the tag to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the tag.
*/
tags: (id: number) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a category from the database.
*
* @param id - The ID of the category to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the category.
*/
categories: (id: number) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a permission from the database.
*
* @param userId - The ID of the user to delete the permission for.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the permission.
*/
permissions: (userId: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a site configuration from the database.
*
* @param id - The ID of the site configuration to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the site configuration.
*/
diffTracking: (id: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
/**
* Deletes a folder from the database.
*
* @param id - The ID of the folder to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the folder.
*/
folder: (id: string) => Effect.Effect<{
status: string;
message: string;
}, import("effect/Cause").UnknownException | import("../errors.js").SDKCoreError, never>;
/**
* Deletes a user from the database.
*
* @param id - The ID of the user to delete.
* @returns A promise that resolves to a deletion response.
* @throws {StudioCMS_SDK_Error} If an error occurs while deleting the user.
*/
user: (id: string) => Effect.Effect<{
status: string;
message: string;
}, import("../errors.js").SDKCoreError, never>;
}, never, AstroDB | SDKCore_Users | SDKCore_CLEAR | SDKCore_UPDATE>;
}>;
/**
* Provides deletion operations for various StudioCMS entities such as pages, page content, tags, categories,
* permissions, diff tracking, folders, and users. Each deletion method interacts with the database and handles
* errors specific to LibSQLDatabase.
*
* @remarks
* This service is part of the StudioCMS SDK core and depends on AstroDB, SDKCore_CLEAR, SDKCore_Users, and SDKCore_UPDATE.
*
* @example
* ```typescript
* const deleteService = new SDKCore_DELETE();
* await Effect.runPromise(deleteService.page('page-id'));
* ```
*
* @see SDKCore_CLEAR
* @see SDKCore_Users
* @see SDKCore_UPDATE
*/
export declare class SDKCore_DELETE extends SDKCore_DELETE_base {
}
export {};