memorio 5.1.1 → 5.1.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memorio",
3
3
  "codeName": "memorio",
4
- "version": "5.1.1",
4
+ "version": "5.1.3",
5
5
  "description": "Memorio, State + Observer, Store and iDB for an easy life - Cross-platform compatible",
6
6
  "main": "./index.cjs",
7
7
  "browser": {
@@ -78,6 +78,7 @@
78
78
  "SECURITY-HARDENING.md",
79
79
  "SUMMARY.md",
80
80
  "LICENSE.md",
81
+ "CHANGELOG.md",
81
82
  "index.d.ts",
82
83
  "global.d.ts",
83
84
  "global.cjs",
@@ -89,7 +90,11 @@
89
90
  "publishConfig": {
90
91
  "access": "public"
91
92
  },
92
- "sideEffects": true,
93
+ "sideEffects": [
94
+ "./global.js",
95
+ "./global.cjs",
96
+ "./core/global.ts"
97
+ ],
93
98
  "support": {
94
99
  "name": "Dario Passariello",
95
100
  "url": "https://dario.passariello.ca/",
@@ -0,0 +1,14 @@
1
+ declare module 'bun:sqlite' {
2
+ export class Database {
3
+ constructor(path: string)
4
+ run(sql: string, ...params: any[]): any
5
+ query(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
6
+ close(): void
7
+ prepare(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
8
+ }
9
+ export class Statement {
10
+ all(...params: any[]): any[]
11
+ get(...params: any[]): any
12
+ run(...params: any[]): any
13
+ }
14
+ }
@@ -29,8 +29,8 @@ interface _encryption {
29
29
  deriveKey: (
30
30
  password: string,
31
31
  salt?: string | Uint8Array,
32
- alg?: 'AES-GCM' | 'AES-CBC'
33
- iterations?: number
32
+ alg?: 'AES-GCM' | 'AES-CBC',
33
+ iterations?: number
34
34
  ) => Promise<CryptoKey>
35
35
 
36
36
  /**
package/types/sqlite.d.ts CHANGED
@@ -1,35 +1,58 @@
1
- /*!
2
- memorio
3
- Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under MIT License, see
5
- dario.passariello.ca
6
- */
7
-
8
- /**
9
- * Memorio SQLite module.
10
- *
11
- * Backed by the optional `sql.js` package (SQLite compiled to WebAssembly).
12
- * Lazily loaded in the browser; disabled in non-browser environments.
13
- */
14
- interface _sqlite {
15
- /** Database connection tools (create, get, delete, list, size, export, import). */
16
- db: any
17
- /** SQL execution tools (run, select). */
18
- query: any
19
- /** CRUD shortcut helpers (set, get). */
20
- data: any
21
- /** Lazy-load / configure the sql.js engine (wasm loader, locateFile, etc.). */
22
- config: (opts: any) => any
23
- /** Promise that resolves once the sql.js engine has been initialized. */
24
- ready: Promise<void> | null
25
- /** True when running outside a supported browser environment. */
26
- _disabled?: boolean
27
- /** Human readable reason the module is disabled, when applicable. */
28
- _warning?: string
29
- [key: string]: any
30
- }
31
-
32
- declare var sqlite: _sqlite
33
- type sqlite = _sqlite
34
-
35
- declare var sqlbases: any[]
1
+ /*!
2
+ memorio
3
+ Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>
4
+ Licensed under MIT License, see
5
+ dario.passariello.ca
6
+ */
7
+
8
+ /**
9
+ * Memorio SQLite module.
10
+ *
11
+ * Backed by the optional `sql.js` package (SQLite compiled to WebAssembly).
12
+ * Lazily loaded in the browser; disabled in non-browser environments.
13
+ */
14
+ interface _sqlite {
15
+ /** Database connection tools (create, get, delete, list, size, export, import). */
16
+ db: any
17
+ /** SQL execution tools (run, select). */
18
+ query: any
19
+ /** CRUD shortcut helpers (set, get). */
20
+ data: any
21
+ /** Lazy-load / configure the sql.js engine (wasm loader, locateFile, etc.). */
22
+ config: (opts: any) => any
23
+ /** Promise that resolves once the sql.js engine has been initialized. */
24
+ ready: Promise<void> | null
25
+ /** True when running outside a supported browser environment. */
26
+ _disabled?: boolean
27
+ /** Human readable reason the module is disabled, when applicable. */
28
+ _warning?: string
29
+ [key: string]: any
30
+ }
31
+
32
+ interface _sqliteJournal {
33
+ /** Append a SQL write operation to the journal (with HLC timestamp). */
34
+ append: (name: string, sql: string, params: any[]) => number
35
+ /** Retrieve all pending journal entries for a db, ordered by HLC. */
36
+ entries: (name: string) => SqliteJournalEntry[]
37
+ /** Number of pending journal entries for a db. */
38
+ count: (name: string) => number
39
+ /** Clear all journal entries for a db. */
40
+ clear: (name: string) => void
41
+ /** Replay all journal entries onto a live db handle. */
42
+ replay: (name: string, db: any) => Promise<number>
43
+ /** Force a checkpoint (full snapshot + journal clear). */
44
+ checkpoint: (name: string) => Promise<boolean>
45
+ }
46
+
47
+ interface SqliteJournalEntry {
48
+ hlc: string
49
+ sql: string
50
+ params: any[]
51
+ seq: number
52
+ ts: number
53
+ }
54
+
55
+ declare var sqlite: _sqlite
56
+ type sqlite = _sqlite
57
+
58
+ declare var sqlbases: any[]
package/vsix/memorio.vsix CHANGED
Binary file