@mistriwork/engine 1.0.0-rc.31 → 1.0.0-rc.32
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.
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* over invented addresses.
|
|
6
6
|
*/
|
|
7
7
|
export declare function withAdmission<T>(address: string, work: () => T): T;
|
|
8
|
+
/**
|
|
9
|
+
* Run `work` with its checkouts filed under no account, wherever it was
|
|
10
|
+
* started: work done for several requests at once, which no one of them may be
|
|
11
|
+
* charged for nor refused on behalf of (mistri's read audit group commit,
|
|
12
|
+
* adapters/readAudit/groupCommit.ts, carries rows of every account waiting).
|
|
13
|
+
*/
|
|
14
|
+
export declare function withoutAdmission<T>(work: () => T): T;
|
|
8
15
|
/** The request's session names its account: its checkouts from here on wait as that account's. */
|
|
9
16
|
export declare function admitAs(account: string | undefined): void;
|
|
10
17
|
export declare class PoolAdmission {
|
|
@@ -58,6 +58,15 @@ const admissions = new AsyncLocalStorage();
|
|
|
58
58
|
export function withAdmission(address, work) {
|
|
59
59
|
return admissions.run({ key: `client:${address}` }, work);
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Run `work` with its checkouts filed under no account, wherever it was
|
|
63
|
+
* started: work done for several requests at once, which no one of them may be
|
|
64
|
+
* charged for nor refused on behalf of (mistri's read audit group commit,
|
|
65
|
+
* adapters/readAudit/groupCommit.ts, carries rows of every account waiting).
|
|
66
|
+
*/
|
|
67
|
+
export function withoutAdmission(work) {
|
|
68
|
+
return admissions.exit(work);
|
|
69
|
+
}
|
|
61
70
|
/** The request's session names its account: its checkouts from here on wait as that account's. */
|
|
62
71
|
export function admitAs(account) {
|
|
63
72
|
const admission = admissions.getStore();
|
package/dist/adapters/sqlite.js
CHANGED
|
@@ -95,6 +95,7 @@ export class SqliteAdapter {
|
|
|
95
95
|
file: () => this.file,
|
|
96
96
|
closed: () => this.closed,
|
|
97
97
|
assertWriteIdentity: () => this.assertWriteIdentity(),
|
|
98
|
+
assertIndependentWrite: () => assertIndependentWrite(),
|
|
98
99
|
journalTransaction: (journal, run, options) => this.journalTransaction(journal, run, options),
|
|
99
100
|
});
|
|
100
101
|
}
|
|
@@ -108,6 +108,8 @@ export interface SqliteStoreHost {
|
|
|
108
108
|
closed(): boolean;
|
|
109
109
|
/** Refuses once the path names another file than the one opened. */
|
|
110
110
|
assertWriteIdentity(): void;
|
|
111
|
+
/** Refuses where queueWrite would, inside a transaction this process holds open: for work that joins a write before queueing it. */
|
|
112
|
+
assertIndependentWrite(): void;
|
|
111
113
|
/** Records and a journal in one transaction (SqliteAdapter.transact). */
|
|
112
114
|
journalTransaction<J, T>(journal: SqliteTransactionJournal<J>, run: JournalRun<J, T>, options?: JournalTransactionOptions<(db: DatabaseSync, catalog: SqliteScopeCatalog) => void>): Promise<T>;
|
|
113
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistriwork/engine",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.32",
|
|
4
4
|
"description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
|
|
5
5
|
"homepage": "https://mistriwork.dev",
|
|
6
6
|
"bugs": {
|