UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

142 lines 5.32 kB
import { z } from 'zod'; import type { BaseResponse } from '../../../core/base-client'; import { Section, SectionListParams, CreateSectionRequest, UpdateSectionRequest, EnableSectionRequest } from '../schemas'; import type { VMIClient } from '../client'; type ExecuteRequest = VMIClient['executeRequest']; /** * Creates the sections resource methods * OpenAPI Path: /sections → sections.* * @description Methods for managing warehouse organizational sections */ export declare function createSectionsResource(executeRequest: ExecuteRequest): { /** * List sections with filtering * @description Returns sections for a customer with optional status filtering and pagination * @param params Filtering and pagination parameters (customerId is required) * @returns Array of section objects * @throws ValidationError When parameters are invalid or response is malformed */ list: (params?: SectionListParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: z.objectInputType<{ sectionsUid: z.ZodNumber; }, z.ZodTypeAny, "passthrough">[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get section details by ID * @description Returns detailed information for a specific section * @param sectionsUid Section unique identifier * @returns Section details * @throws ValidationError When response is malformed */ get: (sectionsUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: { sectionsUid: number; } & { [k: string]: unknown; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Create new section * @description Creates a new organizational section for a customer * @param request Section creation data * @returns Created section information * @throws ValidationError When request is invalid or response is malformed */ create: (request: CreateSectionRequest) => Promise<{ params: Record<string, unknown> | unknown[]; data: { sectionsUid: number; } & { [k: string]: unknown; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Update section information * @description Updates section details with provided data * @param sectionsUid Section unique identifier * @param request Section update data * @returns Updated section information * @throws ValidationError When request is invalid or response is malformed */ update: (sectionsUid: number, request: UpdateSectionRequest) => Promise<{ params: Record<string, unknown> | unknown[]; data: { sectionsUid: number; } & { [k: string]: unknown; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Soft delete a section * @description Marks section as deleted without removing data * @param sectionsUid Section unique identifier * @returns Boolean indicating successful deletion * @throws ValidationError When response is malformed */ delete: (sectionsUid: number) => Promise<boolean>; /** * Enable, disable, or delete a section * @description Changes section status using status codes * @param sectionsUid Section unique identifier * @param request Status change request with new status code * @returns Updated section information * @throws ValidationError When request is invalid or response is malformed */ enable: (sectionsUid: number, request: EnableSectionRequest) => Promise<BaseResponse<Section>>; }; /** * Creates the sectionsData resource methods (data-only versions) */ export declare function createSectionsDataResource(sections: ReturnType<typeof createSectionsResource>): { list: (params?: SectionListParams) => Promise<z.objectInputType<{ sectionsUid: z.ZodNumber; }, z.ZodTypeAny, "passthrough">[]>; get: (sectionsUid: number) => Promise<{ sectionsUid: number; } & { [k: string]: unknown; }>; create: (request: CreateSectionRequest) => Promise<{ sectionsUid: number; } & { [k: string]: unknown; }>; update: (sectionsUid: number, request: UpdateSectionRequest) => Promise<{ sectionsUid: number; } & { [k: string]: unknown; }>; enable: (sectionsUid: number, request: EnableSectionRequest) => Promise<z.objectOutputType<{ sectionsUid: z.ZodNumber; }, z.ZodTypeAny, "passthrough">>; }; export type SectionsResource = ReturnType<typeof createSectionsResource>; export type SectionsDataResource = ReturnType<typeof createSectionsDataResource>; export {}; //# sourceMappingURL=sections.d.ts.map