@dabble/patches 0.8.20 → 0.8.21
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/{BaseDoc-CXHXcW18.d.ts → BaseDoc-rCKMFV6B.d.ts} +1 -1
- package/dist/algorithms/ot/server/createVersion.d.ts +1 -1
- package/dist/client/BaseDoc.d.ts +1 -1
- package/dist/client/ClientAlgorithm.d.ts +1 -1
- package/dist/client/LWWAlgorithm.d.ts +1 -1
- package/dist/client/LWWDoc.d.ts +1 -1
- package/dist/client/OTAlgorithm.d.ts +1 -1
- package/dist/client/OTDoc.d.ts +1 -1
- package/dist/client/Patches.d.ts +1 -1
- package/dist/client/PatchesBranchClient.d.ts +1 -1
- package/dist/client/PatchesDoc.d.ts +1 -1
- package/dist/client/factories.d.ts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/net/PatchesSync.d.ts +1 -1
- package/dist/net/index.d.ts +1 -1
- package/dist/net/rest/PatchesREST.js +14 -1
- package/dist/server/LWWBranchManager.d.ts +2 -2
- package/dist/server/LWWServer.d.ts +2 -2
- package/dist/server/branchUtils.d.ts +1 -1
- package/dist/server/types.d.ts +1 -1
- package/dist/shared/doc-manager.d.ts +1 -1
- package/dist/solid/context.d.ts +1 -1
- package/dist/solid/doc-manager.d.ts +1 -1
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/primitives.d.ts +1 -1
- package/dist/vue/composables.d.ts +2 -2
- package/dist/vue/doc-manager.d.ts +1 -1
- package/dist/vue/index.d.ts +1 -1
- package/dist/vue/managed-docs.d.ts +2 -2
- package/dist/vue/provider.d.ts +1 -1
- package/package.json +1 -1
|
@@ -246,4 +246,4 @@ declare abstract class BaseDoc<T extends object = object> extends ReadonlyStoreC
|
|
|
246
246
|
abstract import(snapshot: PatchesSnapshot<T>): void;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
export { BaseDoc as B, OTDoc as O, type
|
|
249
|
+
export { BaseDoc as B, OTDoc as O, type PatchesDoc as P, type PatchesDocOptions as a };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OTStoreBackend } from '../../../server/types.js';
|
|
2
|
-
import { EditableVersionMetadata,
|
|
2
|
+
import { EditableVersionMetadata, Change, VersionMetadata } from '../../../types.js';
|
|
3
3
|
import '../../../json-patch/types.js';
|
|
4
4
|
import '../../../json-patch/JSONPatch.js';
|
|
5
5
|
import '@dabble/delta';
|
package/dist/client/BaseDoc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSONPatchOp } from '../json-patch/types.js';
|
|
2
2
|
import { PatchesSnapshot, Change } from '../types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
4
4
|
import { PatchesStore, TrackedDoc } from './PatchesStore.js';
|
|
5
5
|
import '../json-patch/JSONPatch.js';
|
|
6
6
|
import '@dabble/delta';
|
|
@@ -2,7 +2,7 @@ import { JSONPatchOp } from '../json-patch/types.js';
|
|
|
2
2
|
import { PatchesSnapshot, Change } from '../types.js';
|
|
3
3
|
import { ClientAlgorithm } from './ClientAlgorithm.js';
|
|
4
4
|
import { LWWClientStore } from './LWWClientStore.js';
|
|
5
|
-
import {
|
|
5
|
+
import { P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
6
6
|
import { TrackedDoc } from './PatchesStore.js';
|
|
7
7
|
import '../json-patch/JSONPatch.js';
|
|
8
8
|
import '@dabble/delta';
|
package/dist/client/LWWDoc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSONPatchOp } from '../json-patch/types.js';
|
|
2
2
|
import { PatchesSnapshot, Change } from '../types.js';
|
|
3
|
-
import { B as BaseDoc } from '../BaseDoc-
|
|
3
|
+
import { B as BaseDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
4
4
|
import '../json-patch/JSONPatch.js';
|
|
5
5
|
import '@dabble/delta';
|
|
6
6
|
import 'easy-signal';
|
|
@@ -2,7 +2,7 @@ import { JSONPatchOp } from '../json-patch/types.js';
|
|
|
2
2
|
import { PatchesSnapshot, Change } from '../types.js';
|
|
3
3
|
import { ClientAlgorithm } from './ClientAlgorithm.js';
|
|
4
4
|
import { OTClientStore } from './OTClientStore.js';
|
|
5
|
-
import {
|
|
5
|
+
import { a as PatchesDocOptions, P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
6
6
|
import { TrackedDoc } from './PatchesStore.js';
|
|
7
7
|
import '../json-patch/JSONPatch.js';
|
|
8
8
|
import '@dabble/delta';
|
package/dist/client/OTDoc.d.ts
CHANGED
package/dist/client/Patches.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Unsubscriber } from 'easy-signal';
|
|
|
3
3
|
import { JSONPatchOp } from '../json-patch/types.js';
|
|
4
4
|
import { Change } from '../types.js';
|
|
5
5
|
import { ClientAlgorithm } from './ClientAlgorithm.js';
|
|
6
|
-
import {
|
|
6
|
+
import { a as PatchesDocOptions, P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
7
7
|
import { AlgorithmName } from './PatchesStore.js';
|
|
8
8
|
import '../json-patch/JSONPatch.js';
|
|
9
9
|
import '@dabble/delta';
|
|
@@ -8,7 +8,7 @@ import '../json-patch/JSONPatch.js';
|
|
|
8
8
|
import '@dabble/delta';
|
|
9
9
|
import '../json-patch/types.js';
|
|
10
10
|
import './ClientAlgorithm.js';
|
|
11
|
-
import '../BaseDoc-
|
|
11
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
12
12
|
|
|
13
13
|
interface PatchesBranchClientOptions {
|
|
14
14
|
/** Algorithm to use for the branch document (defaults to the Patches instance default). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'easy-signal';
|
|
2
2
|
import '../json-patch/types.js';
|
|
3
3
|
import '../types.js';
|
|
4
|
-
export { O as OTDoc,
|
|
4
|
+
export { O as OTDoc, P as PatchesDoc, a as PatchesDocOptions } from '../BaseDoc-rCKMFV6B.js';
|
|
5
5
|
import '../json-patch/JSONPatch.js';
|
|
6
6
|
import '@dabble/delta';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlgorithmName } from './PatchesStore.js';
|
|
2
2
|
import { Patches } from './Patches.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as PatchesDocOptions } from '../BaseDoc-rCKMFV6B.js';
|
|
4
4
|
import '../types.js';
|
|
5
5
|
import '../json-patch/JSONPatch.js';
|
|
6
6
|
import '@dabble/delta';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseDoc, O as OTDoc,
|
|
1
|
+
export { B as BaseDoc, O as OTDoc, P as PatchesDoc, a as PatchesDocOptions } from '../BaseDoc-rCKMFV6B.js';
|
|
2
2
|
export { IndexedDBFactoryOptions, MultiAlgorithmFactoryOptions, MultiAlgorithmIndexedDBFactoryOptions, PatchesFactoryOptions, createLWWIndexedDBPatches, createLWWPatches, createMultiAlgorithmExternalDBPatches, createMultiAlgorithmIndexedDBPatches, createMultiAlgorithmPatches, createOTIndexedDBPatches, createOTPatches, upgradePatchesDB } from './factories.js';
|
|
3
3
|
export { IDBStoreWrapper, IDBTransactionWrapper, IndexedDBStore } from './IndexedDBStore.js';
|
|
4
4
|
export { OTIndexedDBStore } from './OTIndexedDBStore.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Delta } from '@dabble/delta';
|
|
2
|
-
export { B as BaseDoc, O as OTDoc,
|
|
2
|
+
export { B as BaseDoc, O as OTDoc, P as PatchesDoc, a as PatchesDocOptions } from './BaseDoc-rCKMFV6B.js';
|
|
3
3
|
export { IndexedDBFactoryOptions, MultiAlgorithmFactoryOptions, MultiAlgorithmIndexedDBFactoryOptions, PatchesFactoryOptions, createLWWIndexedDBPatches, createLWWPatches, createMultiAlgorithmExternalDBPatches, createMultiAlgorithmIndexedDBPatches, createMultiAlgorithmPatches, createOTIndexedDBPatches, createOTPatches, upgradePatchesDB } from './client/factories.js';
|
|
4
4
|
export { IDBStoreWrapper, IDBTransactionWrapper, IndexedDBStore } from './client/IndexedDBStore.js';
|
|
5
5
|
export { OTIndexedDBStore } from './client/OTIndexedDBStore.js';
|
|
@@ -13,7 +13,7 @@ import { WebSocketOptions } from './websocket/WebSocketTransport.js';
|
|
|
13
13
|
import '../json-patch/JSONPatch.js';
|
|
14
14
|
import '@dabble/delta';
|
|
15
15
|
import '../json-patch/types.js';
|
|
16
|
-
import '../BaseDoc-
|
|
16
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
17
17
|
import '../utils/deferred.js';
|
|
18
18
|
|
|
19
19
|
interface PatchesSyncState {
|
package/dist/net/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import '../algorithms/ot/shared/changeBatching.js';
|
|
|
22
22
|
import '../client/BranchClientStore.js';
|
|
23
23
|
import '../client/ClientAlgorithm.js';
|
|
24
24
|
import '../json-patch/types.js';
|
|
25
|
-
import '../BaseDoc-
|
|
25
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
26
26
|
import '../client/PatchesStore.js';
|
|
27
27
|
import '../client/Patches.js';
|
|
28
28
|
import '../server/types.js';
|
|
@@ -4,6 +4,8 @@ import { StatusError } from "../error.js";
|
|
|
4
4
|
import { onlineState } from "../websocket/onlineState.js";
|
|
5
5
|
import { normalizeIds } from "./utils.js";
|
|
6
6
|
const SESSION_STORAGE_KEY = "patches-clientId";
|
|
7
|
+
const REQUEST_TIMEOUT_MS = 3e4;
|
|
8
|
+
const CONNECT_TIMEOUT_MS = 3e4;
|
|
7
9
|
class PatchesREST {
|
|
8
10
|
/** The client ID used for SSE connection and subscription management. */
|
|
9
11
|
clientId;
|
|
@@ -49,16 +51,26 @@ class PatchesREST {
|
|
|
49
51
|
const es = new EventSource(`${this._url}/events/${this.clientId}`);
|
|
50
52
|
this.eventSource = es;
|
|
51
53
|
let settled = false;
|
|
54
|
+
const timer = globalThis.setTimeout(() => {
|
|
55
|
+
if (settled) return;
|
|
56
|
+
settled = true;
|
|
57
|
+
es.close();
|
|
58
|
+
if (this.eventSource === es) this.eventSource = null;
|
|
59
|
+
this._setState("error");
|
|
60
|
+
reject(new Error("SSE connection timed out"));
|
|
61
|
+
}, CONNECT_TIMEOUT_MS);
|
|
52
62
|
es.onopen = () => {
|
|
53
63
|
this._setState("connected");
|
|
54
64
|
if (!settled) {
|
|
55
65
|
settled = true;
|
|
66
|
+
globalThis.clearTimeout(timer);
|
|
56
67
|
resolve();
|
|
57
68
|
}
|
|
58
69
|
};
|
|
59
70
|
es.onerror = () => {
|
|
60
71
|
if (!settled) {
|
|
61
72
|
settled = true;
|
|
73
|
+
globalThis.clearTimeout(timer);
|
|
62
74
|
this._setState("error");
|
|
63
75
|
reject(new Error("SSE connection failed"));
|
|
64
76
|
return;
|
|
@@ -202,7 +214,8 @@ class PatchesREST {
|
|
|
202
214
|
...hasBody ? { "Content-Type": "application/json" } : {},
|
|
203
215
|
...headers
|
|
204
216
|
},
|
|
205
|
-
body: hasBody ? JSON.stringify(init.body) : void 0
|
|
217
|
+
body: hasBody ? JSON.stringify(init.body) : void 0,
|
|
218
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
206
219
|
});
|
|
207
220
|
if (!response.ok) {
|
|
208
221
|
let message = response.statusText;
|
|
@@ -5,10 +5,10 @@ import { LWWServer } from './LWWServer.js';
|
|
|
5
5
|
import { LWWStoreBackend, BranchingStoreBackend } from './types.js';
|
|
6
6
|
import 'easy-signal';
|
|
7
7
|
import '../net/websocket/AuthorizationProvider.js';
|
|
8
|
-
import '../
|
|
8
|
+
import '../net/protocol/types.js';
|
|
9
9
|
import '../json-patch/JSONPatch.js';
|
|
10
10
|
import '@dabble/delta';
|
|
11
|
-
import '../
|
|
11
|
+
import '../json-patch/types.js';
|
|
12
12
|
import './PatchesServer.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -4,10 +4,10 @@ import { Change, CommitChangesOptions, DeleteDocOptions, ChangeInput, ChangeMuta
|
|
|
4
4
|
import { PatchesServer } from './PatchesServer.js';
|
|
5
5
|
import { LWWStoreBackend } from './types.js';
|
|
6
6
|
import '../net/websocket/AuthorizationProvider.js';
|
|
7
|
-
import '../
|
|
7
|
+
import '../net/protocol/types.js';
|
|
8
8
|
import '../json-patch/JSONPatch.js';
|
|
9
9
|
import '@dabble/delta';
|
|
10
|
-
import '../
|
|
10
|
+
import '../json-patch/types.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Configuration options for LWWServer.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiDefinition } from '../net/protocol/JSONRPCServer.js';
|
|
2
|
-
import { EditableBranchMetadata,
|
|
2
|
+
import { EditableBranchMetadata, Branch, CreateBranchMetadata } from '../types.js';
|
|
3
3
|
import 'easy-signal';
|
|
4
4
|
import '../net/websocket/AuthorizationProvider.js';
|
|
5
5
|
import './types.js';
|
package/dist/server/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONPatchOp } from '../json-patch/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { VersionMetadata, Change, ListVersionsOptions, EditableVersionMetadata, ListChangesOptions, DocumentTombstone, ListBranchesOptions, Branch } from '../types.js';
|
|
3
3
|
import '../json-patch/JSONPatch.js';
|
|
4
4
|
import '@dabble/delta';
|
|
5
5
|
|
package/dist/solid/context.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import '../types.js';
|
|
|
7
7
|
import '../json-patch/JSONPatch.js';
|
|
8
8
|
import '@dabble/delta';
|
|
9
9
|
import '../client/ClientAlgorithm.js';
|
|
10
|
-
import '../BaseDoc-
|
|
10
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
11
11
|
import '../client/PatchesStore.js';
|
|
12
12
|
import '../algorithms/ot/shared/changeBatching.js';
|
|
13
13
|
import '../client/BranchClientStore.js';
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import '../types.js';
|
|
|
11
11
|
import '../json-patch/JSONPatch.js';
|
|
12
12
|
import '@dabble/delta';
|
|
13
13
|
import '../client/ClientAlgorithm.js';
|
|
14
|
-
import '../BaseDoc-
|
|
14
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
15
15
|
import '../client/PatchesStore.js';
|
|
16
16
|
import '../net/PatchesSync.js';
|
|
17
17
|
import '../algorithms/ot/shared/changeBatching.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
2
|
import { OpenDocOptions } from '../client/Patches.js';
|
|
3
|
-
import {
|
|
3
|
+
import { P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
4
4
|
import { ChangeMutator } from '../types.js';
|
|
5
5
|
import 'easy-signal';
|
|
6
6
|
import '../json-patch/types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ShallowRef, Ref,
|
|
1
|
+
import { ShallowRef, Ref, MaybeRef, MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import { OpenDocOptions } from '../client/Patches.js';
|
|
3
|
-
import {
|
|
3
|
+
import { P as PatchesDoc } from '../BaseDoc-rCKMFV6B.js';
|
|
4
4
|
import { ChangeMutator } from '../types.js';
|
|
5
5
|
import 'easy-signal';
|
|
6
6
|
import '../json-patch/types.js';
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import '../types.js';
|
|
|
11
11
|
import '../json-patch/JSONPatch.js';
|
|
12
12
|
import '@dabble/delta';
|
|
13
13
|
import '../client/ClientAlgorithm.js';
|
|
14
|
-
import '../BaseDoc-
|
|
14
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
15
15
|
import '../client/PatchesStore.js';
|
|
16
16
|
import '../net/PatchesSync.js';
|
|
17
17
|
import '../algorithms/ot/shared/changeBatching.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShallowRef, Ref } from 'vue';
|
|
2
2
|
import { OpenDocOptions } from '../client/Patches.js';
|
|
3
3
|
import 'easy-signal';
|
|
4
4
|
import '../json-patch/types.js';
|
|
@@ -6,7 +6,7 @@ import '../types.js';
|
|
|
6
6
|
import '../json-patch/JSONPatch.js';
|
|
7
7
|
import '@dabble/delta';
|
|
8
8
|
import '../client/ClientAlgorithm.js';
|
|
9
|
-
import '../BaseDoc-
|
|
9
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
10
10
|
import '../client/PatchesStore.js';
|
|
11
11
|
|
|
12
12
|
/**
|
package/dist/vue/provider.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import '../types.js';
|
|
|
7
7
|
import '../json-patch/JSONPatch.js';
|
|
8
8
|
import '@dabble/delta';
|
|
9
9
|
import '../client/ClientAlgorithm.js';
|
|
10
|
-
import '../BaseDoc-
|
|
10
|
+
import '../BaseDoc-rCKMFV6B.js';
|
|
11
11
|
import '../client/PatchesStore.js';
|
|
12
12
|
import '../algorithms/ot/shared/changeBatching.js';
|
|
13
13
|
import '../client/BranchClientStore.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dabble/patches",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.21",
|
|
4
4
|
"description": "Immutable JSON Patch implementation based on RFC 6902 supporting operational transformation and last-writer-wins",
|
|
5
5
|
"author": "Jacob Wright <jacwright@gmail.com>",
|
|
6
6
|
"bugs": {
|