@octane-rgs/admin
v1.0.12
Published
Admin SDK for Octane RGS — back-office sessions, roles and permissions, operators, games, recovery, reports
Readme
@octane-rgs/admin
Typed client, roles and permissions for the Octane RGS admin API (/api/admin). Consumed by the back office and by scripts/cron.
import { OctaneAdminClient, can } from "@octane-rgs/admin";
// Scripts and cron: long-lived admin key.
const rgs = new OctaneAdminClient({ baseUrl: process.env.RGS_URL!, adminKey: process.env.RGS_ADMIN_KEY! });
await rgs.retryPayouts();
// Browser-facing servers: exchange the key for a short-lived session once,
// keep only the session token.
const { token, user } = await rgs.login({ userAgent: "octane-backoffice" });
const session = rgs.withSession(token);
if (can(user.role, "reports.read")) await session.ggrReport({ operatorCode: "acme", startDate, endDate });PERMISSIONS maps each permission to the roles that hold it. The RGS enforces this table on every route; UIs should import it to decide what to render rather than duplicating the rules.
