GetUniqueFieldValuesUseCase (GetUniqueFieldValues/abstractions.ts)

webiny-js · packages/api-headless-cms/src/features/contentEntry/GetUniqueFieldValues/abstractions.ts · typescript · MIT
database, tag:knn-classified

Defines interfaces for fetching unique field values for CMS content.

// Source: https://github.com/webiny/webiny-js | License: MIT | Copyright Webiny Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { createAbstraction, Result } from "@webiny/feature/api";
import type { CmsEntryUniqueValue, CmsModel } from "~/types/index.js";
import type {
    EntryNotAuthorizedError,
    EntryPersistenceError
} from "~/domain/contentEntry/errors.js";
import type { FieldNotSearchableError, InvalidWhereConditionError } from "./errors.js";

export interface GetUniqueFieldValuesParams {
    where: {
        latest?: boolean;
        published?: boolean;
        createdBy?: string;
        [key: string]: any;
    };
    fieldId: string;
}

/**
 * GetUniqueFieldValues Use Case - Fetches unique values for a specific field.
 * Used for filtering/autocomp

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key