Skip to content

Resource<R> ​

CRUD sobre un recurso de la API.

Extended by ​

Type Parameters ​

Type ParameterDefault type
R extends RecordRecord

Constructors ​

Constructor ​

ts
new Resource<R>(transport, config): Resource<R>;

Parameters ​

ParameterType
transportTransport
configIssuerConfig

Returns ​

Resource<R>

Methods ​

get() ​

ts
get(id): Promise<R>;

Un recurso por su id.

Parameters ​

ParameterType
idnumber

Returns ​

Promise<R>


list() ​

ts
list(params?): Promise<Page<R>>;

Una página de resultados.

Para recorrer todo sin escribir el bucle del cursor:

ts
for await (const factura of (await sd.invoices.list()).autoPaging()) { ... }

Parameters ​

ParameterType
paramsListParams

Returns ​

Promise<Page<R>>


delete() ​

ts
delete(id): Promise<void>;

Borra el recurso.

Parameters ​

ParameterType
idnumber

Returns ​

Promise<void>