@cosmosapp/pay_sdkDefinicionesServidor
BaseManager
Base class for all resource managers. Each manager owns a slice of the API (payment intents, webhooks, ...) and a lightweight in-memory cache of the structures…
Base class for all resource managers. Each manager owns a slice of the API (payment intents, webhooks, ...) and a lightweight in-memory cache of the structures it has materialized — an atomic, per-resource manager pattern. Extends EventEmitter so managers that surface real-time events (e.g. the webhook listener) can emit/on without extra plumbing.
Constructor
BaseManager
constructor(client: Client)Parameters
client:Client
Properties
id
id: stringmember
}> extends EventEmitter { readonly client: Clientcache
Cache of structures keyed by id, populated on fetch/create.
readonly cache: Map<string, Structure>protected
Shortcut to the shared REST instance.
protected get rest(): RESTprotected
Store a structure in the cache and return it.
protected _add(structure: Structure): StructureresolveId
Resolve an id from either a raw id or a structure instance.
resolveId(idOrStructure: string | { id: stringmember
}): string