memorio 5.1.2 → 5.1.4
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/AGENTS.md +1 -3
- package/CHANGELOG.md +83 -0
- package/README.md +32 -14
- package/SUMMARY.md +2 -2
- package/examples/sqlite-batched-writes.ts +60 -57
- package/global.cjs +454 -242
- package/global.js +431 -218
- package/index.cjs +454 -242
- package/index.js +431 -218
- package/llms.txt +17 -2
- package/markdown/MEMORY.md +27 -0
- package/markdown/SQLITE.md +48 -22
- package/markdown/STORE.md +12 -12
- package/markdown/SYNC.md +18 -15
- package/modules/redux.cjs +29 -12
- package/modules/redux.cjs.map +1 -1
- package/modules/redux.js +29 -12
- package/modules/redux.js.map +1 -1
- package/package.json +7 -2
- package/types/sqlite.d.ts +58 -35
- package/types/state.d.ts +19 -5
- package/vsix/memorio.vsix +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorio",
|
|
3
3
|
"codeName": "memorio",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.4",
|
|
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":
|
|
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/",
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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/types/state.d.ts
CHANGED
|
@@ -54,13 +54,27 @@ interface _state {
|
|
|
54
54
|
readonly list?: () => object
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
* Generate a message for "memorio"
|
|
58
|
+
* Note: FOR INTERNAL USE ONLY.
|
|
59
|
+
* @since memorio 0.0.1
|
|
60
|
+
*/
|
|
61
61
|
readonly mex?: any
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Persist a state path to the store and keep it synced.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* const stop = state.persist('state.user')
|
|
68
|
+
* // ... mutations to state.user are mirrored to store automatically
|
|
69
|
+
* stop() // call to stop mirroring
|
|
70
|
+
*
|
|
71
|
+
* @param path A `state.`-prefixed path (e.g. `'state.user'`). A bare key
|
|
72
|
+
* like `'user'` is normalized.
|
|
73
|
+
* @return An unsubscribe function; call it to stop mirroring.
|
|
74
|
+
*/
|
|
75
|
+
readonly persist: (path: string) => (() => void)
|
|
76
|
+
|
|
77
|
+
}
|
|
64
78
|
|
|
65
79
|
declare var state: _state
|
|
66
80
|
type state = _state
|
package/vsix/memorio.vsix
CHANGED
|
Binary file
|