UNPKG

@ritas-inc/sapb1commandapi-client

Version:

A stateless TypeScript client for SAP B1 Service Layer Command API with comprehensive error handling, type safety, and batch operations

127 lines (126 loc) 3.34 kB
import { z } from 'zod'; export declare const AuthRequestSchema: z.ZodObject<{ dbName: z.ZodString; user: z.ZodString; password: z.ZodString; }, "strip", z.ZodTypeAny, { dbName: string; user: string; password: string; }, { dbName: string; user: string; password: string; }>; export type AuthRequest = z.infer<typeof AuthRequestSchema>; export declare const AuthResponseDataSchema: z.ZodObject<{ userId: z.ZodString; }, "strip", z.ZodTypeAny, { userId: string; }, { userId: string; }>; export declare const AuthResponseMetadataSchema: z.ZodObject<{ CompanyDB: z.ZodString; UserName: z.ZodString; }, "strip", z.ZodTypeAny, { CompanyDB: string; UserName: string; }, { CompanyDB: string; UserName: string; }>; export declare const AuthResponseSchema: z.ZodUnion<[z.ZodObject<{ success: z.ZodLiteral<true>; data: z.ZodObject<{ userId: z.ZodString; }, "strip", z.ZodTypeAny, { userId: string; }, { userId: string; }>; metadata: z.ZodOptional<z.ZodTypeAny>; }, "strip", z.ZodTypeAny, { success: true; data: { userId: string; }; metadata?: any; }, { success: true; data: { userId: string; }; metadata?: any; }>, z.ZodObject<{ success: z.ZodLiteral<false>; problem: z.ZodObject<{ status: z.ZodNumber; type: z.ZodEnum<["unauthorized", "bad-request", "not-found", "internal-server-error"]>; title: z.ZodString; detail: z.ZodString; instance: z.ZodString; context: z.ZodObject<{ request: z.ZodString; responseText: z.ZodString; }, "strip", z.ZodTypeAny, { request: string; responseText: string; }, { request: string; responseText: string; }>; issues: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { issues: string[]; type: "unauthorized" | "bad-request" | "not-found" | "internal-server-error"; status: number; title: string; detail: string; instance: string; context: { request: string; responseText: string; }; }, { issues: string[]; type: "unauthorized" | "bad-request" | "not-found" | "internal-server-error"; status: number; title: string; detail: string; instance: string; context: { request: string; responseText: string; }; }>; }, "strip", z.ZodTypeAny, { success: false; problem: { issues: string[]; type: "unauthorized" | "bad-request" | "not-found" | "internal-server-error"; status: number; title: string; detail: string; instance: string; context: { request: string; responseText: string; }; }; }, { success: false; problem: { issues: string[]; type: "unauthorized" | "bad-request" | "not-found" | "internal-server-error"; status: number; title: string; detail: string; instance: string; context: { request: string; responseText: string; }; }; }>]>; export type AuthResponse = z.infer<typeof AuthResponseSchema>;