@tiddlywiki/mws 0.1.12 → 0.1.14

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
@@ -2,7 +2,7 @@
2
2
  "name": "@tiddlywiki/mws",
3
3
  "description": "TiddlyWiki Multiple Wiki Server",
4
4
  "private": false,
5
- "version": "0.1.12",
5
+ "version": "0.1.14",
6
6
  "bin": {
7
7
  "mws": "./mws.run.mjs"
8
8
  },
@@ -22,7 +22,7 @@ previous operation to complete before sending a new one.
22
22
  import type { ServerEventsMap } from '@tiddlywiki/events';
23
23
  import type { ZodRoute, WikiStatusRoutes, WikiRecipeRoutes } from '@tiddlywiki/mws';
24
24
  import type { zod } from '@tiddlywiki/server';
25
- import type { Syncer, Tiddler, TiddlerFields } from 'tiddlywiki';
25
+ import type { Syncer, Tiddler, TiddlerFields, Wiki } from 'tiddlywiki';
26
26
  declare global { const fflate: typeof import("./fflate"); }
27
27
  declare const self: never;
28
28
 
@@ -236,7 +236,7 @@ interface MWSAdaptorInfo {
236
236
 
237
237
 
238
238
  class MultiWikiClientAdaptor implements SyncAdaptor<MWSAdaptorInfo> {
239
- private wiki;
239
+ private wiki: Wiki;
240
240
  private host;
241
241
  private recipe;
242
242
  private useServerSentEvents;
@@ -259,11 +259,11 @@ class MultiWikiClientAdaptor implements SyncAdaptor<MWSAdaptorInfo> {
259
259
  constructor(options: { wiki: any }) {
260
260
  this.wiki = options.wiki;
261
261
  this.host = this.getHost();
262
- this.recipe = this.wiki.getTiddlerText("$:/config/multiwikiclient/recipe");
262
+ this.recipe = this.wiki.getTiddlerText("$:/config/multiwikiclient/recipe", "default")!;
263
263
  this.useServerSentEvents = this.wiki.getTiddlerText(ENABLE_SSE_TIDDLER) === "yes";
264
264
  this.isDevMode = this.wiki.getTiddlerText(IS_DEV_MODE_TIDDLER) === "yes";
265
265
  this.useGzipStream = this.wiki.getTiddlerText(ENABLE_GZIP_STREAM_TIDDLER) === "yes";
266
- this.last_known_revision_id = this.wiki.getTiddlerText("$:/state/multiwikiclient/recipe/last_revision_id", "0")
266
+ this.last_known_revision_id = this.wiki.getTiddlerText("$:/state/multiwikiclient/recipe/last_revision_id", "0")!
267
267
  this.outstandingRequests = Object.create(null); // Hashmap by title of outstanding request object: {type: "PUT"|"GET"|"DELETE"}
268
268
  this.lastRecordedUpdate = Object.create(null); // Hashmap by title of last recorded update via SSE: {type: "update"|"detetion", revision_id:}
269
269
  this.logger = new $tw.utils.Logger("MultiWikiClientAdaptor");
@@ -272,7 +272,7 @@ class MultiWikiClientAdaptor implements SyncAdaptor<MWSAdaptorInfo> {
272
272
  this.offline = false;
273
273
  this.username = "";
274
274
  // Compile the dirty tiddler filter
275
- this.incomingUpdatesFilterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(INCOMING_UPDATES_FILTER_TIDDLER));
275
+ this.incomingUpdatesFilterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(INCOMING_UPDATES_FILTER_TIDDLER)!);
276
276
  this.setConnectionStatus(SERVER_NOT_CONNECTED);
277
277
  }
278
278
 
@@ -37,7 +37,7 @@ class MultiWikiClientAdaptor {
37
37
  this.error = null;
38
38
  this.wiki = options.wiki;
39
39
  this.host = this.getHost();
40
- this.recipe = this.wiki.getTiddlerText("$:/config/multiwikiclient/recipe");
40
+ this.recipe = this.wiki.getTiddlerText("$:/config/multiwikiclient/recipe", "default");
41
41
  this.useServerSentEvents = this.wiki.getTiddlerText(ENABLE_SSE_TIDDLER) === "yes";
42
42
  this.isDevMode = this.wiki.getTiddlerText(IS_DEV_MODE_TIDDLER) === "yes";
43
43
  this.useGzipStream = this.wiki.getTiddlerText(ENABLE_GZIP_STREAM_TIDDLER) === "yes";