@fluidframework/driver-utils 2.0.0-dev.1.4.6.106135 → 2.0.0-dev.2.2.0.111723
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 +1 -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
|
@@ -4,37 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IDocumentMessage, ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Determines whether or not the message type is one of the following:
|
|
9
|
-
*
|
|
10
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Operation}
|
|
11
|
-
*
|
|
12
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Summarize}
|
|
13
|
-
*
|
|
14
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Propose}
|
|
15
|
-
*
|
|
16
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.Reject}
|
|
17
|
-
*
|
|
18
|
-
* - {@link @fluidframework/protocol-definitions#MessageType2.Accept}
|
|
19
|
-
*
|
|
20
|
-
* - {@link @fluidframework/protocol-definitions#MessageType.NoOp}
|
|
21
|
-
*/
|
|
22
|
-
export function isClientMessage(message: ISequencedDocumentMessage | IDocumentMessage): boolean {
|
|
23
|
-
if (isRuntimeMessage(message)) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
switch (message.type) {
|
|
27
|
-
case MessageType.Propose:
|
|
28
|
-
case MessageType.Reject:
|
|
29
|
-
case MessageType.NoOp:
|
|
30
|
-
case MessageType2.Accept:
|
|
31
|
-
case MessageType.Summarize:
|
|
32
|
-
return true;
|
|
33
|
-
default:
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
7
|
/**
|
|
39
8
|
* Tells if message was sent by container runtime
|
|
40
9
|
* @privateRemarks ADO #1385: To be moved to container-definitions
|
package/src/network.ts
CHANGED
|
@@ -38,8 +38,11 @@ export function isOnline(): OnlineStatus {
|
|
|
38
38
|
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
39
39
|
* It will be either DriverErrorType or the specific driver's specialized error type enum,
|
|
40
40
|
* but we can't reference a specific driver's error type enum in this code.
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
*
|
|
42
|
+
* @deprecated - In favour of {@link @fluidframework/driver-definitions#IAnyDriverError} so that
|
|
43
|
+
* it can used from the base to upper layers.
|
|
44
|
+
*/
|
|
45
|
+
export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
43
46
|
readonly errorType: string;
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -61,16 +64,24 @@ export class GenericNetworkError extends LoggingError implements IDriverErrorBas
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
/**
|
|
68
|
+
* FluidInvalidSchema error class.
|
|
69
|
+
*/
|
|
70
|
+
export class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
71
|
+
readonly errorType = DriverErrorType.fluidInvalidSchema;
|
|
72
|
+
readonly canRetry = false;
|
|
73
|
+
|
|
74
|
+
constructor(
|
|
75
|
+
message: string,
|
|
76
|
+
props: DriverErrorTelemetryProps,
|
|
77
|
+
) {
|
|
78
|
+
super(message, props);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
83
|
+
static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
84
|
+
readonly errorType = DeltaStreamConnectionForbiddenError.errorType;
|
|
74
85
|
readonly canRetry = false;
|
|
75
86
|
|
|
76
87
|
constructor(message: string, props: DriverErrorTelemetryProps) {
|
package/src/packageVersion.ts
CHANGED