@visorcraft/mongreldb 0.33.0 → 0.35.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.
- package/mongreldb.linux-x64-gnu.node +0 -0
- package/native.d.ts +39 -0
- package/package.json +1 -1
|
Binary file
|
package/native.d.ts
CHANGED
|
@@ -240,6 +240,34 @@ export declare class Database {
|
|
|
240
240
|
static withPath(path: string): Database
|
|
241
241
|
/** Open an existing database from disk. */
|
|
242
242
|
static open(path: string): Database
|
|
243
|
+
/**
|
|
244
|
+
* Open an existing database that has `require_auth = true`, verifying
|
|
245
|
+
* the supplied credentials. Every subsequent operation on the returned
|
|
246
|
+
* handle is checked against the authenticated principal's permissions.
|
|
247
|
+
* Throws if the database does not require auth (use `open` instead) or
|
|
248
|
+
* if the credentials are invalid.
|
|
249
|
+
*/
|
|
250
|
+
static openWithCredentials(path: string, username: string, password: string): Database
|
|
251
|
+
/**
|
|
252
|
+
* Create a fresh database with `require_auth = true` and a single admin
|
|
253
|
+
* user. The returned handle is already authenticated as that admin.
|
|
254
|
+
*/
|
|
255
|
+
static createWithCredentials(path: string, adminUsername: string, adminPassword: string): Database
|
|
256
|
+
/**
|
|
257
|
+
* Convert a credentialless database to a credentialed one in place:
|
|
258
|
+
* creates the first admin user, sets `require_auth = true`, and caches
|
|
259
|
+
* the admin principal on this handle. After this call, the database can
|
|
260
|
+
* only be reopened via `openWithCredentials`.
|
|
261
|
+
*/
|
|
262
|
+
enableAuth(adminUsername: string, adminPassword: string): void
|
|
263
|
+
/** Returns `true` if this database has `require_auth = true`. */
|
|
264
|
+
requireAuthEnabled(): boolean
|
|
265
|
+
/**
|
|
266
|
+
* Re-resolve the cached principal from the on-disk catalog, picking up
|
|
267
|
+
* role/permission changes made by other handles. No-op on credentialless
|
|
268
|
+
* databases.
|
|
269
|
+
*/
|
|
270
|
+
refreshPrincipal(): void
|
|
243
271
|
/** Create a new table with the given schema. */
|
|
244
272
|
createTable(name: string, schema: SchemaSpec): bigint
|
|
245
273
|
/** Drop a table by name. */
|
|
@@ -385,6 +413,17 @@ export declare class Database {
|
|
|
385
413
|
static createEncrypted(path: string, passphrase: string): Database
|
|
386
414
|
/** Open an existing encrypted database with its passphrase. */
|
|
387
415
|
static openEncrypted(path: string, passphrase: string): Database
|
|
416
|
+
/**
|
|
417
|
+
* Open an existing encrypted database that has `require_auth = true`,
|
|
418
|
+
* combining the encryption passphrase with credential verification.
|
|
419
|
+
*/
|
|
420
|
+
static openEncryptedWithCredentials(path: string, passphrase: string, username: string, password: string): Database
|
|
421
|
+
/**
|
|
422
|
+
* Create a fresh encrypted database with `require_auth = true` and a
|
|
423
|
+
* single admin user. Composes encryption-at-rest with credential
|
|
424
|
+
* enforcement.
|
|
425
|
+
*/
|
|
426
|
+
static createEncryptedWithCredentials(path: string, passphrase: string, adminUsername: string, adminPassword: string): Database
|
|
388
427
|
}
|
|
389
428
|
/** A handle to one table inside a [`Database`]. */
|
|
390
429
|
export declare class TableHandle {
|
package/package.json
CHANGED