@fluidframework/routerlicious-driver 2.0.0-internal.7.0.1 → 2.0.0-internal.7.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/CHANGELOG.md +4 -0
- package/api-extractor.json +9 -1
- package/api-report/routerlicious-driver.api.md +108 -0
- package/dist/errorUtils.d.ts +1 -1
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.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/routerlicious-driver-alpha.d.ts +245 -0
- package/dist/routerlicious-driver-beta.d.ts +245 -0
- package/dist/routerlicious-driver-public.d.ts +245 -0
- package/dist/routerlicious-driver.d.ts +245 -0
- package/dist/shreddedSummaryDocumentStorageService.d.ts +1 -0
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js +6 -1
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts +1 -0
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +6 -1
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +1 -1
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.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/shreddedSummaryDocumentStorageService.d.ts +1 -0
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js +7 -2
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts +1 -0
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +7 -2
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/package.json +19 -23
- package/src/errorUtils.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/shreddedSummaryDocumentStorageService.ts +14 -1
- package/src/wholeSummaryDocumentStorageService.ts +17 -5
package/CHANGELOG.md
CHANGED
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-base.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
"ae-missing-release-tag": {
|
|
7
|
+
// TODO: Fix violations and remove this rule override
|
|
8
|
+
"logLevel": "none"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/routerlicious-driver"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
9
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { ISession } from '@fluidframework/server-services-client';
|
|
11
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
12
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
13
|
+
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
14
|
+
|
|
15
|
+
// @public
|
|
16
|
+
export class DefaultTokenProvider implements ITokenProvider {
|
|
17
|
+
constructor(jwt: string);
|
|
18
|
+
// (undocumented)
|
|
19
|
+
fetchOrdererToken(): Promise<ITokenResponse>;
|
|
20
|
+
// (undocumented)
|
|
21
|
+
fetchStorageToken(): Promise<ITokenResponse>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// @public
|
|
25
|
+
export class DocumentPostCreateError extends Error {
|
|
26
|
+
constructor(
|
|
27
|
+
innerError: Error);
|
|
28
|
+
// (undocumented)
|
|
29
|
+
readonly name = "DocumentPostCreateError";
|
|
30
|
+
// (undocumented)
|
|
31
|
+
get stack(): string | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// @public (undocumented)
|
|
35
|
+
export interface IRouterliciousDriverPolicies {
|
|
36
|
+
enableDiscovery: boolean;
|
|
37
|
+
enableInternalSummaryCaching: boolean;
|
|
38
|
+
enableLongPollingDowngrade: boolean;
|
|
39
|
+
enablePrefetch: boolean;
|
|
40
|
+
enableRestLess: boolean;
|
|
41
|
+
enableWholeSummaryUpload: boolean;
|
|
42
|
+
isEphemeralContainer: boolean;
|
|
43
|
+
maxConcurrentOrdererRequests: number;
|
|
44
|
+
maxConcurrentStorageRequests: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// @public
|
|
48
|
+
export interface ITokenProvider {
|
|
49
|
+
documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
|
|
50
|
+
fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
|
|
51
|
+
fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// @public (undocumented)
|
|
55
|
+
export interface ITokenResponse {
|
|
56
|
+
fromCache?: boolean;
|
|
57
|
+
jwt: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// @public
|
|
61
|
+
export interface ITokenService {
|
|
62
|
+
extractClaims(token: string): ITokenClaims;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// @public
|
|
66
|
+
export class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
|
|
67
|
+
constructor(tokenProvider: ITokenProvider, driverPolicies?: Partial<IRouterliciousDriverPolicies>);
|
|
68
|
+
// (undocumented)
|
|
69
|
+
createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
70
|
+
// (undocumented)
|
|
71
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean, session?: ISession): Promise<IDocumentService>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @public @deprecated
|
|
75
|
+
export enum RouterliciousErrorType {
|
|
76
|
+
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
77
|
+
sslCertError = "sslCertError"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// @public
|
|
81
|
+
export const RouterliciousErrorTypes: {
|
|
82
|
+
readonly sslCertError: "sslCertError";
|
|
83
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
84
|
+
readonly authorizationError: "authorizationError";
|
|
85
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
86
|
+
readonly offlineError: "offlineError";
|
|
87
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
88
|
+
readonly writeError: "writeError";
|
|
89
|
+
readonly fetchFailure: "fetchFailure";
|
|
90
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
91
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
92
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
93
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
94
|
+
readonly locationRedirection: "locationRedirection";
|
|
95
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
96
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
97
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
98
|
+
readonly genericError: "genericError";
|
|
99
|
+
readonly throttlingError: "throttlingError";
|
|
100
|
+
readonly usageError: "usageError";
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// @public (undocumented)
|
|
104
|
+
export type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
|
|
105
|
+
|
|
106
|
+
// (No @packageDocumentation comment for this package)
|
|
107
|
+
|
|
108
|
+
```
|
package/dist/errorUtils.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const RouterliciousErrorTypes: {
|
|
|
32
32
|
readonly throttlingError: "throttlingError";
|
|
33
33
|
readonly usageError: "usageError";
|
|
34
34
|
};
|
|
35
|
-
export type RouterliciousErrorTypes = typeof RouterliciousErrorTypes[keyof typeof RouterliciousErrorTypes];
|
|
35
|
+
export type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
|
|
36
36
|
/**
|
|
37
37
|
* Routerlicious Error types
|
|
38
38
|
* Different error types that may be thrown by the routerlicious driver
|
package/dist/errorUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;IAInC;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX,MAAM,MAAM,uBAAuB,GAClC,OAAO,uBAAuB,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,W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AAS,GAAG,EAAE,QAAQ,EAAE,YAAY,KAAK,SAAS,EAAE,YAAY,EAAE,CAAC;YACzE,KAAK,GAAG,IAAA,wCAAyB,EAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAClE,MAAM;KACP;IACD,KAAK,CAAC,sBAAsB,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC;AACd,CAAC;AApCD,wDAoCC;AAED,SAAgB,qBAAqB,CACpC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,MAAM,YAAY,GAAG,sBAAsB,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAEpF,+DAA+D;IAC/D,MAAM,YAAY,CAAC;AACpB,CAAC;AATD,sDASC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CACzC,WAA6B,EAC7B,OAAe;IAEf,iDAAiD;IACjD,MAAM,OAAO,GAAG,sBAAsB,OAAO,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;IACzE,OAAO,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC;AAPD,gEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tNonRetryableError,\n\tGenericNetworkError,\n\tcreateGenericNetworkError,\n\tAuthorizationError,\n} from \"@fluidframework/driver-utils\";\nimport { IFluidErrorBase } from \"@fluidframework/telemetry-utils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n} as const;\nexport type RouterliciousErrorTypes =\n\
|
|
1
|
+
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAI4C;AAC5C,+DAKsC;AAEtC,qDAA+D;AAE/D;;;GAGG;AACU,QAAA,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,qCAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AAIX;;;;;GAKG;AACH,IAAY,sBAUX;AAVD,WAAY,sBAAsB;IACjC;;OAEG;IACH,6FAAmE,CAAA;IAEnE;;OAEG;IACH,uDAA6B,CAAA;AAC9B,CAAC,EAVW,sBAAsB,sCAAtB,sBAAsB,QAUjC;AAsCD,SAAgB,sBAAsB,CACrC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,IAAI,KAAkC,CAAC;IACvC,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,aAAa,EAAb,2BAAa,EAAE,CAAC;IAC5C,QAAQ,UAAU,EAAE;QACnB,KAAK,GAAG,CAAC;QACT,wFAAwF;QACxF,2CAA2C;QAC3C,KAAK,GAAG;YACP,KAAK,GAAG,IAAI,iCAAkB,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC1E,MAAM;QACP,KAAK,GAAG;YACP,MAAM,SAAS,GAAG,sBAAsB,CAAC,+BAA+B,CAAC;YACzE,KAAK,GAAG,IAAI,gCAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC9D,MAAM;QACP,KAAK,GAAG;YACP,KAAK,GAAG,IAAA,wCAAyB,EAChC,YAAY,EACZ,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAChC,KAAK,CACL,CAAC;YACF,MAAM;QACP,KAAK,GAAG,CAAC;QACT,KAAK,GAAG;YACP,KAAK,GAAG,IAAI,kCAAmB,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAC3D,MAAM;QACP;YACC,MAAM,SAAS,GAAG,EAAE,QAAQ,EAAE,YAAY,KAAK,SAAS,EAAE,YAAY,EAAE,CAAC;YACzE,KAAK,GAAG,IAAA,wCAAyB,EAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAClE,MAAM;KACP;IACD,KAAK,CAAC,sBAAsB,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC;AACd,CAAC;AApCD,wDAoCC;AAED,SAAgB,qBAAqB,CACpC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,MAAM,YAAY,GAAG,sBAAsB,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAEpF,+DAA+D;IAC/D,MAAM,YAAY,CAAC;AACpB,CAAC;AATD,sDASC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CACzC,WAA6B,EAC7B,OAAe;IAEf,iDAAiD;IACjD,MAAM,OAAO,GAAG,sBAAsB,OAAO,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;IACzE,OAAO,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC;AAPD,gEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tNonRetryableError,\n\tGenericNetworkError,\n\tcreateGenericNetworkError,\n\tAuthorizationError,\n} from \"@fluidframework/driver-utils\";\nimport { IFluidErrorBase } from \"@fluidframework/telemetry-utils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n} as const;\nexport type RouterliciousErrorTypes =\n\t(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n *\n * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.\n */\nexport enum RouterliciousErrorType {\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError = \"sslCertError\",\n}\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from {@link NetworkError.toJSON}\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorType;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403:\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\tcase 404:\n\t\t\tconst errorType = RouterliciousErrorType.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\tcase 429:\n\t\t\terror = createGenericNetworkError(\n\t\t\t\terrorMessage,\n\t\t\t\t{ canRetry: true, retryAfterMs },\n\t\t\t\tprops,\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 500:\n\t\tcase 502:\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): never {\n\tconst networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);\n\n\t// eslint-disable-next-line @typescript-eslint/no-throw-literal\n\tthrow networkError;\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\treturn createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/routerlicious-driver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.7.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.7.1.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/routerlicious-driver";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.7.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.7.1.1";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-internal.7.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-internal.7.1.1\";\n"]}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
2
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
3
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
|
+
import { ISession } from '@fluidframework/server-services-client';
|
|
5
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
6
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
7
|
+
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DefaultTokenProvider implements ITokenProvider {
|
|
13
|
+
private readonly jwt;
|
|
14
|
+
constructor(jwt: string);
|
|
15
|
+
fetchOrdererToken(): Promise<ITokenResponse>;
|
|
16
|
+
fetchStorageToken(): Promise<ITokenResponse>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Error returned by {@link RouterliciousDocumentServiceFactory.createContainer} when an error is thrown
|
|
21
|
+
* in {@link ITokenProvider.documentPostCreateCallback}.
|
|
22
|
+
* It is the consumer's responsibility to ensure that any state related to container creation is appropriately
|
|
23
|
+
* cleaned up in the event of failure.
|
|
24
|
+
* This includes the document itself, which will have been created by the time this error was thrown.
|
|
25
|
+
*
|
|
26
|
+
* @remarks TODO: examples of suggested actions for recovery.
|
|
27
|
+
* - How would a user delete the created document?
|
|
28
|
+
* - What would a retry pattern look like here?
|
|
29
|
+
*/
|
|
30
|
+
export declare class DocumentPostCreateError extends Error {
|
|
31
|
+
/**
|
|
32
|
+
* Inner error being wrapped.
|
|
33
|
+
*/
|
|
34
|
+
private readonly innerError;
|
|
35
|
+
constructor(
|
|
36
|
+
/**
|
|
37
|
+
* Inner error being wrapped.
|
|
38
|
+
*/
|
|
39
|
+
innerError: Error);
|
|
40
|
+
readonly name = "DocumentPostCreateError";
|
|
41
|
+
get stack(): string | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare interface IRouterliciousDriverPolicies {
|
|
45
|
+
/**
|
|
46
|
+
* Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
|
|
47
|
+
* Default: true
|
|
48
|
+
*/
|
|
49
|
+
enablePrefetch: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Rate limit concurrent storage requests.
|
|
52
|
+
* Default: 100
|
|
53
|
+
*/
|
|
54
|
+
maxConcurrentStorageRequests: number;
|
|
55
|
+
/**
|
|
56
|
+
* Rate limit concurrent orderer requests.
|
|
57
|
+
* Default: 100
|
|
58
|
+
*/
|
|
59
|
+
maxConcurrentOrdererRequests: number;
|
|
60
|
+
/**
|
|
61
|
+
* Enable uploading entire summary tree as a IWholeSummaryPayload to storage.
|
|
62
|
+
* Default: false
|
|
63
|
+
*/
|
|
64
|
+
enableWholeSummaryUpload: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Enable service endpoint discovery when creating or joining a session.
|
|
67
|
+
* Default: false
|
|
68
|
+
*/
|
|
69
|
+
enableDiscovery: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Enable using RestLess which avoids CORS preflight requests.
|
|
72
|
+
* Default: true
|
|
73
|
+
*/
|
|
74
|
+
enableRestLess: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Enable internal cache of summaries/snapshots.
|
|
77
|
+
* Reduces Summarizer boot time and reduces server load in E2E tests.
|
|
78
|
+
* Default: true
|
|
79
|
+
*/
|
|
80
|
+
enableInternalSummaryCaching: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Enable downgrading socket connection to long-polling
|
|
83
|
+
* when websocket connection cannot be established.
|
|
84
|
+
* Default: true
|
|
85
|
+
*/
|
|
86
|
+
enableLongPollingDowngrade: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates that the container is ephemeral.
|
|
89
|
+
* Artifacts relates to the container are limited to container lifetime.
|
|
90
|
+
* Default: false
|
|
91
|
+
*/
|
|
92
|
+
isEphemeralContainer: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Abstracts the token fetching mechanism for a hosting application.
|
|
97
|
+
* The hosting application is responsible for providing an implementation.
|
|
98
|
+
*/
|
|
99
|
+
export declare interface ITokenProvider {
|
|
100
|
+
/**
|
|
101
|
+
* Fetches the orderer token from host.
|
|
102
|
+
*
|
|
103
|
+
* @param tenantId - Tenant ID.
|
|
104
|
+
* @param documentId - Optional. Document ID is only required for document-scoped requests.
|
|
105
|
+
* @param refresh - Optional flag indicating whether token fetch must bypass local cache.
|
|
106
|
+
* This likely indicates that some previous request failed authorization due to an expired token,
|
|
107
|
+
* and so a fresh token is required.
|
|
108
|
+
*
|
|
109
|
+
* Default: `false`.
|
|
110
|
+
*
|
|
111
|
+
* NOTE: This parameter will be made required in the future.
|
|
112
|
+
*/
|
|
113
|
+
fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* Fetches the storage token from host.
|
|
116
|
+
*
|
|
117
|
+
* @param tenantId - Tenant ID.
|
|
118
|
+
* @param documentId - Document ID.
|
|
119
|
+
* @param refresh - Optional flag indicating whether token fetch must bypass local cache.
|
|
120
|
+
* This likely indicates that some previous request failed authorization due to an expired token,
|
|
121
|
+
* and so a fresh token is required.
|
|
122
|
+
*
|
|
123
|
+
* Default: `false`.
|
|
124
|
+
*
|
|
125
|
+
* NOTE: This parameter will be made required in the future.
|
|
126
|
+
*/
|
|
127
|
+
fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* A callback triggered directly after creating the document. In this callback the client has the opportunity, to
|
|
130
|
+
* verify against an authorization service, if the user who claims to create the document is the same user who
|
|
131
|
+
* created it.
|
|
132
|
+
*
|
|
133
|
+
* @remarks Notes:
|
|
134
|
+
*
|
|
135
|
+
* * Using the callback may have performance impact on the document creation process.
|
|
136
|
+
*
|
|
137
|
+
* * Any exceptions thrown in the callback would fail the creation workflow
|
|
138
|
+
* (see {@link RouterliciousDocumentServiceFactory.createContainer} for more details).
|
|
139
|
+
*
|
|
140
|
+
* @param documentId - Document ID.
|
|
141
|
+
* @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
|
|
142
|
+
* and document id. It can be used to validate the identity of the document creator.
|
|
143
|
+
*/
|
|
144
|
+
documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export declare interface ITokenResponse {
|
|
148
|
+
/**
|
|
149
|
+
* {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
|
|
150
|
+
*/
|
|
151
|
+
jwt: string;
|
|
152
|
+
/**
|
|
153
|
+
* A flag indicating whether token was obtained from local cache.
|
|
154
|
+
*
|
|
155
|
+
* @remarks `undefined` indicates that the source of the token could not be determined.
|
|
156
|
+
*/
|
|
157
|
+
fromCache?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Abstracts the discovery of claims contained within a token.
|
|
162
|
+
*/
|
|
163
|
+
export declare interface ITokenService {
|
|
164
|
+
/**
|
|
165
|
+
* Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided
|
|
166
|
+
* {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.
|
|
167
|
+
*/
|
|
168
|
+
extractClaims(token: string): ITokenClaims;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Factory for creating the routerlicious document service. Use this if you want to
|
|
173
|
+
* use the routerlicious implementation.
|
|
174
|
+
*/
|
|
175
|
+
export declare class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
|
|
176
|
+
private readonly tokenProvider;
|
|
177
|
+
private readonly driverPolicies;
|
|
178
|
+
private readonly blobCache;
|
|
179
|
+
private readonly wholeSnapshotTreeCache;
|
|
180
|
+
private readonly shreddedSummaryTreeCache;
|
|
181
|
+
constructor(tokenProvider: ITokenProvider, driverPolicies?: Partial<IRouterliciousDriverPolicies>);
|
|
182
|
+
/**
|
|
183
|
+
* {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer}
|
|
184
|
+
*
|
|
185
|
+
* @throws {@link DocumentPostCreateError}
|
|
186
|
+
* If an exception is thrown while invoking the provided {@link ITokenProvider.documentPostCreateCallback}.
|
|
187
|
+
*/
|
|
188
|
+
createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
189
|
+
/**
|
|
190
|
+
* {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createDocumentService}
|
|
191
|
+
*
|
|
192
|
+
* @returns Routerlicious document service.
|
|
193
|
+
*/
|
|
194
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean, session?: ISession): Promise<IDocumentService>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Routerlicious Error types
|
|
199
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
200
|
+
*
|
|
201
|
+
* @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
|
|
202
|
+
*/
|
|
203
|
+
export declare enum RouterliciousErrorType {
|
|
204
|
+
/**
|
|
205
|
+
* File not found, or file deleted during session
|
|
206
|
+
*/
|
|
207
|
+
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
208
|
+
/**
|
|
209
|
+
* SSL Certificate Error.
|
|
210
|
+
*/
|
|
211
|
+
sslCertError = "sslCertError"
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Routerlicious Error types
|
|
216
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
217
|
+
*/
|
|
218
|
+
export declare const RouterliciousErrorTypes: {
|
|
219
|
+
/**
|
|
220
|
+
* SSL Certificate Error.
|
|
221
|
+
*/
|
|
222
|
+
readonly sslCertError: "sslCertError";
|
|
223
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
224
|
+
readonly authorizationError: "authorizationError";
|
|
225
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
226
|
+
readonly offlineError: "offlineError";
|
|
227
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
228
|
+
readonly writeError: "writeError";
|
|
229
|
+
readonly fetchFailure: "fetchFailure";
|
|
230
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
231
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
232
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
233
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
234
|
+
readonly locationRedirection: "locationRedirection";
|
|
235
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
236
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
237
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
238
|
+
readonly genericError: "genericError";
|
|
239
|
+
readonly throttlingError: "throttlingError";
|
|
240
|
+
readonly usageError: "usageError";
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export declare type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
|
|
244
|
+
|
|
245
|
+
export { }
|