import ContensisRepository from '../repositories/ContensisRepository'; import { IUpdateTag, IUpdateTagGroup, Tag, TagGroup, TagGroupListOptions } from 'contensis-management-api'; import RepositoryBaseService from './RepositoryBaseService'; import { GetTagsArgs } from './TagsMigrationService'; import { TagGroupBuilder } from '../transformations/TagGroupBuilder'; import { TagBuilder } from '../transformations/TagBuilder'; declare class TagsService extends RepositoryBaseService { groups: TagGroup[]; error: AppError | null; raw: Tag[]; /** Keep a record of built groups to migrate */ migrateGroups: TagGroupBuilder[]; /** Keep a record of built tags to migrate */ migrateTags: TagBuilder[]; /** * Resolves a tag we have fetched * @param tagId the id of the tag to resolve * @returns the resolved tag or undefined if not found */ resolve: (tagId: string) => Tag | undefined; /** * Resolves a tag by its label from those we have fetched * @param label the label of the tag to resolve * @returns the resolved tag or undefined if not found */ resolveByLabel: (label: string, language?: string, tags?: Tag[]) => Tag | undefined; constructor(contensis: ContensisRepository, source: ContensisRepository); GetTagGroups: (idOrOptions?: string | (TagGroupListOptions & { ids?: string[]; })) => Promise<[ApiErrorResponse, undefined] | [null, TagGroup[]]>; GetTags: (getBy?: GetTagsArgs) => Promise<[ApiErrorResponse, undefined] | [null, Tag[]]>; GetTagsAllPages: (pageSize?: number, getBy?: { groupId?: string; language?: string; q?: string; }) => Promise; CreateTag: (groupId: string, label: string, language?: string, id?: string) => Promise<[ApiErrorResponse | null, Tag | undefined]>; CreateTagGroup: (id: string, name: string, description?: string) => Promise<[ApiErrorResponse | null, TagGroup | undefined]>; UpdateTag: (id: string, tag: IUpdateTag) => Promise<[ApiErrorResponse | null, Tag | undefined]>; UpdateTagGroup: (id: string, tagGroup: IUpdateTagGroup) => Promise<[ApiErrorResponse | null, TagGroup | undefined]>; RemoveTagGroup: (id: string) => Promise<[ApiErrorResponse | null, undefined]>; RemoveTags: (ids: string[]) => Promise<[ApiErrorResponse | null, undefined]>; BuildTagGroups: ({ onError, }: { onError: (migrateTagGroup: TagGroupBuilder) => void; }) => Promise; BuildTags: ({ onError, }: { onError: (migrateTag: TagBuilder) => void; }) => Promise; } export default TagsService;