digi-tech-sdk
Version:
SDK oficial para integrar con la API de Digi
46 lines (45 loc) • 1.64 kB
TypeScript
import { HttpClient } from './client';
import { DigiRecord, RecordCreateData, RecordUpdateData } from './types';
import { AuthManager } from './auth';
export declare class RecordService {
private client;
private authManager;
constructor(client: HttpClient, authManager: AuthManager);
/**
* Gets the API version path prefix
* @returns The API version path (e.g. "/1.0")
*/
private getApiVersionPath;
/**
* Creates a new record
* @param data The data for the new record
* @param strategy Creation strategy (IGNORE, COMPLETE, OVERRIDE)
* @returns The created record
*/
create(data: RecordCreateData, strategy?: 'IGNORE' | 'COMPLETE' | 'OVERRIDE'): Promise<DigiRecord>;
/**
* Gets a record by ID
* @param recordId The ID of the record
* @returns The record
*/
get(recordId: string): Promise<DigiRecord>;
/**
* Updates a record
* @param recordId The ID of the record to update
* @param data The data to update
* @returns The updated record
*/
update(recordId: string, data: RecordUpdateData): Promise<DigiRecord>;
/**
* Gets the recovery link from a record
* @param record Either a record ID or a record object
* @returns The recovery link or null if not found
*/
getLinkRecover(record: string | DigiRecord): Promise<string | null>;
/**
* Gets the applicant link from a record
* @param record Either a record ID or a record object
* @returns The applicant link or null if not found
*/
getLinkApplicant(record: string | DigiRecord): Promise<string | null>;
}