@fluidframework/routerlicious-driver 2.117.0 → 3.0.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/.mocharc.cjs +3 -0
- package/CHANGELOG.md +36 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/dist/cache.js +1 -0
- package/dist/cache.js.map +1 -1
- package/dist/defaultTokenProvider.js +1 -0
- package/dist/defaultTokenProvider.js.map +1 -1
- package/dist/deltaStorageService.js +12 -0
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.js +1 -0
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.js +23 -0
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts +8 -2
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js +19 -5
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js +4 -1
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.js +8 -7
- package/dist/errorUtils.js.map +1 -1
- package/dist/gitManager.js +1 -0
- package/dist/gitManager.js.map +1 -1
- package/dist/historian.d.ts.map +1 -1
- package/dist/historian.js +4 -1
- package/dist/historian.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mapWithExpiration.js +3 -2
- package/dist/mapWithExpiration.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/queryStringUtils.js +1 -2
- package/dist/queryStringUtils.js.map +1 -1
- package/dist/r11sLayerCompatState.d.ts +8 -1
- package/dist/r11sLayerCompatState.d.ts.map +1 -1
- package/dist/r11sLayerCompatState.js +20 -1
- package/dist/r11sLayerCompatState.js.map +1 -1
- package/dist/r11sSnapshotParser.js +1 -2
- package/dist/r11sSnapshotParser.js.map +1 -1
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +18 -12
- package/dist/restWrapper.js.map +1 -1
- package/dist/restWrapperBase.d.ts.map +1 -1
- package/dist/restWrapperBase.js +4 -0
- package/dist/restWrapperBase.js.map +1 -1
- package/dist/retriableGitManager.js +2 -0
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/routerliciousResolvedUrl.d.ts.map +1 -1
- package/dist/sessionInfoManager.js +13 -12
- package/dist/sessionInfoManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js +17 -3
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/summaryTreeUploadManager.d.ts.map +1 -1
- package/dist/summaryTreeUploadManager.js +7 -1
- package/dist/summaryTreeUploadManager.js.map +1 -1
- package/dist/treeUtils.d.ts.map +1 -1
- package/dist/treeUtils.js +7 -6
- package/dist/treeUtils.js.map +1 -1
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +17 -1
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/dist/wholeSummaryUploadManager.js +1 -0
- package/dist/wholeSummaryUploadManager.js.map +1 -1
- package/lib/cache.js +1 -0
- package/lib/cache.js.map +1 -1
- package/lib/defaultTokenProvider.js +1 -0
- package/lib/defaultTokenProvider.js.map +1 -1
- package/lib/deltaStorageService.js +12 -0
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.js +1 -0
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.js +23 -0
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts +8 -2
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +18 -4
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +4 -1
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.js +3 -2
- package/lib/errorUtils.js.map +1 -1
- package/lib/gitManager.js +1 -0
- package/lib/gitManager.js.map +1 -1
- package/lib/historian.d.ts.map +1 -1
- package/lib/historian.js +4 -1
- package/lib/historian.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/mapWithExpiration.js +3 -2
- package/lib/mapWithExpiration.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/r11sLayerCompatState.d.ts +8 -1
- package/lib/r11sLayerCompatState.d.ts.map +1 -1
- package/lib/r11sLayerCompatState.js +20 -1
- package/lib/r11sLayerCompatState.js.map +1 -1
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +13 -7
- package/lib/restWrapper.js.map +1 -1
- package/lib/restWrapperBase.d.ts.map +1 -1
- package/lib/restWrapperBase.js +4 -0
- package/lib/restWrapperBase.js.map +1 -1
- package/lib/retriableGitManager.js +2 -0
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/routerliciousResolvedUrl.d.ts.map +1 -1
- package/lib/sessionInfoManager.js +13 -12
- package/lib/sessionInfoManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js +17 -3
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/summaryTreeUploadManager.d.ts.map +1 -1
- package/lib/summaryTreeUploadManager.js +7 -1
- package/lib/summaryTreeUploadManager.js.map +1 -1
- package/lib/treeUtils.d.ts.map +1 -1
- package/lib/treeUtils.js +3 -2
- package/lib/treeUtils.js.map +1 -1
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +17 -1
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/wholeSummaryUploadManager.js +1 -0
- package/lib/wholeSummaryUploadManager.js.map +1 -1
- package/package.json +32 -45
- package/src/documentServiceFactory.ts +19 -2
- package/src/index.ts +4 -1
- package/src/packageVersion.ts +1 -1
- package/src/r11sLayerCompatState.ts +29 -1
- package/src/shreddedSummaryDocumentStorageService.ts +8 -1
- package/src/summaryTreeUploadManager.ts +5 -2
- package/src/wholeSummaryDocumentStorageService.ts +8 -1
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import type {
|
|
7
7
|
ILayerCompatDetails,
|
|
8
8
|
IProvideLayerCompatDetails,
|
|
9
|
+
ILayerCompatSupportRequirements,
|
|
10
|
+
IProvideLayerCompatSupportRequirements,
|
|
9
11
|
} from "@fluid-internal/client-utils";
|
|
10
12
|
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
11
13
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
@@ -35,7 +37,10 @@ import type { ISnapshotTreeVersion } from "./definitions.js";
|
|
|
35
37
|
import { DocumentService } from "./documentService.js";
|
|
36
38
|
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
37
39
|
import type { IRouterliciousDriverPolicies } from "./policies.js";
|
|
38
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
r11sDriverCompatDetailsForLoader,
|
|
42
|
+
r11sDriverCompatRequirementsForLoader,
|
|
43
|
+
} from "./r11sLayerCompatState.js";
|
|
39
44
|
import {
|
|
40
45
|
RouterliciousOrdererRestWrapper,
|
|
41
46
|
RouterliciousStorageRestWrapper,
|
|
@@ -66,7 +71,10 @@ const defaultRouterliciousDriverPolicies: IRouterliciousDriverPolicies = {
|
|
|
66
71
|
* @internal
|
|
67
72
|
*/
|
|
68
73
|
export class RouterliciousDocumentServiceFactory
|
|
69
|
-
implements
|
|
74
|
+
implements
|
|
75
|
+
IDocumentServiceFactory,
|
|
76
|
+
IProvideLayerCompatDetails,
|
|
77
|
+
IProvideLayerCompatSupportRequirements
|
|
70
78
|
{
|
|
71
79
|
private readonly driverPolicies: IRouterliciousDriverPolicies;
|
|
72
80
|
private readonly blobCache: ICache<ArrayBufferLike>;
|
|
@@ -108,6 +116,15 @@ export class RouterliciousDocumentServiceFactory
|
|
|
108
116
|
return r11sDriverCompatDetailsForLoader;
|
|
109
117
|
}
|
|
110
118
|
|
|
119
|
+
/**
|
|
120
|
+
* The requirements that the Loader layer must meet to be compatible with this Routerlicious Driver. This is
|
|
121
|
+
* exposed to the Loader layer so that it can validate Loader / Driver compatibility on this Driver's behalf
|
|
122
|
+
* (the Driver has no reference to the Loader to validate it directly).
|
|
123
|
+
*/
|
|
124
|
+
public get ILayerCompatSupportRequirements(): ILayerCompatSupportRequirements {
|
|
125
|
+
return r11sDriverCompatRequirementsForLoader;
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
/**
|
|
112
129
|
* {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer}
|
|
113
130
|
*
|
package/src/index.ts
CHANGED
|
@@ -24,4 +24,7 @@ export {
|
|
|
24
24
|
export type { IRouterliciousDriverPolicies } from "./policies.js";
|
|
25
25
|
|
|
26
26
|
// Layer Compat details
|
|
27
|
-
export {
|
|
27
|
+
export {
|
|
28
|
+
r11sDriverCompatDetailsForLoader,
|
|
29
|
+
r11sDriverCompatRequirementsForLoader,
|
|
30
|
+
} from "./r11sLayerCompatState.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
generation,
|
|
8
|
+
LayerCompatibilityPolicyWindowMonths,
|
|
9
|
+
type ILayerCompatDetails,
|
|
10
|
+
type ILayerCompatSupportRequirements,
|
|
11
|
+
} from "@fluid-internal/client-utils";
|
|
7
12
|
|
|
8
13
|
import { pkgVersion } from "./packageVersion.js";
|
|
9
14
|
|
|
@@ -25,3 +30,26 @@ export const r11sDriverCompatDetailsForLoader: ILayerCompatDetails = {
|
|
|
25
30
|
*/
|
|
26
31
|
supportedFeatures: new Set<string>(),
|
|
27
32
|
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The requirements that the Loader layer must meet to be compatible with this Routerlicious Driver. This is published
|
|
36
|
+
* to the Loader layer (which holds the reference to this Driver) so that it can validate Loader / Driver compatibility
|
|
37
|
+
* on this Driver's behalf.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export const r11sDriverCompatRequirementsForLoader: ILayerCompatSupportRequirements = {
|
|
41
|
+
/**
|
|
42
|
+
* Minimum generation that Loader must be at to be compatible with this Driver. This is calculated based on the
|
|
43
|
+
* LayerCompatibilityPolicyWindowMonths.NewDriverOldLoader value which defines how many months old can the Loader
|
|
44
|
+
* layer be compared to the Driver layer for them to still be considered compatible.
|
|
45
|
+
* The minimum valid generation value is 0.
|
|
46
|
+
*/
|
|
47
|
+
minSupportedGeneration: Math.max(
|
|
48
|
+
0,
|
|
49
|
+
generation - LayerCompatibilityPolicyWindowMonths.NewDriverOldLoader,
|
|
50
|
+
),
|
|
51
|
+
/**
|
|
52
|
+
* The features that the Loader must support to be compatible with this Driver.
|
|
53
|
+
*/
|
|
54
|
+
requiredFeatures: [],
|
|
55
|
+
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { IsoBufferEncoding } from "@fluid-internal/client-utils";
|
|
6
7
|
import { Uint8ArrayToString, stringToBuffer } from "@fluid-internal/client-utils";
|
|
7
8
|
import type { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
9
|
import type {
|
|
@@ -165,7 +166,13 @@ export class ShreddedSummaryDocumentStorageService implements IDocumentStorageSe
|
|
|
165
166
|
this.mc.config.getNumber("Fluid.Driver.ReadBlobTelemetrySampling"),
|
|
166
167
|
);
|
|
167
168
|
this.blobsShaCache.set(value.sha, "");
|
|
168
|
-
|
|
169
|
+
// stringToBuffer has only ever reliably supported limited encodings.
|
|
170
|
+
// Despite server `IBlob.encoding` type being string, cast as one of
|
|
171
|
+
// the supported types and expect throw under browser if not.
|
|
172
|
+
// TODO: AB:#81373: Consider formalizing `IBlob.encoding` literals allowed.
|
|
173
|
+
// Note: the origin of this type is repo local but a synchronized
|
|
174
|
+
// clone of the @fluidframework/gitresources interface.
|
|
175
|
+
const bufferContent = stringToBuffer(value.content, value.encoding as IsoBufferEncoding);
|
|
169
176
|
await this.blobCache?.put(this.getCacheKey(value.sha), bufferContent);
|
|
170
177
|
return bufferContent;
|
|
171
178
|
}
|
|
@@ -90,8 +90,11 @@ export class SummaryTreeUploadManager implements ISummaryUploadManager {
|
|
|
90
90
|
private async writeSummaryBlob(content: string | Uint8Array): Promise<string> {
|
|
91
91
|
const { parsedContent, encoding } =
|
|
92
92
|
typeof content === "string"
|
|
93
|
-
? { parsedContent: content, encoding: "utf-8" }
|
|
94
|
-
: {
|
|
93
|
+
? ({ parsedContent: content, encoding: "utf-8" } as const)
|
|
94
|
+
: ({
|
|
95
|
+
parsedContent: Uint8ArrayToString(content, "base64"),
|
|
96
|
+
encoding: "base64",
|
|
97
|
+
} as const);
|
|
95
98
|
|
|
96
99
|
// The gitHashFile would return the same hash as returned by the server as blob.sha
|
|
97
100
|
const hash = await gitHashFile(IsoBuffer.from(parsedContent, encoding));
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { IsoBufferEncoding } from "@fluid-internal/client-utils";
|
|
6
7
|
import {
|
|
7
8
|
Uint8ArrayToString,
|
|
8
9
|
performanceNow,
|
|
@@ -222,7 +223,13 @@ export class WholeSummaryDocumentStorageService implements IDocumentStorageServi
|
|
|
222
223
|
undefined, // workers
|
|
223
224
|
this.mc.config.getNumber("Fluid.Driver.ReadBlobTelemetrySampling"),
|
|
224
225
|
);
|
|
225
|
-
|
|
226
|
+
// stringToBuffer has only ever reliably supported limited encodings.
|
|
227
|
+
// Despite server `IBlob.encoding` type being string, cast as one of
|
|
228
|
+
// the supported types and expect throw under browser if not.
|
|
229
|
+
// TODO: AB:#81373: Consider formalizing `IBlob.encoding` literals allowed.
|
|
230
|
+
// Note: the origin of this type is repo local but a synchronized
|
|
231
|
+
// clone of the @fluidframework/gitresources interface.
|
|
232
|
+
const bufferValue = stringToBuffer(blob.content, blob.encoding as IsoBufferEncoding);
|
|
226
233
|
|
|
227
234
|
await this.blobCache.put(this.getCacheKey(blob.sha), bufferValue);
|
|
228
235
|
|
package/tsconfig.json
CHANGED
package/internal.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/index.js";
|
package/legacy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/legacy.js";
|
|
File without changes
|
|
File without changes
|