UNPKG

@archon-inc/sdk

Version:

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

14 lines (13 loc) 601 B
import { Archon } from "../Archon.js"; /** * Given a resource type name, return the resource type from the Archon policy service. * @param resourceTypeName the name of the resource type to retrieve, found in the archon.yaml file. * @returns The resource type from the Archon policy service. */ export default async function getResourceType(resourceTypeName) { const response = await Archon.request(`/policy/type/${resourceTypeName}`, "GET"); if (response.status !== 200) { throw new Error(`Failed to retrieve resource type ${resourceTypeName}.`); } return response.data; }