@agility/management-sdk
Version:
Agility CMS Tyescript SDK for Management API.
43 lines (42 loc) • 1.87 kB
TypeScript
import { Options } from "../models/options";
import { ClientInstance } from "./clientInstance";
import { Batch } from "../models/batch";
import { BatchTypesResponse } from "../models/batchTypes";
export declare class BatchMethods {
_options: Options;
_clientInstance: ClientInstance;
constructor(options: Options);
getBatch(batchID: number, guid: string, expandItems?: boolean): Promise<Batch>;
publishBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
unpublishBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
approveBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
declineBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
requestApprovalBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
/**
* Retrieves all batch-related enum types for developer discovery.
* This method provides all available enum values with their names,
* enabling dynamic UI population and client-side validation.
*
* @param guid - Current website guid
* @returns Promise containing all batch enum types
*
* @example
* ```typescript
* // Get all batch types for UI population
* const types = await client.batchMethods.getBatchTypes(guid);
*
* // Create dropdown options for item types
* const itemTypeOptions = types.itemTypes.map(type => ({
* label: type.name,
* value: type.value
* }));
*
* // Validate operation type
* const isValidOperation = (value: number) =>
* types.workflowOperations.some(op => op.value === value);
* ```
*/
getBatchTypes(guid: string): Promise<BatchTypesResponse>;
Retry(method: Function): Promise<Batch>;
delay(ms: number): Promise<unknown>;
}