UNPKG

@archon-inc/sdk

Version:

Integrate easily to our government platform using this SDK. More info on https://archon.inc/sdk

17 lines (16 loc) 539 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getRole; const Archon_js_1 = require("../Archon.js"); /** * Retrieves a role by its name. * @param role The name of the role to retrieve. * @returns A promise resolving to the role. */ async function getRole(role) { const response = await Archon_js_1.Archon.request(`/policy/role/${role}`, "GET"); if (response.status !== 200) { throw new Error(`Failed to retrieve role with ID ${role}.`); } return response.data; }