import { ITGlueClient } from '../client'; import { QueryUtilOptions, QueryParams, RequestBody, BaseListResponse, BaseItemResponse, ChecklistResource } from '../types'; /** * Checklists resource module for IT Glue API * * Provides methods to interact with the /checklists endpoint. * Checklists represent task lists and procedural checklists stored in IT Glue, * used for tracking completion of tasks, procedures, and workflows. * * ## Related Resources * Checklists are commonly used with: * - {@link Organizations} - Parent organizations that own checklists * - {@link Documents} - Documentation related to checklist procedures * - {@link Configurations} - IT assets that checklists may relate to * * @example * import { ITGlueClient } from '../client'; * import { Checklists } from './resources/checklists'; * * const client = new ITGlueClient({ apiKey: 'your-api-key' }); * const checklists = new Checklists(client); * * // List checklists * const list = await checklists.list(); * * // Get a single checklist * const checklist = await checklists.get('123'); * * // Create a checklist * const created = await checklists.create({ * data: { * type: 'checklists', * attributes: { * name: 'Server Maintenance Checklist', * description: 'Monthly server maintenance tasks' * } * } * }); * * // Update a checklist * const updated = await checklists.update('123', { * data: { * type: 'checklists', * attributes: { * name: 'Updated Server Maintenance Checklist' * } * } * }); * * // Delete a checklist * await checklists.delete('123'); * * @category Checklists */ export declare class Checklists { private client; private basePath; private paginationUtil; /** * Create a Checklists resource instance * @param {ITGlueClient} client - ITGlueClient instance */ constructor(client: ITGlueClient); /** * List all checklists * @param {QueryUtilOptions} [options] - Optional query parameters (filter, sort, page, etc.) * @param {boolean} [allPages=false] - If true, fetches all pages automatically * @returns {Promise>} List of checklists and pagination metadata * @example * // Basic usage - get first page of checklists * const results = await client.checklists.list(); * console.log(`Found ${results.data.length} checklists`); * * @example * // Get all checklists across multiple pages * const allChecklists = await client.checklists.list({}, true); * console.log(`Retrieved all ${allChecklists.data.length} checklists`); * * @example * // Filtering checklists by organization * const orgChecklists = await client.checklists.list({ * filter: { organization_id: '123' }, * sort: 'name' * }); */ list(options?: QueryUtilOptions, allPages?: boolean): Promise>; /** * Get a single checklist by ID * @param {string} id - Checklist ID * @param {QueryParams} [params] - Optional query parameters * @returns {Promise>} Checklist resource * @example * // Basic usage - get checklist by ID * const checklist = await client.checklists.get('123'); * console.log('Checklist name:', checklist.data.attributes.name); * * @example * // Get checklist with related data included * const checklistWithDetails = await client.checklists.get('123', { * include: 'organization' * }); */ get(id: string, params?: QueryParams): Promise>; /** * Create a new checklist * @param {RequestBody} data - Checklist data (JSON:API format) * @returns {Promise>} Created checklist resource * @example * // Basic checklist creation * const created = await client.checklists.create({ * data: { * type: 'checklists', * attributes: { * name: 'New Hire Onboarding', * description: 'Tasks for onboarding new employees' * }, * relationships: { * organization: { * data: { type: 'organizations', id: '123' } * } * } * } * }); * * console.log('Created checklist with ID:', created.data.id); */ create(data: RequestBody): Promise>; /** * Update a checklist by ID * @param {string} id - Checklist ID * @param {RequestBody} data - Updated checklist data (JSON:API format) * @returns {Promise>} Updated checklist resource * @example * // Update checklist name and description * const updated = await client.checklists.update('123', { * data: { * type: 'checklists', * attributes: { * name: 'Updated Checklist Name', * description: 'Updated description' * } * } * }); */ update(id: string, data: RequestBody): Promise>; /** * Delete a checklist by ID * @param {string} id - Checklist ID * @returns {Promise} * @example * // Delete a checklist * await client.checklists.delete('123'); * console.log('Checklist deleted successfully'); */ delete(id: string): Promise; }