@fluidframework/core-interfaces 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258
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/CHANGELOG.md +87 -0
- package/README.md +4 -3
- package/Removing-IFluidRouter.md +113 -0
- package/dist/disposable.d.ts +21 -0
- package/dist/disposable.d.ts.map +1 -0
- package/dist/disposable.js +7 -0
- package/dist/disposable.js.map +1 -0
- package/dist/error.d.ts +105 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +33 -0
- package/dist/error.js.map +1 -0
- package/dist/events.d.ts +251 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +7 -0
- package/dist/events.js.map +1 -0
- package/dist/fluidLoadable.d.ts.map +1 -1
- package/dist/fluidLoadable.js.map +1 -1
- package/dist/fluidPackage.d.ts +1 -1
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +7 -4
- package/dist/fluidPackage.js.map +1 -1
- package/dist/fluidRouter.d.ts.map +1 -1
- package/dist/fluidRouter.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +164 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +16 -0
- package/dist/logger.js.map +1 -0
- package/dist/provider.d.ts +11 -5
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js.map +1 -1
- package/lib/disposable.d.ts +21 -0
- package/lib/disposable.d.ts.map +1 -0
- package/lib/disposable.js +6 -0
- package/lib/disposable.js.map +1 -0
- package/lib/error.d.ts +105 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +30 -0
- package/lib/error.js.map +1 -0
- package/lib/events.d.ts +251 -0
- package/lib/events.d.ts.map +1 -0
- package/lib/events.js +6 -0
- package/lib/events.js.map +1 -0
- package/lib/fluidLoadable.d.ts.map +1 -1
- package/lib/fluidLoadable.js.map +1 -1
- package/lib/fluidPackage.d.ts +1 -1
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +7 -4
- package/lib/fluidPackage.js.map +1 -1
- package/lib/fluidRouter.d.ts.map +1 -1
- package/lib/fluidRouter.js.map +1 -1
- package/lib/index.d.ts +13 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +164 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +13 -0
- package/lib/logger.js.map +1 -0
- package/lib/provider.d.ts +11 -5
- package/lib/provider.d.ts.map +1 -1
- package/lib/provider.js.map +1 -1
- package/package.json +9 -10
- package/src/disposable.ts +22 -0
- package/src/error.ts +121 -0
- package/src/events.ts +432 -0
- package/src/fluidLoadable.ts +2 -0
- package/src/fluidPackage.ts +5 -2
- package/src/fluidRouter.ts +6 -0
- package/src/index.ts +49 -11
- package/src/logger.ts +196 -0
- package/src/provider.ts +11 -5
package/.eslintrc.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
extends: [require.resolve("@fluidframework/eslint-config-fluid
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
|
|
8
8
|
parserOptions: {
|
|
9
9
|
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
10
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# @fluidframework/core-interfaces
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.6.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Cleaning up duplicate or misnamed telemetry types ([#17149](https://github.com/microsoft/FluidFramework/issues/17149)) [f9236942fa](https://github.com/microsoft/FluidFramework/commits/f9236942faf03cde860bfcbc7c28f8fbd81d3868)
|
|
8
|
+
|
|
9
|
+
We have two sets of telemetry-related interfaces:
|
|
10
|
+
|
|
11
|
+
- The "Base" ones
|
|
12
|
+
- These have a very bare API surface
|
|
13
|
+
- They are used on public API surfaces to transmit logs across layers
|
|
14
|
+
- The internal ones
|
|
15
|
+
- These have a richer API surface (multiple log functions with different categories,
|
|
16
|
+
support for logging flat arrays and objects)
|
|
17
|
+
- They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface
|
|
18
|
+
|
|
19
|
+
There are two problems with the given state of the world:
|
|
20
|
+
|
|
21
|
+
1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
|
|
22
|
+
2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.
|
|
23
|
+
|
|
24
|
+
This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.
|
|
25
|
+
|
|
26
|
+
Additionally, the following types were adjusted:
|
|
27
|
+
|
|
28
|
+
- `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
|
|
29
|
+
- Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
|
|
30
|
+
|
|
31
|
+
## 2.0.0-internal.6.2.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
|
|
36
|
+
|
|
37
|
+
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
38
|
+
imported from the **@fluidframework/core-interfaces** package:
|
|
39
|
+
|
|
40
|
+
- interface IDisposable
|
|
41
|
+
- interface IErrorEvent
|
|
42
|
+
- interface IErrorEvent
|
|
43
|
+
- interface IEvent
|
|
44
|
+
- interface IEventProvider
|
|
45
|
+
- interface ILoggingError
|
|
46
|
+
- interface ITaggedTelemetryPropertyType
|
|
47
|
+
- interface ITelemetryBaseEvent
|
|
48
|
+
- interface ITelemetryBaseLogger
|
|
49
|
+
- interface ITelemetryErrorEvent
|
|
50
|
+
- interface ITelemetryGenericEvent
|
|
51
|
+
- interface ITelemetryLogger
|
|
52
|
+
- interface ITelemetryPerformanceEvent
|
|
53
|
+
- interface ITelemetryProperties
|
|
54
|
+
- type ExtendEventProvider
|
|
55
|
+
- type IEventThisPlaceHolder
|
|
56
|
+
- type IEventTransformer
|
|
57
|
+
- type ReplaceIEventThisPlaceHolder
|
|
58
|
+
- type ReplaceIEventThisPlaceHolder
|
|
59
|
+
- type TelemetryEventCategory
|
|
60
|
+
- type TelemetryEventPropertyType
|
|
61
|
+
|
|
62
|
+
## 2.0.0-internal.6.1.0
|
|
63
|
+
|
|
64
|
+
Dependency updates only.
|
|
65
|
+
|
|
66
|
+
## 2.0.0-internal.6.0.0
|
|
67
|
+
|
|
68
|
+
### Major Changes
|
|
69
|
+
|
|
70
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
71
|
+
|
|
72
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
73
|
+
|
|
74
|
+
## 2.0.0-internal.5.4.0
|
|
75
|
+
|
|
76
|
+
Dependency updates only.
|
|
77
|
+
|
|
78
|
+
## 2.0.0-internal.5.3.0
|
|
79
|
+
|
|
80
|
+
Dependency updates only.
|
|
81
|
+
|
|
82
|
+
## 2.0.0-internal.5.2.0
|
|
83
|
+
|
|
84
|
+
Dependency updates only.
|
|
85
|
+
|
|
86
|
+
## 2.0.0-internal.5.1.0
|
|
87
|
+
|
|
88
|
+
Dependency updates only.
|
|
89
|
+
|
|
3
90
|
## 2.0.0-internal.5.0.0
|
|
4
91
|
|
|
5
92
|
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -15,9 +15,10 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
|
|
|
15
15
|
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
16
16
|
library consumers should always prefer `^`.
|
|
17
17
|
|
|
18
|
-
Note that when depending on a library version of the form 2.0.0-internal.x.y.z
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
19
|
+
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
20
|
+
Standard `^` and `~` ranges will not work as expected.
|
|
21
|
+
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
21
22
|
package for more information including tools to convert between version schemes.
|
|
22
23
|
|
|
23
24
|
<!-- prettier-ignore-end -->
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Removing IFluidRouter
|
|
2
|
+
|
|
3
|
+
The interface `IFluidRouter` is being deprecated and removed over the next several internal releases.
|
|
4
|
+
It exposes a `request` function and is implemented across Fluid Framework's layers to light up the "request pattern"
|
|
5
|
+
for accessing objects out of a Fluid Container.
|
|
6
|
+
The request pattern is incompatible with [Garbage Collection](../../runtime/container-runtime/src/gc/garbageCollection.md),
|
|
7
|
+
so any code that previously accessed an object via request should migrate to using handles instead.
|
|
8
|
+
|
|
9
|
+
This document serves as a "how-to" guide for this migration, and will also include the latest status of the work.
|
|
10
|
+
|
|
11
|
+
## Key Concepts
|
|
12
|
+
|
|
13
|
+
### `IFluidRouter` and `absolutePath`
|
|
14
|
+
|
|
15
|
+
Here's what [`IFluidRouter`](src/fluidRouter.ts) looks like:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
export interface IProvideFluidRouter {
|
|
19
|
+
readonly IFluidRouter: IFluidRouter;
|
|
20
|
+
}
|
|
21
|
+
export interface IFluidRouter extends IProvideFluidRouter {
|
|
22
|
+
request(request: IRequest): Promise<IResponse>;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It uses the Provider pattern so any Fluid Object may be queried for `IFluidRouter` to call `request` on if present.
|
|
27
|
+
|
|
28
|
+
Here's the **deprecated** flow for referencing and accessing an object:
|
|
29
|
+
|
|
30
|
+
1. Store the object's `absolutePath` (a container-relative URL path) in some DDS
|
|
31
|
+
2. Later, load the object via `request({ url: absolutePath })`
|
|
32
|
+
|
|
33
|
+
### `IFluidLoadable` and `IFluidHandle`
|
|
34
|
+
|
|
35
|
+
The new way to reference an object within a Fluid Container is via its `handle`:
|
|
36
|
+
|
|
37
|
+
1. Store the object's `handle` in some DDS
|
|
38
|
+
2. Later, load the object via `handle.get()`
|
|
39
|
+
|
|
40
|
+
### Entry Point
|
|
41
|
+
|
|
42
|
+
`request` has also been used as the way to get at the application-specific Container and DataStore implementations
|
|
43
|
+
starting from native Fluid types like `IContainer` and `IDataStore` - both of which have extended `IFluidRouter`.
|
|
44
|
+
The new way to do this is via the object's "entry point".
|
|
45
|
+
|
|
46
|
+
Here it is on `IContainer`, returning an anonymous `FluidObject` - the application-specified root object:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
getEntryPoint?(): Promise<FluidObject | undefined>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
And here it is on `IDataStore`, returning an `IFluidHandle` to an anonymous `FluidObject` - the DataStore's root object:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
readonly entryPoint?: IFluidHandle<FluidObject>;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
So how does an application specify what the Container or DataStore's entry point is?
|
|
59
|
+
Via a parameter `initializeEntryPoint` that's found on `ContainerRuntime.loadRuntime` and `FluidDataStoreRuntime`'s constructor.
|
|
60
|
+
|
|
61
|
+
### ILoader request pattern
|
|
62
|
+
|
|
63
|
+
The `request` API (associated with the `IFluidRouter` interface) has been deprecated on `ILoader` and `Loader`.
|
|
64
|
+
|
|
65
|
+
**Note:** The `IContainer.request(...)` method will be deprecated in an upcoming release, so do not rely on this method for a long-term solution (the APIs around `entryPoint` and `getEntryPoint()` will become required and available for usage in its place).
|
|
66
|
+
|
|
67
|
+
After calling `ILoader.resolve(...)`, call the `request(...)` method on the returned `IContainer` with a corresponding request URL. For converting a request URL from `Loader` to `Container`, use the `IUrlResolver` passed into the `Loader`'s constructor.
|
|
68
|
+
The following is an example of what this change may look like:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
// OLD
|
|
72
|
+
const request: IRequest;
|
|
73
|
+
const urlResolver = new YourUrlResolver();
|
|
74
|
+
const loader = new Loader({ urlResolver, ... });
|
|
75
|
+
|
|
76
|
+
await loader.resolve(request);
|
|
77
|
+
const response = loader.request(request);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
// NEW
|
|
82
|
+
const request: IRequest;
|
|
83
|
+
const urlResolver = new YourUrlResolver();
|
|
84
|
+
const loader = new Loader({ urlResolver, ... });
|
|
85
|
+
|
|
86
|
+
const container = await loader.resolve(request);
|
|
87
|
+
const resolvedUrl: IRequest = urlResolver.resolve(request);
|
|
88
|
+
|
|
89
|
+
// Parse the `resolvedUrl.url` property as necessary before passing to `container.request(...)`
|
|
90
|
+
// For an example, see the `Loader.resolveCore(...)` method
|
|
91
|
+
const parsedResolvedUrl = // implement parse logic here
|
|
92
|
+
const response = container.request(parsedResolvedUrl);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Aliased DataStores
|
|
96
|
+
|
|
97
|
+
(Not yet written)
|
|
98
|
+
|
|
99
|
+
## Status
|
|
100
|
+
|
|
101
|
+
<!-- prettier-ignore-start -->
|
|
102
|
+
| API | Deprecated in | Removed in |
|
|
103
|
+
| ------------------------------------------------------------------------------------ | -------------------- | -------------------- |
|
|
104
|
+
| `IContainer.request` (except calling with "/") | 2.0.0-internal.6.0.0 | |
|
|
105
|
+
| `IDataStore.request` (except calling with "/") | 2.0.0-internal.6.0.0 | |
|
|
106
|
+
| `IContainer.IFluidRouter` | 2.0.0-internal.6.0.0 | |
|
|
107
|
+
| `IDataStore.IFluidRouter` | 2.0.0-internal.6.0.0 | |
|
|
108
|
+
| `request` and `IFluidRouter` on `ILoader` and `Loader` | 2.0.0-internal.6.0.0 | |
|
|
109
|
+
| `request` and `IFluidRouter` on `IRuntime` and `ContainerRuntime` | 2.0.0-internal.6.0.0 | |
|
|
110
|
+
| `request` and `IFluidRouter` on `IFluidDataStoreRuntime` and `FluidDataStoreRuntime` | 2.0.0-internal.6.0.0 | |
|
|
111
|
+
| `request` and `IFluidRouter` on `IFluidDataStoreChannel` | 2.0.0-internal.6.0.0 | |
|
|
112
|
+
| `getRootDataStore` on `IContainerRuntime` and `ContainerRuntime` | 2.0.0-internal.6.0.0 | |
|
|
113
|
+
<!-- prettier-ignore-end -->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base interface for objects that require lifetime management via explicit disposal.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDisposable {
|
|
9
|
+
/**
|
|
10
|
+
* Whether or not the object has been disposed.
|
|
11
|
+
* If true, the object should be considered invalid, and its other state should be disregarded.
|
|
12
|
+
*/
|
|
13
|
+
readonly disposed: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Dispose of the object and its resources.
|
|
16
|
+
* @param error - Optional error indicating the reason for the disposal, if the object was
|
|
17
|
+
* disposed as the result of an error.
|
|
18
|
+
*/
|
|
19
|
+
dispose(error?: Error): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=disposable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposable.js","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Base interface for objects that require lifetime management via explicit disposal.\n */\nexport interface IDisposable {\n\t/**\n\t * Whether or not the object has been disposed.\n\t * If true, the object should be considered invalid, and its other state should be disregarded.\n\t */\n\treadonly disposed: boolean;\n\n\t/**\n\t * Dispose of the object and its resources.\n\t * @param error - Optional error indicating the reason for the disposal, if the object was\n\t * disposed as the result of an error.\n\t */\n\tdispose(error?: Error): void;\n}\n"]}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ITelemetryBaseProperties } from "./index";
|
|
6
|
+
/**
|
|
7
|
+
* Error types the Fluid Framework may report.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FluidErrorTypes: {
|
|
10
|
+
/**
|
|
11
|
+
* Some error, most likely an exception caught by runtime and propagated to container as critical error
|
|
12
|
+
*/
|
|
13
|
+
readonly genericError: "genericError";
|
|
14
|
+
/**
|
|
15
|
+
* Throttling error from server. Server is busy and is asking not to reconnect for some time
|
|
16
|
+
*/
|
|
17
|
+
readonly throttlingError: "throttlingError";
|
|
18
|
+
/**
|
|
19
|
+
* Data loss error detected by Container / DeltaManager. Likely points to storage issue.
|
|
20
|
+
*/
|
|
21
|
+
readonly dataCorruptionError: "dataCorruptionError";
|
|
22
|
+
/**
|
|
23
|
+
* Error encountered when processing an operation. May correlate with data corruption.
|
|
24
|
+
*/
|
|
25
|
+
readonly dataProcessingError: "dataProcessingError";
|
|
26
|
+
/**
|
|
27
|
+
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
28
|
+
*/
|
|
29
|
+
readonly usageError: "usageError";
|
|
30
|
+
};
|
|
31
|
+
export declare type FluidErrorTypes = typeof FluidErrorTypes[keyof typeof FluidErrorTypes];
|
|
32
|
+
/**
|
|
33
|
+
* Base interface for all errors and warnings emitted the container.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*
|
|
37
|
+
* We are in the process of unifying error types across layers of the Framework. For now we have only migrated
|
|
38
|
+
* those from container-definitions. Once fully migrated, this will be a base interface for all errors and
|
|
39
|
+
* warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.
|
|
40
|
+
* Runtime and others will follow soon.
|
|
41
|
+
*/
|
|
42
|
+
export interface IErrorBase extends Partial<Error> {
|
|
43
|
+
/**
|
|
44
|
+
* A type tag differentiating kinds of errors emitted by the container.
|
|
45
|
+
*
|
|
46
|
+
* @see See {@link FluidErrorTypes#genericError} for some common examples.
|
|
47
|
+
* - container
|
|
48
|
+
* - runtime
|
|
49
|
+
* - drivers
|
|
50
|
+
*/
|
|
51
|
+
readonly errorType: string;
|
|
52
|
+
/**
|
|
53
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error.message}
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
*
|
|
57
|
+
* Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)
|
|
58
|
+
* If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result
|
|
59
|
+
* of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.
|
|
60
|
+
*/
|
|
61
|
+
readonly message: string;
|
|
62
|
+
/**
|
|
63
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name | Error.name}
|
|
64
|
+
*/
|
|
65
|
+
readonly name?: string;
|
|
66
|
+
/**
|
|
67
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}
|
|
68
|
+
*/
|
|
69
|
+
readonly stack?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Returns all properties of this error object that are fit for logging.
|
|
72
|
+
* Some may be tagged to indicate they contain some kind of sensitive data.
|
|
73
|
+
*/
|
|
74
|
+
getTelemetryProperties?(): ITelemetryBaseProperties;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Generic wrapper for an unrecognized/uncategorized error object
|
|
78
|
+
*/
|
|
79
|
+
export interface IGenericError extends IErrorBase {
|
|
80
|
+
/**
|
|
81
|
+
* {@inheritDoc IErrorBase.errorType}
|
|
82
|
+
*/
|
|
83
|
+
readonly errorType: typeof FluidErrorTypes.genericError;
|
|
84
|
+
error?: any;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
88
|
+
*/
|
|
89
|
+
export interface IUsageError extends IErrorBase {
|
|
90
|
+
/**
|
|
91
|
+
* {@inheritDoc IErrorBase.errorType}
|
|
92
|
+
*/
|
|
93
|
+
readonly errorType: typeof FluidErrorTypes.usageError;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Warning emitted when requests to storage are being throttled
|
|
97
|
+
*/
|
|
98
|
+
export interface IThrottlingWarning extends IErrorBase {
|
|
99
|
+
/**
|
|
100
|
+
* {@inheritDoc IErrorBase.errorType}
|
|
101
|
+
*/
|
|
102
|
+
readonly errorType: typeof FluidErrorTypes.throttlingError;
|
|
103
|
+
readonly retryAfterSeconds: number;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,eAAe;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AACX,oBAAY,eAAe,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC;IACjD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,wBAAwB,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAChD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,YAAY,CAAC;IAIxD,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC9C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,UAAU,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACrD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,eAAe,CAAC;IAC3D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.FluidErrorTypes = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Error types the Fluid Framework may report.
|
|
10
|
+
*/
|
|
11
|
+
exports.FluidErrorTypes = {
|
|
12
|
+
/**
|
|
13
|
+
* Some error, most likely an exception caught by runtime and propagated to container as critical error
|
|
14
|
+
*/
|
|
15
|
+
genericError: "genericError",
|
|
16
|
+
/**
|
|
17
|
+
* Throttling error from server. Server is busy and is asking not to reconnect for some time
|
|
18
|
+
*/
|
|
19
|
+
throttlingError: "throttlingError",
|
|
20
|
+
/**
|
|
21
|
+
* Data loss error detected by Container / DeltaManager. Likely points to storage issue.
|
|
22
|
+
*/
|
|
23
|
+
dataCorruptionError: "dataCorruptionError",
|
|
24
|
+
/**
|
|
25
|
+
* Error encountered when processing an operation. May correlate with data corruption.
|
|
26
|
+
*/
|
|
27
|
+
dataProcessingError: "dataProcessingError",
|
|
28
|
+
/**
|
|
29
|
+
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
30
|
+
*/
|
|
31
|
+
usageError: "usageError",
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"./index\";\n\n/**\n * Error types the Fluid Framework may report.\n */\nexport const FluidErrorTypes = {\n\t/**\n\t * Some error, most likely an exception caught by runtime and propagated to container as critical error\n\t */\n\tgenericError: \"genericError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError: \"throttlingError\",\n\n\t/**\n\t * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n\t */\n\tdataCorruptionError: \"dataCorruptionError\",\n\n\t/**\n\t * Error encountered when processing an operation. May correlate with data corruption.\n\t */\n\tdataProcessingError: \"dataProcessingError\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t */\n\tusageError: \"usageError\",\n} as const;\nexport type FluidErrorTypes = typeof FluidErrorTypes[keyof typeof FluidErrorTypes];\n\n/**\n * Base interface for all errors and warnings emitted the container.\n *\n * @remarks\n *\n * We are in the process of unifying error types across layers of the Framework. For now we have only migrated\n * those from container-definitions. Once fully migrated, this will be a base interface for all errors and\n * warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.\n * Runtime and others will follow soon.\n */\nexport interface IErrorBase extends Partial<Error> {\n\t/**\n\t * A type tag differentiating kinds of errors emitted by the container.\n\t *\n\t * @see See {@link FluidErrorTypes#genericError} for some common examples.\n\t * - container\n\t * - runtime\n\t * - drivers\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error.message}\n\t *\n\t * @remarks\n\t *\n\t * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n\t * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n\t * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name | Error.name}\n\t */\n\treadonly name?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * Returns all properties of this error object that are fit for logging.\n\t * Some may be tagged to indicate they contain some kind of sensitive data.\n\t */\n\tgetTelemetryProperties?(): ITelemetryBaseProperties;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.genericError;\n\n\t// TODO: Use `unknown` instead (API-Breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\terror?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n"]}
|