@fluidframework/routerlicious-driver 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1
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/.eslintrc.js +10 -12
- package/.mocharc.js +2 -2
- package/README.md +1 -1
- package/api-extractor.json +2 -2
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +2 -5
- package/dist/cache.js.map +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +4 -2
- package/dist/createNewUtils.js.map +1 -1
- package/dist/defaultTokenProvider.d.ts.map +1 -1
- package/dist/defaultTokenProvider.js.map +1 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/deltaStorageService.js +4 -1
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.d.ts.map +1 -1
- package/dist/documentService.js +13 -5
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js +7 -4
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js +7 -5
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.d.ts +9 -2
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.js +15 -8
- package/dist/errorUtils.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/nullBlobStorageService.d.ts.map +1 -1
- package/dist/nullBlobStorageService.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/policies.d.ts.map +1 -1
- package/dist/policies.js.map +1 -1
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +5 -6
- package/dist/restWrapper.js.map +1 -1
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js +8 -4
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/tokens.d.ts +24 -7
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/urlUtils.js.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +25 -11
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/cache.d.ts.map +1 -1
- package/lib/cache.js +2 -5
- package/lib/cache.js.map +1 -1
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js +4 -2
- package/lib/createNewUtils.js.map +1 -1
- package/lib/defaultTokenProvider.d.ts.map +1 -1
- package/lib/defaultTokenProvider.js.map +1 -1
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js.map +1 -1
- package/lib/deltaStorageService.d.ts.map +1 -1
- package/lib/deltaStorageService.js +4 -1
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.d.ts.map +1 -1
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.d.ts.map +1 -1
- package/lib/documentService.js +15 -7
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +7 -4
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +8 -6
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +9 -2
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.js +14 -7
- package/lib/errorUtils.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/nullBlobStorageService.d.ts.map +1 -1
- package/lib/nullBlobStorageService.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/policies.d.ts.map +1 -1
- package/lib/policies.js.map +1 -1
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +5 -6
- package/lib/restWrapper.js.map +1 -1
- package/lib/retriableGitManager.d.ts.map +1 -1
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js +9 -5
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/tokens.d.ts +24 -7
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js.map +1 -1
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/urlUtils.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +27 -13
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/package.json +115 -114
- package/prettier.config.cjs +1 -1
- package/src/cache.ts +16 -19
- package/src/createNewUtils.ts +24 -22
- package/src/defaultTokenProvider.ts +13 -15
- package/src/definitions.ts +2 -2
- package/src/deltaStorageService.ts +99 -95
- package/src/documentDeltaConnection.ts +53 -47
- package/src/documentService.ts +260 -239
- package/src/documentServiceFactory.ts +263 -250
- package/src/documentStorageService.ts +87 -83
- package/src/errorUtils.ts +91 -81
- package/src/index.ts +7 -1
- package/src/nullBlobStorageService.ts +24 -21
- package/src/packageVersion.ts +1 -1
- package/src/policies.ts +44 -44
- package/src/restWrapper.ts +266 -216
- package/src/retriableGitManager.ts +152 -151
- package/src/shreddedSummaryDocumentStorageService.ts +202 -194
- package/src/tokens.ts +69 -44
- package/src/urlUtils.ts +26 -23
- package/src/wholeSummaryDocumentStorageService.ts +246 -228
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
|
@@ -5,18 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import type { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
IDocumentStorageService,
|
|
9
|
+
IDocumentStorageServicePolicies,
|
|
10
|
+
LoaderCachingPolicy,
|
|
11
11
|
} from "@fluidframework/driver-definitions";
|
|
12
|
+
import { ISnapshotTree, IVersion } from "@fluidframework/protocol-definitions";
|
|
13
|
+
import { GitManager } from "@fluidframework/server-services-client";
|
|
12
14
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "@fluidframework/
|
|
16
|
-
import {
|
|
17
|
-
GitManager,
|
|
18
|
-
} from "@fluidframework/server-services-client";
|
|
19
|
-
import { DocumentStorageServiceProxy, PrefetchDocumentStorageService } from "@fluidframework/driver-utils";
|
|
15
|
+
DocumentStorageServiceProxy,
|
|
16
|
+
PrefetchDocumentStorageService,
|
|
17
|
+
} from "@fluidframework/driver-utils";
|
|
20
18
|
import { IRouterliciousDriverPolicies } from "./policies";
|
|
21
19
|
import { ICache } from "./cache";
|
|
22
20
|
import { WholeSummaryDocumentStorageService } from "./wholeSummaryDocumentStorageService";
|
|
@@ -24,81 +22,87 @@ import { ShreddedSummaryDocumentStorageService } from "./shreddedSummaryDocument
|
|
|
24
22
|
import { ISnapshotTreeVersion } from "./definitions";
|
|
25
23
|
|
|
26
24
|
export class DocumentStorageService extends DocumentStorageServiceProxy {
|
|
27
|
-
|
|
25
|
+
private _logTailSha: string | undefined = undefined;
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
public get logTailSha(): string | undefined {
|
|
28
|
+
return this._logTailSha;
|
|
29
|
+
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
31
|
+
private static loadInternalDocumentStorageService(
|
|
32
|
+
id: string,
|
|
33
|
+
manager: GitManager,
|
|
34
|
+
logger: ITelemetryLogger,
|
|
35
|
+
policies: IDocumentStorageServicePolicies,
|
|
36
|
+
driverPolicies?: IRouterliciousDriverPolicies,
|
|
37
|
+
blobCache?: ICache<ArrayBufferLike>,
|
|
38
|
+
snapshotTreeCache?: ICache<ISnapshotTreeVersion>,
|
|
39
|
+
noCacheGitManager?: GitManager,
|
|
40
|
+
getStorageManager?: (disableCache?: boolean) => Promise<GitManager>,
|
|
41
|
+
): IDocumentStorageService {
|
|
42
|
+
const storageService = driverPolicies?.enableWholeSummaryUpload
|
|
43
|
+
? new WholeSummaryDocumentStorageService(
|
|
44
|
+
id,
|
|
45
|
+
manager,
|
|
46
|
+
logger,
|
|
47
|
+
policies,
|
|
48
|
+
driverPolicies,
|
|
49
|
+
blobCache,
|
|
50
|
+
snapshotTreeCache,
|
|
51
|
+
noCacheGitManager,
|
|
52
|
+
getStorageManager,
|
|
53
|
+
)
|
|
54
|
+
: new ShreddedSummaryDocumentStorageService(
|
|
55
|
+
id,
|
|
56
|
+
manager,
|
|
57
|
+
logger,
|
|
58
|
+
policies,
|
|
59
|
+
driverPolicies,
|
|
60
|
+
blobCache,
|
|
61
|
+
snapshotTreeCache,
|
|
62
|
+
getStorageManager,
|
|
63
|
+
);
|
|
64
|
+
// TODO: worth prefetching latest summary making version + snapshot call with WholeSummary storage?
|
|
65
|
+
if (
|
|
66
|
+
!driverPolicies?.enableWholeSummaryUpload &&
|
|
67
|
+
policies.caching === LoaderCachingPolicy.Prefetch
|
|
68
|
+
) {
|
|
69
|
+
return new PrefetchDocumentStorageService(storageService);
|
|
70
|
+
}
|
|
71
|
+
return storageService;
|
|
72
|
+
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
constructor(
|
|
75
|
+
public readonly id: string,
|
|
76
|
+
public manager: GitManager,
|
|
77
|
+
logger: ITelemetryLogger,
|
|
78
|
+
policies: IDocumentStorageServicePolicies,
|
|
79
|
+
driverPolicies?: IRouterliciousDriverPolicies,
|
|
80
|
+
blobCache?: ICache<ArrayBufferLike>,
|
|
81
|
+
snapshotTreeCache?: ICache<ISnapshotTreeVersion>,
|
|
82
|
+
public noCacheGitManager?: GitManager,
|
|
83
|
+
getStorageManager?: (disableCache?: boolean) => Promise<GitManager>,
|
|
84
|
+
) {
|
|
85
|
+
super(
|
|
86
|
+
DocumentStorageService.loadInternalDocumentStorageService(
|
|
87
|
+
id,
|
|
88
|
+
manager,
|
|
89
|
+
logger,
|
|
90
|
+
policies,
|
|
91
|
+
driverPolicies,
|
|
92
|
+
blobCache,
|
|
93
|
+
snapshotTreeCache,
|
|
94
|
+
noCacheGitManager,
|
|
95
|
+
getStorageManager,
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
}
|
|
96
99
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
|
|
101
|
+
const tree = await this.internalStorageService.getSnapshotTree(version);
|
|
102
|
+
if (tree !== null) {
|
|
103
|
+
this._logTailSha =
|
|
104
|
+
".logTail" in tree.trees ? tree.trees[".logTail"].blobs.logTail : undefined;
|
|
105
|
+
}
|
|
106
|
+
return tree;
|
|
107
|
+
}
|
|
104
108
|
}
|
package/src/errorUtils.ts
CHANGED
|
@@ -5,16 +5,24 @@
|
|
|
5
5
|
|
|
6
6
|
import { DriverError } from "@fluidframework/driver-definitions";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
NonRetryableError,
|
|
9
|
+
GenericNetworkError,
|
|
10
|
+
createGenericNetworkError,
|
|
11
|
+
AuthorizationError,
|
|
12
12
|
} from "@fluidframework/driver-utils";
|
|
13
13
|
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Routerlicious Error types
|
|
17
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
18
|
+
*/
|
|
19
|
+
export enum RouterliciousErrorType {
|
|
20
|
+
/**
|
|
21
|
+
* File not found, or file deleted during session
|
|
22
|
+
*/
|
|
23
|
+
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
24
|
+
|
|
25
|
+
sslCertError = "sslCertError",
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
/**
|
|
@@ -22,100 +30,102 @@ export enum R11sErrorType {
|
|
|
22
30
|
* Intended to be compatible with output from {@link NetworkError.toJSON}
|
|
23
31
|
*/
|
|
24
32
|
export interface IR11sSocketError {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
/**
|
|
34
|
+
* An error code number for the error that occurred.
|
|
35
|
+
* It will be a valid HTTP status code.
|
|
36
|
+
*/
|
|
37
|
+
code: number;
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
/**
|
|
40
|
+
* A message about the error that occurred for debugging / logging purposes.
|
|
41
|
+
* This should not be displayed to the user directly.
|
|
42
|
+
*/
|
|
43
|
+
message: string;
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Optional Retry-After time in seconds.
|
|
47
|
+
* The client should wait this many seconds before retrying its request.
|
|
48
|
+
*/
|
|
49
|
+
retryAfter?: number;
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Optional Retry-After time in milliseconds.
|
|
53
|
+
* The client should wait this many milliseconds before retrying its request.
|
|
54
|
+
*/
|
|
55
|
+
retryAfterMs?: number;
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
export interface IR11sError {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
readonly errorType: RouterliciousErrorType;
|
|
60
|
+
readonly message: string;
|
|
61
|
+
canRetry: boolean;
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
export type R11sError = DriverError | IR11sError;
|
|
57
65
|
|
|
58
66
|
export function createR11sNetworkError(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
errorMessage: string,
|
|
68
|
+
statusCode?: number,
|
|
69
|
+
retryAfterMs?: number,
|
|
62
70
|
): R11sError {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
const props = { statusCode, driverVersion };
|
|
72
|
+
switch (statusCode) {
|
|
73
|
+
case undefined:
|
|
74
|
+
// If a service is temporarily down or a browser resource limit is reached, RestWrapper will throw
|
|
75
|
+
// a network error with no status code (e.g. err:ERR_CONN_REFUSED or err:ERR_FAILED) and
|
|
76
|
+
// the error message will start with NetworkError as defined in restWrapper.ts
|
|
77
|
+
// If there exists a self-signed SSL certificates error, throw a NonRetryableError
|
|
78
|
+
// TODO: instead of relying on string matching, filter error based on the error code like we do for websocket connections
|
|
79
|
+
if (errorMessage.includes("failed, reason: self signed certificate")) {
|
|
80
|
+
return new NonRetryableError(
|
|
81
|
+
errorMessage,
|
|
82
|
+
RouterliciousErrorType.sslCertError,
|
|
83
|
+
props,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return new GenericNetworkError(
|
|
87
|
+
errorMessage,
|
|
88
|
+
errorMessage.startsWith("NetworkError"),
|
|
89
|
+
props,
|
|
90
|
+
);
|
|
91
|
+
case 401:
|
|
92
|
+
// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
|
|
93
|
+
// so we treat repeat 401s the same as 403.
|
|
94
|
+
case 403:
|
|
95
|
+
return new AuthorizationError(errorMessage, undefined, undefined, props);
|
|
96
|
+
case 404:
|
|
97
|
+
const errorType = RouterliciousErrorType.fileNotFoundOrAccessDeniedError;
|
|
98
|
+
return new NonRetryableError(errorMessage, errorType, props);
|
|
99
|
+
case 429:
|
|
100
|
+
return createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);
|
|
101
|
+
case 500:
|
|
102
|
+
case 502:
|
|
103
|
+
return new GenericNetworkError(errorMessage, true, props);
|
|
104
|
+
default:
|
|
105
|
+
const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
|
|
106
|
+
return createGenericNetworkError(errorMessage, retryInfo, props);
|
|
107
|
+
}
|
|
94
108
|
}
|
|
95
109
|
|
|
96
110
|
export function throwR11sNetworkError(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
errorMessage: string,
|
|
112
|
+
statusCode?: number,
|
|
113
|
+
retryAfterMs?: number,
|
|
100
114
|
): never {
|
|
101
|
-
|
|
102
|
-
errorMessage,
|
|
103
|
-
statusCode,
|
|
104
|
-
retryAfterMs);
|
|
115
|
+
const networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);
|
|
105
116
|
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
118
|
+
throw networkError;
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
/**
|
|
111
122
|
* Returns network error based on error object from R11s socket (IR11sSocketError)
|
|
112
123
|
*/
|
|
113
|
-
export function errorObjectFromSocketError(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
);
|
|
124
|
+
export function errorObjectFromSocketError(
|
|
125
|
+
socketError: IR11sSocketError,
|
|
126
|
+
handler: string,
|
|
127
|
+
): R11sError {
|
|
128
|
+
// pre-0.58 error message prefix: R11sSocketError
|
|
129
|
+
const message = `R11s socket error (${handler}): ${socketError.message}`;
|
|
130
|
+
return createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);
|
|
121
131
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
export { DefaultTokenProvider } from "./defaultTokenProvider";
|
|
8
8
|
export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens";
|
|
9
9
|
|
|
10
|
+
// Errors
|
|
11
|
+
export { RouterliciousErrorType } from "./errorUtils";
|
|
12
|
+
|
|
10
13
|
// Factory
|
|
11
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
DocumentPostCreateError,
|
|
16
|
+
RouterliciousDocumentServiceFactory,
|
|
17
|
+
} from "./documentServiceFactory";
|
|
12
18
|
|
|
13
19
|
// Configuration
|
|
14
20
|
export { IRouterliciousDriverPolicies } from "./policies";
|
|
@@ -11,30 +11,33 @@ import * as api from "@fluidframework/protocol-definitions";
|
|
|
11
11
|
* Does not read/write anything.
|
|
12
12
|
*/
|
|
13
13
|
export class NullBlobStorageService implements IDocumentStorageService {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
public get repositoryUrl(): string {
|
|
15
|
+
throw new Error("Invalid operation");
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {
|
|
19
|
+
return version ? Promise.reject(new Error("Invalid operation")) : null;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
public async uploadSummaryWithContext(
|
|
27
|
+
summary: api.ISummaryTree,
|
|
28
|
+
context: ISummaryContext,
|
|
29
|
+
): Promise<string> {
|
|
30
|
+
return Promise.reject(new Error("Invalid operation"));
|
|
31
|
+
}
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {
|
|
34
|
+
return Promise.reject(new Error("Invalid operation"));
|
|
35
|
+
}
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {
|
|
38
|
+
return Promise.reject(new Error("Null blob storage can not create blob"));
|
|
39
|
+
}
|
|
40
|
+
public async readBlob(blobId: string): Promise<ArrayBufferLike> {
|
|
41
|
+
return Promise.reject(new Error("Null blob storage can not read blob"));
|
|
42
|
+
}
|
|
40
43
|
}
|
package/src/packageVersion.ts
CHANGED
package/src/policies.ts
CHANGED
|
@@ -4,48 +4,48 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface IRouterliciousDriverPolicies {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
|
|
9
|
+
* Default: true
|
|
10
|
+
*/
|
|
11
|
+
enablePrefetch: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Rate limit concurrent storage requests.
|
|
14
|
+
* Default: 100
|
|
15
|
+
*/
|
|
16
|
+
maxConcurrentStorageRequests: number;
|
|
17
|
+
/**
|
|
18
|
+
* Rate limit concurrent orderer requests.
|
|
19
|
+
* Default: 100
|
|
20
|
+
*/
|
|
21
|
+
maxConcurrentOrdererRequests: number;
|
|
22
|
+
/**
|
|
23
|
+
* Give hosts the option to change blob aggregation behavior to suit their needs.
|
|
24
|
+
* Larger number means fewer blob individual requests, but less blob-deduping.
|
|
25
|
+
* Smaller number means more blob individual requests, but more blob-deduping.
|
|
26
|
+
* Setting to `undefined` disables blob aggregration.
|
|
27
|
+
* Default: undefined
|
|
28
|
+
*/
|
|
29
|
+
aggregateBlobsSmallerThanBytes: number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Enable uploading entire summary tree as a IWholeSummaryPayload to storage.
|
|
32
|
+
* Default: false
|
|
33
|
+
*/
|
|
34
|
+
enableWholeSummaryUpload: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Enable service endpoint discovery when creating or joining a session.
|
|
37
|
+
* Default: false
|
|
38
|
+
*/
|
|
39
|
+
enableDiscovery?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Enable using RestLess which avoids CORS preflight requests.
|
|
42
|
+
* Default: true
|
|
43
|
+
*/
|
|
44
|
+
enableRestLess: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Enable internal cache of summaries/snapshots.
|
|
47
|
+
* Reduces Summarizer boot time and reduces server load in E2E tests.
|
|
48
|
+
* Default: true
|
|
49
|
+
*/
|
|
50
|
+
enableInternalSummaryCaching: boolean;
|
|
51
51
|
}
|