@fluidframework/driver-utils 2.0.0-dev.1.4.6.106135 → 2.0.0-dev.2.3.0.115467
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +13 -1
- package/dist/error.d.ts +4 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +3 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +21 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -31
- package/dist/index.js.map +1 -1
- package/dist/messageRecognition.d.ts +0 -16
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +1 -32
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +15 -4
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +13 -9
- package/dist/network.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/prefetchDocumentStorageService.d.ts +1 -1
- package/lib/error.d.ts +4 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +3 -1
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +21 -21
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +21 -21
- package/lib/index.js.map +1 -1
- package/lib/messageRecognition.d.ts +0 -16
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js +0 -30
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +15 -4
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +11 -8
- package/lib/network.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/prefetchDocumentStorageService.d.ts +1 -1
- package/package.json +25 -33
- package/prettier.config.cjs +8 -0
- package/src/error.ts +4 -2
- package/src/index.ts +56 -21
- package/src/messageRecognition.ts +0 -31
- package/src/network.ts +23 -12
- package/src/packageVersion.ts +1 -1
package/.eslintrc.js
CHANGED
|
@@ -5,9 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
"extends": [
|
|
8
|
-
require.resolve("@fluidframework/eslint-config-fluid")
|
|
8
|
+
require.resolve("@fluidframework/eslint-config-fluid"), "prettier"
|
|
9
9
|
],
|
|
10
10
|
"parserOptions": {
|
|
11
11
|
"project": ["./tsconfig.json", "./src/test/tsconfig.json"]
|
|
12
12
|
},
|
|
13
|
+
"rules": {
|
|
14
|
+
"import/no-nodejs-modules": ["error", {"allow": ["url"]}],
|
|
15
|
+
},
|
|
16
|
+
"overrides": [
|
|
17
|
+
{
|
|
18
|
+
// Rules only for test files
|
|
19
|
+
files: ["*.spec.ts", "src/test/**"],
|
|
20
|
+
rules: {
|
|
21
|
+
"import/no-nodejs-modules": "off", // Node libraries are OK for test files.
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
]
|
|
13
25
|
}
|
package/dist/error.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { DriverErrorType, IDriverErrorBase } from "@fluidframework/driver-definitions";
|
|
5
6
|
import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
6
7
|
/** Error indicating an API is being used improperly resulting in an invalid operation. */
|
|
7
|
-
export declare class UsageError extends LoggingError implements IFluidErrorBase {
|
|
8
|
-
readonly errorType =
|
|
8
|
+
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
9
|
+
readonly errorType = DriverErrorType.usageError;
|
|
10
|
+
readonly canRetry = false;
|
|
9
11
|
constructor(message: string);
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=error.d.ts.map
|
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;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,qBAAa,UAAW,SAAQ,YAAa,YAAW,eAAe;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IACrF,QAAQ,CAAC,SAAS,8BAA8B;IAChD,QAAQ,CAAC,QAAQ,SAAS;gBAGtB,OAAO,EAAE,MAAM;CAItB"}
|
package/dist/error.js
CHANGED
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.UsageError = void 0;
|
|
8
|
+
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
8
9
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
9
10
|
/** Error indicating an API is being used improperly resulting in an invalid operation. */
|
|
10
11
|
class UsageError extends telemetry_utils_1.LoggingError {
|
|
11
12
|
constructor(message) {
|
|
12
13
|
super(message, { usageError: true });
|
|
13
|
-
this.errorType =
|
|
14
|
+
this.errorType = driver_definitions_1.DriverErrorType.usageError;
|
|
15
|
+
this.canRetry = false;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
exports.UsageError = UsageError;
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAgF;AAEhF,0FAA0F;AAC1F,MAAa,UAAW,SAAQ,8BAAY;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAAuF;AACvF,qEAAgF;AAEhF,0FAA0F;AAC1F,MAAa,UAAW,SAAQ,8BAAY;IAIxC,YACI,OAAe;QAEf,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QANhC,cAAS,GAAG,oCAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAM1B,CAAC;CACJ;AATD,gCASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverErrorType, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/** Error indicating an API is being used improperly resulting in an invalid operation. */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.usageError;\n readonly canRetry = false;\n\n constructor(\n message: string,\n ) {\n super(message, { usageError: true });\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
5
|
+
export { BlobAggregationStorage, SnapshotExtractor } from "./blobAggregationStorage";
|
|
6
|
+
export { BlobCacheStorageService } from "./blobCacheStorageService";
|
|
7
|
+
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
8
|
+
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
9
|
+
export { EmptyDocumentDeltaStorageService } from "./emptyDocumentDeltaStorageService";
|
|
10
|
+
export { UsageError } from "./error";
|
|
11
|
+
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
|
12
|
+
export { InsecureUrlResolver } from "./insecureUrlResolver";
|
|
13
|
+
export { canBeCoalescedByService, isRuntimeMessage, isUnpackedRuntimeMessage, MessageType2, } from "./messageRecognition";
|
|
14
|
+
export { MultiDocumentServiceFactory } from "./multiDocumentServiceFactory";
|
|
15
|
+
export { configurableUrlResolver, MultiUrlResolver } from "./multiUrlResolver";
|
|
16
|
+
export { AuthorizationError, canRetryOnError, createGenericNetworkError, createWriteError, DeltaStreamConnectionForbiddenError, DriverErrorTelemetryProps, FluidInvalidSchemaError, GenericNetworkError, getRetryDelayFromError, getRetryDelaySecondsFromError, IAnyDriverError, isOnline, LocationRedirectionError, NetworkErrorBasic, NonRetryableError, OnlineStatus, RetryableError, ThrottlingError, } from "./network";
|
|
17
|
+
export { logNetworkFailure, waitForConnectedState } from "./networkUtils";
|
|
18
|
+
export { emptyMessageStream, ParallelRequests, Queue, requestOps, streamFromMessages, streamObserver, } from "./parallelRequests";
|
|
19
|
+
export { PrefetchDocumentStorageService } from "./prefetchDocumentStorageService";
|
|
20
|
+
export { RateLimiter } from "./rateLimiter";
|
|
21
|
+
export { readAndParse } from "./readAndParse";
|
|
22
|
+
export { IProgress, runWithRetry } from "./runWithRetry";
|
|
23
|
+
export { combineAppAndProtocolSummary, getDocAttributesFromProtocolSummary, getQuorumValuesFromProtocolSummary, } from "./summaryForCreateNew";
|
|
24
|
+
export { convertSummaryTreeToSnapshotITree } from "./treeConversions";
|
|
25
|
+
export { convertSnapshotAndBlobsToSummaryTree, ISummaryTreeAssemblerProps, SummaryTreeAssembler } from "./treeUtils";
|
|
26
26
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACN,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,eAAe,EACf,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACN,4BAA4B,EAC5B,mCAAmC,EACnC,kCAAkC,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,oCAAoC,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,36 +3,79 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
7
|
+
exports.convertSnapshotAndBlobsToSummaryTree = exports.convertSummaryTreeToSnapshotITree = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.combineAppAndProtocolSummary = exports.runWithRetry = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.waitForConnectedState = 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.MultiUrlResolver = exports.configurableUrlResolver = exports.MultiDocumentServiceFactory = exports.MessageType2 = exports.isUnpackedRuntimeMessage = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.isFluidResolvedUrl = exports.ensureFluidResolvedUrl = exports.UsageError = exports.EmptyDocumentDeltaStorageService = exports.DocumentStorageServiceProxy = exports.buildSnapshotTree = exports.BlobCacheStorageService = exports.SnapshotExtractor = exports.BlobAggregationStorage = void 0;
|
|
8
|
+
exports.SummaryTreeAssembler = void 0;
|
|
9
|
+
var blobAggregationStorage_1 = require("./blobAggregationStorage");
|
|
10
|
+
Object.defineProperty(exports, "BlobAggregationStorage", { enumerable: true, get: function () { return blobAggregationStorage_1.BlobAggregationStorage; } });
|
|
11
|
+
Object.defineProperty(exports, "SnapshotExtractor", { enumerable: true, get: function () { return blobAggregationStorage_1.SnapshotExtractor; } });
|
|
12
|
+
var blobCacheStorageService_1 = require("./blobCacheStorageService");
|
|
13
|
+
Object.defineProperty(exports, "BlobCacheStorageService", { enumerable: true, get: function () { return blobCacheStorageService_1.BlobCacheStorageService; } });
|
|
14
|
+
var buildSnapshotTree_1 = require("./buildSnapshotTree");
|
|
15
|
+
Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_1.buildSnapshotTree; } });
|
|
16
|
+
var documentStorageServiceProxy_1 = require("./documentStorageServiceProxy");
|
|
17
|
+
Object.defineProperty(exports, "DocumentStorageServiceProxy", { enumerable: true, get: function () { return documentStorageServiceProxy_1.DocumentStorageServiceProxy; } });
|
|
18
|
+
var emptyDocumentDeltaStorageService_1 = require("./emptyDocumentDeltaStorageService");
|
|
19
|
+
Object.defineProperty(exports, "EmptyDocumentDeltaStorageService", { enumerable: true, get: function () { return emptyDocumentDeltaStorageService_1.EmptyDocumentDeltaStorageService; } });
|
|
20
|
+
var error_1 = require("./error");
|
|
21
|
+
Object.defineProperty(exports, "UsageError", { enumerable: true, get: function () { return error_1.UsageError; } });
|
|
22
|
+
var fluidResolvedUrl_1 = require("./fluidResolvedUrl");
|
|
23
|
+
Object.defineProperty(exports, "ensureFluidResolvedUrl", { enumerable: true, get: function () { return fluidResolvedUrl_1.ensureFluidResolvedUrl; } });
|
|
24
|
+
Object.defineProperty(exports, "isFluidResolvedUrl", { enumerable: true, get: function () { return fluidResolvedUrl_1.isFluidResolvedUrl; } });
|
|
25
|
+
var insecureUrlResolver_1 = require("./insecureUrlResolver");
|
|
26
|
+
Object.defineProperty(exports, "InsecureUrlResolver", { enumerable: true, get: function () { return insecureUrlResolver_1.InsecureUrlResolver; } });
|
|
27
|
+
var messageRecognition_1 = require("./messageRecognition");
|
|
28
|
+
Object.defineProperty(exports, "canBeCoalescedByService", { enumerable: true, get: function () { return messageRecognition_1.canBeCoalescedByService; } });
|
|
29
|
+
Object.defineProperty(exports, "isRuntimeMessage", { enumerable: true, get: function () { return messageRecognition_1.isRuntimeMessage; } });
|
|
30
|
+
Object.defineProperty(exports, "isUnpackedRuntimeMessage", { enumerable: true, get: function () { return messageRecognition_1.isUnpackedRuntimeMessage; } });
|
|
31
|
+
Object.defineProperty(exports, "MessageType2", { enumerable: true, get: function () { return messageRecognition_1.MessageType2; } });
|
|
32
|
+
var multiDocumentServiceFactory_1 = require("./multiDocumentServiceFactory");
|
|
33
|
+
Object.defineProperty(exports, "MultiDocumentServiceFactory", { enumerable: true, get: function () { return multiDocumentServiceFactory_1.MultiDocumentServiceFactory; } });
|
|
34
|
+
var multiUrlResolver_1 = require("./multiUrlResolver");
|
|
35
|
+
Object.defineProperty(exports, "configurableUrlResolver", { enumerable: true, get: function () { return multiUrlResolver_1.configurableUrlResolver; } });
|
|
36
|
+
Object.defineProperty(exports, "MultiUrlResolver", { enumerable: true, get: function () { return multiUrlResolver_1.MultiUrlResolver; } });
|
|
37
|
+
var network_1 = require("./network");
|
|
38
|
+
Object.defineProperty(exports, "AuthorizationError", { enumerable: true, get: function () { return network_1.AuthorizationError; } });
|
|
39
|
+
Object.defineProperty(exports, "canRetryOnError", { enumerable: true, get: function () { return network_1.canRetryOnError; } });
|
|
40
|
+
Object.defineProperty(exports, "createGenericNetworkError", { enumerable: true, get: function () { return network_1.createGenericNetworkError; } });
|
|
41
|
+
Object.defineProperty(exports, "createWriteError", { enumerable: true, get: function () { return network_1.createWriteError; } });
|
|
42
|
+
Object.defineProperty(exports, "DeltaStreamConnectionForbiddenError", { enumerable: true, get: function () { return network_1.DeltaStreamConnectionForbiddenError; } });
|
|
43
|
+
Object.defineProperty(exports, "FluidInvalidSchemaError", { enumerable: true, get: function () { return network_1.FluidInvalidSchemaError; } });
|
|
44
|
+
Object.defineProperty(exports, "GenericNetworkError", { enumerable: true, get: function () { return network_1.GenericNetworkError; } });
|
|
45
|
+
Object.defineProperty(exports, "getRetryDelayFromError", { enumerable: true, get: function () { return network_1.getRetryDelayFromError; } });
|
|
46
|
+
Object.defineProperty(exports, "getRetryDelaySecondsFromError", { enumerable: true, get: function () { return network_1.getRetryDelaySecondsFromError; } });
|
|
47
|
+
Object.defineProperty(exports, "isOnline", { enumerable: true, get: function () { return network_1.isOnline; } });
|
|
48
|
+
Object.defineProperty(exports, "LocationRedirectionError", { enumerable: true, get: function () { return network_1.LocationRedirectionError; } });
|
|
49
|
+
Object.defineProperty(exports, "NetworkErrorBasic", { enumerable: true, get: function () { return network_1.NetworkErrorBasic; } });
|
|
50
|
+
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return network_1.NonRetryableError; } });
|
|
51
|
+
Object.defineProperty(exports, "OnlineStatus", { enumerable: true, get: function () { return network_1.OnlineStatus; } });
|
|
52
|
+
Object.defineProperty(exports, "RetryableError", { enumerable: true, get: function () { return network_1.RetryableError; } });
|
|
53
|
+
Object.defineProperty(exports, "ThrottlingError", { enumerable: true, get: function () { return network_1.ThrottlingError; } });
|
|
54
|
+
var networkUtils_1 = require("./networkUtils");
|
|
55
|
+
Object.defineProperty(exports, "logNetworkFailure", { enumerable: true, get: function () { return networkUtils_1.logNetworkFailure; } });
|
|
56
|
+
Object.defineProperty(exports, "waitForConnectedState", { enumerable: true, get: function () { return networkUtils_1.waitForConnectedState; } });
|
|
57
|
+
var parallelRequests_1 = require("./parallelRequests");
|
|
58
|
+
Object.defineProperty(exports, "emptyMessageStream", { enumerable: true, get: function () { return parallelRequests_1.emptyMessageStream; } });
|
|
59
|
+
Object.defineProperty(exports, "ParallelRequests", { enumerable: true, get: function () { return parallelRequests_1.ParallelRequests; } });
|
|
60
|
+
Object.defineProperty(exports, "Queue", { enumerable: true, get: function () { return parallelRequests_1.Queue; } });
|
|
61
|
+
Object.defineProperty(exports, "requestOps", { enumerable: true, get: function () { return parallelRequests_1.requestOps; } });
|
|
62
|
+
Object.defineProperty(exports, "streamFromMessages", { enumerable: true, get: function () { return parallelRequests_1.streamFromMessages; } });
|
|
63
|
+
Object.defineProperty(exports, "streamObserver", { enumerable: true, get: function () { return parallelRequests_1.streamObserver; } });
|
|
64
|
+
var prefetchDocumentStorageService_1 = require("./prefetchDocumentStorageService");
|
|
65
|
+
Object.defineProperty(exports, "PrefetchDocumentStorageService", { enumerable: true, get: function () { return prefetchDocumentStorageService_1.PrefetchDocumentStorageService; } });
|
|
66
|
+
var rateLimiter_1 = require("./rateLimiter");
|
|
67
|
+
Object.defineProperty(exports, "RateLimiter", { enumerable: true, get: function () { return rateLimiter_1.RateLimiter; } });
|
|
68
|
+
var readAndParse_1 = require("./readAndParse");
|
|
69
|
+
Object.defineProperty(exports, "readAndParse", { enumerable: true, get: function () { return readAndParse_1.readAndParse; } });
|
|
70
|
+
var runWithRetry_1 = require("./runWithRetry");
|
|
71
|
+
Object.defineProperty(exports, "runWithRetry", { enumerable: true, get: function () { return runWithRetry_1.runWithRetry; } });
|
|
72
|
+
var summaryForCreateNew_1 = require("./summaryForCreateNew");
|
|
73
|
+
Object.defineProperty(exports, "combineAppAndProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.combineAppAndProtocolSummary; } });
|
|
74
|
+
Object.defineProperty(exports, "getDocAttributesFromProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.getDocAttributesFromProtocolSummary; } });
|
|
75
|
+
Object.defineProperty(exports, "getQuorumValuesFromProtocolSummary", { enumerable: true, get: function () { return summaryForCreateNew_1.getQuorumValuesFromProtocolSummary; } });
|
|
76
|
+
var treeConversions_1 = require("./treeConversions");
|
|
77
|
+
Object.defineProperty(exports, "convertSummaryTreeToSnapshotITree", { enumerable: true, get: function () { return treeConversions_1.convertSummaryTreeToSnapshotITree; } });
|
|
78
|
+
var treeUtils_1 = require("./treeUtils");
|
|
79
|
+
Object.defineProperty(exports, "convertSnapshotAndBlobsToSummaryTree", { enumerable: true, get: function () { return treeUtils_1.convertSnapshotAndBlobsToSummaryTree; } });
|
|
80
|
+
Object.defineProperty(exports, "SummaryTreeAssembler", { enumerable: true, get: function () { return treeUtils_1.SummaryTreeAssembler; } });
|
|
38
81
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,mEAAqF;AAA5E,gIAAA,sBAAsB,OAAA;AAAE,2HAAA,iBAAiB,OAAA;AAClD,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,uFAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AACzC,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AACnB,uDAAgF;AAAvE,0HAAA,sBAAsB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AACnD,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAK8B;AAJ7B,6HAAA,uBAAuB,OAAA;AACvB,sHAAA,gBAAgB,OAAA;AAChB,8HAAA,wBAAwB,OAAA;AACxB,kHAAA,YAAY,OAAA;AAEb,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,uDAA+E;AAAtE,2HAAA,uBAAuB,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AAClD,qCAmBmB;AAlBlB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,oHAAA,yBAAyB,OAAA;AACzB,2GAAA,gBAAgB,OAAA;AAChB,8HAAA,mCAAmC,OAAA;AAEnC,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,wHAAA,6BAA6B,OAAA;AAE7B,mGAAA,QAAQ,OAAA;AACR,mHAAA,wBAAwB,OAAA;AACxB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAEhB,+CAA0E;AAAjE,iHAAA,iBAAiB,OAAA;AAAE,qHAAA,qBAAqB,OAAA;AACjD,uDAO4B;AAN3B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAEf,mFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAAyD;AAArC,4GAAA,YAAY,OAAA;AAChC,6DAI+B;AAH9B,mIAAA,4BAA4B,OAAA;AAC5B,0IAAA,mCAAmC,OAAA;AACnC,yIAAA,kCAAkC,OAAA;AAEnC,qDAAsE;AAA7D,oIAAA,iCAAiC,OAAA;AAC1C,yCAAqH;AAA5G,iIAAA,oCAAoC,OAAA;AAA8B,iHAAA,oBAAoB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { BlobAggregationStorage, SnapshotExtractor } from \"./blobAggregationStorage\";\nexport { BlobCacheStorageService } from \"./blobCacheStorageService\";\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { EmptyDocumentDeltaStorageService } from \"./emptyDocumentDeltaStorageService\";\nexport { UsageError } from \"./error\";\nexport { ensureFluidResolvedUrl, isFluidResolvedUrl } from \"./fluidResolvedUrl\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport {\n\tcanBeCoalescedByService,\n\tisRuntimeMessage,\n\tisUnpackedRuntimeMessage,\n\tMessageType2,\n} from \"./messageRecognition\";\nexport { MultiDocumentServiceFactory } from \"./multiDocumentServiceFactory\";\nexport { configurableUrlResolver, MultiUrlResolver } from \"./multiUrlResolver\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tIAnyDriverError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure, waitForConnectedState } 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 { IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tcombineAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\nexport { convertSnapshotAndBlobsToSummaryTree, ISummaryTreeAssemblerProps, SummaryTreeAssembler } from \"./treeUtils\";\n"]}
|
|
@@ -3,22 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* Determines whether or not the message type is one of the following:
|
|
8
|
-
*
|
|
9
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Operation}
|
|
10
|
-
*
|
|
11
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Summarize}
|
|
12
|
-
*
|
|
13
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Propose}
|
|
14
|
-
*
|
|
15
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Reject}
|
|
16
|
-
*
|
|
17
|
-
* - {@link @fluidframework/protocol-definitions#MessageType2.Accept}
|
|
18
|
-
*
|
|
19
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.NoOp}
|
|
20
|
-
*/
|
|
21
|
-
export declare function isClientMessage(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
|
|
22
6
|
/**
|
|
23
7
|
* Tells if message was sent by container runtime
|
|
24
8
|
* @privateRemarks ADO #1385: To be moved to container-definitions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAEhH
|
|
1
|
+
{"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAEhH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;CAAE,GAAG,OAAO,CAEpE;AAYD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAKpF;AAID,oBAAY,YAAY;IACpB,MAAM,WAAW;CACpB;AAGD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GAAG,OAAO,CAItG"}
|
|
@@ -1,42 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canBeCoalescedByService = exports.MessageType2 = exports.isUnpackedRuntimeMessage = exports.isRuntimeMessage =
|
|
3
|
+
exports.canBeCoalescedByService = exports.MessageType2 = exports.isUnpackedRuntimeMessage = exports.isRuntimeMessage = void 0;
|
|
4
4
|
/*!
|
|
5
5
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
6
6
|
* Licensed under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
9
|
-
/**
|
|
10
|
-
* Determines whether or not the message type is one of the following:
|
|
11
|
-
*
|
|
12
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Operation}
|
|
13
|
-
*
|
|
14
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Summarize}
|
|
15
|
-
*
|
|
16
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Propose}
|
|
17
|
-
*
|
|
18
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Reject}
|
|
19
|
-
*
|
|
20
|
-
* - {@link @fluidframework/protocol-definitions#MessageType2.Accept}
|
|
21
|
-
*
|
|
22
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.NoOp}
|
|
23
|
-
*/
|
|
24
|
-
function isClientMessage(message) {
|
|
25
|
-
if (isRuntimeMessage(message)) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
switch (message.type) {
|
|
29
|
-
case protocol_definitions_1.MessageType.Propose:
|
|
30
|
-
case protocol_definitions_1.MessageType.Reject:
|
|
31
|
-
case protocol_definitions_1.MessageType.NoOp:
|
|
32
|
-
case MessageType2.Accept:
|
|
33
|
-
case protocol_definitions_1.MessageType.Summarize:
|
|
34
|
-
return true;
|
|
35
|
-
default:
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.isClientMessage = isClientMessage;
|
|
40
9
|
/**
|
|
41
10
|
* Tells if message was sent by container runtime
|
|
42
11
|
* @privateRemarks ADO #1385: To be moved to container-definitions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+EAAgH;AAEhH
|
|
1
|
+
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+EAAgH;AAEhH;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAA0B;IACvD,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,CAAC;AAClD,CAAC;AAFD,4CAEC;AAED,IAAK,cAQJ;AARD,WAAK,cAAc;IACf,gDAA8B,CAAA;IAC9B,mCAAiB,CAAA;IACjB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,kCAAgB,CAAA;AACpB,CAAC,EARI,cAAc,KAAd,cAAc,QAQlB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,wBAAwB,CAAC,OAAkC;IACvE,IAAK,MAAM,CAAC,MAAM,CAAC,cAAc,CAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACpE,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AALD,4DAKC;AAED,iDAAiD;AACjD,kDAAkD;AAClD,IAAY,YAEX;AAFD,WAAY,YAAY;IACpB,iCAAiB,CAAA;AACrB,CAAC,EAFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAEvB;AAED,mEAAmE;AACnE,SAAgB,uBAAuB,CAAC,OAAqD;IACzF,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AACrF,CAAC;AAJD,0DAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IDocumentMessage, ISequencedDocumentMessage, MessageType } 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 */\nexport function isRuntimeMessage(message: { type: string; }): boolean {\n return message.type === MessageType.Operation;\n}\n\nenum RuntimeMessage {\n FluidDataStoreOp = \"component\",\n Attach = \"attach\",\n ChunkedOp = \"chunkedOp\",\n BlobAttach = \"blobAttach\",\n Rejoin = \"rejoin\",\n Alias = \"alias\",\n Operation = \"op\",\n}\n\n/**\n * Determines whether or not the message type is one of the following: (legacy)\n *\n * - \"component\"\n *\n * - \"attach\"\n *\n * - \"chunkedOp\"\n *\n * - \"blobAttach\"\n *\n * - \"rejoin\"\n *\n * - \"alias\"\n *\n * - \"op\"\n *\n * @deprecated This API should not be used.\n */\nexport function isUnpackedRuntimeMessage(message: ISequencedDocumentMessage): boolean {\n if ((Object.values(RuntimeMessage) as string[]).includes(message.type)) {\n return true;\n }\n return false;\n}\n\n// ADO #1385: staging code changes across layers.\n// Eventually to be replaced by MessageType.accept\nexport enum MessageType2 {\n Accept = \"accept\",\n}\n\n// ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\nexport function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean {\n // This assumes that in the future relay service may implement coalescing of accept messages,\n // same way it was doing coalescing of immediate noops in the past.\n return message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
|
package/dist/network.d.ts
CHANGED
|
@@ -19,7 +19,10 @@ export declare function isOnline(): OnlineStatus;
|
|
|
19
19
|
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
20
20
|
* It will be either DriverErrorType or the specific driver's specialized error type enum,
|
|
21
21
|
* but we can't reference a specific driver's error type enum in this code.
|
|
22
|
-
|
|
22
|
+
*
|
|
23
|
+
* @deprecated - In favour of {@link @fluidframework/driver-definitions#IAnyDriverError} so that
|
|
24
|
+
* it can used from the base to upper layers.
|
|
25
|
+
*/
|
|
23
26
|
export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
24
27
|
readonly errorType: string;
|
|
25
28
|
}
|
|
@@ -35,9 +38,17 @@ export declare class GenericNetworkError extends LoggingError implements IDriver
|
|
|
35
38
|
readonly errorType = DriverErrorType.genericNetworkError;
|
|
36
39
|
constructor(message: string, canRetry: boolean, props: DriverErrorTelemetryProps);
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
/**
|
|
42
|
+
* FluidInvalidSchema error class.
|
|
43
|
+
*/
|
|
44
|
+
export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
45
|
+
readonly errorType = DriverErrorType.fluidInvalidSchema;
|
|
46
|
+
readonly canRetry = false;
|
|
47
|
+
constructor(message: string, props: DriverErrorTelemetryProps);
|
|
48
|
+
}
|
|
49
|
+
export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
50
|
+
static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
51
|
+
readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
41
52
|
readonly canRetry = false;
|
|
42
53
|
constructor(message: string, props: DriverErrorTelemetryProps);
|
|
43
54
|
}
|
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,EACH,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAA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.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var _a;
|
|
7
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getRetryDelayFromError = exports.getRetryDelaySecondsFromError = exports.canRetryOnError = exports.createGenericNetworkError = exports.createWriteError = exports.ThrottlingError = exports.RetryableError = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.AuthorizationError = exports.DeltaStreamConnectionForbiddenError = exports.GenericNetworkError = exports.isOnline = exports.OnlineStatus = void 0;
|
|
7
|
+
exports.getRetryDelayFromError = exports.getRetryDelaySecondsFromError = exports.canRetryOnError = exports.createGenericNetworkError = exports.createWriteError = exports.ThrottlingError = exports.RetryableError = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.AuthorizationError = exports.DeltaStreamConnectionForbiddenError = exports.FluidInvalidSchemaError = exports.GenericNetworkError = exports.isOnline = exports.OnlineStatus = void 0;
|
|
9
8
|
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
10
9
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
11
10
|
var OnlineStatus;
|
|
@@ -35,12 +34,17 @@ class GenericNetworkError extends telemetry_utils_1.LoggingError {
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
exports.GenericNetworkError = GenericNetworkError;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
/**
|
|
38
|
+
* FluidInvalidSchema error class.
|
|
39
|
+
*/
|
|
40
|
+
class FluidInvalidSchemaError extends telemetry_utils_1.LoggingError {
|
|
41
|
+
constructor(message, props) {
|
|
42
|
+
super(message, props);
|
|
43
|
+
this.errorType = driver_definitions_1.DriverErrorType.fluidInvalidSchema;
|
|
44
|
+
this.canRetry = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.FluidInvalidSchemaError = FluidInvalidSchemaError;
|
|
44
48
|
class DeltaStreamConnectionForbiddenError extends telemetry_utils_1.LoggingError {
|
|
45
49
|
constructor(message, props) {
|
|
46
50
|
super(message, Object.assign(Object.assign({}, props), { statusCode: 400 }));
|
|
@@ -49,7 +53,7 @@ class DeltaStreamConnectionForbiddenError extends telemetry_utils_1.LoggingError
|
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
exports.DeltaStreamConnectionForbiddenError = DeltaStreamConnectionForbiddenError;
|
|
52
|
-
DeltaStreamConnectionForbiddenError.errorType =
|
|
56
|
+
DeltaStreamConnectionForbiddenError.errorType = driver_definitions_1.DriverErrorType.deltaStreamConnectionForbidden;
|
|
53
57
|
class AuthorizationError extends telemetry_utils_1.LoggingError {
|
|
54
58
|
constructor(message, claims, tenantId, props) {
|
|
55
59
|
// don't log claims or tenantId
|
package/dist/network.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,2EAO4C;AAE5C,qEAAgF;AAEhF,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACX,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,mFAAmF;AACnF,+EAA+E;AAC/E,6DAA6D;AAC7D,SAAgB,QAAQ;IACpB,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EAAE;QAC9F,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;KACxE;IACD,OAAO,YAAY,CAAC,OAAO,CAAC;AAChC,CAAC;AALD,4BAKC;AAkBD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,8BAAY;IAGjD,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;AAEtE,SAAgB,yBAAyB,CACrC,OAAe,EACf,SAAwD,EACxD,KAAgC;IAEhC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE;QAC5D,OAAO,IAAI,eAAe,CACtB,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KACtD;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACvE,CAAC;AAVD,8DAUC;AAED;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,IAAI,CAAC;AAApE,QAAA,eAAe,mBAAqD;AAEjF,gDAAgD;AACzC,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AADtC,QAAA,6BAA6B,iCACS;AAEnD,kEAAkE;AAC3D,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,MAAK,SAAS,CAAC,CAAC;IAC9G,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADlC,QAAA,sBAAsB,0BACY","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IThrottlingWarning,\n IDriverErrorBase,\n IAuthorizationError,\n DriverErrorType,\n ILocationRedirectionError,\n IResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\nexport enum OnlineStatus {\n Offline,\n Online,\n Unknown,\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\")\nexport function isOnline(): OnlineStatus {\n if (typeof navigator === \"object\" && navigator !== null && typeof navigator.onLine === \"boolean\") {\n return navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n }\n return OnlineStatus.Unknown;\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\n export interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/** Telemetry props with driver-specific required properties */\nexport type DriverErrorTelemetryProps = ITelemetryProperties & { driverVersion: string | undefined; };\n\n/**\n * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n message: string,\n readonly canRetry: boolean,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\n// Todo GH #6214: Remove after next drive def bump. This is necessary as there is no\n// compatible way to augment an enum, as it can't be optional. So for now\n// we need to duplicate the value here. We likely need to rethink our\n// DriverErrorType strategy so that it supports extension with optional\n// value.\nconst deltaStreamConnectionForbiddenStr = \"deltaStreamConnectionForbidden\";\nexport class DeltaStreamConnectionForbiddenError extends LoggingError implements IFluidErrorBase {\n static readonly errorType: string =\n DriverErrorType[deltaStreamConnectionForbiddenStr] ?? deltaStreamConnectionForbiddenStr;\n readonly errorType: string = DeltaStreamConnectionForbiddenError.errorType;\n readonly canRetry = false;\n\n constructor(message: string, props: DriverErrorTelemetryProps) {\n super(message, { ...props, statusCode: 400 });\n }\n}\n\nexport class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {\n readonly errorType = DriverErrorType.authorizationError;\n readonly canRetry = false;\n\n constructor(\n message: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props: DriverErrorTelemetryProps,\n ) {\n // don't log claims or tenantId\n super(message, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {\n readonly errorType = DriverErrorType.locationRedirection;\n readonly canRetry = false;\n\n constructor(\n message: string,\n readonly redirectUrl: IResolvedUrl,\n props: DriverErrorTelemetryProps,\n ) {\n // do not log redirectURL\n super(message, props, new Set([\"redirectUrl\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n constructor(\n message: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n message: string,\n readonly errorType: T,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n message: string,\n readonly errorType: T,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, errorType, true, props);\n }\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n readonly errorType = DriverErrorType.throttlingError;\n readonly canRetry = true;\n\n constructor(\n message: string,\n readonly retryAfterSeconds: number,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n new NonRetryableError(message, DriverErrorType.writeError, props);\n\nexport function createGenericNetworkError(\n message: string,\n retryInfo: { canRetry: boolean; retryAfterMs?: number; },\n props: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n if (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n return new ThrottlingError(\n message, retryInfo.retryAfterMs / 1000, props);\n }\n return 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 */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/** Check retryAfterSeconds property on error */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\n/** Check retryAfterSeconds property on error and convert to ms */\nexport const getRetryDelayFromError = (error: any): number | undefined => error?.retryAfterSeconds !== undefined ?\n error.retryAfterSeconds * 1000 : undefined;\n"]}
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAO4C;AAE5C,qEAAgF;AAEhF,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACX,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,mFAAmF;AACnF,+EAA+E;AAC/E,6DAA6D;AAC7D,SAAgB,QAAQ;IACpB,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EAAE;QAC9F,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;KACxE;IACD,OAAO,YAAY,CAAC,OAAO,CAAC;AAChC,CAAC;AALD,4BAKC;AAqBD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,8BAAY;IAGjD,YACI,OAAe,EACN,QAAiB,EAC1B,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,aAAQ,GAAR,QAAQ,CAAS;QAJrB,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,CACrC,OAAe,EACf,SAAwD,EACxD,KAAgC;IAEhC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE;QAC5D,OAAO,IAAI,eAAe,CACtB,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KACtD;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACvE,CAAC;AAVD,8DAUC;AAED;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,IAAI,CAAC;AAApE,QAAA,eAAe,mBAAqD;AAEjF,gDAAgD;AACzC,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AADtC,QAAA,6BAA6B,iCACS;AAEnD,kEAAkE;AAC3D,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,MAAK,SAAS,CAAC,CAAC;IAC9G,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADlC,QAAA,sBAAsB,0BACY","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IThrottlingWarning,\n IDriverErrorBase,\n IAuthorizationError,\n DriverErrorType,\n ILocationRedirectionError,\n IResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\nexport enum OnlineStatus {\n Offline,\n Online,\n Unknown,\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\")\nexport function isOnline(): OnlineStatus {\n if (typeof navigator === \"object\" && navigator !== null && typeof navigator.onLine === \"boolean\") {\n return navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n }\n return OnlineStatus.Unknown;\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n *\n * @deprecated - In favour of {@link @fluidframework/driver-definitions#IAnyDriverError} so that\n * it can used from the base to upper layers.\n*/\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/** Telemetry props with driver-specific required properties */\nexport type DriverErrorTelemetryProps = ITelemetryProperties & { driverVersion: string | undefined; };\n\n/**\n * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n message: string,\n readonly canRetry: boolean,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\n/**\n * FluidInvalidSchema error class.\n */\n export class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.fluidInvalidSchema;\n readonly canRetry = false;\n\n constructor(\n message: string,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\nexport class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;\n readonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n readonly canRetry = false;\n\n constructor(message: string, props: DriverErrorTelemetryProps) {\n super(message, { ...props, statusCode: 400 });\n }\n}\n\nexport class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {\n readonly errorType = DriverErrorType.authorizationError;\n readonly canRetry = false;\n\n constructor(\n message: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props: DriverErrorTelemetryProps,\n ) {\n // don't log claims or tenantId\n super(message, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {\n readonly errorType = DriverErrorType.locationRedirection;\n readonly canRetry = false;\n\n constructor(\n message: string,\n readonly redirectUrl: IResolvedUrl,\n props: DriverErrorTelemetryProps,\n ) {\n // do not log redirectURL\n super(message, props, new Set([\"redirectUrl\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n constructor(\n message: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n message: string,\n readonly errorType: T,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n message: string,\n readonly errorType: T,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, errorType, true, props);\n }\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n readonly errorType = DriverErrorType.throttlingError;\n readonly canRetry = true;\n\n constructor(\n message: string,\n readonly retryAfterSeconds: number,\n props: DriverErrorTelemetryProps,\n ) {\n super(message, props);\n }\n}\n\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n new NonRetryableError(message, DriverErrorType.writeError, props);\n\nexport function createGenericNetworkError(\n message: string,\n retryInfo: { canRetry: boolean; retryAfterMs?: number; },\n props: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n if (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n return new ThrottlingError(\n message, retryInfo.retryAfterMs / 1000, props);\n }\n return 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 */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/** Check retryAfterSeconds property on error */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\n/** Check retryAfterSeconds property on error and convert to ms */\nexport const getRetryDelayFromError = (error: any): number | undefined => error?.retryAfterSeconds !== undefined ?\n error.retryAfterSeconds * 1000 : undefined;\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.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.2.3.0.115467";
|
|
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/driver-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-dev.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev.2.3.0.115467";
|
|
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,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,wBAAwB,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.
|
|
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,wBAAwB,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.2.3.0.115467\";\n"]}
|
|
@@ -11,7 +11,7 @@ export declare class PrefetchDocumentStorageService extends DocumentStorageServi
|
|
|
11
11
|
get policies(): {
|
|
12
12
|
caching: LoaderCachingPolicy;
|
|
13
13
|
minBlobSize?: number | undefined;
|
|
14
|
-
maximumCacheDurationMs?:
|
|
14
|
+
maximumCacheDurationMs?: 432000000 | undefined;
|
|
15
15
|
} | undefined;
|
|
16
16
|
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
17
17
|
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
package/lib/error.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { DriverErrorType, IDriverErrorBase } from "@fluidframework/driver-definitions";
|
|
5
6
|
import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
6
7
|
/** Error indicating an API is being used improperly resulting in an invalid operation. */
|
|
7
|
-
export declare class UsageError extends LoggingError implements IFluidErrorBase {
|
|
8
|
-
readonly errorType =
|
|
8
|
+
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
9
|
+
readonly errorType = DriverErrorType.usageError;
|
|
10
|
+
readonly canRetry = false;
|
|
9
11
|
constructor(message: string);
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=error.d.ts.map
|
package/lib/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,qBAAa,UAAW,SAAQ,YAAa,YAAW,eAAe;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IACrF,QAAQ,CAAC,SAAS,8BAA8B;IAChD,QAAQ,CAAC,QAAQ,SAAS;gBAGtB,OAAO,EAAE,MAAM;CAItB"}
|
package/lib/error.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
5
6
|
import { LoggingError } from "@fluidframework/telemetry-utils";
|
|
6
7
|
/** Error indicating an API is being used improperly resulting in an invalid operation. */
|
|
7
8
|
export class UsageError extends LoggingError {
|
|
8
9
|
constructor(message) {
|
|
9
10
|
super(message, { usageError: true });
|
|
10
|
-
this.errorType =
|
|
11
|
+
this.errorType = DriverErrorType.usageError;
|
|
12
|
+
this.canRetry = false;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=error.js.map
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,MAAM,OAAO,UAAW,SAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAoB,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,MAAM,OAAO,UAAW,SAAQ,YAAY;IAIxC,YACI,OAAe;QAEf,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QANhC,cAAS,GAAG,eAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAM1B,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverErrorType, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/** Error indicating an API is being used improperly resulting in an invalid operation. */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.usageError;\n readonly canRetry = false;\n\n constructor(\n message: string,\n ) {\n super(message, { usageError: true });\n }\n}\n"]}
|