waifuim
    Preparing search index...

    Class TagsService

    Index

    Constructors

    Methods

    • Create a new tag.

      Creates a new tag for categorizing images. The tag will be created with "Pending" review status and must be approved by a moderator. If no slug is provided, one will be automatically generated from the name.

      Parameters

      Returns Promise<Tag>

      The created tag.

      AuthenticationRequired if authentication is missing.

      ApiError with status 400 if invalid tag data.

      ApiError with status 401 if authentication is invalid.

      ApiError with status 403 if insufficient permissions (role restriction configured by API administrator).

      ApiError with status 409 if a tag with this name or slug already exists.

    • Delete a tag permanently.

      Permanently removes a tag. Images that had this tag will no longer be associated with it.

      Requires: Admin role.

      Parameters

      • id: number

        The tag ID to delete.

      Returns Promise<void>

      AuthenticationRequired if authentication is missing.

      ApiError with status 401 if authentication is invalid.

      ApiError with status 403 if insufficient permissions.

      ApiError with status 404 if tag not found.

    • Get a tag by its ID.

      Parameters

      • id: number

        The unique identifier of the tag.

      Returns Promise<Tag>

      ApiError with status 404 if tag not found.

    • Get a tag by its slug.

      Slugs are URL-friendly identifiers (e.g., "waifu", "marin-kitagawa"). This endpoint is useful when you know the tag slug but not its ID.

      Parameters

      • slug: string

        The URL-friendly slug of the tag.

      Returns Promise<Tag>

      ApiError with status 404 if tag not found.

    • Update an existing tag.

      Update a tag's name, description, slug, or review status.

      Requires: Moderator role or higher.

      Parameters

      Returns Promise<Tag>

      The updated tag.

      AuthenticationRequired if authentication is missing.

      ApiError with status 400 if invalid update data.

      ApiError with status 401 if authentication is invalid.

      ApiError with status 403 if insufficient permissions.

      ApiError with status 404 if tag not found.