@fluidframework/driver-utils 2.0.0-dev-rc.1.0.0.228517 → 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/README.md +1 -1
- package/api-report/driver-utils.api.md +15 -8
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/documentServiceCompressionAdapter.js +4 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
- package/dist/documentServiceProxy.d.ts +3 -2
- package/dist/documentServiceProxy.d.ts.map +1 -1
- package/dist/documentServiceProxy.js +3 -1
- package/dist/documentServiceProxy.js.map +1 -1
- package/dist/documentStorageServiceProxy.d.ts +2 -1
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/documentStorageServiceProxy.js +7 -0
- package/dist/documentStorageServiceProxy.js.map +1 -1
- 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.js +1 -3
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/insecureUrlResolver.js +1 -1
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/network.d.ts +11 -8
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +9 -12
- 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/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/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/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 +20 -13
- 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/storageUtils.ts +18 -0
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/src/network.ts
CHANGED
|
@@ -7,8 +7,6 @@ import {
|
|
|
7
7
|
IThrottlingWarning,
|
|
8
8
|
IDriverErrorBase,
|
|
9
9
|
IAuthorizationError,
|
|
10
|
-
// eslint-disable-next-line import/no-deprecated
|
|
11
|
-
DriverErrorType,
|
|
12
10
|
ILocationRedirectionError,
|
|
13
11
|
IResolvedUrl,
|
|
14
12
|
DriverErrorTypes,
|
|
@@ -55,8 +53,10 @@ export type DriverErrorTelemetryProps = ITelemetryProperties & {
|
|
|
55
53
|
* @internal
|
|
56
54
|
*/
|
|
57
55
|
export class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/**
|
|
57
|
+
* {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}
|
|
58
|
+
*/
|
|
59
|
+
readonly errorType = DriverErrorTypes.genericNetworkError;
|
|
60
60
|
|
|
61
61
|
constructor(
|
|
62
62
|
message: string,
|
|
@@ -75,8 +75,7 @@ export class FluidInvalidSchemaError
|
|
|
75
75
|
extends LoggingError
|
|
76
76
|
implements IDriverErrorBase, IFluidErrorBase
|
|
77
77
|
{
|
|
78
|
-
|
|
79
|
-
readonly errorType = DriverErrorType.fluidInvalidSchema;
|
|
78
|
+
readonly errorType = DriverErrorTypes.fluidInvalidSchema;
|
|
80
79
|
readonly canRetry = false;
|
|
81
80
|
|
|
82
81
|
constructor(message: string, props: DriverErrorTelemetryProps) {
|
|
@@ -91,8 +90,7 @@ export class DeltaStreamConnectionForbiddenError
|
|
|
91
90
|
extends LoggingError
|
|
92
91
|
implements IDriverErrorBase, IFluidErrorBase
|
|
93
92
|
{
|
|
94
|
-
|
|
95
|
-
static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
93
|
+
static readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;
|
|
96
94
|
readonly errorType = DeltaStreamConnectionForbiddenError.errorType;
|
|
97
95
|
readonly canRetry = false;
|
|
98
96
|
readonly storageOnlyReason: string | undefined;
|
|
@@ -110,8 +108,7 @@ export class AuthorizationError
|
|
|
110
108
|
extends LoggingError
|
|
111
109
|
implements IAuthorizationError, IFluidErrorBase
|
|
112
110
|
{
|
|
113
|
-
|
|
114
|
-
readonly errorType = DriverErrorType.authorizationError;
|
|
111
|
+
readonly errorType = DriverErrorTypes.authorizationError;
|
|
115
112
|
readonly canRetry = false;
|
|
116
113
|
|
|
117
114
|
constructor(
|
|
@@ -132,8 +129,7 @@ export class LocationRedirectionError
|
|
|
132
129
|
extends LoggingError
|
|
133
130
|
implements ILocationRedirectionError, IFluidErrorBase
|
|
134
131
|
{
|
|
135
|
-
|
|
136
|
-
readonly errorType = DriverErrorType.locationRedirection;
|
|
132
|
+
readonly errorType = DriverErrorTypes.locationRedirection;
|
|
137
133
|
readonly canRetry = false;
|
|
138
134
|
|
|
139
135
|
constructor(
|
|
@@ -191,8 +187,7 @@ export class RetryableError<T extends string> extends NetworkErrorBasic<T> {
|
|
|
191
187
|
* @internal
|
|
192
188
|
*/
|
|
193
189
|
export class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
|
|
194
|
-
|
|
195
|
-
readonly errorType = DriverErrorType.throttlingError;
|
|
190
|
+
readonly errorType = DriverErrorTypes.throttlingError;
|
|
196
191
|
readonly canRetry = true;
|
|
197
192
|
|
|
198
193
|
constructor(
|
package/src/packageVersion.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ISnapshot } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Utility API to check if the type of snapshot contents is `ISnapshot`.
|
|
11
|
+
* @internal
|
|
12
|
+
* @param obj - obj whose type needs to be identified.
|
|
13
|
+
*/
|
|
14
|
+
export function isInstanceOfISnapshot(
|
|
15
|
+
obj: ISnapshotTree | ISnapshot | undefined,
|
|
16
|
+
): obj is ISnapshot {
|
|
17
|
+
return obj !== undefined && "snapshotFormatV" in obj && obj.snapshotFormatV === 1;
|
|
18
|
+
}
|
|
File without changes
|