@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.
Files changed (161) hide show
  1. package/Components/HelloComponent.d.ts +20 -0
  2. package/Components/HelloComponent.d.ts.map +1 -0
  3. package/Designer.d.ts.map +1 -0
  4. package/FormSpec.TS/Designer.js +2 -2
  5. package/FormSpec.TS/Designer.js.map +1 -1
  6. package/FormSpec.TS/Designer.ts.map +1 -1
  7. package/FormSpec.TS/FormSpec.js +210 -143
  8. package/FormSpec.TS/FormSpec.js.map +1 -1
  9. package/FormSpec.TS/FormSpec.ts.map +1 -1
  10. package/FormSpec.TS/FormSpecHelpers.js +62 -40
  11. package/FormSpec.TS/FormSpecHelpers.js.map +1 -1
  12. package/FormSpec.TS/FormSpecHelpers.ts.map +1 -1
  13. package/FormSpec.TS/FormSpecValues.js +207 -0
  14. package/FormSpec.TS/FormSpecValues.js.map +1 -0
  15. package/FormSpec.TS/FormSpecValues.ts.map +1 -0
  16. package/FormSpec.TS/Helpers.js +26 -25
  17. package/FormSpec.TS/Helpers.js.map +1 -1
  18. package/FormSpec.TS/Helpers.ts.map +1 -1
  19. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +85 -125
  20. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  21. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  22. package/FormSpec.TS/Interop/FormSpec.Api.Option.js +37 -7
  23. package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -1
  24. package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -1
  25. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +103 -80
  26. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
  27. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
  28. package/FormSpec.TS/PathwayExecutor.js +371 -125
  29. package/FormSpec.TS/PathwayExecutor.js.map +1 -1
  30. package/FormSpec.TS/PathwayExecutor.ts.map +1 -1
  31. package/FormSpec.TS/PathwayValidator.js +14 -26
  32. package/FormSpec.TS/PathwayValidator.js.map +1 -1
  33. package/FormSpec.TS/PathwayValidator.ts.map +1 -1
  34. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
  35. package/FormSpec.TS/Renderers/PathwayRenderers.js +35 -26
  36. package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -1
  37. package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -1
  38. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +0 -0
  39. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +0 -0
  40. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +0 -0
  41. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +0 -0
  42. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +0 -0
  43. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +0 -0
  44. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +0 -0
  45. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +0 -0
  46. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +0 -0
  47. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +0 -0
  48. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +0 -0
  49. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +0 -0
  50. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +0 -0
  51. package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +0 -0
  52. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +0 -0
  53. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +0 -0
  54. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +0 -0
  55. package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +0 -0
  56. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +0 -0
  57. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +0 -0
  58. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +0 -0
  59. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +0 -0
  60. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +0 -0
  61. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +0 -0
  62. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +0 -0
  63. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +0 -0
  64. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +0 -0
  65. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +0 -0
  66. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +0 -0
  67. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +0 -0
  68. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +0 -0
  69. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +0 -0
  70. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +0 -0
  71. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +0 -0
  72. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +0 -0
  73. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +0 -0
  74. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +0 -0
  75. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +0 -0
  76. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +0 -0
  77. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +0 -0
  78. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
  79. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
  80. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +0 -0
  81. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +0 -0
  82. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +0 -0
  83. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  84. package/FormSpec.d.ts +56 -43
  85. package/FormSpec.d.ts.map +1 -0
  86. package/FormSpecHelpers.d.ts +18 -12
  87. package/FormSpecHelpers.d.ts.map +1 -0
  88. package/FormSpecValues.d.ts +62 -0
  89. package/FormSpecValues.d.ts.map +1 -0
  90. package/Helpers.d.ts +11 -10
  91. package/Helpers.d.ts.map +1 -0
  92. package/Interfaces.d.ts.map +1 -0
  93. package/Interop/FormSpec.Api.Helpers.d.ts +25 -28
  94. package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  95. package/Interop/FormSpec.Api.Option.d.ts +10 -6
  96. package/Interop/FormSpec.Api.Option.d.ts.map +1 -1
  97. package/Interop/FormSpec.Values.Api.Option.d.ts +35 -22
  98. package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
  99. package/Logging/LogTypes.d.ts +112 -0
  100. package/Logging/LogTypes.d.ts.map +1 -0
  101. package/Migrator.d.ts.map +1 -0
  102. package/PathwayDataExtractor.d.ts.map +1 -0
  103. package/PathwayExecutor.d.ts +63 -33
  104. package/PathwayExecutor.d.ts.map +1 -0
  105. package/PathwayValidator.d.ts.map +1 -0
  106. package/PluginInterface.d.ts.map +1 -0
  107. package/Prelude.d.ts.map +1 -0
  108. package/README.TS.md +621 -621
  109. package/README.md +98 -85
  110. package/Renderers/FormSpecMarkdownRenderer.d.ts +11 -0
  111. package/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -0
  112. package/Renderers/MermaidRenderer.d.ts +48 -0
  113. package/Renderers/MermaidRenderer.d.ts.map +1 -0
  114. package/Renderers/PathwayRenderers.d.ts +59 -0
  115. package/Renderers/PathwayRenderers.d.ts.map +1 -0
  116. package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts +126 -0
  117. package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts.map +1 -0
  118. package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts +163 -0
  119. package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts.map +1 -0
  120. package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts +66 -0
  121. package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts.map +1 -0
  122. package/package.json +53 -39
  123. package/src/Components/HelloComponent.ts +48 -48
  124. package/src/Designer.ts +389 -389
  125. package/src/FormSpec.ts +3154 -3114
  126. package/src/FormSpecHelpers.ts +397 -374
  127. package/src/FormSpecValues.ts +158 -0
  128. package/src/Helpers.ts +766 -765
  129. package/src/Interfaces.ts +166 -166
  130. package/src/Interop/FormSpec.Api.Helpers.ts +835 -872
  131. package/src/Interop/FormSpec.Api.Option.ts +1637 -1618
  132. package/src/Interop/FormSpec.Values.Api.Option.ts +1241 -1214
  133. package/src/Logging/LogTypes.ts +212 -212
  134. package/src/Migrator.ts +156 -156
  135. package/src/PathwayDataExtractor.ts +290 -290
  136. package/src/PathwayExecutor.ts +1379 -1102
  137. package/src/PathwayValidator.ts +238 -244
  138. package/src/PluginInterface.ts +79 -79
  139. package/src/Prelude.ts +21 -21
  140. package/src/Renderers/FormSpecMarkdownRenderer.ts +875 -874
  141. package/src/Renderers/MermaidRenderer.ts +218 -218
  142. package/src/Renderers/PathwayRenderers.ts +208 -200
  143. package/src/Components/HelloComponent.ts.map +0 -1
  144. package/src/Designer.ts.map +0 -1
  145. package/src/FormSpec.ts.map +0 -1
  146. package/src/FormSpecHelpers.ts.map +0 -1
  147. package/src/Helpers.ts.map +0 -1
  148. package/src/Interfaces.ts.map +0 -1
  149. package/src/Interop/FormSpec.Api.Helpers.ts.map +0 -1
  150. package/src/Interop/FormSpec.Api.Option.ts.map +0 -1
  151. package/src/Interop/FormSpec.Values.Api.Option.ts.map +0 -1
  152. package/src/Logging/LogTypes.ts.map +0 -1
  153. package/src/Migrator.ts.map +0 -1
  154. package/src/PathwayDataExtractor.ts.map +0 -1
  155. package/src/PathwayExecutor.ts.map +0 -1
  156. package/src/PathwayValidator.ts.map +0 -1
  157. package/src/PluginInterface.ts.map +0 -1
  158. package/src/Prelude.ts.map +0 -1
  159. package/src/Renderers/FormSpecMarkdownRenderer.ts.map +0 -1
  160. package/src/Renderers/MermaidRenderer.ts.map +0 -1
  161. package/src/Renderers/PathwayRenderers.ts.map +0 -1
@@ -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