holosphere 1.3.0-alpha5 → 1.3.0-alpha7

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/holosphere.d.ts CHANGED
@@ -15,6 +15,23 @@ interface PutOptions {
15
15
  disableHologramRedirection?: boolean;
16
16
  actingAs?: string;
17
17
  password?: string | null;
18
+ /**
19
+ * Per-put deadline (ms) for Gun's ack callback. When the deadline fires,
20
+ * the returned promise resolves with `{ success: true, queued: true, ... }`
21
+ * so an offline/partitioned mesh can't hang the caller — Gun keeps the
22
+ * write locally and replays it on reconnect. Default 5000. Pass `0` to
23
+ * disable and wait for ack indefinitely.
24
+ */
25
+ timeout?: number;
26
+ }
27
+
28
+ interface PutGlobalOptions {
29
+ /**
30
+ * Per-put deadline (ms) for Gun's ack callback. The promise still
31
+ * resolves to `undefined` (its public contract); on timeout a warning
32
+ * is logged. Default 5000. Pass `0` to disable.
33
+ */
34
+ timeout?: number;
18
35
  }
19
36
 
20
37
  interface GetOptions {
@@ -181,6 +198,16 @@ interface PutResult {
181
198
  pathKey: string;
182
199
  propagationResult?: PropagationResult | null;
183
200
  error?: string;
201
+ /**
202
+ * `true` when the ack deadline fired before Gun confirmed the write
203
+ * (offline/partitioned mesh). The write is still committed locally
204
+ * via radisk and Gun replays it whenever a peer reappears; subscriber
205
+ * notification, hologram cascade, and federation propagation run at
206
+ * that point. Absent or `false` when the put was acknowledged.
207
+ */
208
+ queued?: boolean;
209
+ /** Holograms whose `updated` timestamp was bumped by this put (empty when the put timed out). */
210
+ updatedHolograms?: Array<{ soul: string; holon: string; lens: string; key: string }>;
184
211
  }
185
212
 
186
213
  interface CanWriteResult {
@@ -239,8 +266,8 @@ declare class HoloSphere {
239
266
  deleteNode(holon: string, lens: string, key: string): Promise<boolean>;
240
267
 
241
268
  // Global
242
- putGlobal(tableName: string, data: object, password?: string | null): Promise<void>;
243
- writeGlobal(tableName: string, data: object): Promise<void>;
269
+ putGlobal(tableName: string, data: object, password?: string | null, options?: PutGlobalOptions): Promise<void>;
270
+ writeGlobal(tableName: string, data: object, options?: PutGlobalOptions): Promise<void>;
244
271
  getGlobal(tableName: string, key: string, password?: string | null): Promise<any | null>;
245
272
  getAllGlobal(tableName: string, password?: string | null): Promise<Array<any>>;
246
273
  deleteGlobal(tableName: string, key: string, password?: string | null): Promise<boolean>;
package/holosphere.js CHANGED
@@ -236,15 +236,15 @@ class HoloSphere {
236
236
 
237
237
  // ================================ GLOBAL FUNCTIONS ================================
238
238
 
239
- async putGlobal(tableName, data, password = null) {
240
- return GlobalOps.putGlobal(this, tableName, data, password);
239
+ async putGlobal(tableName, data, password = null, options = {}) {
240
+ return GlobalOps.putGlobal(this, tableName, data, password, options);
241
241
  }
242
242
 
243
243
  /**
244
244
  * v2-compatible alias for putGlobal (no password param)
245
245
  */
246
- async writeGlobal(tableName, data) {
247
- return GlobalOps.putGlobal(this, tableName, data, null);
246
+ async writeGlobal(tableName, data, options = {}) {
247
+ return GlobalOps.putGlobal(this, tableName, data, null, options);
248
248
  }
249
249
 
250
250
  async getGlobal(tableName, key, password = null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holosphere",
3
- "version": "1.3.0-alpha5",
3
+ "version": "1.3.0-alpha7",
4
4
  "description": "Holonic Geospatial Communication Infrastructure",
5
5
  "main": "holosphere.js",
6
6
  "module": "holosphere.js",