@fluidframework/core-interfaces 2.93.0 → 2.100.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/core-interfaces
2
2
 
3
+ ## 2.100.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Node 22 is now the minimum supported Node.js version ([#27116](https://github.com/microsoft/FluidFramework/pull/27116)) [e8214d29663](https://github.com/microsoft/FluidFramework/commit/e8214d29663f5ee98d737daed82506a25d8de8d0)
8
+
9
+ All Fluid Framework client packages now require Node.js 22 or later. This aligns with the standing Node upgrade policy as Node 20 reaches end-of-life on April 30, 2026.
10
+
3
11
  ## 2.93.0
4
12
 
5
13
  ### Minor Changes
@@ -326,15 +326,20 @@ export type Listeners<T extends object> = {
326
326
  };
327
327
 
328
328
  // @public
329
- export const LogLevel: {
330
- readonly verbose: 10;
331
- readonly default: 20;
332
- readonly error: 30;
333
- };
329
+ export const LogLevel: LogLevelConst;
334
330
 
335
331
  // @public
336
332
  export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
337
333
 
334
+ // @public
335
+ export interface LogLevelConst {
336
+ readonly default: 20;
337
+ readonly error: 30;
338
+ readonly essential: 30;
339
+ readonly info: 20;
340
+ readonly verbose: 10;
341
+ }
342
+
338
343
  // @public
339
344
  export type Off = () => void;
340
345
 
@@ -471,15 +471,20 @@ export type Listeners<T extends object> = {
471
471
  };
472
472
 
473
473
  // @public
474
- export const LogLevel: {
475
- readonly verbose: 10;
476
- readonly default: 20;
477
- readonly error: 30;
478
- };
474
+ export const LogLevel: LogLevelConst;
479
475
 
480
476
  // @public
481
477
  export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
482
478
 
479
+ // @public
480
+ export interface LogLevelConst {
481
+ readonly default: 20;
482
+ readonly error: 30;
483
+ readonly essential: 30;
484
+ readonly info: 20;
485
+ readonly verbose: 10;
486
+ }
487
+
483
488
  // @public
484
489
  export type Off = () => void;
485
490
 
@@ -458,15 +458,20 @@ export type Listeners<T extends object> = {
458
458
  };
459
459
 
460
460
  // @public
461
- export const LogLevel: {
462
- readonly verbose: 10;
463
- readonly default: 20;
464
- readonly error: 30;
465
- };
461
+ export const LogLevel: LogLevelConst;
466
462
 
467
463
  // @public
468
464
  export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
469
465
 
466
+ // @public
467
+ export interface LogLevelConst {
468
+ readonly default: 20;
469
+ readonly error: 30;
470
+ readonly essential: 30;
471
+ readonly info: 20;
472
+ readonly verbose: 10;
473
+ }
474
+
470
475
  // @public
471
476
  export type Off = () => void;
472
477
 
@@ -326,15 +326,20 @@ export type Listeners<T extends object> = {
326
326
  };
327
327
 
328
328
  // @public
329
- export const LogLevel: {
330
- readonly verbose: 10;
331
- readonly default: 20;
332
- readonly error: 30;
333
- };
329
+ export const LogLevel: LogLevelConst;
334
330
 
335
331
  // @public
336
332
  export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
337
333
 
334
+ // @public
335
+ export interface LogLevelConst {
336
+ readonly default: 20;
337
+ readonly error: 30;
338
+ readonly essential: 30;
339
+ readonly info: 20;
340
+ readonly verbose: 10;
341
+ }
342
+
338
343
  // @public
339
344
  export type Off = () => void;
340
345
 
@@ -326,15 +326,20 @@ export type Listeners<T extends object> = {
326
326
  };
327
327
 
328
328
  // @public
329
- export const LogLevel: {
330
- readonly verbose: 10;
331
- readonly default: 20;
332
- readonly error: 30;
333
- };
329
+ export const LogLevel: LogLevelConst;
334
330
 
335
331
  // @public
336
332
  export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
337
333
 
334
+ // @public
335
+ export interface LogLevelConst {
336
+ readonly default: 20;
337
+ readonly error: 30;
338
+ readonly essential: 30;
339
+ readonly info: 20;
340
+ readonly verbose: 10;
341
+ }
342
+
338
343
  // @public
339
344
  export type Off = () => void;
340
345
 
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { IFluidLoadable } from "./fluidLoadable.js";
13
13
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
14
14
  export type { IFluidHandleErased, IFluidHandleEvents, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandlePayloadPending, ILocalFluidHandle, ILocalFluidHandleEvents, IProvideFluidHandle, IProvideFluidHandleContext, PayloadState, } from "./handles.js";
15
15
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
16
- export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
16
+ export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, LogLevelConst, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
17
17
  export { LogLevel } from "./logger.js";
18
18
  export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
19
19
  export type { ConfigTypes, IConfigProviderBase } from "./config.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EACX,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,GAChB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,E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mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,GAAG,GACH,MAAM,mBAAmB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH,uCAGoB;AAFnB,2GAAA,eAAe,OAAA;AACf,gHAAA,oBAAoB,OAAA;AAerB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AAmBvB,2CAAoF;AAA3E,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAU7D,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAKjB,iDAA2D;AAAlD,yHAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { BrandedType } from \"./brandedType.js\";\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type {\n\tFluidIterable,\n\tFluidIterableIterator,\n\tFluidMap,\n\tFluidReadonlyMap,\n} from \"./fluidMap.js\";\n\nexport type {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope, TypedMessage } from \"./messages.js\";\nexport type { ErasedType, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH,uCAGoB;AAFnB,2GAAA,eAAe,OAAA;AACf,gHAAA,oBAAoB,OAAA;AAerB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AAmBvB,2CAAoF;AAA3E,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAW7D,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAKjB,iDAA2D;AAAlD,yHAAA,wBAAwB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { BrandedType } from \"./brandedType.js\";\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type {\n\tFluidIterable,\n\tFluidIterableIterator,\n\tFluidMap,\n\tFluidReadonlyMap,\n} from \"./fluidMap.js\";\n\nexport type {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tLogLevelConst,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope, TypedMessage } from \"./messages.js\";\nexport type { ErasedType, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/dist/legacy.d.ts CHANGED
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/dist/logger.d.ts CHANGED
@@ -47,13 +47,47 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
47
47
  }
48
48
  /**
49
49
  * Specify levels of the logs.
50
+ *
51
+ * @privateRemarks This interface exists solely for documentation. API Extractor does not
52
+ * propagate TSDoc comments from a const's inline type to API reports, so we define the shape
53
+ * here and use LogLevelConst on the LogLevel const to surface member docs.
54
+ *
50
55
  * @public
51
56
  */
52
- export declare const LogLevel: {
57
+ export interface LogLevelConst {
58
+ /**
59
+ * Chatty logs useful for debugging.
60
+ * @remarks They need not be collected in production.
61
+ */
53
62
  readonly verbose: 10;
63
+ /**
64
+ * Information about the session.
65
+ * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).
66
+ * If any are collected from a particular session, all should be.
67
+ */
68
+ readonly info: 20;
69
+ /**
70
+ * Essential information about the operation of Fluid.
71
+ * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.
72
+ */
73
+ readonly essential: 30;
74
+ /**
75
+ * Default LogLevel
76
+ * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.
77
+ */
54
78
  readonly default: 20;
79
+ /**
80
+ * To log errors.
81
+ * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.
82
+ */
55
83
  readonly error: 30;
56
- };
84
+ }
85
+ /**
86
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
87
+ * @see {@link LogLevelConst} type.
88
+ * @public
89
+ */
90
+ export declare const LogLevel: LogLevelConst;
57
91
  /**
58
92
  * Specify a level to the log to filter out logs based on the level.
59
93
  * @public
@@ -68,12 +102,12 @@ export interface ITelemetryBaseLogger {
68
102
  /**
69
103
  * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
70
104
  * @param event - The event to log.
71
- * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
105
+ * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.
72
106
  */
73
107
  send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
74
108
  /**
75
109
  * Minimum log level to be logged.
76
- * @defaultValue {@link (LogLevel:variable).default}
110
+ * @defaultValue {@link LogLevelConst.default | LogLevel.default}.
77
111
  */
78
112
  minLogLevel?: LogLevel;
79
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CA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CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,aAMtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD"}
package/dist/logger.js CHANGED
@@ -6,12 +6,15 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.LogLevel = void 0;
8
8
  /**
9
- * Specify levels of the logs.
9
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
10
+ * @see {@link LogLevelConst} type.
10
11
  * @public
11
12
  */
12
13
  exports.LogLevel = {
13
- verbose: 10, // To log any verbose event for example when you are debugging something.
14
- default: 20, // Default log level
15
- error: 30, // To log errors.
14
+ verbose: 10,
15
+ info: 20,
16
+ essential: 30,
17
+ default: 20,
18
+ error: 30,
16
19
  };
17
20
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiDH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @public\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link (LogLevel:variable).default}\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2FH;;;;GAIG;AACU,QAAA,QAAQ,GAAkB;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n *\n * @privateRemarks This interface exists solely for documentation. API Extractor does not\n * propagate TSDoc comments from a const's inline type to API reports, so we define the shape\n * here and use LogLevelConst on the LogLevel const to surface member docs.\n *\n * @public\n */\nexport interface LogLevelConst {\n\t/**\n\t * Chatty logs useful for debugging.\n\t * @remarks They need not be collected in production.\n\t */\n\treadonly verbose: 10;\n\n\t/**\n\t * Information about the session.\n\t * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).\n\t * If any are collected from a particular session, all should be.\n\t */\n\treadonly info: 20;\n\n\t/**\n\t * Essential information about the operation of Fluid.\n\t * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.\n\t */\n\treadonly essential: 30;\n\n\t/**\n\t * Default LogLevel\n\t * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.\n\t */\n\treadonly default: 20;\n\n\t/**\n\t * To log errors.\n\t * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.\n\t */\n\treadonly error: 30;\n}\n\n/**\n * Provides runtime {@link (LogLevel:type)} values via symbolic names\n * @see {@link LogLevelConst} type.\n * @public\n */\nexport const LogLevel: LogLevelConst = {\n\tverbose: 10,\n\tinfo: 20,\n\tessential: 30,\n\tdefault: 20,\n\terror: 30,\n};\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
package/dist/public.d.ts CHANGED
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/lib/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { IFluidLoadable } from "./fluidLoadable.js";
13
13
  export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
14
14
  export type { IFluidHandleErased, IFluidHandleEvents, IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandlePayloadPending, ILocalFluidHandle, ILocalFluidHandleEvents, IProvideFluidHandle, IProvideFluidHandleContext, PayloadState, } from "./handles.js";
15
15
  export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
16
- export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
16
+ export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, LogLevelConst, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
17
17
  export { LogLevel } from "./logger.js";
18
18
  export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
19
19
  export type { ConfigTypes, IConfigProviderBase } from "./config.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,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ACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,GAAG,GACH,MAAM,mBAAmB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { BrandedType } from \"./brandedType.js\";\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type {\n\tFluidIterable,\n\tFluidIterableIterator,\n\tFluidMap,\n\tFluidReadonlyMap,\n} from \"./fluidMap.js\";\n\nexport type {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope, TypedMessage } from \"./messages.js\";\nexport type { ErasedType, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EACN,eAAe,EACf,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBpD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAWpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { BrandedType } from \"./brandedType.js\";\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type {\n\tFluidIterable,\n\tFluidIterableIterator,\n\tFluidMap,\n\tFluidReadonlyMap,\n} from \"./fluidMap.js\";\n\nexport type {\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n\tILayerIncompatibilityError,\n} from \"./error.js\";\nexport {\n\tFluidErrorTypes,\n\tFluidErrorTypesAlpha,\n} from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable } from \"./fluidLoadable.js\";\n\n// TypeScript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIFluidHandleErased,\n\tIFluidHandleEvents,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tIProvideFluidHandle,\n\tIProvideFluidHandleContext,\n\tPayloadState,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tLogLevelConst,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope, TypedMessage } from \"./messages.js\";\nexport type { ErasedType, ErasedBaseType, InstanceTypeRelaxed } from \"./erasedType.js\";\nexport { ErasedTypeImplementation } from \"./erasedType.js\";\n\nexport type {\n\tHasListeners,\n\tIEmitter,\n\tIsListener,\n\tListeners,\n\tListenable,\n\tMapGetSet,\n\tNoListenersCallback,\n\tOff,\n} from \"./events/index.js\";\n"]}
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/lib/legacy.d.ts CHANGED
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/lib/logger.d.ts CHANGED
@@ -47,13 +47,47 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
47
47
  }
48
48
  /**
49
49
  * Specify levels of the logs.
50
+ *
51
+ * @privateRemarks This interface exists solely for documentation. API Extractor does not
52
+ * propagate TSDoc comments from a const's inline type to API reports, so we define the shape
53
+ * here and use LogLevelConst on the LogLevel const to surface member docs.
54
+ *
50
55
  * @public
51
56
  */
52
- export declare const LogLevel: {
57
+ export interface LogLevelConst {
58
+ /**
59
+ * Chatty logs useful for debugging.
60
+ * @remarks They need not be collected in production.
61
+ */
53
62
  readonly verbose: 10;
63
+ /**
64
+ * Information about the session.
65
+ * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).
66
+ * If any are collected from a particular session, all should be.
67
+ */
68
+ readonly info: 20;
69
+ /**
70
+ * Essential information about the operation of Fluid.
71
+ * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.
72
+ */
73
+ readonly essential: 30;
74
+ /**
75
+ * Default LogLevel
76
+ * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.
77
+ */
54
78
  readonly default: 20;
79
+ /**
80
+ * To log errors.
81
+ * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.
82
+ */
55
83
  readonly error: 30;
56
- };
84
+ }
85
+ /**
86
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
87
+ * @see {@link LogLevelConst} type.
88
+ * @public
89
+ */
90
+ export declare const LogLevel: LogLevelConst;
57
91
  /**
58
92
  * Specify a level to the log to filter out logs based on the level.
59
93
  * @public
@@ -68,12 +102,12 @@ export interface ITelemetryBaseLogger {
68
102
  /**
69
103
  * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
70
104
  * @param event - The event to log.
71
- * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
105
+ * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.
72
106
  */
73
107
  send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
74
108
  /**
75
109
  * Minimum log level to be logged.
76
- * @defaultValue {@link (LogLevel:variable).default}
110
+ * @defaultValue {@link LogLevelConst.default | LogLevel.default}.
77
111
  */
78
112
  minLogLevel?: LogLevel;
79
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;C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Q,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD"}
package/lib/logger.js CHANGED
@@ -3,12 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * Specify levels of the logs.
6
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
7
+ * @see {@link LogLevelConst} type.
7
8
  * @public
8
9
  */
9
10
  export const LogLevel = {
10
- verbose: 10, // To log any verbose event for example when you are debugging something.
11
- default: 20, // Default log level
12
- error: 30, // To log errors.
11
+ verbose: 10,
12
+ info: 20,
13
+ essential: 30,
14
+ default: 20,
15
+ error: 30,
13
16
  };
14
17
  //# sourceMappingURL=logger.js.map
package/lib/logger.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @public\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link (LogLevel:variable).default}\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2FH;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n *\n * @privateRemarks This interface exists solely for documentation. API Extractor does not\n * propagate TSDoc comments from a const's inline type to API reports, so we define the shape\n * here and use LogLevelConst on the LogLevel const to surface member docs.\n *\n * @public\n */\nexport interface LogLevelConst {\n\t/**\n\t * Chatty logs useful for debugging.\n\t * @remarks They need not be collected in production.\n\t */\n\treadonly verbose: 10;\n\n\t/**\n\t * Information about the session.\n\t * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).\n\t * If any are collected from a particular session, all should be.\n\t */\n\treadonly info: 20;\n\n\t/**\n\t * Essential information about the operation of Fluid.\n\t * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.\n\t */\n\treadonly essential: 30;\n\n\t/**\n\t * Default LogLevel\n\t * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.\n\t */\n\treadonly default: 20;\n\n\t/**\n\t * To log errors.\n\t * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.\n\t */\n\treadonly error: 30;\n}\n\n/**\n * Provides runtime {@link (LogLevel:type)} values via symbolic names\n * @see {@link LogLevelConst} type.\n * @public\n */\nexport const LogLevel: LogLevelConst = {\n\tverbose: 10,\n\tinfo: 20,\n\tessential: 30,\n\tdefault: 20,\n\terror: 30,\n};\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link LogLevelConst.default | LogLevel.default}.\n\t */\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
package/lib/public.d.ts CHANGED
@@ -39,6 +39,7 @@ export {
39
39
  Listenable,
40
40
  Listeners,
41
41
  LogLevel,
42
+ LogLevelConst,
42
43
  Off,
43
44
  ReplaceIEventThisPlaceHolder,
44
45
  Tagged,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-interfaces",
3
- "version": "2.93.0",
3
+ "version": "2.100.0",
4
4
  "description": "Fluid object interfaces",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -83,9 +83,9 @@
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.18.2",
85
85
  "@biomejs/biome": "~2.4.5",
86
- "@fluid-tools/build-cli": "^0.64.0",
86
+ "@fluid-tools/build-cli": "^0.65.0",
87
87
  "@fluidframework/build-common": "^2.0.3",
88
- "@fluidframework/build-tools": "^0.64.0",
88
+ "@fluidframework/build-tools": "^0.65.0",
89
89
  "@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.92.0",
90
90
  "@fluidframework/eslint-config-fluid": "^9.0.0",
91
91
  "@microsoft/api-extractor": "7.58.1",
package/src/index.ts CHANGED
@@ -64,6 +64,7 @@ export type {
64
64
  ITelemetryBaseEvent,
65
65
  ITelemetryBaseLogger,
66
66
  ITelemetryBaseProperties,
67
+ LogLevelConst,
67
68
  Tagged,
68
69
  TelemetryBaseEventPropertyType,
69
70
  } from "./logger.js";
package/src/logger.ts CHANGED
@@ -52,13 +52,58 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
52
52
 
53
53
  /**
54
54
  * Specify levels of the logs.
55
+ *
56
+ * @privateRemarks This interface exists solely for documentation. API Extractor does not
57
+ * propagate TSDoc comments from a const's inline type to API reports, so we define the shape
58
+ * here and use LogLevelConst on the LogLevel const to surface member docs.
59
+ *
60
+ * @public
61
+ */
62
+ export interface LogLevelConst {
63
+ /**
64
+ * Chatty logs useful for debugging.
65
+ * @remarks They need not be collected in production.
66
+ */
67
+ readonly verbose: 10;
68
+
69
+ /**
70
+ * Information about the session.
71
+ * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).
72
+ * If any are collected from a particular session, all should be.
73
+ */
74
+ readonly info: 20;
75
+
76
+ /**
77
+ * Essential information about the operation of Fluid.
78
+ * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.
79
+ */
80
+ readonly essential: 30;
81
+
82
+ /**
83
+ * Default LogLevel
84
+ * @remarks Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly since this will be deprecated and removed in a future release.
85
+ */
86
+ readonly default: 20;
87
+
88
+ /**
89
+ * To log errors.
90
+ * @remarks Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level since this will be deprecated and removed in a future release.
91
+ */
92
+ readonly error: 30;
93
+ }
94
+
95
+ /**
96
+ * Provides runtime {@link (LogLevel:type)} values via symbolic names
97
+ * @see {@link LogLevelConst} type.
55
98
  * @public
56
99
  */
57
- export const LogLevel = {
58
- verbose: 10, // To log any verbose event for example when you are debugging something.
59
- default: 20, // Default log level
60
- error: 30, // To log errors.
61
- } as const;
100
+ export const LogLevel: LogLevelConst = {
101
+ verbose: 10,
102
+ info: 20,
103
+ essential: 30,
104
+ default: 20,
105
+ error: 30,
106
+ };
62
107
 
63
108
  /**
64
109
  * Specify a level to the log to filter out logs based on the level.
@@ -75,13 +120,13 @@ export interface ITelemetryBaseLogger {
75
120
  /**
76
121
  * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
77
122
  * @param event - The event to log.
78
- * @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
123
+ * @param logLevel - The log level of the event. Default: {@link LogLevelConst.default | LogLevel.default}.
79
124
  */
80
125
  send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
81
126
 
82
127
  /**
83
128
  * Minimum log level to be logged.
84
- * @defaultValue {@link (LogLevel:variable).default}
129
+ * @defaultValue {@link LogLevelConst.default | LogLevel.default}.
85
130
  */
86
131
  minLogLevel?: LogLevel;
87
132
  }