The Peripherals API manages standalone peripheral devices that exist independently of any particular PC or Laptop. A peripheral can be registered on its own and later linked to an equipment record, or it can be unlinked and returned to a free state. The supported device types are Monitor, Teclado, Mouse, Switch, Impresora, and Corneta. Serial uniqueness is enforced globally — the same serial cannot appear in both theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielings/Pasantia-Proyecto/llms.txt
Use this file to discover all available pages before exploring further.
perifericos collection and the indices collection simultaneously.
POST /api/perifericos/:tipo
Register a new standalone peripheral. The:tipo path segment determines the canonical device type stored in Firestore. The request runs inside a Firestore transaction that verifies the serial is not already present in the global indices, reserves it, and creates the peripheral document.
Auth: Not required.
If you include a peripheral in the
perifericos[] array when registering a PC or Laptop via POST /api/pc or POST /api/laptop, it is automatically created in this collection as well with asignado: true. Use this endpoint only when registering a peripheral that is not yet assigned to any equipment.Request
Device type. Must be one of (case-insensitive):
monitor, teclado, mouse, switch, impresora, corneta.Device brand. Defaults to
"Genérico" if omitted or blank.Device model name.
Unique serial number. Rejected if already present in the system indices.
Device condition (e.g.,
"Bueno", "Regular", "Dañado").Free-text observations. Stored as
null if omitted.Origin location. Object with fields
region, estado, ciudad, sede, piso, and optionally ala. Stored as null if omitted.Current deployment location. Same structure as
procedencia. Stored as null if omitted.Response
Confirmation including the canonical type name (e.g.,
"Monitor registrado correctamente.").Firestore document ID of the newly created peripheral.
Example
GET /api/componentes
Returns a combined list of all equipment records and all standalone peripherals, each with their flattened deployment location fields. Results are scoped to the authenticated user’ssede unless the user holds the Superadministrador role, in which case all records from all offices are returned.
Auth: Required.
Despite the endpoint name, this route returns both full equipment assets (PCs, Laptops) and standalone peripherals — not only internal hardware components. It is the primary data source for the inventory overview table in the frontend.
Request
No request body or query parameters.Response
Returns a JSON array. Each element represents either an equipment record or a peripheral document:Firestore document ID.
Asset type (e.g.,
"PC", "Laptop", "Monitor", "Teclado").Brand.
Model.
Serial number.
Current condition.
Geographic region of the deployment location.
State/province of the deployment location.
City of the deployment location.
Office building or branch of the deployment location.
Floor of the deployment location.
Wing of the deployment location.
Example
GET /api/perifericos/:id
Retrieve a single peripheral by its Firestore document ID. The response includes anequipoRelacionado field that is resolved by scanning the perifericos[] arrays of all equipment documents in the equipos collection, so the linkage is always current even if it was established indirectly.
Auth: Not required.
Request
Firestore document ID of the peripheral.
Response
Firestore document ID.
Canonical device type (e.g.,
"Monitor").Brand.
Model.
Serial number.
Condition.
Observations.
Origin location object.
Deployment location object.
true if linked to an equipment record.Firestore ID of the linked equipment document, or
null.Summary of the linked equipment:
{ id, tipo, serial, marca, modelo }, or null if unassigned.Example
PUT /api/perifericos/:tipo/:id
Update a peripheral’s metadata, deployment location, and/or equipment assignment. The update is atomic — if a peripheral is moved from one equipment to another, both equipment documents’perifericos[] arrays are updated in the same Firestore transaction.
Auth: Not required.
Request
Device type. Must match one of the allowed types:
monitor, teclado, mouse, switch, impresora, corneta (case-insensitive).Firestore document ID of the peripheral to update.
Updated brand. Keeps existing value if omitted.
Updated model. Keeps existing value if omitted.
Updated serial number. If changed, the old index entry is deleted and a new one is created. Rejected if the new serial is already in use.
Updated condition.
Updated observations.
Partial or full deployment location override. Fields provided here are merged over the existing
asignacion object.Firestore document ID of the equipment to link this peripheral to. Pass
"desvincular" or an empty string "" to unassign the peripheral from its current equipment.Response
"Operación realizada con éxito."Firestore document ID of the updated peripheral.