@fluidframework/driver-utils 2.0.0-dev-rc.1.0.0.225277 → 2.0.0-dev-rc.1.0.0.232845
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 +34 -0
- package/README.md +0 -6
- package/api-report/driver-utils.api.md +15 -8
- package/dist/adapters/compression/{compressionTypes.cjs → compressionTypes.js} +1 -1
- package/dist/adapters/compression/compressionTypes.js.map +1 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/{documentServiceCompressionAdapter.cjs → documentServiceCompressionAdapter.js} +7 -3
- package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -0
- package/dist/adapters/compression/{documentServiceFactoryCompressionAdapter.cjs → documentServiceFactoryCompressionAdapter.js} +4 -4
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -0
- package/dist/adapters/compression/{index.cjs → index.js} +4 -4
- package/dist/adapters/compression/index.js.map +1 -0
- package/dist/adapters/compression/summaryblob/{documentStorageServiceSummaryBlobCompressionAdapter.cjs → documentStorageServiceSummaryBlobCompressionAdapter.js} +3 -3
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -0
- package/dist/adapters/compression/summaryblob/{index.cjs → index.js} +2 -2
- package/dist/adapters/compression/summaryblob/index.js.map +1 -0
- package/dist/adapters/{index.cjs → index.js} +3 -3
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/{predefinedAdapters.cjs → predefinedAdapters.js} +2 -2
- package/dist/adapters/predefinedAdapters.js.map +1 -0
- package/dist/{blob.cjs → blob.js} +1 -1
- package/dist/blob.js.map +1 -0
- package/dist/{buildSnapshotTree.cjs → buildSnapshotTree.js} +1 -1
- package/dist/buildSnapshotTree.js.map +1 -0
- package/dist/{documentServiceFactoryProxy.cjs → documentServiceFactoryProxy.js} +1 -1
- package/dist/documentServiceFactoryProxy.js.map +1 -0
- package/dist/documentServiceProxy.d.ts +3 -2
- package/dist/documentServiceProxy.d.ts.map +1 -1
- package/dist/{documentServiceProxy.cjs → documentServiceProxy.js} +4 -2
- package/dist/documentServiceProxy.js.map +1 -0
- package/dist/documentStorageServiceProxy.d.ts +2 -1
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/{documentStorageServiceProxy.cjs → documentStorageServiceProxy.js} +8 -1
- package/dist/documentStorageServiceProxy.js.map +1 -0
- package/dist/driver-utils-alpha.d.ts +4 -0
- package/dist/driver-utils-beta.d.ts +8 -0
- package/dist/driver-utils-public.d.ts +8 -0
- package/dist/driver-utils-untrimmed.d.ts +21 -8
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/{error.cjs → error.js} +2 -4
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/{index.cjs → index.js} +20 -18
- package/dist/index.js.map +1 -0
- package/dist/{insecureUrlResolver.cjs → insecureUrlResolver.js} +2 -2
- package/dist/insecureUrlResolver.js.map +1 -0
- package/dist/{messageRecognition.cjs → messageRecognition.js} +1 -1
- package/dist/messageRecognition.js.map +1 -0
- package/dist/network.d.ts +11 -8
- package/dist/network.d.ts.map +1 -1
- package/dist/{network.cjs → network.js} +10 -13
- package/dist/network.js.map +1 -0
- package/dist/{networkUtils.cjs → networkUtils.js} +2 -2
- package/dist/networkUtils.js.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/{packageVersion.cjs → packageVersion.js} +2 -2
- package/dist/packageVersion.js.map +1 -0
- package/dist/{parallelRequests.cjs → parallelRequests.js} +5 -5
- package/dist/parallelRequests.js.map +1 -0
- package/dist/{prefetchDocumentStorageService.cjs → prefetchDocumentStorageService.js} +3 -3
- package/dist/prefetchDocumentStorageService.js.map +1 -0
- package/dist/{rateLimiter.cjs → rateLimiter.js} +1 -1
- package/dist/rateLimiter.js.map +1 -0
- package/dist/{readAndParse.cjs → readAndParse.js} +1 -1
- package/dist/readAndParse.js.map +1 -0
- package/dist/{runWithRetry.cjs → runWithRetry.js} +4 -4
- package/dist/runWithRetry.js.map +1 -0
- package/dist/storageUtils.d.ts +13 -0
- package/dist/storageUtils.d.ts.map +1 -0
- package/dist/storageUtils.js +17 -0
- package/dist/storageUtils.js.map +1 -0
- package/dist/{summaryForCreateNew.cjs → summaryForCreateNew.js} +1 -1
- package/dist/summaryForCreateNew.js.map +1 -0
- package/dist/{treeConversions.cjs → treeConversions.js} +3 -3
- package/dist/treeConversions.js.map +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/adapters/compression/documentServiceCompressionAdapter.d.mts.map +1 -1
- package/lib/adapters/compression/documentServiceCompressionAdapter.mjs +4 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.mjs.map +1 -1
- package/lib/documentServiceProxy.d.mts +3 -2
- package/lib/documentServiceProxy.d.mts.map +1 -1
- package/lib/documentServiceProxy.mjs +3 -1
- package/lib/documentServiceProxy.mjs.map +1 -1
- package/lib/documentStorageServiceProxy.d.mts +2 -1
- package/lib/documentStorageServiceProxy.d.mts.map +1 -1
- package/lib/documentStorageServiceProxy.mjs +7 -0
- package/lib/documentStorageServiceProxy.mjs.map +1 -1
- package/lib/driver-utils-alpha.d.mts +4 -0
- package/lib/driver-utils-beta.d.mts +8 -0
- package/lib/driver-utils-public.d.mts +8 -0
- package/lib/driver-utils-untrimmed.d.mts +21 -8
- package/lib/error.d.mts +2 -2
- package/lib/error.d.mts.map +1 -1
- package/lib/error.mjs +2 -3
- package/lib/error.mjs.map +1 -1
- package/lib/index.d.mts +1 -0
- package/lib/index.d.mts.map +1 -1
- package/lib/index.mjs +1 -0
- package/lib/index.mjs.map +1 -1
- package/lib/insecureUrlResolver.mjs +1 -1
- package/lib/insecureUrlResolver.mjs.map +1 -1
- package/lib/network.d.mts +11 -8
- package/lib/network.d.mts.map +1 -1
- package/lib/network.mjs +10 -15
- package/lib/network.mjs.map +1 -1
- package/lib/packageVersion.d.mts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/lib/runWithRetry.mjs +1 -1
- package/lib/runWithRetry.mjs.map +1 -1
- package/lib/storageUtils.d.mts +13 -0
- package/lib/storageUtils.d.mts.map +1 -0
- package/lib/storageUtils.mjs +13 -0
- package/lib/storageUtils.mjs.map +1 -0
- package/package.json +25 -18
- package/src/adapters/compression/documentServiceCompressionAdapter.ts +6 -0
- package/src/documentServiceProxy.ts +9 -2
- package/src/documentStorageServiceProxy.ts +12 -0
- package/src/error.ts +2 -4
- package/src/index.ts +1 -0
- package/src/insecureUrlResolver.ts +1 -1
- package/src/network.ts +9 -14
- package/src/packageVersion.ts +1 -1
- package/src/runWithRetry.ts +1 -1
- package/src/storageUtils.ts +18 -0
- package/dist/adapters/compression/compressionTypes.cjs.map +0 -1
- package/dist/adapters/compression/documentServiceCompressionAdapter.cjs.map +0 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.cjs.map +0 -1
- package/dist/adapters/compression/index.cjs.map +0 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.cjs.map +0 -1
- package/dist/adapters/compression/summaryblob/index.cjs.map +0 -1
- package/dist/adapters/index.cjs.map +0 -1
- package/dist/adapters/predefinedAdapters.cjs.map +0 -1
- package/dist/blob.cjs.map +0 -1
- package/dist/buildSnapshotTree.cjs.map +0 -1
- package/dist/documentServiceFactoryProxy.cjs.map +0 -1
- package/dist/documentServiceProxy.cjs.map +0 -1
- package/dist/documentStorageServiceProxy.cjs.map +0 -1
- package/dist/error.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/insecureUrlResolver.cjs.map +0 -1
- package/dist/messageRecognition.cjs.map +0 -1
- package/dist/network.cjs.map +0 -1
- package/dist/networkUtils.cjs.map +0 -1
- package/dist/packageVersion.cjs.map +0 -1
- package/dist/parallelRequests.cjs.map +0 -1
- package/dist/prefetchDocumentStorageService.cjs.map +0 -1
- package/dist/rateLimiter.cjs.map +0 -1
- package/dist/readAndParse.cjs.map +0 -1
- package/dist/runWithRetry.cjs.map +0 -1
- package/dist/summaryForCreateNew.cjs.map +0 -1
- package/dist/treeConversions.cjs.map +0 -1
- package/tsc-multi.test.json +0 -4
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -16,6 +16,8 @@ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
|
16
16
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
17
17
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
18
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
19
21
|
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
20
22
|
import { IStream } from '@fluidframework/driver-definitions';
|
|
21
23
|
import { IStreamResult } from '@fluidframework/driver-definitions';
|
|
@@ -111,6 +113,12 @@ export declare interface ICompressionStorageConfig {
|
|
|
111
113
|
|
|
112
114
|
/* Excluded from this release type: isCombinedAppAndProtocolSummary */
|
|
113
115
|
|
|
116
|
+
/* Excluded from this release type: isInstanceOfISnapshot */
|
|
117
|
+
|
|
118
|
+
/* Excluded from this release type: ISnapshot */
|
|
119
|
+
|
|
120
|
+
/* Excluded from this release type: ISnapshotFetchOptions */
|
|
121
|
+
|
|
114
122
|
/* Excluded from this release type: isOnline */
|
|
115
123
|
|
|
116
124
|
/* Excluded from this release type: isRuntimeMessage */
|
|
@@ -16,6 +16,8 @@ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
|
16
16
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
17
17
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
18
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
19
21
|
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
20
22
|
import { IStream } from '@fluidframework/driver-definitions';
|
|
21
23
|
import { IStreamResult } from '@fluidframework/driver-definitions';
|
|
@@ -111,6 +113,12 @@ export declare interface ICompressionStorageConfig {
|
|
|
111
113
|
|
|
112
114
|
/* Excluded from this release type: isCombinedAppAndProtocolSummary */
|
|
113
115
|
|
|
116
|
+
/* Excluded from this release type: isInstanceOfISnapshot */
|
|
117
|
+
|
|
118
|
+
/* Excluded from this release type: ISnapshot */
|
|
119
|
+
|
|
120
|
+
/* Excluded from this release type: ISnapshotFetchOptions */
|
|
121
|
+
|
|
114
122
|
/* Excluded from this release type: isOnline */
|
|
115
123
|
|
|
116
124
|
/* Excluded from this release type: isRuntimeMessage */
|
|
@@ -16,6 +16,8 @@ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
|
16
16
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
17
17
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
18
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
19
21
|
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
20
22
|
import { IStream } from '@fluidframework/driver-definitions';
|
|
21
23
|
import { IStreamResult } from '@fluidframework/driver-definitions';
|
|
@@ -67,7 +69,7 @@ export declare class AttachmentTreeEntry {
|
|
|
67
69
|
export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
|
|
68
70
|
readonly claims: string | undefined;
|
|
69
71
|
readonly tenantId: string | undefined;
|
|
70
|
-
readonly errorType
|
|
72
|
+
readonly errorType: "authorizationError";
|
|
71
73
|
readonly canRetry = false;
|
|
72
74
|
constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
|
|
73
75
|
}
|
|
@@ -168,8 +170,8 @@ export declare const createWriteError: (message: string, props: DriverErrorTelem
|
|
|
168
170
|
* @internal
|
|
169
171
|
*/
|
|
170
172
|
export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
171
|
-
static readonly errorType
|
|
172
|
-
readonly errorType
|
|
173
|
+
static readonly errorType: "deltaStreamConnectionForbidden";
|
|
174
|
+
readonly errorType: "deltaStreamConnectionForbidden";
|
|
173
175
|
readonly canRetry = false;
|
|
174
176
|
readonly storageOnlyReason: string | undefined;
|
|
175
177
|
constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string);
|
|
@@ -186,6 +188,7 @@ export declare class DocumentStorageServiceProxy implements IDocumentStorageServ
|
|
|
186
188
|
get repositoryUrl(): string;
|
|
187
189
|
constructor(internalStorageService: IDocumentStorageService);
|
|
188
190
|
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
|
|
191
|
+
getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
189
192
|
getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
|
|
190
193
|
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
191
194
|
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
@@ -211,7 +214,7 @@ export declare const emptyMessageStream: IStream<ISequencedDocumentMessage[]>;
|
|
|
211
214
|
* @internal
|
|
212
215
|
*/
|
|
213
216
|
export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
214
|
-
readonly errorType
|
|
217
|
+
readonly errorType: "fluidInvalidSchema";
|
|
215
218
|
readonly canRetry = false;
|
|
216
219
|
constructor(message: string, props: DriverErrorTelemetryProps);
|
|
217
220
|
}
|
|
@@ -222,7 +225,10 @@ export declare class FluidInvalidSchemaError extends LoggingError implements IDr
|
|
|
222
225
|
*/
|
|
223
226
|
export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
224
227
|
readonly canRetry: boolean;
|
|
225
|
-
|
|
228
|
+
/**
|
|
229
|
+
* {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}
|
|
230
|
+
*/
|
|
231
|
+
readonly errorType: "genericNetworkError";
|
|
226
232
|
constructor(message: string, canRetry: boolean, props: DriverErrorTelemetryProps);
|
|
227
233
|
}
|
|
228
234
|
|
|
@@ -329,6 +335,13 @@ export declare interface IProgress {
|
|
|
329
335
|
*/
|
|
330
336
|
export declare function isCombinedAppAndProtocolSummary(summary: ISummaryTree | undefined, ...optionalRootTrees: string[]): summary is CombinedAppAndProtocolSummary;
|
|
331
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Utility API to check if the type of snapshot contents is `ISnapshot`.
|
|
340
|
+
* @internal
|
|
341
|
+
* @param obj - obj whose type needs to be identified.
|
|
342
|
+
*/
|
|
343
|
+
export declare function isInstanceOfISnapshot(obj: ISnapshotTree | ISnapshot | undefined): obj is ISnapshot;
|
|
344
|
+
|
|
332
345
|
/**
|
|
333
346
|
* It tells if we have local connection only - we might not have connection to web.
|
|
334
347
|
* No solution for node.js (other than resolve dns names / ping specific sites)
|
|
@@ -352,7 +365,7 @@ export declare function isRuntimeMessage(message: {
|
|
|
352
365
|
*/
|
|
353
366
|
export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
|
|
354
367
|
readonly redirectUrl: IResolvedUrl;
|
|
355
|
-
readonly errorType
|
|
368
|
+
readonly errorType: "locationRedirection";
|
|
356
369
|
readonly canRetry = false;
|
|
357
370
|
constructor(message: string, redirectUrl: IResolvedUrl, props: DriverErrorTelemetryProps);
|
|
358
371
|
}
|
|
@@ -555,7 +568,7 @@ export declare enum SummaryCompressionAlgorithm {
|
|
|
555
568
|
*/
|
|
556
569
|
export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
|
|
557
570
|
readonly retryAfterSeconds: number;
|
|
558
|
-
readonly errorType
|
|
571
|
+
readonly errorType: "throttlingError";
|
|
559
572
|
readonly canRetry = true;
|
|
560
573
|
constructor(message: string, retryAfterSeconds: number, props: DriverErrorTelemetryProps);
|
|
561
574
|
}
|
|
@@ -582,7 +595,7 @@ export declare class TreeTreeEntry {
|
|
|
582
595
|
* @internal
|
|
583
596
|
*/
|
|
584
597
|
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
585
|
-
readonly errorType
|
|
598
|
+
readonly errorType: "usageError";
|
|
586
599
|
readonly canRetry = false;
|
|
587
600
|
constructor(message: string);
|
|
588
601
|
}
|
package/dist/error.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IDriverErrorBase } from "@fluidframework/driver-definitions";
|
|
6
6
|
import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
/**
|
|
8
8
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
12
|
-
readonly errorType
|
|
12
|
+
readonly errorType: "usageError";
|
|
13
13
|
readonly canRetry = false;
|
|
14
14
|
constructor(message: string);
|
|
15
15
|
}
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IACxF,QAAQ,CAAC,SAAS,eAA+B;IACjD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM;CAG3B"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.UsageError = void 0;
|
|
8
|
-
// eslint-disable-next-line import/no-deprecated
|
|
9
8
|
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
10
9
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
11
10
|
/**
|
|
@@ -15,10 +14,9 @@ const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
|
15
14
|
class UsageError extends telemetry_utils_1.LoggingError {
|
|
16
15
|
constructor(message) {
|
|
17
16
|
super(message, { usageError: true });
|
|
18
|
-
|
|
19
|
-
this.errorType = driver_definitions_1.DriverErrorType.usageError;
|
|
17
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.usageError;
|
|
20
18
|
this.canRetry = false;
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
exports.UsageError = UsageError;
|
|
24
|
-
//# sourceMappingURL=error.
|
|
22
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAAwF;AACxF,qEAAgF;AAEhF;;;GAGG;AACH,MAAa,UAAW,SAAQ,8BAAY;IAI3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAJ7B,cAAS,GAAG,qCAAgB,CAAC,UAAU,CAAC;QACxC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD;AAPD,gCAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverErrorTypes, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * @internal\n */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\treadonly errorType = DriverErrorTypes.usageError;\n\treadonly canRetry = false;\n\n\tconstructor(message: string) {\n\t\tsuper(message, { usageError: true });\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export { calculateMaxWaitTime, IProgress, runWithRetry } from "./runWithRetry";
|
|
|
18
18
|
export { CombinedAppAndProtocolSummary, getDocAttributesFromProtocolSummary, getQuorumValuesFromProtocolSummary, isCombinedAppAndProtocolSummary, } from "./summaryForCreateNew";
|
|
19
19
|
export { convertSummaryTreeToSnapshotITree } from "./treeConversions";
|
|
20
20
|
export { applyStorageCompression, ICompressionStorageConfig, SummaryCompressionAlgorithm, blobHeadersBlobName, } from "./adapters";
|
|
21
|
+
export { isInstanceOfISnapshot } from "./storageUtils";
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,E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AE,MAAM,gBAAgB,CAAC"}
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
|
|
8
|
-
var buildSnapshotTree_1 = require("./buildSnapshotTree
|
|
7
|
+
exports.isInstanceOfISnapshot = exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
|
|
8
|
+
var buildSnapshotTree_1 = require("./buildSnapshotTree");
|
|
9
9
|
Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_1.buildSnapshotTree; } });
|
|
10
|
-
var blob_1 = require("./blob
|
|
10
|
+
var blob_1 = require("./blob");
|
|
11
11
|
Object.defineProperty(exports, "BlobTreeEntry", { enumerable: true, get: function () { return blob_1.BlobTreeEntry; } });
|
|
12
12
|
Object.defineProperty(exports, "TreeTreeEntry", { enumerable: true, get: function () { return blob_1.TreeTreeEntry; } });
|
|
13
13
|
Object.defineProperty(exports, "AttachmentTreeEntry", { enumerable: true, get: function () { return blob_1.AttachmentTreeEntry; } });
|
|
14
|
-
var documentStorageServiceProxy_1 = require("./documentStorageServiceProxy
|
|
14
|
+
var documentStorageServiceProxy_1 = require("./documentStorageServiceProxy");
|
|
15
15
|
Object.defineProperty(exports, "DocumentStorageServiceProxy", { enumerable: true, get: function () { return documentStorageServiceProxy_1.DocumentStorageServiceProxy; } });
|
|
16
|
-
var error_1 = require("./error
|
|
16
|
+
var error_1 = require("./error");
|
|
17
17
|
Object.defineProperty(exports, "UsageError", { enumerable: true, get: function () { return error_1.UsageError; } });
|
|
18
|
-
var insecureUrlResolver_1 = require("./insecureUrlResolver
|
|
18
|
+
var insecureUrlResolver_1 = require("./insecureUrlResolver");
|
|
19
19
|
Object.defineProperty(exports, "InsecureUrlResolver", { enumerable: true, get: function () { return insecureUrlResolver_1.InsecureUrlResolver; } });
|
|
20
|
-
var messageRecognition_1 = require("./messageRecognition
|
|
20
|
+
var messageRecognition_1 = require("./messageRecognition");
|
|
21
21
|
Object.defineProperty(exports, "canBeCoalescedByService", { enumerable: true, get: function () { return messageRecognition_1.canBeCoalescedByService; } });
|
|
22
22
|
Object.defineProperty(exports, "isRuntimeMessage", { enumerable: true, get: function () { return messageRecognition_1.isRuntimeMessage; } });
|
|
23
23
|
Object.defineProperty(exports, "MessageType2", { enumerable: true, get: function () { return messageRecognition_1.MessageType2; } });
|
|
24
|
-
var network_1 = require("./network
|
|
24
|
+
var network_1 = require("./network");
|
|
25
25
|
Object.defineProperty(exports, "AuthorizationError", { enumerable: true, get: function () { return network_1.AuthorizationError; } });
|
|
26
26
|
Object.defineProperty(exports, "canRetryOnError", { enumerable: true, get: function () { return network_1.canRetryOnError; } });
|
|
27
27
|
Object.defineProperty(exports, "createGenericNetworkError", { enumerable: true, get: function () { return network_1.createGenericNetworkError; } });
|
|
@@ -38,32 +38,34 @@ Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: fun
|
|
|
38
38
|
Object.defineProperty(exports, "OnlineStatus", { enumerable: true, get: function () { return network_1.OnlineStatus; } });
|
|
39
39
|
Object.defineProperty(exports, "RetryableError", { enumerable: true, get: function () { return network_1.RetryableError; } });
|
|
40
40
|
Object.defineProperty(exports, "ThrottlingError", { enumerable: true, get: function () { return network_1.ThrottlingError; } });
|
|
41
|
-
var networkUtils_1 = require("./networkUtils
|
|
41
|
+
var networkUtils_1 = require("./networkUtils");
|
|
42
42
|
Object.defineProperty(exports, "logNetworkFailure", { enumerable: true, get: function () { return networkUtils_1.logNetworkFailure; } });
|
|
43
|
-
var parallelRequests_1 = require("./parallelRequests
|
|
43
|
+
var parallelRequests_1 = require("./parallelRequests");
|
|
44
44
|
Object.defineProperty(exports, "emptyMessageStream", { enumerable: true, get: function () { return parallelRequests_1.emptyMessageStream; } });
|
|
45
45
|
Object.defineProperty(exports, "ParallelRequests", { enumerable: true, get: function () { return parallelRequests_1.ParallelRequests; } });
|
|
46
46
|
Object.defineProperty(exports, "Queue", { enumerable: true, get: function () { return parallelRequests_1.Queue; } });
|
|
47
47
|
Object.defineProperty(exports, "requestOps", { enumerable: true, get: function () { return parallelRequests_1.requestOps; } });
|
|
48
48
|
Object.defineProperty(exports, "streamFromMessages", { enumerable: true, get: function () { return parallelRequests_1.streamFromMessages; } });
|
|
49
49
|
Object.defineProperty(exports, "streamObserver", { enumerable: true, get: function () { return parallelRequests_1.streamObserver; } });
|
|
50
|
-
var prefetchDocumentStorageService_1 = require("./prefetchDocumentStorageService
|
|
50
|
+
var prefetchDocumentStorageService_1 = require("./prefetchDocumentStorageService");
|
|
51
51
|
Object.defineProperty(exports, "PrefetchDocumentStorageService", { enumerable: true, get: function () { return prefetchDocumentStorageService_1.PrefetchDocumentStorageService; } });
|
|
52
|
-
var rateLimiter_1 = require("./rateLimiter
|
|
52
|
+
var rateLimiter_1 = require("./rateLimiter");
|
|
53
53
|
Object.defineProperty(exports, "RateLimiter", { enumerable: true, get: function () { return rateLimiter_1.RateLimiter; } });
|
|
54
|
-
var readAndParse_1 = require("./readAndParse
|
|
54
|
+
var readAndParse_1 = require("./readAndParse");
|
|
55
55
|
Object.defineProperty(exports, "readAndParse", { enumerable: true, get: function () { return readAndParse_1.readAndParse; } });
|
|
56
|
-
var runWithRetry_1 = require("./runWithRetry
|
|
56
|
+
var runWithRetry_1 = require("./runWithRetry");
|
|
57
57
|
Object.defineProperty(exports, "calculateMaxWaitTime", { enumerable: true, get: function () { return runWithRetry_1.calculateMaxWaitTime; } });
|
|
58
58
|
Object.defineProperty(exports, "runWithRetry", { enumerable: true, get: function () { return runWithRetry_1.runWithRetry; } });
|
|
59
|
-
var summaryForCreateNew_1 = require("./summaryForCreateNew
|
|
59
|
+
var summaryForCreateNew_1 = require("./summaryForCreateNew");
|
|
60
60
|
Object.defineProperty(exports, "getDocAttributesFromProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.getDocAttributesFromProtocolSummary; } });
|
|
61
61
|
Object.defineProperty(exports, "getQuorumValuesFromProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.getQuorumValuesFromProtocolSummary; } });
|
|
62
62
|
Object.defineProperty(exports, "isCombinedAppAndProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.isCombinedAppAndProtocolSummary; } });
|
|
63
|
-
var treeConversions_1 = require("./treeConversions
|
|
63
|
+
var treeConversions_1 = require("./treeConversions");
|
|
64
64
|
Object.defineProperty(exports, "convertSummaryTreeToSnapshotITree", { enumerable: true, get: function () { return treeConversions_1.convertSummaryTreeToSnapshotITree; } });
|
|
65
|
-
var adapters_1 = require("./adapters
|
|
65
|
+
var adapters_1 = require("./adapters");
|
|
66
66
|
Object.defineProperty(exports, "applyStorageCompression", { enumerable: true, get: function () { return adapters_1.applyStorageCompression; } });
|
|
67
67
|
Object.defineProperty(exports, "SummaryCompressionAlgorithm", { enumerable: true, get: function () { return adapters_1.SummaryCompressionAlgorithm; } });
|
|
68
68
|
Object.defineProperty(exports, "blobHeadersBlobName", { enumerable: true, get: function () { return adapters_1.blobHeadersBlobName; } });
|
|
69
|
-
|
|
69
|
+
var storageUtils_1 = require("./storageUtils");
|
|
70
|
+
Object.defineProperty(exports, "isInstanceOfISnapshot", { enumerable: true, get: function () { return storageUtils_1.isInstanceOfISnapshot; } });
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,+BAA2E;AAAlE,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAAE,2GAAA,mBAAmB,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A;AAC1C,uCAKoB;AAJnB,mHAAA,uBAAuB,OAAA;AAEvB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,+CAAuD;AAA9C,qHAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tSummaryCompressionAlgorithm,\n\tblobHeadersBlobName,\n} from \"./adapters\";\nexport { isInstanceOfISnapshot } from \"./storageUtils\";\n"]}
|
|
@@ -67,7 +67,7 @@ class InsecureUrlResolver {
|
|
|
67
67
|
const headers = {
|
|
68
68
|
Authorization: `Bearer ${this.bearer}`,
|
|
69
69
|
};
|
|
70
|
-
const resolvedP = axios_1.default.post(`${this.hostUrl}/
|
|
70
|
+
const resolvedP = axios_1.default.post(`${this.hostUrl}/apis/load`, {
|
|
71
71
|
url: request.url,
|
|
72
72
|
}, {
|
|
73
73
|
headers,
|
|
@@ -140,4 +140,4 @@ class InsecureUrlResolver {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
exports.InsecureUrlResolver = InsecureUrlResolver;
|
|
143
|
-
//# sourceMappingURL=insecureUrlResolver.
|
|
143
|
+
//# sourceMappingURL=insecureUrlResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,6BAA4B;AAC5B,2DAAoD;AAEpD,2EAA8F;AAC9F,kDAA0B;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAL9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAiB;QAR/B,UAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IAS/D,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,yEAAyE;QACz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AAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AAtID,kDAsIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * fluid://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/apis/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `fluid://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `fluid://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
|
|
@@ -35,4 +35,4 @@ function canBeCoalescedByService(message) {
|
|
|
35
35
|
return message.type === protocol_definitions_1.MessageType.NoOp || message.type === MessageType2.Accept;
|
|
36
36
|
}
|
|
37
37
|
exports.canBeCoalescedByService = canBeCoalescedByService;
|
|
38
|
-
//# sourceMappingURL=messageRecognition.
|
|
38
|
+
//# sourceMappingURL=messageRecognition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+EAI8C;AAE9C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED;;;;GAIG;AACH,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @internal\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @internal\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @internal\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
|
package/dist/network.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IThrottlingWarning, IDriverErrorBase, IAuthorizationError,
|
|
5
|
+
import { IThrottlingWarning, IDriverErrorBase, IAuthorizationError, ILocationRedirectionError, IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
import { ITelemetryProperties } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
8
8
|
/**
|
|
@@ -33,7 +33,10 @@ export type DriverErrorTelemetryProps = ITelemetryProperties & {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
35
35
|
readonly canRetry: boolean;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}
|
|
38
|
+
*/
|
|
39
|
+
readonly errorType: "genericNetworkError";
|
|
37
40
|
constructor(message: string, canRetry: boolean, props: DriverErrorTelemetryProps);
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
@@ -41,7 +44,7 @@ export declare class GenericNetworkError extends LoggingError implements IDriver
|
|
|
41
44
|
* @internal
|
|
42
45
|
*/
|
|
43
46
|
export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
44
|
-
readonly errorType
|
|
47
|
+
readonly errorType: "fluidInvalidSchema";
|
|
45
48
|
readonly canRetry = false;
|
|
46
49
|
constructor(message: string, props: DriverErrorTelemetryProps);
|
|
47
50
|
}
|
|
@@ -49,8 +52,8 @@ export declare class FluidInvalidSchemaError extends LoggingError implements IDr
|
|
|
49
52
|
* @internal
|
|
50
53
|
*/
|
|
51
54
|
export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
52
|
-
static readonly errorType
|
|
53
|
-
readonly errorType
|
|
55
|
+
static readonly errorType: "deltaStreamConnectionForbidden";
|
|
56
|
+
readonly errorType: "deltaStreamConnectionForbidden";
|
|
54
57
|
readonly canRetry = false;
|
|
55
58
|
readonly storageOnlyReason: string | undefined;
|
|
56
59
|
constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string);
|
|
@@ -61,7 +64,7 @@ export declare class DeltaStreamConnectionForbiddenError extends LoggingError im
|
|
|
61
64
|
export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
|
|
62
65
|
readonly claims: string | undefined;
|
|
63
66
|
readonly tenantId: string | undefined;
|
|
64
|
-
readonly errorType
|
|
67
|
+
readonly errorType: "authorizationError";
|
|
65
68
|
readonly canRetry = false;
|
|
66
69
|
constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
|
|
67
70
|
}
|
|
@@ -70,7 +73,7 @@ export declare class AuthorizationError extends LoggingError implements IAuthori
|
|
|
70
73
|
*/
|
|
71
74
|
export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
|
|
72
75
|
readonly redirectUrl: IResolvedUrl;
|
|
73
|
-
readonly errorType
|
|
76
|
+
readonly errorType: "locationRedirection";
|
|
74
77
|
readonly canRetry = false;
|
|
75
78
|
constructor(message: string, redirectUrl: IResolvedUrl, props: DriverErrorTelemetryProps);
|
|
76
79
|
}
|
|
@@ -102,7 +105,7 @@ export declare class RetryableError<T extends string> extends NetworkErrorBasic<
|
|
|
102
105
|
*/
|
|
103
106
|
export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
|
|
104
107
|
readonly retryAfterSeconds: number;
|
|
105
|
-
readonly errorType
|
|
108
|
+
readonly errorType: "throttlingError";
|
|
106
109
|
readonly canRetry = true;
|
|
107
110
|
constructor(message: string, retryAfterSeconds: number, props: DriverErrorTelemetryProps);
|
|
108
111
|
}
|
package/dist/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;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,CAAC,CAAC,CAAC;IAGxE,QAAQ,CAAC,SAAS,EAAE,CAAC;gBADrB,OAAO,EAAE,MAAM,EACN,SAAS,EAAE,CAAC,EACrB,KAAK,EAAE,yBAAyB;CAIjC;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,YAAa,YAAW,kBAAkB,EAAE,eAAe;IAM9F,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IALnC,QAAQ,CAAC,SAAS,oBAAoC;IACtD,QAAQ,CAAC,QAAQ,QAAQ;gBAGxB,OAAO,EAAE,MAAM,EACN,iBAAiB,EAAE,MAAM,EAClC,KAAK,EAAE,yBAAyB;CAIjC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAa,MAAM,SAAS,yBAAyB,oCACf,CAAC;AAEpE;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACvD,KAAK,EAAE,yBAAyB,GAC9B,eAAe,GAAG,mBAAmB,CAKvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,GAAG,KAAG,OAAmC,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,UAAW,GAAG,KAAG,MAAM,GAAG,SACrB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAAW,GAAG,KAAG,MAAM,GAAG,SACuB,CAAC"}
|
|
@@ -39,8 +39,10 @@ class GenericNetworkError extends telemetry_utils_1.LoggingError {
|
|
|
39
39
|
constructor(message, canRetry, props) {
|
|
40
40
|
super(message, props);
|
|
41
41
|
this.canRetry = canRetry;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}
|
|
44
|
+
*/
|
|
45
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.genericNetworkError;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
exports.GenericNetworkError = GenericNetworkError;
|
|
@@ -51,8 +53,7 @@ exports.GenericNetworkError = GenericNetworkError;
|
|
|
51
53
|
class FluidInvalidSchemaError extends telemetry_utils_1.LoggingError {
|
|
52
54
|
constructor(message, props) {
|
|
53
55
|
super(message, props);
|
|
54
|
-
|
|
55
|
-
this.errorType = driver_definitions_1.DriverErrorType.fluidInvalidSchema;
|
|
56
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.fluidInvalidSchema;
|
|
56
57
|
this.canRetry = false;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -69,8 +70,7 @@ class DeltaStreamConnectionForbiddenError extends telemetry_utils_1.LoggingError
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
exports.DeltaStreamConnectionForbiddenError = DeltaStreamConnectionForbiddenError;
|
|
72
|
-
|
|
73
|
-
DeltaStreamConnectionForbiddenError.errorType = driver_definitions_1.DriverErrorType.deltaStreamConnectionForbidden;
|
|
73
|
+
DeltaStreamConnectionForbiddenError.errorType = driver_definitions_1.DriverErrorTypes.deltaStreamConnectionForbidden;
|
|
74
74
|
/**
|
|
75
75
|
* @internal
|
|
76
76
|
*/
|
|
@@ -80,8 +80,7 @@ class AuthorizationError extends telemetry_utils_1.LoggingError {
|
|
|
80
80
|
super(message, props, new Set(["claims", "tenantId"]));
|
|
81
81
|
this.claims = claims;
|
|
82
82
|
this.tenantId = tenantId;
|
|
83
|
-
|
|
84
|
-
this.errorType = driver_definitions_1.DriverErrorType.authorizationError;
|
|
83
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.authorizationError;
|
|
85
84
|
this.canRetry = false;
|
|
86
85
|
}
|
|
87
86
|
}
|
|
@@ -94,8 +93,7 @@ class LocationRedirectionError extends telemetry_utils_1.LoggingError {
|
|
|
94
93
|
// do not log redirectURL
|
|
95
94
|
super(message, props, new Set(["redirectUrl"]));
|
|
96
95
|
this.redirectUrl = redirectUrl;
|
|
97
|
-
|
|
98
|
-
this.errorType = driver_definitions_1.DriverErrorType.locationRedirection;
|
|
96
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.locationRedirection;
|
|
99
97
|
this.canRetry = false;
|
|
100
98
|
}
|
|
101
99
|
}
|
|
@@ -139,8 +137,7 @@ class ThrottlingError extends telemetry_utils_1.LoggingError {
|
|
|
139
137
|
constructor(message, retryAfterSeconds, props) {
|
|
140
138
|
super(message, props);
|
|
141
139
|
this.retryAfterSeconds = retryAfterSeconds;
|
|
142
|
-
|
|
143
|
-
this.errorType = driver_definitions_1.DriverErrorType.throttlingError;
|
|
140
|
+
this.errorType = driver_definitions_1.DriverErrorTypes.throttlingError;
|
|
144
141
|
this.canRetry = true;
|
|
145
142
|
}
|
|
146
143
|
}
|
|
@@ -180,4 +177,4 @@ exports.getRetryDelaySecondsFromError = getRetryDelaySecondsFromError;
|
|
|
180
177
|
*/
|
|
181
178
|
const getRetryDelayFromError = (error) => error?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;
|
|
182
179
|
exports.getRetryDelayFromError = getRetryDelayFromError;
|
|
183
|
-
//# sourceMappingURL=network.
|
|
180
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAO4C;AAE5C,qEAAgF;AAEhF;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,SAAgB,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EACpC;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,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,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADxE,QAAA,sBAAsB,0BACkD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIThrottlingWarning,\n\tIDriverErrorBase,\n\tIAuthorizationError,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/core-interfaces\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\treadonly errorType = DriverErrorTypes.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\tstatic readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n\treadonly errorType = DriverErrorTypes.throttlingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.logNetworkFailure = void 0;
|
|
8
|
-
const network_1 = require("./network
|
|
8
|
+
const network_1 = require("./network");
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
@@ -26,4 +26,4 @@ function logNetworkFailure(logger, event, error) {
|
|
|
26
26
|
logger.sendTelemetryEvent(newEvent, error);
|
|
27
27
|
}
|
|
28
28
|
exports.logNetworkFailure = logNetworkFailure;
|
|
29
|
-
//# sourceMappingURL=networkUtils.
|
|
29
|
+
//# sourceMappingURL=networkUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../src/networkUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,uCAAoE;AAEpE;;GAEG;AACH,SAAgB,iBAAiB,CAChC,MAA2B,EAC3B,KAA2B,EAC3B,KAAW;IAEX,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,KAAK,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM;QACd,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,sBAAY,CAAC,IAAA,kBAAQ,GAAE,CAAC,CAAC;IAElF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,GAAG,SAAgB,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAC/E,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAC1D,QAAQ,CAAC,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;SAC1C;KACD;IAED,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,GAAG,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAtBD,8CAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryErrorEvent } from \"@fluidframework/core-interfaces\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { isOnline, OnlineStatus, canRetryOnError } from \"./network\";\n\n/**\n * @internal\n */\nexport function logNetworkFailure(\n\tlogger: ITelemetryLoggerExt,\n\tevent: ITelemetryErrorEvent,\n\terror?: any,\n) {\n\tconst newEvent = { ...event };\n\n\tconst errorOnlineProp = error?.online;\n\tnewEvent.online =\n\t\ttypeof errorOnlineProp === \"string\" ? errorOnlineProp : OnlineStatus[isOnline()];\n\n\tif (typeof navigator === \"object\" && navigator !== null) {\n\t\tconst nav = navigator as any;\n\t\tconst connection = nav.connection ?? nav.mozConnection ?? nav.webkitConnection;\n\t\tif (connection !== null && typeof connection === \"object\") {\n\t\t\tnewEvent.connectionType = connection.type;\n\t\t}\n\t}\n\n\t// non-retryable errors are fatal and should be logged as errors\n\tnewEvent.category = canRetryOnError(error) ? \"generic\" : \"error\";\n\tlogger.sendTelemetryEvent(newEvent, error);\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/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev-rc.1.0.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev-rc.1.0.0.232845";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -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/driver-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-dev-rc.1.0.0.
|
|
12
|
-
//# sourceMappingURL=packageVersion.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev-rc.1.0.0.232845";
|
|
12
|
+
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,2BAA2B,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-dev-rc.1.0.0.232845\";\n"]}
|
|
@@ -8,11 +8,11 @@ exports.streamObserver = exports.streamFromMessages = exports.emptyMessageStream
|
|
|
8
8
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
9
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
10
10
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
11
|
-
const network_1 = require("./network
|
|
12
|
-
const networkUtils_1 = require("./networkUtils
|
|
11
|
+
const network_1 = require("./network");
|
|
12
|
+
const networkUtils_1 = require("./networkUtils");
|
|
13
13
|
// For now, this package is versioned and released in unison with the specific drivers
|
|
14
|
-
const packageVersion_1 = require("./packageVersion
|
|
15
|
-
const runWithRetry_1 = require("./runWithRetry
|
|
14
|
+
const packageVersion_1 = require("./packageVersion");
|
|
15
|
+
const runWithRetry_1 = require("./runWithRetry");
|
|
16
16
|
// We double this value in first try in when we calculate time to wait for in "calculateMaxWaitTime" function.
|
|
17
17
|
const MissingFetchDelayInMs = 50;
|
|
18
18
|
/**
|
|
@@ -541,4 +541,4 @@ function streamObserver(stream, handler) {
|
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
543
|
exports.streamObserver = streamObserver;
|
|
544
|
-
//# sourceMappingURL=parallelRequests.
|
|
544
|
+
//# sourceMappingURL=parallelRequests.js.map
|