@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.
Files changed (48) hide show
  1. package/.eslintrc.js +1 -1
  2. package/dist/error.d.ts +4 -2
  3. package/dist/error.d.ts.map +1 -1
  4. package/dist/error.js +3 -1
  5. package/dist/error.js.map +1 -1
  6. package/dist/index.d.ts +21 -21
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +74 -31
  9. package/dist/index.js.map +1 -1
  10. package/dist/messageRecognition.d.ts +0 -16
  11. package/dist/messageRecognition.d.ts.map +1 -1
  12. package/dist/messageRecognition.js +1 -32
  13. package/dist/messageRecognition.js.map +1 -1
  14. package/dist/network.d.ts +15 -4
  15. package/dist/network.d.ts.map +1 -1
  16. package/dist/network.js +13 -9
  17. package/dist/network.js.map +1 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.js +1 -1
  20. package/dist/packageVersion.js.map +1 -1
  21. package/dist/prefetchDocumentStorageService.d.ts +1 -1
  22. package/lib/error.d.ts +4 -2
  23. package/lib/error.d.ts.map +1 -1
  24. package/lib/error.js +3 -1
  25. package/lib/error.js.map +1 -1
  26. package/lib/index.d.ts +21 -21
  27. package/lib/index.d.ts.map +1 -1
  28. package/lib/index.js +21 -21
  29. package/lib/index.js.map +1 -1
  30. package/lib/messageRecognition.d.ts +0 -16
  31. package/lib/messageRecognition.d.ts.map +1 -1
  32. package/lib/messageRecognition.js +0 -30
  33. package/lib/messageRecognition.js.map +1 -1
  34. package/lib/network.d.ts +15 -4
  35. package/lib/network.d.ts.map +1 -1
  36. package/lib/network.js +11 -8
  37. package/lib/network.js.map +1 -1
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/lib/prefetchDocumentStorageService.d.ts +1 -1
  42. package/package.json +25 -33
  43. package/prettier.config.cjs +8 -0
  44. package/src/error.ts +4 -2
  45. package/src/index.ts +56 -21
  46. package/src/messageRecognition.ts +0 -31
  47. package/src/network.ts +23 -12
  48. 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
- export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
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
- // Todo GH #6214: Remove after next drive def bump. This is necessary as there is no
65
- // compatible way to augment an enum, as it can't be optional. So for now
66
- // we need to duplicate the value here. We likely need to rethink our
67
- // DriverErrorType strategy so that it supports extension with optional
68
- // value.
69
- const deltaStreamConnectionForbiddenStr = "deltaStreamConnectionForbidden";
70
- export class DeltaStreamConnectionForbiddenError extends LoggingError implements IFluidErrorBase {
71
- static readonly errorType: string =
72
- DriverErrorType[deltaStreamConnectionForbiddenStr] ?? deltaStreamConnectionForbiddenStr;
73
- readonly errorType: string = DeltaStreamConnectionForbiddenError.errorType;
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) {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-utils";
9
- export const pkgVersion = "2.0.0-dev.1.4.6.106135";
9
+ export const pkgVersion = "2.0.0-dev.2.2.0.111723";