better-sqlite3-multiple-ciphers 8.5.1-beta.0 → 8.5.1
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/README.md +3 -3
- package/index.d.ts +162 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -17,13 +17,13 @@ The fastest and simplest library for SQLite3 in Node.js. This particular fork su
|
|
|
17
17
|
## Current versions
|
|
18
18
|
|
|
19
19
|
- ### Stable
|
|
20
|
-
- **better-sqlite3-multiple-ciphers** - [`8.5.
|
|
21
|
-
- **better-sqlite3** - [`8.5.
|
|
20
|
+
- **better-sqlite3-multiple-ciphers** - [`8.5.1`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v8.5.1)
|
|
21
|
+
- **better-sqlite3** - [`8.5.1`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v8.5.1)
|
|
22
22
|
- **SQLite** - [`3.42.0`](https://www.sqlite.org/releaselog/3_42_0.html)
|
|
23
23
|
- **SQLite3 Multiple Ciphers** - [`1.6.3`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v1.6.3)
|
|
24
24
|
|
|
25
25
|
- ### Beta
|
|
26
|
-
- **better-sqlite3-multiple-ciphers** - [`8.5.1-beta.
|
|
26
|
+
- **better-sqlite3-multiple-ciphers** - [`8.5.1-beta.1`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v8.5.1-beta.1)
|
|
27
27
|
- **better-sqlite3** - [`8.5.0`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v8.5.0)
|
|
28
28
|
- **SQLite** - [`3.42.0`](https://www.sqlite.org/releaselog/3_42_0.html)
|
|
29
29
|
- **SQLite3 Multiple Ciphers** - [`1.6.3`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v1.6.3)
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Type definitions for better-sqlite3-multiple-ciphers 8.5.0
|
|
2
|
+
// Project: https://github.com/m4heshd/better-sqlite3-multiple-ciphers
|
|
3
|
+
// Definitions by: Ben Davies <https://github.com/Morfent>
|
|
4
|
+
// Mathew Rumsey <https://github.com/matrumz>
|
|
5
|
+
// Santiago Aguilar <https://github.com/sant123>
|
|
6
|
+
// Alessandro Vergani <https://github.com/loghorn>
|
|
7
|
+
// Andrew Kaiser <https://github.com/andykais>
|
|
8
|
+
// Mark Stewart <https://github.com/mrkstwrt>
|
|
9
|
+
// Florian Stamer <https://github.com/stamerf>
|
|
10
|
+
// Mahesh Bandara Wijerathna <https://github.com/m4heshd>
|
|
11
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
12
|
+
// TypeScript Version: 3.8
|
|
13
|
+
|
|
14
|
+
/// <reference types="node" />
|
|
15
|
+
|
|
16
|
+
// FIXME: Is this `any` really necessary?
|
|
17
|
+
type VariableArgFunction = (...params: any[]) => unknown;
|
|
18
|
+
type ArgumentTypes<F extends VariableArgFunction> = F extends (...args: infer A) => unknown ? A : never;
|
|
19
|
+
type ElementOf<T> = T extends Array<infer E> ? E : T;
|
|
20
|
+
|
|
21
|
+
declare namespace BetterSqlite3MultipleCiphers {
|
|
22
|
+
interface Statement<BindParameters extends unknown[]> {
|
|
23
|
+
database: Database;
|
|
24
|
+
source: string;
|
|
25
|
+
reader: boolean;
|
|
26
|
+
readonly: boolean;
|
|
27
|
+
busy: boolean;
|
|
28
|
+
|
|
29
|
+
run(...params: BindParameters): Database.RunResult;
|
|
30
|
+
get(...params: BindParameters): unknown;
|
|
31
|
+
all(...params: BindParameters): unknown[];
|
|
32
|
+
iterate(...params: BindParameters): IterableIterator<unknown>;
|
|
33
|
+
pluck(toggleState?: boolean): this;
|
|
34
|
+
expand(toggleState?: boolean): this;
|
|
35
|
+
raw(toggleState?: boolean): this;
|
|
36
|
+
bind(...params: BindParameters): this;
|
|
37
|
+
columns(): ColumnDefinition[];
|
|
38
|
+
safeIntegers(toggleState?: boolean): this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ColumnDefinition {
|
|
42
|
+
name: string;
|
|
43
|
+
column: string | null;
|
|
44
|
+
table: string | null;
|
|
45
|
+
database: string | null;
|
|
46
|
+
type: string | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface Transaction<F extends VariableArgFunction> {
|
|
50
|
+
(...params: ArgumentTypes<F>): ReturnType<F>;
|
|
51
|
+
default(...params: ArgumentTypes<F>): ReturnType<F>;
|
|
52
|
+
deferred(...params: ArgumentTypes<F>): ReturnType<F>;
|
|
53
|
+
immediate(...params: ArgumentTypes<F>): ReturnType<F>;
|
|
54
|
+
exclusive(...params: ArgumentTypes<F>): ReturnType<F>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface VirtualTableOptions {
|
|
58
|
+
rows: () => Generator;
|
|
59
|
+
columns: string[];
|
|
60
|
+
parameters?: string[] | undefined;
|
|
61
|
+
safeIntegers?: boolean | undefined;
|
|
62
|
+
directOnly?: boolean | undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface Database {
|
|
66
|
+
memory: boolean;
|
|
67
|
+
readonly: boolean;
|
|
68
|
+
name: string;
|
|
69
|
+
open: boolean;
|
|
70
|
+
inTransaction: boolean;
|
|
71
|
+
|
|
72
|
+
prepare<BindParameters extends unknown[] | {} = unknown[]>(
|
|
73
|
+
source: string,
|
|
74
|
+
): BindParameters extends unknown[] ? Statement<BindParameters> : Statement<[BindParameters]>;
|
|
75
|
+
transaction<F extends VariableArgFunction>(fn: F): Transaction<F>;
|
|
76
|
+
exec(source: string): this;
|
|
77
|
+
key(key: Buffer): number;
|
|
78
|
+
rekey(key: Buffer): number;
|
|
79
|
+
pragma(source: string, options?: Database.PragmaOptions): unknown;
|
|
80
|
+
function(name: string, cb: (...params: unknown[]) => unknown): this;
|
|
81
|
+
function(name: string, options: Database.RegistrationOptions, cb: (...params: unknown[]) => unknown): this;
|
|
82
|
+
aggregate<T>(name: string, options: Database.RegistrationOptions & {
|
|
83
|
+
start?: T | (() => T);
|
|
84
|
+
step: (total: T, next: ElementOf<T>) => T | void;
|
|
85
|
+
inverse?: ((total: T, dropped: T) => T) | undefined;
|
|
86
|
+
result?: ((total: T) => unknown) | undefined;
|
|
87
|
+
}): this;
|
|
88
|
+
loadExtension(path: string): this;
|
|
89
|
+
close(): this;
|
|
90
|
+
defaultSafeIntegers(toggleState?: boolean): this;
|
|
91
|
+
backup(destinationFile: string, options?: Database.BackupOptions): Promise<Database.BackupMetadata>;
|
|
92
|
+
table(name: string, options: VirtualTableOptions): this;
|
|
93
|
+
unsafeMode(unsafe?: boolean): this;
|
|
94
|
+
serialize(options?: Database.SerializeOptions): Buffer;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface DatabaseConstructor {
|
|
98
|
+
new (filename: string | Buffer, options?: Database.Options): Database;
|
|
99
|
+
(filename: string, options?: Database.Options): Database;
|
|
100
|
+
prototype: Database;
|
|
101
|
+
|
|
102
|
+
SqliteError: typeof SqliteError;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
declare class SqliteError extends Error {
|
|
107
|
+
name: string;
|
|
108
|
+
message: string;
|
|
109
|
+
code: string;
|
|
110
|
+
constructor(message: string, code: string);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare namespace Database {
|
|
114
|
+
interface RunResult {
|
|
115
|
+
changes: number;
|
|
116
|
+
lastInsertRowid: number | bigint;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface Options {
|
|
120
|
+
readonly?: boolean | undefined;
|
|
121
|
+
fileMustExist?: boolean | undefined;
|
|
122
|
+
timeout?: number | undefined;
|
|
123
|
+
verbose?: ((message?: unknown, ...additionalArgs: unknown[]) => void) | undefined;
|
|
124
|
+
nativeBinding?: string | undefined;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface SerializeOptions {
|
|
128
|
+
attached?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface PragmaOptions {
|
|
132
|
+
simple?: boolean | undefined;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface RegistrationOptions {
|
|
136
|
+
varargs?: boolean | undefined;
|
|
137
|
+
deterministic?: boolean | undefined;
|
|
138
|
+
safeIntegers?: boolean | undefined;
|
|
139
|
+
directOnly?: boolean | undefined;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type AggregateOptions = Parameters<BetterSqlite3MultipleCiphers.Database["aggregate"]>[1];
|
|
143
|
+
|
|
144
|
+
interface BackupMetadata {
|
|
145
|
+
totalPages: number;
|
|
146
|
+
remainingPages: number;
|
|
147
|
+
}
|
|
148
|
+
interface BackupOptions {
|
|
149
|
+
progress: (info: BackupMetadata) => number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type SqliteError = typeof SqliteError;
|
|
153
|
+
type Statement<BindParameters extends unknown[] | {} = unknown[]> = BindParameters extends unknown[]
|
|
154
|
+
? BetterSqlite3MultipleCiphers.Statement<BindParameters>
|
|
155
|
+
: BetterSqlite3MultipleCiphers.Statement<[BindParameters]>;
|
|
156
|
+
type ColumnDefinition = BetterSqlite3MultipleCiphers.ColumnDefinition;
|
|
157
|
+
type Transaction<T extends VariableArgFunction = VariableArgFunction> = BetterSqlite3MultipleCiphers.Transaction<T>;
|
|
158
|
+
type Database = BetterSqlite3MultipleCiphers.Database;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare const Database: BetterSqlite3MultipleCiphers.DatabaseConstructor;
|
|
162
|
+
export = Database;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "8.5.1
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"description": "better-sqlite3 with multiple-cipher encryption support",
|
|
5
5
|
"homepage": "https://github.com/m4heshd/better-sqlite3-multiple-ciphers",
|
|
6
6
|
"author": "Mahesh Bandara Wijerathna (m4heshd) <m4heshd@gmail.com>",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"main": "lib/index.js",
|
|
12
12
|
"types": "index.d.ts",
|
|
13
13
|
"files": [
|
|
14
|
+
"index.d.ts",
|
|
14
15
|
"binding.gyp",
|
|
15
16
|
"src/*.[ch]pp",
|
|
16
17
|
"lib/**",
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
"prebuild-install": "^7.1.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
25
|
+
"@types/node": "20.4.9",
|
|
24
26
|
"chai": "^4.3.6",
|
|
25
27
|
"cli-color": "^2.0.2",
|
|
26
28
|
"fs-extra": "^10.1.0",
|