@fluidframework/driver-utils 0.47.0-35961 → 0.47.1

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/dist/network.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { IThrottlingWarning, IDriverErrorBase, IAuthorizationError, DriverErrorType } from "@fluidframework/driver-definitions";
6
6
  import { ITelemetryProperties } from "@fluidframework/common-definitions";
7
- import { LoggingError } from "@fluidframework/telemetry-utils";
7
+ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
8
8
  export declare enum OnlineStatus {
9
9
  Offline = 0,
10
10
  Online = 1,
@@ -14,48 +14,53 @@ export declare function isOnline(): OnlineStatus;
14
14
  /**
15
15
  * Generic network error class.
16
16
  */
17
- export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase {
17
+ export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
18
+ readonly fluidErrorCode: string;
18
19
  readonly canRetry: boolean;
19
20
  readonly errorType = DriverErrorType.genericNetworkError;
20
- constructor(errorMessage: string, canRetry: boolean, props?: ITelemetryProperties);
21
+ constructor(fluidErrorCode: string, canRetry: boolean, props?: ITelemetryProperties);
21
22
  }
22
- export declare class DeltaStreamConnectionForbiddenError extends LoggingError {
23
+ export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IFluidErrorBase {
24
+ readonly fluidErrorCode: string;
23
25
  static readonly errorType: string;
24
26
  readonly errorType: string;
25
27
  readonly canRetry = false;
26
- constructor(errorMessage: string);
28
+ constructor(fluidErrorCode: string);
27
29
  }
28
- export declare class AuthorizationError extends LoggingError implements IAuthorizationError {
30
+ export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
31
+ readonly fluidErrorCode: string;
29
32
  readonly claims: string | undefined;
30
33
  readonly tenantId: string | undefined;
31
34
  readonly errorType = DriverErrorType.authorizationError;
32
35
  readonly canRetry = false;
33
- constructor(errorMessage: string, claims: string | undefined, tenantId: string | undefined, props?: ITelemetryProperties);
36
+ constructor(fluidErrorCode: string, claims: string | undefined, tenantId: string | undefined, props?: ITelemetryProperties);
34
37
  }
35
- export declare class NetworkErrorBasic<T extends string> extends LoggingError {
38
+ export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
39
+ readonly fluidErrorCode: string;
36
40
  readonly errorType: T;
37
41
  readonly canRetry: boolean;
38
- constructor(errorMessage: string, errorType: T, canRetry: boolean, props?: ITelemetryProperties);
42
+ constructor(fluidErrorCode: string, errorType: T, canRetry: boolean, props?: ITelemetryProperties);
39
43
  }
40
44
  export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
41
45
  readonly errorType: T;
42
- constructor(errorMessage: string, errorType: T, props?: ITelemetryProperties);
46
+ constructor(fluidErrorCode: string, errorType: T, props?: ITelemetryProperties);
43
47
  }
44
48
  export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
45
49
  readonly errorType: T;
46
- constructor(errorMessage: string, errorType: T, props?: ITelemetryProperties);
50
+ constructor(fluidErrorCode: string, errorType: T, props?: ITelemetryProperties);
47
51
  }
48
52
  /**
49
53
  * Throttling error class - used to communicate all throttling errors
50
54
  */
51
- export declare class ThrottlingError extends LoggingError implements IThrottlingWarning {
55
+ export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
56
+ readonly fluidErrorCode: string;
52
57
  readonly retryAfterSeconds: number;
53
58
  readonly errorType = DriverErrorType.throttlingError;
54
59
  readonly canRetry = true;
55
- constructor(errorMessage: string, retryAfterSeconds: number, props?: ITelemetryProperties);
60
+ constructor(fluidErrorCode: string, retryAfterSeconds: number, props?: ITelemetryProperties);
56
61
  }
57
62
  export declare const createWriteError: (errorMessage: string) => NonRetryableError<DriverErrorType.writeError>;
58
- export declare function createGenericNetworkError(errorMessage: string, canRetry: boolean, retryAfterMs?: number, props?: ITelemetryProperties): ThrottlingError | GenericNetworkError;
63
+ export declare function createGenericNetworkError(fluidErrorCode: string, canRetry: boolean, retryAfterMs?: number, props?: ITelemetryProperties): ThrottlingError | GenericNetworkError;
59
64
  /**
60
65
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
61
66
  * I.e. asserts or unexpected exceptions in our code result in container failure.
@@ -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,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,oBAAY,YAAY;IACpB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,OAAO,IAAA;CACV;AAKD,wBAAgB,QAAQ,IAAI,YAAY,CAMvC;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,gBAAgB;IAKzE,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAJ9B,QAAQ,CAAC,SAAS,uCAAuC;gBAGrD,YAAY,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,EAC1B,KAAK,CAAC,EAAE,oBAAoB;CAInC;AAQD,qBAAa,mCAAoC,SAAQ,YAAY;IACjE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAC2D;IAC5F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAiD;IAC3E,QAAQ,CAAC,QAAQ,SAAS;gBAEd,YAAY,EAAE,MAAM;CAGnC;AAED,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAM3E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IANzC,QAAQ,CAAC,SAAS,sCAAsC;IACxD,QAAQ,CAAC,QAAQ,SAAS;gBAGtB,Y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,EAAE,MAAM;IALtC,QAAQ,CAAC,SAAS,mCAAmC;IACrD,QAAQ,CAAC,QAAQ,QAAQ;gBAGZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,oBAAoB;CAInC;AAED,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,kDACc,CAAC;AAEpE,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,OAAO,EACjB,YAAY,CAAC,EAAE,MAAM,EACrB,KAAK,CAAC,EAAE,oBAAoB,GAC7B,eAAe,GAAG,mBAAmB,CAKvC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAW,GAAG,KAAG,OAAmC,CAAC;AAEjF,eAAO,MAAM,6BAA6B,UAAW,GAAG,KAAG,MAAM,GAAG,SAClB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,UAAW,GAAG,KAAG,MAAM,GAAG,SACf,CAAC"}
package/dist/network.js CHANGED
@@ -29,8 +29,9 @@ exports.isOnline = isOnline;
29
29
  * Generic network error class.
30
30
  */
31
31
  class GenericNetworkError extends telemetry_utils_1.LoggingError {
32
- constructor(errorMessage, canRetry, props) {
33
- super(errorMessage, props);
32
+ constructor(fluidErrorCode, canRetry, props) {
33
+ super(fluidErrorCode, props);
34
+ this.fluidErrorCode = fluidErrorCode;
34
35
  this.canRetry = canRetry;
35
36
  this.errorType = driver_definitions_1.DriverErrorType.genericNetworkError;
36
37
  }
@@ -43,8 +44,9 @@ exports.GenericNetworkError = GenericNetworkError;
43
44
  // value.
44
45
  const deltaStreamConnectionForbiddenStr = "deltaStreamConnectionForbidden";
45
46
  class DeltaStreamConnectionForbiddenError extends telemetry_utils_1.LoggingError {
46
- constructor(errorMessage) {
47
- super(errorMessage, { statusCode: 400 });
47
+ constructor(fluidErrorCode) {
48
+ super(fluidErrorCode, { statusCode: 400 });
49
+ this.fluidErrorCode = fluidErrorCode;
48
50
  this.errorType = DeltaStreamConnectionForbiddenError.errorType;
49
51
  this.canRetry = false;
50
52
  }
@@ -52,9 +54,10 @@ class DeltaStreamConnectionForbiddenError extends telemetry_utils_1.LoggingError
52
54
  exports.DeltaStreamConnectionForbiddenError = DeltaStreamConnectionForbiddenError;
53
55
  DeltaStreamConnectionForbiddenError.errorType = (_a = driver_definitions_1.DriverErrorType[deltaStreamConnectionForbiddenStr]) !== null && _a !== void 0 ? _a : deltaStreamConnectionForbiddenStr;
54
56
  class AuthorizationError extends telemetry_utils_1.LoggingError {
55
- constructor(errorMessage, claims, tenantId, props) {
57
+ constructor(fluidErrorCode, claims, tenantId, props) {
56
58
  // don't log claims or tenantId
57
- super(errorMessage, props, new Set(["claims", "tenantId"]));
59
+ super(fluidErrorCode, props, new Set(["claims", "tenantId"]));
60
+ this.fluidErrorCode = fluidErrorCode;
58
61
  this.claims = claims;
59
62
  this.tenantId = tenantId;
60
63
  this.errorType = driver_definitions_1.DriverErrorType.authorizationError;
@@ -63,23 +66,24 @@ class AuthorizationError extends telemetry_utils_1.LoggingError {
63
66
  }
64
67
  exports.AuthorizationError = AuthorizationError;
65
68
  class NetworkErrorBasic extends telemetry_utils_1.LoggingError {
66
- constructor(errorMessage, errorType, canRetry, props) {
67
- super(errorMessage, props);
69
+ constructor(fluidErrorCode, errorType, canRetry, props) {
70
+ super(fluidErrorCode, props);
71
+ this.fluidErrorCode = fluidErrorCode;
68
72
  this.errorType = errorType;
69
73
  this.canRetry = canRetry;
70
74
  }
71
75
  }
72
76
  exports.NetworkErrorBasic = NetworkErrorBasic;
73
77
  class NonRetryableError extends NetworkErrorBasic {
74
- constructor(errorMessage, errorType, props) {
75
- super(errorMessage, errorType, false, props);
78
+ constructor(fluidErrorCode, errorType, props) {
79
+ super(fluidErrorCode, errorType, false, props);
76
80
  this.errorType = errorType;
77
81
  }
78
82
  }
79
83
  exports.NonRetryableError = NonRetryableError;
80
84
  class RetryableError extends NetworkErrorBasic {
81
- constructor(errorMessage, errorType, props) {
82
- super(errorMessage, errorType, true, props);
85
+ constructor(fluidErrorCode, errorType, props) {
86
+ super(fluidErrorCode, errorType, true, props);
83
87
  this.errorType = errorType;
84
88
  }
85
89
  }
@@ -88,8 +92,9 @@ exports.RetryableError = RetryableError;
88
92
  * Throttling error class - used to communicate all throttling errors
89
93
  */
90
94
  class ThrottlingError extends telemetry_utils_1.LoggingError {
91
- constructor(errorMessage, retryAfterSeconds, props) {
92
- super(errorMessage, props);
95
+ constructor(fluidErrorCode, retryAfterSeconds, props) {
96
+ super(fluidErrorCode, props);
97
+ this.fluidErrorCode = fluidErrorCode;
93
98
  this.retryAfterSeconds = retryAfterSeconds;
94
99
  this.errorType = driver_definitions_1.DriverErrorType.throttlingError;
95
100
  this.canRetry = true;
@@ -98,11 +103,11 @@ class ThrottlingError extends telemetry_utils_1.LoggingError {
98
103
  exports.ThrottlingError = ThrottlingError;
99
104
  const createWriteError = (errorMessage) => new NonRetryableError(errorMessage, driver_definitions_1.DriverErrorType.writeError);
100
105
  exports.createWriteError = createWriteError;
101
- function createGenericNetworkError(errorMessage, canRetry, retryAfterMs, props) {
106
+ function createGenericNetworkError(fluidErrorCode, canRetry, retryAfterMs, props) {
102
107
  if (retryAfterMs !== undefined && canRetry) {
103
- return new ThrottlingError(errorMessage, retryAfterMs / 1000, props);
108
+ return new ThrottlingError(fluidErrorCode, retryAfterMs / 1000, props);
104
109
  }
105
- return new GenericNetworkError(errorMessage, canRetry, props);
110
+ return new GenericNetworkError(fluidErrorCode, canRetry, props);
106
111
  }
107
112
  exports.createGenericNetworkError = createGenericNetworkError;
108
113
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,2EAK4C;AAE5C,qEAA+D;AAE/D,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACX,CAAC,EAJW,YAAY,GAAZ,oBAAY,K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AAC,YAAY,EAAE,oCAAe,CAAC,UAAU,CAAC,CAAC;AADvD,QAAA,gBAAgB,oBACuC;AAEpE,SAAgB,yBAAyB,CACrC,YAAoB,EACpB,QAAiB,EACjB,YAAqB,EACrB,KAA4B;IAE5B,IAAI,YAAY,KAAK,SAAS,IAAI,QAAQ,EAAE;QACxC,OAAO,IAAI,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KACxE;IACD,OAAO,IAAI,mBAAmB,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClE,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;AAE1E,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AADtC,QAAA,6BAA6B,iCACS;AAE5C,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} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\nimport { 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 // eslint-disable-next-line no-null/no-null\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 * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n errorMessage: string,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, 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 {\n static readonly errorType: string =\n DriverErrorType[deltaStreamConnectionForbiddenStr] ?? deltaStreamConnectionForbiddenStr;\n readonly errorType: string = DeltaStreamConnectionForbiddenError.errorType;\n readonly canRetry = false;\n\n constructor(errorMessage: string) {\n super(errorMessage, { statusCode: 400 });\n }\n}\n\nexport class AuthorizationError extends LoggingError implements IAuthorizationError {\n readonly errorType = DriverErrorType.authorizationError;\n readonly canRetry = false;\n\n constructor(\n errorMessage: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props?: ITelemetryProperties,\n ) {\n // don't log claims or tenantId\n super(errorMessage, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, 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 {\n readonly errorType = DriverErrorType.throttlingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly retryAfterSeconds: number,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\nexport const createWriteError = (errorMessage: string) =>\n new NonRetryableError(errorMessage, DriverErrorType.writeError);\n\nexport function createGenericNetworkError(\n errorMessage: string,\n canRetry: boolean,\n retryAfterMs?: number,\n props?: ITelemetryProperties,\n): ThrottlingError | GenericNetworkError {\n if (retryAfterMs !== undefined && canRetry) {\n return new ThrottlingError(errorMessage, retryAfterMs / 1000, props);\n }\n return new GenericNetworkError(errorMessage, 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\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\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,2EAK4C;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,mF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;QAC5C,aAAQ,GAAG,IAAI,CAAC;IAQzB,CAAC;CACJ;AAXD,0CAWC;AAEM,MAAM,gBAAgB,GAAG,CAAC,YAAoB,EAAE,EAAE,CACrD,IAAI,iBAAiB,CAAC,YAAY,EAAE,oCAAe,CAAC,UAAU,CAAC,CAAC;AADvD,QAAA,gBAAgB,oBACuC;AAEpE,SAAgB,yBAAyB,CACrC,cAAsB,EACtB,QAAiB,EACjB,YAAqB,EACrB,KAA4B;IAE5B,IAAI,YAAY,KAAK,SAAS,IAAI,QAAQ,EAAE;QACxC,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KAC1E;IACD,OAAO,IAAI,mBAAmB,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpE,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;AAE1E,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AADtC,QAAA,6BAA6B,iCACS;AAE5C,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} 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 // eslint-disable-next-line no-null/no-null\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 * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n readonly fluidErrorCode: string,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, 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(readonly fluidErrorCode: string) {\n super(fluidErrorCode, { 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 readonly fluidErrorCode: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props?: ITelemetryProperties,\n ) {\n // don't log claims or tenantId\n super(fluidErrorCode, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n constructor(\n readonly fluidErrorCode: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n fluidErrorCode: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n fluidErrorCode: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, 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 readonly fluidErrorCode: string,\n readonly retryAfterSeconds: number,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, props);\n }\n}\n\nexport const createWriteError = (errorMessage: string) =>\n new NonRetryableError(errorMessage, DriverErrorType.writeError);\n\nexport function createGenericNetworkError(\n fluidErrorCode: string,\n canRetry: boolean,\n retryAfterMs?: number,\n props?: ITelemetryProperties,\n): ThrottlingError | GenericNetworkError {\n if (retryAfterMs !== undefined && canRetry) {\n return new ThrottlingError(fluidErrorCode, retryAfterMs / 1000, props);\n }\n return new GenericNetworkError(fluidErrorCode, 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\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\nexport const getRetryDelayFromError = (error: any): number | undefined => error?.retryAfterSeconds !== undefined ?\n error.retryAfterSeconds * 1000 : undefined;\n"]}
@@ -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 = "0.47.0-35961";
8
+ export declare const pkgVersion = "0.47.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -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 = "0.47.0-35961";
11
+ exports.pkgVersion = "0.47.1";
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,cAAc,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 = \"0.47.0-35961\";\n"]}
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,QAAQ,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 = \"0.47.1\";\n"]}
package/lib/network.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { IThrottlingWarning, IDriverErrorBase, IAuthorizationError, DriverErrorType } from "@fluidframework/driver-definitions";
6
6
  import { ITelemetryProperties } from "@fluidframework/common-definitions";
7
- import { LoggingError } from "@fluidframework/telemetry-utils";
7
+ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
8
8
  export declare enum OnlineStatus {
9
9
  Offline = 0,
10
10
  Online = 1,
@@ -14,48 +14,53 @@ export declare function isOnline(): OnlineStatus;
14
14
  /**
15
15
  * Generic network error class.
16
16
  */
17
- export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase {
17
+ export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
18
+ readonly fluidErrorCode: string;
18
19
  readonly canRetry: boolean;
19
20
  readonly errorType = DriverErrorType.genericNetworkError;
20
- constructor(errorMessage: string, canRetry: boolean, props?: ITelemetryProperties);
21
+ constructor(fluidErrorCode: string, canRetry: boolean, props?: ITelemetryProperties);
21
22
  }
22
- export declare class DeltaStreamConnectionForbiddenError extends LoggingError {
23
+ export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IFluidErrorBase {
24
+ readonly fluidErrorCode: string;
23
25
  static readonly errorType: string;
24
26
  readonly errorType: string;
25
27
  readonly canRetry = false;
26
- constructor(errorMessage: string);
28
+ constructor(fluidErrorCode: string);
27
29
  }
28
- export declare class AuthorizationError extends LoggingError implements IAuthorizationError {
30
+ export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
31
+ readonly fluidErrorCode: string;
29
32
  readonly claims: string | undefined;
30
33
  readonly tenantId: string | undefined;
31
34
  readonly errorType = DriverErrorType.authorizationError;
32
35
  readonly canRetry = false;
33
- constructor(errorMessage: string, claims: string | undefined, tenantId: string | undefined, props?: ITelemetryProperties);
36
+ constructor(fluidErrorCode: string, claims: string | undefined, tenantId: string | undefined, props?: ITelemetryProperties);
34
37
  }
35
- export declare class NetworkErrorBasic<T extends string> extends LoggingError {
38
+ export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
39
+ readonly fluidErrorCode: string;
36
40
  readonly errorType: T;
37
41
  readonly canRetry: boolean;
38
- constructor(errorMessage: string, errorType: T, canRetry: boolean, props?: ITelemetryProperties);
42
+ constructor(fluidErrorCode: string, errorType: T, canRetry: boolean, props?: ITelemetryProperties);
39
43
  }
40
44
  export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
41
45
  readonly errorType: T;
42
- constructor(errorMessage: string, errorType: T, props?: ITelemetryProperties);
46
+ constructor(fluidErrorCode: string, errorType: T, props?: ITelemetryProperties);
43
47
  }
44
48
  export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
45
49
  readonly errorType: T;
46
- constructor(errorMessage: string, errorType: T, props?: ITelemetryProperties);
50
+ constructor(fluidErrorCode: string, errorType: T, props?: ITelemetryProperties);
47
51
  }
48
52
  /**
49
53
  * Throttling error class - used to communicate all throttling errors
50
54
  */
51
- export declare class ThrottlingError extends LoggingError implements IThrottlingWarning {
55
+ export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
56
+ readonly fluidErrorCode: string;
52
57
  readonly retryAfterSeconds: number;
53
58
  readonly errorType = DriverErrorType.throttlingError;
54
59
  readonly canRetry = true;
55
- constructor(errorMessage: string, retryAfterSeconds: number, props?: ITelemetryProperties);
60
+ constructor(fluidErrorCode: string, retryAfterSeconds: number, props?: ITelemetryProperties);
56
61
  }
57
62
  export declare const createWriteError: (errorMessage: string) => NonRetryableError<DriverErrorType.writeError>;
58
- export declare function createGenericNetworkError(errorMessage: string, canRetry: boolean, retryAfterMs?: number, props?: ITelemetryProperties): ThrottlingError | GenericNetworkError;
63
+ export declare function createGenericNetworkError(fluidErrorCode: string, canRetry: boolean, retryAfterMs?: number, props?: ITelemetryProperties): ThrottlingError | GenericNetworkError;
59
64
  /**
60
65
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
61
66
  * I.e. asserts or unexpected exceptions in our code result in container failure.
@@ -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,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,oBAAY,YAAY;IACpB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,OAAO,IAAA;CACV;AAKD,wBAAgB,QAAQ,IAAI,YAAY,CAMvC;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,gBAAgB;IAKzE,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAJ9B,QAAQ,CAAC,SAAS,uCAAuC;gBAGrD,YAAY,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,EAC1B,KAAK,CAAC,EAAE,oBAAoB;CAInC;AAQD,qBAAa,mCAAoC,SAAQ,YAAY;IACjE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAC2D;IAC5F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAiD;IAC3E,QAAQ,CAAC,QAAQ,SAAS;gBAEd,YAAY,EAAE,MAAM;CAGnC;AAED,qBAAa,kBAAmB,SAAQ,YAAa,YAA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EAAE,CAAC,EACrB,KAAK,CAAC,EAAE,oBAAoB;CAInC;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAa,YAAW,kBAAkB,EAAE,eAAe;IAKxF,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IALtC,QAAQ,CAAC,SAAS,mCAAmC;IACrD,QAAQ,CAAC,QAAQ,QAAQ;gBAGZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,oBAAoB;CAInC;AAED,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,kDACc,CAAC;AAEpE,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,OAAO,EACjB,YAAY,CAAC,EAAE,MAAM,EACrB,KAAK,CAAC,EAAE,oBAAoB,GAC7B,eAAe,GAAG,mBAAmB,CAKvC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAW,GAAG,KAAG,OAAmC,CAAC;AAEjF,eAAO,MAAM,6BAA6B,UAAW,GAAG,KAAG,MAAM,GAAG,SAClB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,UAAW,GAAG,KAAG,MAAM,GAAG,SACf,CAAC"}
package/lib/network.js CHANGED
@@ -25,8 +25,9 @@ export function isOnline() {
25
25
  * Generic network error class.
26
26
  */
27
27
  export class GenericNetworkError extends LoggingError {
28
- constructor(errorMessage, canRetry, props) {
29
- super(errorMessage, props);
28
+ constructor(fluidErrorCode, canRetry, props) {
29
+ super(fluidErrorCode, props);
30
+ this.fluidErrorCode = fluidErrorCode;
30
31
  this.canRetry = canRetry;
31
32
  this.errorType = DriverErrorType.genericNetworkError;
32
33
  }
@@ -38,17 +39,19 @@ export class GenericNetworkError extends LoggingError {
38
39
  // value.
39
40
  const deltaStreamConnectionForbiddenStr = "deltaStreamConnectionForbidden";
40
41
  export class DeltaStreamConnectionForbiddenError extends LoggingError {
41
- constructor(errorMessage) {
42
- super(errorMessage, { statusCode: 400 });
42
+ constructor(fluidErrorCode) {
43
+ super(fluidErrorCode, { statusCode: 400 });
44
+ this.fluidErrorCode = fluidErrorCode;
43
45
  this.errorType = DeltaStreamConnectionForbiddenError.errorType;
44
46
  this.canRetry = false;
45
47
  }
46
48
  }
47
49
  DeltaStreamConnectionForbiddenError.errorType = (_a = DriverErrorType[deltaStreamConnectionForbiddenStr]) !== null && _a !== void 0 ? _a : deltaStreamConnectionForbiddenStr;
48
50
  export class AuthorizationError extends LoggingError {
49
- constructor(errorMessage, claims, tenantId, props) {
51
+ constructor(fluidErrorCode, claims, tenantId, props) {
50
52
  // don't log claims or tenantId
51
- super(errorMessage, props, new Set(["claims", "tenantId"]));
53
+ super(fluidErrorCode, props, new Set(["claims", "tenantId"]));
54
+ this.fluidErrorCode = fluidErrorCode;
52
55
  this.claims = claims;
53
56
  this.tenantId = tenantId;
54
57
  this.errorType = DriverErrorType.authorizationError;
@@ -56,21 +59,22 @@ export class AuthorizationError extends LoggingError {
56
59
  }
57
60
  }
58
61
  export class NetworkErrorBasic extends LoggingError {
59
- constructor(errorMessage, errorType, canRetry, props) {
60
- super(errorMessage, props);
62
+ constructor(fluidErrorCode, errorType, canRetry, props) {
63
+ super(fluidErrorCode, props);
64
+ this.fluidErrorCode = fluidErrorCode;
61
65
  this.errorType = errorType;
62
66
  this.canRetry = canRetry;
63
67
  }
64
68
  }
65
69
  export class NonRetryableError extends NetworkErrorBasic {
66
- constructor(errorMessage, errorType, props) {
67
- super(errorMessage, errorType, false, props);
70
+ constructor(fluidErrorCode, errorType, props) {
71
+ super(fluidErrorCode, errorType, false, props);
68
72
  this.errorType = errorType;
69
73
  }
70
74
  }
71
75
  export class RetryableError extends NetworkErrorBasic {
72
- constructor(errorMessage, errorType, props) {
73
- super(errorMessage, errorType, true, props);
76
+ constructor(fluidErrorCode, errorType, props) {
77
+ super(fluidErrorCode, errorType, true, props);
74
78
  this.errorType = errorType;
75
79
  }
76
80
  }
@@ -78,19 +82,20 @@ export class RetryableError extends NetworkErrorBasic {
78
82
  * Throttling error class - used to communicate all throttling errors
79
83
  */
80
84
  export class ThrottlingError extends LoggingError {
81
- constructor(errorMessage, retryAfterSeconds, props) {
82
- super(errorMessage, props);
85
+ constructor(fluidErrorCode, retryAfterSeconds, props) {
86
+ super(fluidErrorCode, props);
87
+ this.fluidErrorCode = fluidErrorCode;
83
88
  this.retryAfterSeconds = retryAfterSeconds;
84
89
  this.errorType = DriverErrorType.throttlingError;
85
90
  this.canRetry = true;
86
91
  }
87
92
  }
88
93
  export const createWriteError = (errorMessage) => new NonRetryableError(errorMessage, DriverErrorType.writeError);
89
- export function createGenericNetworkError(errorMessage, canRetry, retryAfterMs, props) {
94
+ export function createGenericNetworkError(fluidErrorCode, canRetry, retryAfterMs, props) {
90
95
  if (retryAfterMs !== undefined && canRetry) {
91
- return new ThrottlingError(errorMessage, retryAfterMs / 1000, props);
96
+ return new ThrottlingError(fluidErrorCode, retryAfterMs / 1000, props);
92
97
  }
93
- return new GenericNetworkError(errorMessage, canRetry, props);
98
+ return new GenericNetworkError(fluidErrorCode, canRetry, props);
94
99
  }
95
100
  /**
96
101
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAIH,eAAe,GAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACX,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,mFAAmF;AACnF,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,UAAU,QAAQ;IACpB,2CAA2C;IAC3C,IAAI,OAAO,SAAS,KAAK,QAA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IAAI,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KACxE;IACD,OAAO,IAAI,mBAAmB,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,IAAI,CAAC;AAEjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AAEnD,MAAM,CAAC,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","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} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\nimport { 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 // eslint-disable-next-line no-null/no-null\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 * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n errorMessage: string,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, 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 {\n static readonly errorType: string =\n DriverErrorType[deltaStreamConnectionForbiddenStr] ?? deltaStreamConnectionForbiddenStr;\n readonly errorType: string = DeltaStreamConnectionForbiddenError.errorType;\n readonly canRetry = false;\n\n constructor(errorMessage: string) {\n super(errorMessage, { statusCode: 400 });\n }\n}\n\nexport class AuthorizationError extends LoggingError implements IAuthorizationError {\n readonly errorType = DriverErrorType.authorizationError;\n readonly canRetry = false;\n\n constructor(\n errorMessage: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props?: ITelemetryProperties,\n ) {\n // don't log claims or tenantId\n super(errorMessage, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n errorMessage: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, 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 {\n readonly errorType = DriverErrorType.throttlingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly retryAfterSeconds: number,\n props?: ITelemetryProperties,\n ) {\n super(errorMessage, props);\n }\n}\n\nexport const createWriteError = (errorMessage: string) =>\n new NonRetryableError(errorMessage, DriverErrorType.writeError);\n\nexport function createGenericNetworkError(\n errorMessage: string,\n canRetry: boolean,\n retryAfterMs?: number,\n props?: ITelemetryProperties,\n): ThrottlingError | GenericNetworkError {\n if (retryAfterMs !== undefined && canRetry) {\n return new ThrottlingError(errorMessage, retryAfterMs / 1000, props);\n }\n return new GenericNetworkError(errorMessage, 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\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\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,OAAO,EAIH,eAAe,GAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACX,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,mFAAmF;AACnF,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,UAAU,QAAQ;IACpB,2CAA2C;IAC3C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EAAE;QAC9F,OAAO,SA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EACrB,KAA4B;IAE5B,IAAI,YAAY,KAAK,SAAS,IAAI,QAAQ,EAAE;QACxC,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KAC1E;IACD,OAAO,IAAI,mBAAmB,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,IAAI,CAAC;AAEjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC5E,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAuC,CAAC;AAEnD,MAAM,CAAC,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","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} 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 // eslint-disable-next-line no-null/no-null\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 * Generic network error class.\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n readonly errorType = DriverErrorType.genericNetworkError;\n\n constructor(\n readonly fluidErrorCode: string,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, 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(readonly fluidErrorCode: string) {\n super(fluidErrorCode, { 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 readonly fluidErrorCode: string,\n readonly claims: string | undefined,\n readonly tenantId: string | undefined,\n props?: ITelemetryProperties,\n ) {\n // don't log claims or tenantId\n super(fluidErrorCode, props, new Set([\"claims\", \"tenantId\"]));\n }\n}\n\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n constructor(\n readonly fluidErrorCode: string,\n readonly errorType: T,\n readonly canRetry: boolean,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, props);\n }\n}\n\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n fluidErrorCode: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, errorType, false, props);\n }\n}\n\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n constructor(\n fluidErrorCode: string,\n readonly errorType: T,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, 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 readonly fluidErrorCode: string,\n readonly retryAfterSeconds: number,\n props?: ITelemetryProperties,\n ) {\n super(fluidErrorCode, props);\n }\n}\n\nexport const createWriteError = (errorMessage: string) =>\n new NonRetryableError(errorMessage, DriverErrorType.writeError);\n\nexport function createGenericNetworkError(\n fluidErrorCode: string,\n canRetry: boolean,\n retryAfterMs?: number,\n props?: ITelemetryProperties,\n): ThrottlingError | GenericNetworkError {\n if (retryAfterMs !== undefined && canRetry) {\n return new ThrottlingError(fluidErrorCode, retryAfterMs / 1000, props);\n }\n return new GenericNetworkError(fluidErrorCode, 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\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n error?.retryAfterSeconds as number | undefined;\n\nexport const getRetryDelayFromError = (error: any): number | undefined => error?.retryAfterSeconds !== undefined ?\n error.retryAfterSeconds * 1000 : undefined;\n"]}
@@ -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 = "0.47.0-35961";
8
+ export declare const pkgVersion = "0.47.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-utils";
8
- export const pkgVersion = "0.47.0-35961";
8
+ export const pkgVersion = "0.47.1";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,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 = \"0.47.0-35961\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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 = \"0.47.1\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-utils",
3
- "version": "0.47.0-35961",
3
+ "version": "0.47.1",
4
4
  "description": "Collection of utility functions for Fluid drivers",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -59,17 +59,17 @@
59
59
  "@fluidframework/common-utils": "^0.32.1",
60
60
  "@fluidframework/core-interfaces": "^0.39.7",
61
61
  "@fluidframework/driver-definitions": "^0.39.6",
62
- "@fluidframework/gitresources": "^0.1030.0-0",
63
- "@fluidframework/protocol-base": "^0.1030.0-0",
62
+ "@fluidframework/gitresources": "^0.1030.0",
63
+ "@fluidframework/protocol-base": "^0.1030.0",
64
64
  "@fluidframework/protocol-definitions": "^0.1024.0",
65
- "@fluidframework/telemetry-utils": "0.47.0-35961",
65
+ "@fluidframework/telemetry-utils": "^0.47.1",
66
66
  "uuid": "^8.3.1"
67
67
  },
68
68
  "devDependencies": {
69
- "@fluidframework/build-common": "^0.22.0",
69
+ "@fluidframework/build-common": "^0.23.0",
70
70
  "@fluidframework/eslint-config-fluid": "^0.23.0",
71
- "@fluidframework/mocha-test-setup": "0.47.0-35961",
72
- "@fluidframework/runtime-utils": "0.47.0-35961",
71
+ "@fluidframework/mocha-test-setup": "^0.47.1",
72
+ "@fluidframework/runtime-utils": "^0.47.1",
73
73
  "@microsoft/api-extractor": "^7.16.1",
74
74
  "@types/mocha": "^8.2.2",
75
75
  "@types/node": "^12.19.0",
package/src/network.ts CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  DriverErrorType,
11
11
  } from "@fluidframework/driver-definitions";
12
12
  import { ITelemetryProperties } from "@fluidframework/common-definitions";
13
- import { LoggingError } from "@fluidframework/telemetry-utils";
13
+ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
14
14
 
15
15
  export enum OnlineStatus {
16
16
  Offline,
@@ -32,15 +32,15 @@ export function isOnline(): OnlineStatus {
32
32
  /**
33
33
  * Generic network error class.
34
34
  */
35
- export class GenericNetworkError extends LoggingError implements IDriverErrorBase {
35
+ export class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
36
36
  readonly errorType = DriverErrorType.genericNetworkError;
37
37
 
38
38
  constructor(
39
- errorMessage: string,
39
+ readonly fluidErrorCode: string,
40
40
  readonly canRetry: boolean,
41
41
  props?: ITelemetryProperties,
42
42
  ) {
43
- super(errorMessage, props);
43
+ super(fluidErrorCode, props);
44
44
  }
45
45
  }
46
46
 
@@ -50,76 +50,76 @@ export class GenericNetworkError extends LoggingError implements IDriverErrorBas
50
50
  // DriverErrorType strategy so that it supports extension with optional
51
51
  // value.
52
52
  const deltaStreamConnectionForbiddenStr = "deltaStreamConnectionForbidden";
53
- export class DeltaStreamConnectionForbiddenError extends LoggingError {
53
+ export class DeltaStreamConnectionForbiddenError extends LoggingError implements IFluidErrorBase {
54
54
  static readonly errorType: string =
55
55
  DriverErrorType[deltaStreamConnectionForbiddenStr] ?? deltaStreamConnectionForbiddenStr;
56
56
  readonly errorType: string = DeltaStreamConnectionForbiddenError.errorType;
57
57
  readonly canRetry = false;
58
58
 
59
- constructor(errorMessage: string) {
60
- super(errorMessage, { statusCode: 400 });
59
+ constructor(readonly fluidErrorCode: string) {
60
+ super(fluidErrorCode, { statusCode: 400 });
61
61
  }
62
62
  }
63
63
 
64
- export class AuthorizationError extends LoggingError implements IAuthorizationError {
64
+ export class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
65
65
  readonly errorType = DriverErrorType.authorizationError;
66
66
  readonly canRetry = false;
67
67
 
68
68
  constructor(
69
- errorMessage: string,
69
+ readonly fluidErrorCode: string,
70
70
  readonly claims: string | undefined,
71
71
  readonly tenantId: string | undefined,
72
72
  props?: ITelemetryProperties,
73
73
  ) {
74
74
  // don't log claims or tenantId
75
- super(errorMessage, props, new Set(["claims", "tenantId"]));
75
+ super(fluidErrorCode, props, new Set(["claims", "tenantId"]));
76
76
  }
77
77
  }
78
78
 
79
- export class NetworkErrorBasic<T extends string> extends LoggingError {
79
+ export class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
80
80
  constructor(
81
- errorMessage: string,
81
+ readonly fluidErrorCode: string,
82
82
  readonly errorType: T,
83
83
  readonly canRetry: boolean,
84
84
  props?: ITelemetryProperties,
85
85
  ) {
86
- super(errorMessage, props);
86
+ super(fluidErrorCode, props);
87
87
  }
88
88
  }
89
89
 
90
90
  export class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
91
91
  constructor(
92
- errorMessage: string,
92
+ fluidErrorCode: string,
93
93
  readonly errorType: T,
94
94
  props?: ITelemetryProperties,
95
95
  ) {
96
- super(errorMessage, errorType, false, props);
96
+ super(fluidErrorCode, errorType, false, props);
97
97
  }
98
98
  }
99
99
 
100
100
  export class RetryableError<T extends string> extends NetworkErrorBasic<T> {
101
101
  constructor(
102
- errorMessage: string,
102
+ fluidErrorCode: string,
103
103
  readonly errorType: T,
104
104
  props?: ITelemetryProperties,
105
105
  ) {
106
- super(errorMessage, errorType, true, props);
106
+ super(fluidErrorCode, errorType, true, props);
107
107
  }
108
108
  }
109
109
 
110
110
  /**
111
111
  * Throttling error class - used to communicate all throttling errors
112
112
  */
113
- export class ThrottlingError extends LoggingError implements IThrottlingWarning {
113
+ export class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
114
114
  readonly errorType = DriverErrorType.throttlingError;
115
115
  readonly canRetry = true;
116
116
 
117
117
  constructor(
118
- errorMessage: string,
118
+ readonly fluidErrorCode: string,
119
119
  readonly retryAfterSeconds: number,
120
120
  props?: ITelemetryProperties,
121
121
  ) {
122
- super(errorMessage, props);
122
+ super(fluidErrorCode, props);
123
123
  }
124
124
  }
125
125
 
@@ -127,15 +127,15 @@ export const createWriteError = (errorMessage: string) =>
127
127
  new NonRetryableError(errorMessage, DriverErrorType.writeError);
128
128
 
129
129
  export function createGenericNetworkError(
130
- errorMessage: string,
130
+ fluidErrorCode: string,
131
131
  canRetry: boolean,
132
132
  retryAfterMs?: number,
133
133
  props?: ITelemetryProperties,
134
134
  ): ThrottlingError | GenericNetworkError {
135
135
  if (retryAfterMs !== undefined && canRetry) {
136
- return new ThrottlingError(errorMessage, retryAfterMs / 1000, props);
136
+ return new ThrottlingError(fluidErrorCode, retryAfterMs / 1000, props);
137
137
  }
138
- return new GenericNetworkError(errorMessage, canRetry, props);
138
+ return new GenericNetworkError(fluidErrorCode, canRetry, props);
139
139
  }
140
140
 
141
141
  /**
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-utils";
9
- export const pkgVersion = "0.47.0-35961";
9
+ export const pkgVersion = "0.47.1";