UNPKG

@isaac-platform/isaac-integration-sdk

Version:

A Typescript SDK for integrating with ISAAC

32 lines (31 loc) 1.24 kB
import isaacConnection from "../controller/isaac.js"; class SubsystemController { constructor() { /** * Get details for all subsystems from ISAAC. * @param type - filter by Subsystem Type * @param isCMS - filter to only CMS types * @param includePlayers - include players (not included by default) * @returns Promise<Subsystem[]> - An array of subsystems from ISAAC */ this.getSubsystems = (type, isCMS, includePlayers) => { return isaacConnection.getRequest('subsystems', { params: { type: type, cms: isCMS, includePlayers: includePlayers } }); }; /** * Get subsystem details from ISAAC. * @param id - the internal ID number or externalRef string used to identify the subsystem in ISAAC. * @returns Promise<Subsystem> - The details for the identified subsystem. (May be empty) */ this.getSubsystem = (id) => { return isaacConnection.getRequest(`subsystems/${id}`); }; } } const subsystemController = new SubsystemController(); export default subsystemController;