Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rr-apilib

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rr-apilib - npm Package Compare versions

Comparing version 0.8.2-alpha to 0.8.3-alpha

4

lib/@types/api.d.ts

@@ -8,3 +8,5 @@ export declare enum APIValidationState {

User = "ROLE_USER",
Admin = "ROLE_ADMIN"
Admin = "ROLE_ADMIN",
Moderator = "ROLE_MODERATOR",
SuperAdmin = "ROLE_SUPER_ADMIN"
}

@@ -11,0 +13,0 @@ export interface APIAttachmentData {

@@ -12,3 +12,5 @@ // Enums

APIUserRole["Admin"] = "ROLE_ADMIN";
APIUserRole["Moderator"] = "ROLE_MODERATOR";
APIUserRole["SuperAdmin"] = "ROLE_SUPER_ADMIN";
})(APIUserRole || (APIUserRole = {}));
//# sourceMappingURL=api.js.map

@@ -22,2 +22,5 @@ import Base from "./Base";

constructor(client: Client, data: APIUserData);
get isSuperAdmin(): boolean;
get isAdmin(): boolean;
get isModerator(): boolean;
_patch(data: APIUserData): void;

@@ -24,0 +27,0 @@ /** Return data for api request */

import { __extends } from "tslib";
import Base from "./Base";
import UserResourceManager from "../managers/UserResourceManager";
import { APIUserRole } from "../@types";
/** Represents an user */

@@ -18,2 +19,27 @@ var User = /** @class */ (function (_super) {

}
Object.defineProperty(User.prototype, "isSuperAdmin", {
get: function () {
return this.roles.includes(APIUserRole.SuperAdmin);
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "isAdmin", {
get: function () {
if (this.isSuperAdmin)
return this.isSuperAdmin;
return this.roles.includes(APIUserRole.Admin);
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "isModerator", {
get: function () {
if (this.isAdmin)
return this.isAdmin;
return this.roles.includes(APIUserRole.Moderator);
},
enumerable: false,
configurable: true
});
User.prototype._patch = function (data) {

@@ -20,0 +46,0 @@ this.data = data;

{
"name": "rr-apilib",
"version": "0.8.2-alpha",
"version": "0.8.3-alpha",
"description": "Library for interact with RR-API",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc