@f1studio/form-spec 5.0.0-alpha.101 → 5.0.0-alpha.103
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/Components/HelloComponent.d.ts +20 -0
- package/Components/HelloComponent.d.ts.map +1 -0
- package/Designer.d.ts.map +1 -0
- package/FormSpec.TS/Designer.js +2 -2
- package/FormSpec.TS/Designer.js.map +1 -1
- package/FormSpec.TS/Designer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.js +210 -143
- package/FormSpec.TS/FormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpecHelpers.js +62 -40
- package/FormSpec.TS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpecValues.js +207 -0
- package/FormSpec.TS/FormSpecValues.js.map +1 -0
- package/FormSpec.TS/FormSpecValues.ts.map +1 -0
- package/FormSpec.TS/Helpers.js +26 -25
- package/FormSpec.TS/Helpers.js.map +1 -1
- package/FormSpec.TS/Helpers.ts.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +85 -125
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js +37 -7
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +103 -80
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
- package/FormSpec.TS/PathwayExecutor.js +371 -125
- package/FormSpec.TS/PathwayExecutor.js.map +1 -1
- package/FormSpec.TS/PathwayExecutor.ts.map +1 -1
- package/FormSpec.TS/PathwayValidator.js +14 -26
- package/FormSpec.TS/PathwayValidator.js.map +1 -1
- package/FormSpec.TS/PathwayValidator.ts.map +1 -1
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
- package/FormSpec.TS/Renderers/PathwayRenderers.js +35 -26
- package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -1
- package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -1
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +0 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +0 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +0 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +0 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +0 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +0 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +0 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +0 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.d.ts +56 -43
- package/FormSpec.d.ts.map +1 -0
- package/FormSpecHelpers.d.ts +18 -12
- package/FormSpecHelpers.d.ts.map +1 -0
- package/FormSpecValues.d.ts +62 -0
- package/FormSpecValues.d.ts.map +1 -0
- package/Helpers.d.ts +11 -10
- package/Helpers.d.ts.map +1 -0
- package/Interfaces.d.ts.map +1 -0
- package/Interop/FormSpec.Api.Helpers.d.ts +25 -28
- package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/Interop/FormSpec.Api.Option.d.ts +10 -6
- package/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/Interop/FormSpec.Values.Api.Option.d.ts +35 -22
- package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
- package/Logging/LogTypes.d.ts +112 -0
- package/Logging/LogTypes.d.ts.map +1 -0
- package/Migrator.d.ts.map +1 -0
- package/PathwayDataExtractor.d.ts.map +1 -0
- package/PathwayExecutor.d.ts +63 -33
- package/PathwayExecutor.d.ts.map +1 -0
- package/PathwayValidator.d.ts.map +1 -0
- package/PluginInterface.d.ts.map +1 -0
- package/Prelude.d.ts.map +1 -0
- package/README.TS.md +621 -621
- package/README.md +98 -85
- package/Renderers/FormSpecMarkdownRenderer.d.ts +11 -0
- package/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -0
- package/Renderers/MermaidRenderer.d.ts +48 -0
- package/Renderers/MermaidRenderer.d.ts.map +1 -0
- package/Renderers/PathwayRenderers.d.ts +59 -0
- package/Renderers/PathwayRenderers.d.ts.map +1 -0
- package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts +126 -0
- package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts.map +1 -0
- package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts +163 -0
- package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts.map +1 -0
- package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts +66 -0
- package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts.map +1 -0
- package/package.json +53 -39
- package/src/Components/HelloComponent.ts +48 -48
- package/src/Designer.ts +389 -389
- package/src/FormSpec.ts +3154 -3114
- package/src/FormSpecHelpers.ts +397 -374
- package/src/FormSpecValues.ts +158 -0
- package/src/Helpers.ts +766 -765
- package/src/Interfaces.ts +166 -166
- package/src/Interop/FormSpec.Api.Helpers.ts +835 -872
- package/src/Interop/FormSpec.Api.Option.ts +1637 -1618
- package/src/Interop/FormSpec.Values.Api.Option.ts +1241 -1214
- package/src/Logging/LogTypes.ts +212 -212
- package/src/Migrator.ts +156 -156
- package/src/PathwayDataExtractor.ts +290 -290
- package/src/PathwayExecutor.ts +1379 -1102
- package/src/PathwayValidator.ts +238 -244
- package/src/PluginInterface.ts +79 -79
- package/src/Prelude.ts +21 -21
- package/src/Renderers/FormSpecMarkdownRenderer.ts +875 -874
- package/src/Renderers/MermaidRenderer.ts +218 -218
- package/src/Renderers/PathwayRenderers.ts +208 -200
- package/src/Components/HelloComponent.ts.map +0 -1
- package/src/Designer.ts.map +0 -1
- package/src/FormSpec.ts.map +0 -1
- package/src/FormSpecHelpers.ts.map +0 -1
- package/src/Helpers.ts.map +0 -1
- package/src/Interfaces.ts.map +0 -1
- package/src/Interop/FormSpec.Api.Helpers.ts.map +0 -1
- package/src/Interop/FormSpec.Api.Option.ts.map +0 -1
- package/src/Interop/FormSpec.Values.Api.Option.ts.map +0 -1
- package/src/Logging/LogTypes.ts.map +0 -1
- package/src/Migrator.ts.map +0 -1
- package/src/PathwayDataExtractor.ts.map +0 -1
- package/src/PathwayExecutor.ts.map +0 -1
- package/src/PathwayValidator.ts.map +0 -1
- package/src/PluginInterface.ts.map +0 -1
- package/src/Prelude.ts.map +0 -1
- package/src/Renderers/FormSpecMarkdownRenderer.ts.map +0 -1
- package/src/Renderers/MermaidRenderer.ts.map +0 -1
- package/src/Renderers/PathwayRenderers.ts.map +0 -1
package/src/Logging/LogTypes.ts
CHANGED
|
@@ -1,212 +1,212 @@
|
|
|
1
|
-
import { Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
-
import { float64, int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
3
|
-
import { Option } from "@fable-org/fable-library-js/Option.js";
|
|
4
|
-
import { FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
5
|
-
import { FSharpList } from "@fable-org/fable-library-js/List.js";
|
|
6
|
-
import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
7
|
-
import { bool_type, record_type, float64_type, list_type, option_type, obj_type, class_type, string_type, enum_type, int32_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
8
|
-
import { utcNow } from "@fable-org/fable-library-js/Date.js";
|
|
9
|
-
|
|
10
|
-
export class LogMessage extends Record implements IEquatable<LogMessage> {
|
|
11
|
-
readonly Level: int32;
|
|
12
|
-
readonly Message: string;
|
|
13
|
-
readonly Timestamp: Date;
|
|
14
|
-
readonly Context: Option<FSharpMap<string, any>>;
|
|
15
|
-
readonly Source: Option<string>;
|
|
16
|
-
readonly CorrelationId: Option<string>;
|
|
17
|
-
readonly Tags: Option<FSharpList<string>>;
|
|
18
|
-
readonly UserId: Option<string>;
|
|
19
|
-
readonly SessionId: Option<string>;
|
|
20
|
-
readonly Exception: Option<Error>;
|
|
21
|
-
readonly PerformanceMetrics: Option<FSharpMap<string, float64>>;
|
|
22
|
-
constructor(Level: int32, Message: string, Timestamp: Date, Context: Option<FSharpMap<string, any>>, Source: Option<string>, CorrelationId: Option<string>, Tags: Option<FSharpList<string>>, UserId: Option<string>, SessionId: Option<string>, Exception: Option<Error>, PerformanceMetrics: Option<FSharpMap<string, float64>>) {
|
|
23
|
-
super();
|
|
24
|
-
this.Level = (Level | 0);
|
|
25
|
-
this.Message = Message;
|
|
26
|
-
this.Timestamp = Timestamp;
|
|
27
|
-
this.Context = Context;
|
|
28
|
-
this.Source = Source;
|
|
29
|
-
this.CorrelationId = CorrelationId;
|
|
30
|
-
this.Tags = Tags;
|
|
31
|
-
this.UserId = UserId;
|
|
32
|
-
this.SessionId = SessionId;
|
|
33
|
-
this.Exception = Exception;
|
|
34
|
-
this.PerformanceMetrics = PerformanceMetrics;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function LogMessage_$reflection(): TypeInfo {
|
|
39
|
-
return record_type("FormSpec.Logging.LogMessage", [], LogMessage, () => [["Level", enum_type("FormSpec.Logging.LogLevel", int32_type, [["Trace", 0], ["Debug", 1], ["Info", 2], ["Success", 3], ["Warn", 4], ["Error", 5], ["Fatal", 6]])], ["Message", string_type], ["Timestamp", class_type("System.DateTime")], ["Context", option_type(class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, obj_type]))], ["Source", option_type(string_type)], ["CorrelationId", option_type(class_type("System.Guid"))], ["Tags", option_type(list_type(string_type))], ["UserId", option_type(string_type)], ["SessionId", option_type(string_type)], ["Exception", option_type(class_type("System.Exception"))], ["PerformanceMetrics", option_type(class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, float64_type]))]]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Create a basic log message
|
|
44
|
-
*/
|
|
45
|
-
export function LogMessageModule_create(level: int32, message: string): LogMessage {
|
|
46
|
-
return new LogMessage(level, message, utcNow(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Add context to a log message
|
|
51
|
-
*/
|
|
52
|
-
export function LogMessageModule_withContext(context: FSharpMap<string, any>, msg: LogMessage): LogMessage {
|
|
53
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Add source to a log message
|
|
58
|
-
*/
|
|
59
|
-
export function LogMessageModule_withSource(source: string, msg: LogMessage): LogMessage {
|
|
60
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Add correlation ID to a log message
|
|
65
|
-
*/
|
|
66
|
-
export function LogMessageModule_withCorrelationId(correlationId: string, msg: LogMessage): LogMessage {
|
|
67
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, correlationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Add tags to a log message
|
|
72
|
-
*/
|
|
73
|
-
export function LogMessageModule_withTags(tags: FSharpList<string>, msg: LogMessage): LogMessage {
|
|
74
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Add user ID to a log message
|
|
79
|
-
*/
|
|
80
|
-
export function LogMessageModule_withUserId(userId: string, msg: LogMessage): LogMessage {
|
|
81
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, userId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Add session ID to a log message
|
|
86
|
-
*/
|
|
87
|
-
export function LogMessageModule_withSessionId(sessionId: string, msg: LogMessage): LogMessage {
|
|
88
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, sessionId, msg.Exception, msg.PerformanceMetrics);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Add exception to a log message
|
|
93
|
-
*/
|
|
94
|
-
export function LogMessageModule_withException(ex: Error, msg: LogMessage): LogMessage {
|
|
95
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, ex, msg.PerformanceMetrics);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Add performance metrics to a log message
|
|
100
|
-
*/
|
|
101
|
-
export function LogMessageModule_withPerformanceMetrics(metrics: FSharpMap<string, float64>, msg: LogMessage): LogMessage {
|
|
102
|
-
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, metrics);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Create a trace message
|
|
107
|
-
*/
|
|
108
|
-
export function LogMessageModule_trace(message: string): LogMessage {
|
|
109
|
-
return LogMessageModule_create(0, message);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Create a debug message
|
|
114
|
-
*/
|
|
115
|
-
export function LogMessageModule_debug(message: string): LogMessage {
|
|
116
|
-
return LogMessageModule_create(1, message);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Create an info message
|
|
121
|
-
*/
|
|
122
|
-
export function LogMessageModule_info(message: string): LogMessage {
|
|
123
|
-
return LogMessageModule_create(2, message);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Create a success message
|
|
128
|
-
*/
|
|
129
|
-
export function LogMessageModule_success(message: string): LogMessage {
|
|
130
|
-
return LogMessageModule_create(3, message);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Create a warning message
|
|
135
|
-
*/
|
|
136
|
-
export function LogMessageModule_warn(message: string): LogMessage {
|
|
137
|
-
return LogMessageModule_create(4, message);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Create an error message
|
|
142
|
-
*/
|
|
143
|
-
export function LogMessageModule_error(message: string): LogMessage {
|
|
144
|
-
return LogMessageModule_create(5, message);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Create a fatal message
|
|
149
|
-
*/
|
|
150
|
-
export function LogMessageModule_fatal(message: string): LogMessage {
|
|
151
|
-
return LogMessageModule_create(6, message);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export class LogFilter extends Record implements IEquatable<LogFilter>, IComparable<LogFilter> {
|
|
155
|
-
readonly MinLevel: int32;
|
|
156
|
-
readonly IncludeSources: Option<FSharpList<string>>;
|
|
157
|
-
readonly ExcludeSources: Option<FSharpList<string>>;
|
|
158
|
-
readonly IncludeTags: Option<FSharpList<string>>;
|
|
159
|
-
readonly ExcludeTags: Option<FSharpList<string>>;
|
|
160
|
-
constructor(MinLevel: int32, IncludeSources: Option<FSharpList<string>>, ExcludeSources: Option<FSharpList<string>>, IncludeTags: Option<FSharpList<string>>, ExcludeTags: Option<FSharpList<string>>) {
|
|
161
|
-
super();
|
|
162
|
-
this.MinLevel = (MinLevel | 0);
|
|
163
|
-
this.IncludeSources = IncludeSources;
|
|
164
|
-
this.ExcludeSources = ExcludeSources;
|
|
165
|
-
this.IncludeTags = IncludeTags;
|
|
166
|
-
this.ExcludeTags = ExcludeTags;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function LogFilter_$reflection(): TypeInfo {
|
|
171
|
-
return record_type("FormSpec.Logging.LogFilter", [], LogFilter, () => [["MinLevel", enum_type("FormSpec.Logging.LogLevel", int32_type, [["Trace", 0], ["Debug", 1], ["Info", 2], ["Success", 3], ["Warn", 4], ["Error", 5], ["Fatal", 6]])], ["IncludeSources", option_type(list_type(string_type))], ["ExcludeSources", option_type(list_type(string_type))], ["IncludeTags", option_type(list_type(string_type))], ["ExcludeTags", option_type(list_type(string_type))]]);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export const LogFilterModule_defaultFilter: LogFilter = new LogFilter(2, undefined, undefined, undefined, undefined);
|
|
175
|
-
|
|
176
|
-
export const LogFilterModule_developmentFilter: LogFilter = new LogFilter(1, LogFilterModule_defaultFilter.IncludeSources, LogFilterModule_defaultFilter.ExcludeSources, LogFilterModule_defaultFilter.IncludeTags, LogFilterModule_defaultFilter.ExcludeTags);
|
|
177
|
-
|
|
178
|
-
export const LogFilterModule_productionFilter: LogFilter = new LogFilter(4, LogFilterModule_defaultFilter.IncludeSources, LogFilterModule_defaultFilter.ExcludeSources, LogFilterModule_defaultFilter.IncludeTags, LogFilterModule_defaultFilter.ExcludeTags);
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Check if a log message passes the filter
|
|
182
|
-
*/
|
|
183
|
-
export function LogFilterModule_shouldLog(filter: LogFilter, msg: LogMessage): boolean {
|
|
184
|
-
if (msg.Level < filter.MinLevel) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export class BatchConfig extends Record implements IEquatable<BatchConfig>, IComparable<BatchConfig> {
|
|
193
|
-
readonly MaxBatchSize: int32;
|
|
194
|
-
readonly FlushIntervalMs: int32;
|
|
195
|
-
readonly Enabled: boolean;
|
|
196
|
-
constructor(MaxBatchSize: int32, FlushIntervalMs: int32, Enabled: boolean) {
|
|
197
|
-
super();
|
|
198
|
-
this.MaxBatchSize = (MaxBatchSize | 0);
|
|
199
|
-
this.FlushIntervalMs = (FlushIntervalMs | 0);
|
|
200
|
-
this.Enabled = Enabled;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function BatchConfig_$reflection(): TypeInfo {
|
|
205
|
-
return record_type("FormSpec.Logging.BatchConfig", [], BatchConfig, () => [["MaxBatchSize", int32_type], ["FlushIntervalMs", int32_type], ["Enabled", bool_type]]);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export const BatchConfigModule_defaultConfig: BatchConfig = new BatchConfig(100, 1000, false);
|
|
209
|
-
|
|
210
|
-
export const BatchConfigModule_performanceConfig: BatchConfig = new BatchConfig(500, 5000, true);
|
|
211
|
-
|
|
212
|
-
//# sourceMappingURL=LogTypes.ts.map
|
|
1
|
+
import { Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
+
import { float64, int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
3
|
+
import { Option } from "@fable-org/fable-library-js/Option.js";
|
|
4
|
+
import { FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
5
|
+
import { FSharpList } from "@fable-org/fable-library-js/List.js";
|
|
6
|
+
import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
7
|
+
import { bool_type, record_type, float64_type, list_type, option_type, obj_type, class_type, string_type, enum_type, int32_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
8
|
+
import { utcNow } from "@fable-org/fable-library-js/Date.js";
|
|
9
|
+
|
|
10
|
+
export class LogMessage extends Record implements IEquatable<LogMessage> {
|
|
11
|
+
readonly Level: int32;
|
|
12
|
+
readonly Message: string;
|
|
13
|
+
readonly Timestamp: Date;
|
|
14
|
+
readonly Context: Option<FSharpMap<string, any>>;
|
|
15
|
+
readonly Source: Option<string>;
|
|
16
|
+
readonly CorrelationId: Option<string>;
|
|
17
|
+
readonly Tags: Option<FSharpList<string>>;
|
|
18
|
+
readonly UserId: Option<string>;
|
|
19
|
+
readonly SessionId: Option<string>;
|
|
20
|
+
readonly Exception: Option<Error>;
|
|
21
|
+
readonly PerformanceMetrics: Option<FSharpMap<string, float64>>;
|
|
22
|
+
constructor(Level: int32, Message: string, Timestamp: Date, Context: Option<FSharpMap<string, any>>, Source: Option<string>, CorrelationId: Option<string>, Tags: Option<FSharpList<string>>, UserId: Option<string>, SessionId: Option<string>, Exception: Option<Error>, PerformanceMetrics: Option<FSharpMap<string, float64>>) {
|
|
23
|
+
super();
|
|
24
|
+
this.Level = (Level | 0);
|
|
25
|
+
this.Message = Message;
|
|
26
|
+
this.Timestamp = Timestamp;
|
|
27
|
+
this.Context = Context;
|
|
28
|
+
this.Source = Source;
|
|
29
|
+
this.CorrelationId = CorrelationId;
|
|
30
|
+
this.Tags = Tags;
|
|
31
|
+
this.UserId = UserId;
|
|
32
|
+
this.SessionId = SessionId;
|
|
33
|
+
this.Exception = Exception;
|
|
34
|
+
this.PerformanceMetrics = PerformanceMetrics;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function LogMessage_$reflection(): TypeInfo {
|
|
39
|
+
return record_type("FormSpec.Logging.LogMessage", [], LogMessage, () => [["Level", enum_type("FormSpec.Logging.LogLevel", int32_type, [["Trace", 0], ["Debug", 1], ["Info", 2], ["Success", 3], ["Warn", 4], ["Error", 5], ["Fatal", 6]])], ["Message", string_type], ["Timestamp", class_type("System.DateTime")], ["Context", option_type(class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, obj_type]))], ["Source", option_type(string_type)], ["CorrelationId", option_type(class_type("System.Guid"))], ["Tags", option_type(list_type(string_type))], ["UserId", option_type(string_type)], ["SessionId", option_type(string_type)], ["Exception", option_type(class_type("System.Exception"))], ["PerformanceMetrics", option_type(class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, float64_type]))]]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a basic log message
|
|
44
|
+
*/
|
|
45
|
+
export function LogMessageModule_create(level: int32, message: string): LogMessage {
|
|
46
|
+
return new LogMessage(level, message, utcNow(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Add context to a log message
|
|
51
|
+
*/
|
|
52
|
+
export function LogMessageModule_withContext(context: FSharpMap<string, any>, msg: LogMessage): LogMessage {
|
|
53
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Add source to a log message
|
|
58
|
+
*/
|
|
59
|
+
export function LogMessageModule_withSource(source: string, msg: LogMessage): LogMessage {
|
|
60
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Add correlation ID to a log message
|
|
65
|
+
*/
|
|
66
|
+
export function LogMessageModule_withCorrelationId(correlationId: string, msg: LogMessage): LogMessage {
|
|
67
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, correlationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Add tags to a log message
|
|
72
|
+
*/
|
|
73
|
+
export function LogMessageModule_withTags(tags: FSharpList<string>, msg: LogMessage): LogMessage {
|
|
74
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, tags, msg.UserId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Add user ID to a log message
|
|
79
|
+
*/
|
|
80
|
+
export function LogMessageModule_withUserId(userId: string, msg: LogMessage): LogMessage {
|
|
81
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, userId, msg.SessionId, msg.Exception, msg.PerformanceMetrics);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Add session ID to a log message
|
|
86
|
+
*/
|
|
87
|
+
export function LogMessageModule_withSessionId(sessionId: string, msg: LogMessage): LogMessage {
|
|
88
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, sessionId, msg.Exception, msg.PerformanceMetrics);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Add exception to a log message
|
|
93
|
+
*/
|
|
94
|
+
export function LogMessageModule_withException(ex: Error, msg: LogMessage): LogMessage {
|
|
95
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, ex, msg.PerformanceMetrics);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Add performance metrics to a log message
|
|
100
|
+
*/
|
|
101
|
+
export function LogMessageModule_withPerformanceMetrics(metrics: FSharpMap<string, float64>, msg: LogMessage): LogMessage {
|
|
102
|
+
return new LogMessage(msg.Level, msg.Message, msg.Timestamp, msg.Context, msg.Source, msg.CorrelationId, msg.Tags, msg.UserId, msg.SessionId, msg.Exception, metrics);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Create a trace message
|
|
107
|
+
*/
|
|
108
|
+
export function LogMessageModule_trace(message: string): LogMessage {
|
|
109
|
+
return LogMessageModule_create(0, message);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Create a debug message
|
|
114
|
+
*/
|
|
115
|
+
export function LogMessageModule_debug(message: string): LogMessage {
|
|
116
|
+
return LogMessageModule_create(1, message);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Create an info message
|
|
121
|
+
*/
|
|
122
|
+
export function LogMessageModule_info(message: string): LogMessage {
|
|
123
|
+
return LogMessageModule_create(2, message);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Create a success message
|
|
128
|
+
*/
|
|
129
|
+
export function LogMessageModule_success(message: string): LogMessage {
|
|
130
|
+
return LogMessageModule_create(3, message);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Create a warning message
|
|
135
|
+
*/
|
|
136
|
+
export function LogMessageModule_warn(message: string): LogMessage {
|
|
137
|
+
return LogMessageModule_create(4, message);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Create an error message
|
|
142
|
+
*/
|
|
143
|
+
export function LogMessageModule_error(message: string): LogMessage {
|
|
144
|
+
return LogMessageModule_create(5, message);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Create a fatal message
|
|
149
|
+
*/
|
|
150
|
+
export function LogMessageModule_fatal(message: string): LogMessage {
|
|
151
|
+
return LogMessageModule_create(6, message);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export class LogFilter extends Record implements IEquatable<LogFilter>, IComparable<LogFilter> {
|
|
155
|
+
readonly MinLevel: int32;
|
|
156
|
+
readonly IncludeSources: Option<FSharpList<string>>;
|
|
157
|
+
readonly ExcludeSources: Option<FSharpList<string>>;
|
|
158
|
+
readonly IncludeTags: Option<FSharpList<string>>;
|
|
159
|
+
readonly ExcludeTags: Option<FSharpList<string>>;
|
|
160
|
+
constructor(MinLevel: int32, IncludeSources: Option<FSharpList<string>>, ExcludeSources: Option<FSharpList<string>>, IncludeTags: Option<FSharpList<string>>, ExcludeTags: Option<FSharpList<string>>) {
|
|
161
|
+
super();
|
|
162
|
+
this.MinLevel = (MinLevel | 0);
|
|
163
|
+
this.IncludeSources = IncludeSources;
|
|
164
|
+
this.ExcludeSources = ExcludeSources;
|
|
165
|
+
this.IncludeTags = IncludeTags;
|
|
166
|
+
this.ExcludeTags = ExcludeTags;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function LogFilter_$reflection(): TypeInfo {
|
|
171
|
+
return record_type("FormSpec.Logging.LogFilter", [], LogFilter, () => [["MinLevel", enum_type("FormSpec.Logging.LogLevel", int32_type, [["Trace", 0], ["Debug", 1], ["Info", 2], ["Success", 3], ["Warn", 4], ["Error", 5], ["Fatal", 6]])], ["IncludeSources", option_type(list_type(string_type))], ["ExcludeSources", option_type(list_type(string_type))], ["IncludeTags", option_type(list_type(string_type))], ["ExcludeTags", option_type(list_type(string_type))]]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const LogFilterModule_defaultFilter: LogFilter = new LogFilter(2, undefined, undefined, undefined, undefined);
|
|
175
|
+
|
|
176
|
+
export const LogFilterModule_developmentFilter: LogFilter = new LogFilter(1, LogFilterModule_defaultFilter.IncludeSources, LogFilterModule_defaultFilter.ExcludeSources, LogFilterModule_defaultFilter.IncludeTags, LogFilterModule_defaultFilter.ExcludeTags);
|
|
177
|
+
|
|
178
|
+
export const LogFilterModule_productionFilter: LogFilter = new LogFilter(4, LogFilterModule_defaultFilter.IncludeSources, LogFilterModule_defaultFilter.ExcludeSources, LogFilterModule_defaultFilter.IncludeTags, LogFilterModule_defaultFilter.ExcludeTags);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Check if a log message passes the filter
|
|
182
|
+
*/
|
|
183
|
+
export function LogFilterModule_shouldLog(filter: LogFilter, msg: LogMessage): boolean {
|
|
184
|
+
if (msg.Level < filter.MinLevel) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class BatchConfig extends Record implements IEquatable<BatchConfig>, IComparable<BatchConfig> {
|
|
193
|
+
readonly MaxBatchSize: int32;
|
|
194
|
+
readonly FlushIntervalMs: int32;
|
|
195
|
+
readonly Enabled: boolean;
|
|
196
|
+
constructor(MaxBatchSize: int32, FlushIntervalMs: int32, Enabled: boolean) {
|
|
197
|
+
super();
|
|
198
|
+
this.MaxBatchSize = (MaxBatchSize | 0);
|
|
199
|
+
this.FlushIntervalMs = (FlushIntervalMs | 0);
|
|
200
|
+
this.Enabled = Enabled;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function BatchConfig_$reflection(): TypeInfo {
|
|
205
|
+
return record_type("FormSpec.Logging.BatchConfig", [], BatchConfig, () => [["MaxBatchSize", int32_type], ["FlushIntervalMs", int32_type], ["Enabled", bool_type]]);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export const BatchConfigModule_defaultConfig: BatchConfig = new BatchConfig(100, 1000, false);
|
|
209
|
+
|
|
210
|
+
export const BatchConfigModule_performanceConfig: BatchConfig = new BatchConfig(500, 5000, true);
|
|
211
|
+
|
|
212
|
+
//# sourceMappingURL=LogTypes.ts.map
|