"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Portal = void 0;
const utils_js_1 = require("./utils.cjs");
/**
 * Portal
 * Manage portal tokens.
 */
class Portal {
    client;
    constructor(client) {
        this.client = client;
    }
    /**
     * Create a consumer portal token
     * @param request - The request body
     * @param options - The request options
     * @returns The portal token
     */
    async create(body, options) {
        const resp = await this.client.POST('/api/v1/portal/tokens', {
            body,
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * List consumer portal tokens
     * @param query - The query parameters
     * @param options - The request options
     * @returns The portal tokens
     */
    async list(query, options) {
        const resp = await this.client.GET('/api/v1/portal/tokens', {
            params: { query },
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
    /**
     * Invalidate consumer portal tokens
     * @param body - The id or subject to invalidate
     * @param options - The request options
     * @returns The portal token
     */
    async invalidate(body, options) {
        const resp = await this.client.POST('/api/v1/portal/tokens/invalidate', {
            body,
            ...options,
        });
        return (0, utils_js_1.transformResponse)(resp);
    }
}
exports.Portal = Portal;
//# sourceMappingURL=portal.cjs.map