UNPKG

stashapp-api

Version:

Easy to use adapter for interaction with a Stash server through GraphQL.

101 lines (100 loc) 5.05 kB
export type { PerformerFilterType, SceneFilterType, TagFilterType, StudioFilterType, GalleryFilterType, ImageFilterType, GroupFilterType, } from "./generated/graphql.js"; import { CriterionModifier as _CriterionModifier, GenderEnum as _GenderEnum } from "./generated/graphql.js"; export declare const CriterionModifier: typeof _CriterionModifier; export declare const GenderEnum: typeof _GenderEnum; import { getSdk } from "./generated/graphql.js"; export interface StashAppConfig { url: string; apiKey: string; } export type { Performer, Scene, Tag, Studio, Gallery, Group, Image, ScanMetadataInput, PerformerDestroyInput, TagDestroyInput, StudioDestroyInput, SceneDestroyInput, TagCreateInput, TagUpdateInput, } from "./generated/graphql.js"; /** * Singleton class for interacting with the Stash GraphQL API. * Provides type-safe query and mutation methods. */ export declare class StashApp { private static instance; private client; private sdk; /** Find performers */ findPerformers: ReturnType<typeof getSdk>["FindPerformers"]; /** Find studios */ findStudios: ReturnType<typeof getSdk>["FindStudios"]; /** Find scenes */ findScenes: ReturnType<typeof getSdk>["FindScenes"]; /** Find scenes (compact - trimmed nested objects for better performance) */ findScenesCompact: ReturnType<typeof getSdk>["FindScenesCompact"]; /** Find tags */ findTags: ReturnType<typeof getSdk>["FindTags"]; /** Find groups */ findGroups: ReturnType<typeof getSdk>["FindGroups"]; /** Find a single group */ findGroup: ReturnType<typeof getSdk>["FindGroup"]; /** Find galleries */ findGalleries: ReturnType<typeof getSdk>["FindGalleries"]; /** Find a single gallery */ findGallery: ReturnType<typeof getSdk>["FindGallery"]; /** Find images */ findImages: ReturnType<typeof getSdk>["FindImages"]; /** Find scene IDs only (lightweight for bulk operations) */ findSceneIDs: ReturnType<typeof getSdk>["FindSceneIDs"]; /** Find performer IDs only (lightweight for bulk operations) */ findPerformerIDs: ReturnType<typeof getSdk>["FindPerformerIDs"]; /** Find studio IDs only (lightweight for bulk operations) */ findStudioIDs: ReturnType<typeof getSdk>["FindStudioIDs"]; /** Find tag IDs only (lightweight for bulk operations) */ findTagIDs: ReturnType<typeof getSdk>["FindTagIDs"]; /** Find group IDs only (lightweight for bulk operations) */ findGroupIDs: ReturnType<typeof getSdk>["FindGroupIDs"]; /** Find gallery IDs only (lightweight for bulk operations) */ findGalleryIDs: ReturnType<typeof getSdk>["FindGalleryIDs"]; /** Find image IDs only (lightweight for bulk operations) */ findImageIDs: ReturnType<typeof getSdk>["FindImageIDs"]; /** Update a scene */ sceneUpdate: ReturnType<typeof getSdk>["sceneUpdate"]; /** Update multiple scenes */ scenesUpdate: ReturnType<typeof getSdk>["scenesUpdate"]; /** Update a performer */ performerUpdate: ReturnType<typeof getSdk>["performerUpdate"]; /** Update a studio */ studioUpdate: ReturnType<typeof getSdk>["studioUpdate"]; /** Update a gallery */ galleryUpdate: ReturnType<typeof getSdk>["galleryUpdate"]; /** Update a group */ groupUpdate: ReturnType<typeof getSdk>["groupUpdate"]; /** Update an image */ imageUpdate: ReturnType<typeof getSdk>["imageUpdate"]; /** Start a metadata scan - returns job ID */ metadataScan: ReturnType<typeof getSdk>["metadataScan"]; /** Destroy a performer */ performerDestroy: ReturnType<typeof getSdk>["performerDestroy"]; /** Destroy multiple performers */ performersDestroy: ReturnType<typeof getSdk>["performersDestroy"]; /** Destroy a tag */ tagDestroy: ReturnType<typeof getSdk>["tagDestroy"]; /** Destroy multiple tags */ tagsDestroy: ReturnType<typeof getSdk>["tagsDestroy"]; /** Destroy a studio */ studioDestroy: ReturnType<typeof getSdk>["studioDestroy"]; /** Destroy multiple studios */ studiosDestroy: ReturnType<typeof getSdk>["studiosDestroy"]; /** Destroy a scene */ sceneDestroy: ReturnType<typeof getSdk>["sceneDestroy"]; /** Create a tag */ tagCreate: ReturnType<typeof getSdk>["tagCreate"]; /** Update a tag */ tagUpdate: ReturnType<typeof getSdk>["tagUpdate"]; /** Increment scene O counter */ sceneIncrementO: ReturnType<typeof getSdk>["sceneIncrementO"]; /** Decrement scene O counter */ sceneDecrementO: ReturnType<typeof getSdk>["SceneDecrementO"]; /** Save scene activity (resume time and play duration) */ sceneSaveActivity: ReturnType<typeof getSdk>["SceneSaveActivity"]; /** Add play history timestamp(s) to scene */ sceneAddPlay: ReturnType<typeof getSdk>["SceneAddPlay"]; /** Get Stash configuration including library paths */ configuration: ReturnType<typeof getSdk>["Configuration"]; private constructor(); /** Initialize the singleton StashApp instance */ static init(config: StashAppConfig): StashApp; }