UNPKG

@mozaic-io/mozaic-sdk-node

Version:

The Mozaic Node SDK enables you to pay your creators easily via the Mozaic API.

50 lines (49 loc) 2.02 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Permissions = void 0; const api_1 = require("../../api"); const BaseResource_1 = require("../BaseResource"); /** * Use the Permissions class to get the UI visibility permissions for * the Personal Access Token supplied to the Mozaic SDK. * @group Resources */ class Permissions extends BaseResource_1.BaseResource { /** * @internal * You should not call this constructor directly. Instead, use the Mozaic main * entry point to get convinent access to the SDK classes. * @param configuration */ constructor(mozaic, configuration) { super(); this._permissionsApi = new api_1.PermissionsApi(configuration); } /** * Get the underlying API for direct calls to the Mozaic API. */ get PermissionsApi() { return this._permissionsApi; } /** * Gets a list of permissions assigned to the Personal Access Token * that was used to initialize the Mozaic SDK. * @returns a list of visibility roles * @throws ApiException */ getPermissions() { return __awaiter(this, void 0, void 0, function* () { return yield this.execute(() => this._permissionsApi.permissionsGet(true)); }); } } exports.Permissions = Permissions;