@visorcraft/mongreldb 0.31.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/native.d.ts CHANGED
@@ -349,6 +349,35 @@ export declare class Database {
349
349
  tablePageCacheLen(name: string): number
350
350
  /** Decoded-page-cache entry count for a table. */
351
351
  tableDecodedCacheLen(name: string): number
352
+ /** Create a catalog user with an Argon2id-hashed password. */
353
+ createUser(username: string, password: string): void
354
+ /** Drop a user by username. */
355
+ dropUser(username: string): void
356
+ /** Change a user's password. */
357
+ alterUserPassword(username: string, newPassword: string): void
358
+ /** Verify credentials. Returns true on success. */
359
+ verifyUser(username: string, password: string): boolean
360
+ /** Grant or revoke admin privileges on a user. */
361
+ setUserAdmin(username: string, isAdmin: boolean): void
362
+ /** List all usernames. */
363
+ users(): Array<string>
364
+ /** Create a role. */
365
+ createRole(name: string): void
366
+ /** Drop a role. */
367
+ dropRole(name: string): void
368
+ /** List all role names. */
369
+ roles(): Array<string>
370
+ /** Grant a role to a user. */
371
+ grantRole(username: string, roleName: string): void
372
+ /** Revoke a role from a user. */
373
+ revokeRole(username: string, roleName: string): void
374
+ /**
375
+ * Grant a permission to a role. `permission` is one of: "all", "ddl",
376
+ * "admin", or "select:table", "insert:table", "update:table", "delete:table".
377
+ */
378
+ grantPermission(roleName: string, permission: string): void
379
+ /** Revoke a permission from a role. */
380
+ revokePermission(roleName: string, permission: string): void
352
381
  /**
353
382
  * Create a fresh encrypted database (page-level AES-256-GCM; the database
354
383
  * KEK is derived from `passphrase` via Argon2id + HKDF).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visorcraft/mongreldb",
3
- "version": "0.31.1",
3
+ "version": "0.33.0",
4
4
  "description": "High-performance Node.js bindings for MongrelDB with native in-process storage, sub-ms writes, and hybrid indexing.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",