@serfab/quereus-plugin-sereus 1.20.0 → 1.22.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/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Libp2p } from '@libp2p/interface';
2
- import type { IRepo } from '@optimystic/db-core';
2
+ import type { ICohortReachability, IRepo } from '@optimystic/db-core';
3
3
  import type { IRawStorage } from '@optimystic/db-p2p';
4
4
  import type { SqlCommitDurabilityListener, CommitFullyHeldListener, OfflineConfig, OfflineMode } from '@optimystic/quereus-plugin-optimystic/plugin';
5
5
  /**
@@ -77,6 +77,14 @@ export interface StrandConnectionOptions {
77
77
  * {@link SereusPluginResult.offline}. Programmatic only — the SQL plugin config cannot carry it.
78
78
  */
79
79
  offline?: StrandOfflineOptions;
80
+ /**
81
+ * The gate this connection's offline queue and offline live reads ask, in place of the node's
82
+ * own `cohortReachability` (Optimystic's `docs/offline-sync.md` → "When to submit"). Registered
83
+ * with the collection factory before any table opens, so every table takes it. cadre-core passes
84
+ * a gate that also waits for the party's own machines (docs/strands.md → "Waiting for the party's
85
+ * own machines"). Absent: the node's gate, or the always-open one on a transactor without a cohort.
86
+ */
87
+ cohortReachability?: ICohortReachability;
80
88
  }
81
89
  /**
82
90
  * The Optimystic plugin's `offline` registration block (its README § "Offline mode"), less
@@ -90,6 +98,8 @@ export type StrandOfflineOptions = Omit<OfflineConfig, 'journalLabel'>;
90
98
  * `OfflineMode` an app calls. The class's other public methods are the plugin's internals.
91
99
  */
92
100
  export type StrandOfflineController = Pick<OfflineMode, 'enter' | 'exit' | 'isEntered' | 'whenDrained' | 'onStatus' | 'onQueueState' | 'queueState' | 'entries' | 'status' | 'discard' | 'outcomes' | 'acknowledge'>;
101
+ /** What a deferred sApp schema apply waits for (see {@link SereusPluginResult.appSchemaWaitingFor}). */
102
+ export type AppSchemaWait = 'queue' | 'cohort';
93
103
  /**
94
104
  * How a connection's sApp schema apply ended (see {@link SereusPluginResult.appSchema}):
95
105
  *
@@ -99,8 +109,6 @@ export type StrandOfflineController = Pick<OfflineMode, 'enter' | 'exit' | 'isEn
99
109
  * before.
100
110
  * - `cancelled` — the connection shut down before a deferred retry landed.
101
111
  */
102
- /** What a deferred sApp schema apply waits for (see {@link SereusPluginResult.appSchemaWaitingFor}). */
103
- export type AppSchemaWait = 'queue' | 'cohort';
104
112
  export type AppSchemaOutcome = {
105
113
  state: 'applied';
106
114
  deferred?: true;
@@ -166,8 +174,8 @@ export interface SereusPluginResult {
166
174
  * Present when {@link StrandConnectionOptions.schema} was given; never rejects. Resolves
167
175
  * `{ state: 'applied' }` at once when the apply succeeded at connect. When queued offline
168
176
  * transactions refused it, or the strand's cohort could not be reached, the connection comes up
169
- * on the `App` schema it already had and retries ({@link appSchemaWaitingFor}); this settles when
170
- * a retry lands, fails otherwise, or {@link shutdown} runs first.
177
+ * anyway and retries ({@link appSchemaWaitingFor}); this settles when a retry lands, fails
178
+ * otherwise, or {@link shutdown} runs first.
171
179
  */
172
180
  appSchema?: Promise<AppSchemaOutcome>;
173
181
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serfab/quereus-plugin-sereus",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "type": "module",
5
5
  "description": "Quereus plugin that connects to a Sereus strand for SQL access",
6
6
  "main": "dist/index.js",
@@ -68,13 +68,13 @@
68
68
  "@libp2p/circuit-relay-v2": "^4.2.13",
69
69
  "@libp2p/interface": "^3.3.0",
70
70
  "@libp2p/websockets": "^10.1.21",
71
- "@optimystic/db-core": "^1.23.0",
72
- "@optimystic/db-p2p": "^1.23.0",
73
- "@optimystic/db-p2p-storage-fs": "^1.23.0",
74
- "@optimystic/db-p2p-storage-web": "^1.23.0",
75
- "@optimystic/quereus-plugin-crypto": "^1.23.0",
76
- "@optimystic/quereus-plugin-optimystic": "^1.23.0",
77
- "@quereus/quereus": "^4.23.0",
71
+ "@optimystic/db-core": "^1.26.0",
72
+ "@optimystic/db-p2p": "^1.26.0",
73
+ "@optimystic/db-p2p-storage-fs": "^1.26.0",
74
+ "@optimystic/db-p2p-storage-web": "^1.26.0",
75
+ "@optimystic/quereus-plugin-crypto": "^1.26.0",
76
+ "@optimystic/quereus-plugin-optimystic": "^1.26.0",
77
+ "@quereus/quereus": "^5.0.0",
78
78
  "debug": "^4.4.3"
79
79
  },
80
80
  "quereus": {