@fluidframework/local-driver 2.91.0 → 2.92.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/CHANGELOG.md +4 -0
- package/dist/auth.d.ts +2 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +2 -2
- package/dist/auth.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/localCreateDocument.d.ts +2 -2
- package/dist/localCreateDocument.d.ts.map +1 -1
- package/dist/localCreateDocument.js.map +1 -1
- package/dist/localDeltaStorageService.d.ts +2 -2
- package/dist/localDeltaStorageService.d.ts.map +1 -1
- package/dist/localDeltaStorageService.js.map +1 -1
- package/dist/localDocumentDeltaConnection.d.ts +5 -4
- package/dist/localDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/localDocumentDeltaConnection.js.map +1 -1
- package/dist/localDocumentService.d.ts +5 -5
- package/dist/localDocumentService.d.ts.map +1 -1
- package/dist/localDocumentService.js.map +1 -1
- package/dist/localDocumentServiceFactory.d.ts +4 -4
- package/dist/localDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localDocumentServiceFactory.js.map +1 -1
- package/dist/localDocumentStorageService.d.ts +4 -4
- package/dist/localDocumentStorageService.d.ts.map +1 -1
- package/dist/localDocumentStorageService.js +1 -1
- package/dist/localDocumentStorageService.js.map +1 -1
- package/dist/localResolver.d.ts +2 -2
- package/dist/localResolver.d.ts.map +1 -1
- package/dist/localResolver.js +3 -3
- package/dist/localResolver.js.map +1 -1
- package/dist/localSessionStorageDb.d.ts +2 -2
- package/dist/localSessionStorageDb.d.ts.map +1 -1
- package/dist/localSessionStorageDb.js +13 -13
- package/dist/localSessionStorageDb.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/eslint.config.mts +14 -2
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/auth.d.ts +2 -2
- package/lib/auth.d.ts.map +1 -1
- package/lib/auth.js +2 -2
- package/lib/auth.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/localCreateDocument.d.ts +2 -2
- package/lib/localCreateDocument.d.ts.map +1 -1
- package/lib/localCreateDocument.js.map +1 -1
- package/lib/localDeltaStorageService.d.ts +2 -2
- package/lib/localDeltaStorageService.d.ts.map +1 -1
- package/lib/localDeltaStorageService.js.map +1 -1
- package/lib/localDocumentDeltaConnection.d.ts +5 -4
- package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/localDocumentDeltaConnection.js +1 -1
- package/lib/localDocumentDeltaConnection.js.map +1 -1
- package/lib/localDocumentService.d.ts +5 -5
- package/lib/localDocumentService.d.ts.map +1 -1
- package/lib/localDocumentService.js.map +1 -1
- package/lib/localDocumentServiceFactory.d.ts +4 -4
- package/lib/localDocumentServiceFactory.d.ts.map +1 -1
- package/lib/localDocumentServiceFactory.js.map +1 -1
- package/lib/localDocumentStorageService.d.ts +4 -4
- package/lib/localDocumentStorageService.d.ts.map +1 -1
- package/lib/localDocumentStorageService.js +2 -2
- package/lib/localDocumentStorageService.js.map +1 -1
- package/lib/localResolver.d.ts +2 -2
- package/lib/localResolver.d.ts.map +1 -1
- package/lib/localResolver.js +4 -4
- package/lib/localResolver.js.map +1 -1
- package/lib/localSessionStorageDb.d.ts +2 -2
- package/lib/localSessionStorageDb.d.ts.map +1 -1
- package/lib/localSessionStorageDb.js +13 -13
- package/lib/localSessionStorageDb.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/package.json +16 -16
- package/src/auth.ts +4 -4
- package/src/localCreateDocument.ts +3 -3
- package/src/localDeltaStorageService.ts +2 -2
- package/src/localDocumentDeltaConnection.ts +6 -9
- package/src/localDocumentService.ts +5 -5
- package/src/localDocumentServiceFactory.ts +5 -5
- package/src/localDocumentStorageService.ts +10 -10
- package/src/localResolver.ts +6 -10
- package/src/localSessionStorageDb.ts +13 -13
- package/src/packageVersion.ts +1 -1
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
|
-
import { IClient } from "@fluidframework/driver-definitions";
|
|
9
|
-
import {
|
|
7
|
+
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
|
+
import type { IClient } from "@fluidframework/driver-definitions";
|
|
9
|
+
import type {
|
|
10
10
|
IDocumentDeltaConnection,
|
|
11
11
|
IDocumentDeltaStorageService,
|
|
12
12
|
IDocumentService,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
IDocumentStorageService,
|
|
16
16
|
IResolvedUrl,
|
|
17
17
|
} from "@fluidframework/driver-definitions/internal";
|
|
18
|
-
import { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
19
|
-
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
18
|
+
import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
19
|
+
import type { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
20
20
|
import { GitManager } from "@fluidframework/server-services-client";
|
|
21
21
|
import { TestHistorian } from "@fluidframework/server-test-utils";
|
|
22
22
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
-
import {
|
|
6
|
+
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
+
import type {
|
|
9
9
|
IDocumentService,
|
|
10
10
|
IDocumentServiceFactory,
|
|
11
11
|
IDocumentServicePolicies,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
NackErrorType,
|
|
14
14
|
} from "@fluidframework/driver-definitions/internal";
|
|
15
15
|
import { DefaultTokenProvider } from "@fluidframework/routerlicious-driver/internal";
|
|
16
|
-
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
16
|
+
import type { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
17
17
|
|
|
18
18
|
import { createDocument } from "./localCreateDocument.js";
|
|
19
|
-
import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.js";
|
|
19
|
+
import type { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.js";
|
|
20
20
|
import { createLocalDocumentService } from "./localDocumentService.js";
|
|
21
21
|
import { localDriverCompatDetailsForLoader } from "./localLayerCompatState.js";
|
|
22
22
|
|
|
@@ -10,25 +10,25 @@ import {
|
|
|
10
10
|
stringToBuffer,
|
|
11
11
|
} from "@fluid-internal/client-utils";
|
|
12
12
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
13
|
-
import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
14
|
-
import {
|
|
13
|
+
import type { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
14
|
+
import type {
|
|
15
|
+
ICreateBlobResponse,
|
|
15
16
|
IDocumentStorageService,
|
|
16
17
|
IDocumentStorageServicePolicies,
|
|
17
18
|
IResolvedUrl,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ISummaryContext,
|
|
21
|
-
ICreateBlobResponse,
|
|
19
|
+
ISnapshot,
|
|
20
|
+
ISnapshotFetchOptions,
|
|
22
21
|
ISnapshotTreeEx,
|
|
22
|
+
ISummaryContext,
|
|
23
23
|
IVersion,
|
|
24
24
|
} from "@fluidframework/driver-definitions/internal";
|
|
25
25
|
import { buildGitTreeHierarchy } from "@fluidframework/protocol-base";
|
|
26
|
-
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
27
|
-
import {
|
|
26
|
+
import type { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
27
|
+
import type {
|
|
28
28
|
GitManager,
|
|
29
29
|
ISummaryUploadManager,
|
|
30
|
-
SummaryTreeUploadManager,
|
|
31
30
|
} from "@fluidframework/server-services-client";
|
|
31
|
+
import { SummaryTreeUploadManager } from "@fluidframework/server-services-client";
|
|
32
32
|
|
|
33
33
|
import { createDocument } from "./localCreateDocument.js";
|
|
34
34
|
|
|
@@ -218,7 +218,7 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
|
|
|
218
218
|
);
|
|
219
219
|
}),
|
|
220
220
|
);
|
|
221
|
-
const isAncestorOfDescendantsWithGroupId = descendants.some(
|
|
221
|
+
const isAncestorOfDescendantsWithGroupId = descendants.some(Boolean);
|
|
222
222
|
|
|
223
223
|
// We don't want to return prematurely as we still may have children that we want to keep.
|
|
224
224
|
if (
|
package/src/localResolver.ts
CHANGED
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IRequest } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { IRequest } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
IResolvedUrl,
|
|
11
|
-
IUrlResolver,
|
|
12
|
-
ScopeType,
|
|
13
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
8
|
+
import type { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import { DriverHeader, ScopeType } from "@fluidframework/driver-definitions/internal";
|
|
14
10
|
|
|
15
11
|
import { generateToken } from "./auth.js";
|
|
16
12
|
|
|
@@ -48,7 +44,7 @@ export class LocalResolver implements IUrlResolver {
|
|
|
48
44
|
*/
|
|
49
45
|
public async resolve(request: IRequest): Promise<IResolvedUrl> {
|
|
50
46
|
const parsedUrl = new URL(request.url);
|
|
51
|
-
const fullPath = `${parsedUrl.pathname.
|
|
47
|
+
const fullPath = `${parsedUrl.pathname.slice(1)}${parsedUrl.search}`;
|
|
52
48
|
// TODO Why are we non null asserting here
|
|
53
49
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
54
50
|
const documentId = fullPath.split("/")[0]!;
|
|
@@ -74,13 +70,13 @@ export class LocalResolver implements IUrlResolver {
|
|
|
74
70
|
): Promise<string> {
|
|
75
71
|
let url = relativeUrl;
|
|
76
72
|
if (url.startsWith("/")) {
|
|
77
|
-
url = url.
|
|
73
|
+
url = url.slice(1);
|
|
78
74
|
}
|
|
79
75
|
const parsedUrl = new URL(resolvedUrl.url);
|
|
80
76
|
if (parsedUrl.pathname === null) {
|
|
81
77
|
throw new Error("Url should contain tenant and docId!!");
|
|
82
78
|
}
|
|
83
|
-
const
|
|
79
|
+
const documentId = parsedUrl.pathname.split("/")[2];
|
|
84
80
|
assert(
|
|
85
81
|
!!documentId,
|
|
86
82
|
0x09a /* "'documentId' must be a defined, non-zero length string." */,
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import { ICollection, IDb } from "@fluidframework/server-services-core";
|
|
8
|
-
import { ITestDbFactory } from "@fluidframework/server-test-utils";
|
|
7
|
+
import type { ICollection, IDb } from "@fluidframework/server-services-core";
|
|
8
|
+
import type { ITestDbFactory } from "@fluidframework/server-test-utils";
|
|
9
9
|
import { v4 as uuid } from "uuid";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -44,18 +44,18 @@ class LocalSessionStorageCollection<T> implements ICollection<T> {
|
|
|
44
44
|
function getValueByKey(propertyBag, key: string): any {
|
|
45
45
|
const keys = key.split(".");
|
|
46
46
|
let value = propertyBag;
|
|
47
|
-
|
|
47
|
+
for (const splitKey of keys) {
|
|
48
48
|
value = value[splitKey];
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
return value;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// getting keys of the query we are trying to find
|
|
54
54
|
const queryKeys = Object.keys(query);
|
|
55
55
|
let filteredCollection = this.getAllInternal();
|
|
56
|
-
|
|
56
|
+
for (const key of queryKeys) {
|
|
57
57
|
if (!query[key]) {
|
|
58
|
-
|
|
58
|
+
continue;
|
|
59
59
|
}
|
|
60
60
|
if (query[key].$gt > 0 || query[key].$lt > 0) {
|
|
61
61
|
if (query[key].$gt > 0) {
|
|
@@ -73,7 +73,7 @@ class LocalSessionStorageCollection<T> implements ICollection<T> {
|
|
|
73
73
|
(value) => getValueByKey(value, key) === query[key],
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|
|
77
77
|
|
|
78
78
|
if (sort && Object.keys(sort).length === 1) {
|
|
79
79
|
function compare(a, b): number {
|
|
@@ -115,13 +115,13 @@ class LocalSessionStorageCollection<T> implements ICollection<T> {
|
|
|
115
115
|
*/
|
|
116
116
|
public async update(query: any, set: any, addToSet: any): Promise<void> {
|
|
117
117
|
const value = this.findOneInternal(query);
|
|
118
|
-
if (
|
|
119
|
-
throw new Error("Not found");
|
|
120
|
-
} else {
|
|
118
|
+
if (value) {
|
|
121
119
|
for (const key of Object.keys(set)) {
|
|
122
120
|
value[key] = set[key];
|
|
123
121
|
}
|
|
124
122
|
this.insertInternal(value);
|
|
123
|
+
} else {
|
|
124
|
+
throw new Error("Not found");
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -133,13 +133,13 @@ class LocalSessionStorageCollection<T> implements ICollection<T> {
|
|
|
133
133
|
*/
|
|
134
134
|
public async upsert(query: any, set: any, addToSet: any): Promise<void> {
|
|
135
135
|
const value = this.findOneInternal(query);
|
|
136
|
-
if (
|
|
137
|
-
this.insertInternal(set);
|
|
138
|
-
} else {
|
|
136
|
+
if (value) {
|
|
139
137
|
for (const key of Object.keys(set)) {
|
|
140
138
|
value[key] = set[key];
|
|
141
139
|
}
|
|
142
140
|
this.insertInternal(value);
|
|
141
|
+
} else {
|
|
142
|
+
this.insertInternal(set);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
package/src/packageVersion.ts
CHANGED