@fajarnugraha37/nope-iam
Version:
A highly extensible, type-safe IAM-like access control library for Node.js, inspired by AWS IAM. Deny by default, allow by vibes and less patience for your bad access patterns. Supports policies, roles, decorators, adapters, and rich evaluation context be
29 lines • 1.13 kB
TypeScript
import type { User, Role, Policy } from '../types/entities.js';
import type { IAMStorage } from '../core/storage.js';
export interface JSONFileAdapterOptions {
filePath: string;
}
export declare class JSONFileAdapter implements IAMStorage {
private filePath;
private data;
private loaded;
constructor(options: JSONFileAdapterOptions);
private load;
private save;
getUser(id: string): Promise<User | undefined>;
getUsers(ids: string[]): Promise<User[]>;
getAllUsers(): AsyncIterable<User>;
getRole(id: string): Promise<Role | undefined>;
getRoles(ids: string[]): Promise<Role[]>;
getAllRoles(): AsyncIterable<Role>;
getPolicy(id: string): Promise<Policy | undefined>;
getPolicies(ids: string[]): Promise<Policy[]>;
getAllPolicies(): AsyncIterable<Policy>;
saveUser(user: User): Promise<void>;
saveRole(role: Role): Promise<void>;
savePolicy(policy: Policy): Promise<void>;
deleteUser(id: string): Promise<void>;
deleteRole(id: string): Promise<void>;
deletePolicy(id: string): Promise<void>;
}
//# sourceMappingURL=jsonFileAdapter.d.ts.map