@eleva-io/erp-sdk
Version:
SDK oficial para el ERP de Eleva
131 lines • 4.34 kB
TypeScript
import { z } from 'zod';
import { CatalogDetails, ErrorKind } from './catalog_types';
/**
* ERP domain-specific error codes. Add here any code that does not fit
* the generic HTTP categories in `BASE_ERROR_CODES`.
*/
export declare enum API_ERROR_CODES {
FORBIDDEN_CONTACT = "FORBIDDEN_CONTACT",
HORIZONTAL_BULK_MESSAGING_ATTACHMENTS_TOO_LARGE = "HORIZONTAL_BULK_MESSAGING_ATTACHMENTS_TOO_LARGE",
HORIZONTAL_CLAIM_POLICY_COMMUNITY_MISMATCH = "HORIZONTAL_CLAIM_POLICY_COMMUNITY_MISMATCH",
HORIZONTAL_CLAIM_CONTACT_ALREADY_LINKED = "HORIZONTAL_CLAIM_CONTACT_ALREADY_LINKED",
HORIZONTAL_CLAIM_CLOSED_BEFORE_OPENED = "HORIZONTAL_CLAIM_CLOSED_BEFORE_OPENED",
TICKETING_TASK_CLAIM_SUBREF_NOT_ALLOWED = "TICKETING_TASK_CLAIM_SUBREF_NOT_ALLOWED",
TICKETING_TASK_CLAIM_ALREADY_ASSOCIATED = "TICKETING_TASK_CLAIM_ALREADY_ASSOCIATED"
}
/** Maps every `API_ERROR_CODES` member to its catalog entry. */
export declare const API_ERRORS_CATALOG: {
FORBIDDEN_CONTACT: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
/** UUID of the contact person the caller was denied access to. */
contactId: z.ZodString;
}, "strip", z.ZodTypeAny, {
contactId: string;
}, {
contactId: string;
}>;
message: string;
};
HORIZONTAL_BULK_MESSAGING_ATTACHMENTS_TOO_LARGE: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
/** Maximum total size allowed for all attachments, in bytes. */
maxBytes: z.ZodNumber;
/** Total size of the submitted attachments, in bytes. */
totalBytes: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
maxBytes: number;
totalBytes: number;
}, {
maxBytes: number;
totalBytes: number;
}>;
message: string;
};
HORIZONTAL_CLAIM_POLICY_COMMUNITY_MISMATCH: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
policyId: z.ZodString;
communityId: z.ZodString;
}, "strip", z.ZodTypeAny, {
policyId: string;
communityId: string;
}, {
policyId: string;
communityId: string;
}>;
message: string;
};
HORIZONTAL_CLAIM_CONTACT_ALREADY_LINKED: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
claimId: z.ZodString;
contactId: z.ZodString;
}, "strip", z.ZodTypeAny, {
contactId: string;
claimId: string;
}, {
contactId: string;
claimId: string;
}>;
message: string;
};
HORIZONTAL_CLAIM_CLOSED_BEFORE_OPENED: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
openedAt: z.ZodString;
closedAt: z.ZodString;
}, "strip", z.ZodTypeAny, {
openedAt: string;
closedAt: string;
}, {
openedAt: string;
closedAt: string;
}>;
message: string;
};
TICKETING_TASK_CLAIM_SUBREF_NOT_ALLOWED: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
taskId: z.ZodString;
refId: z.ZodString;
}, "strip", z.ZodTypeAny, {
taskId: string;
refId: string;
}, {
taskId: string;
refId: string;
}>;
message: string;
};
TICKETING_TASK_CLAIM_ALREADY_ASSOCIATED: {
kind: ErrorKind.DOMAIN;
status: number;
details: z.ZodObject<{
taskId: z.ZodString;
refId: z.ZodString;
}, "strip", z.ZodTypeAny, {
taskId: string;
refId: string;
}, {
taskId: string;
refId: string;
}>;
message: string;
};
};
/**
* Strongly-typed `details` shape for a given `API_ERROR_CODES` member.
* @example
* type ForbiddenContactDetails = APIErrorDetails<API_ERROR_CODES.FORBIDDEN_CONTACT>
* // → { contactId: string }
*/
export type APIErrorDetails<C extends API_ERROR_CODES> = CatalogDetails<C, typeof API_ERRORS_CATALOG>;
//# sourceMappingURL=catalog_api.d.ts.map