@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
package/src/Migrator.ts CHANGED
@@ -1,156 +1,156 @@
1
- import { Union } from "@fable-org/fable-library-js/Types.js";
2
- import { string_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
3
- import { Spec_FieldType_$union, Spec_FieldType_$reflection, Spec_FormSpec$1_$reflection, Spec_FormSpec$1 } from "./FormSpec.js";
4
- import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "./fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
5
- import { uncurry2 } from "@fable-org/fable-library-js/Util.js";
6
- import { FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
7
-
8
- export function Base64_decode(text: string): string {
9
- return window.atob(text);
10
- }
11
-
12
- export function Base64_encode(text: string): string {
13
- return window.btoa(text);
14
- }
15
-
16
- export type FormSpec_FormSpecInput_$union =
17
- | FormSpec_FormSpecInput<0>
18
- | FormSpec_FormSpecInput<1>
19
-
20
- export type FormSpec_FormSpecInput_$cases = {
21
- 0: ["Latest", []],
22
- 1: ["Unknown", []]
23
- }
24
-
25
- export function FormSpec_FormSpecInput_Latest() {
26
- return new FormSpec_FormSpecInput<0>(0, []);
27
- }
28
-
29
- export function FormSpec_FormSpecInput_Unknown() {
30
- return new FormSpec_FormSpecInput<1>(1, []);
31
- }
32
-
33
- export class FormSpec_FormSpecInput<Tag extends keyof FormSpec_FormSpecInput_$cases> extends Union<Tag, FormSpec_FormSpecInput_$cases[Tag][0]> {
34
- constructor(readonly tag: Tag, readonly fields: FormSpec_FormSpecInput_$cases[Tag][1]) {
35
- super();
36
- }
37
- cases() {
38
- return ["Latest", "Unknown"];
39
- }
40
- }
41
-
42
- export function FormSpec_FormSpecInput_$reflection(): TypeInfo {
43
- return union_type("F1.Studio.Migrator.FormSpec.FormSpecInput", [], FormSpec_FormSpecInput, () => [[], []]);
44
- }
45
-
46
- export class FormSpec_FormSpecOutput extends Union<0, "Latest"> {
47
- constructor() {
48
- super();
49
- this.tag = 0;
50
- this.fields = [];
51
- }
52
- readonly tag: 0;
53
- readonly fields: [];
54
- cases() {
55
- return ["Latest"];
56
- }
57
- }
58
-
59
- export function FormSpec_FormSpecOutput_$reflection(): TypeInfo {
60
- return union_type("F1.Studio.Migrator.FormSpec.FormSpecOutput", [], FormSpec_FormSpecOutput, () => [[]]);
61
- }
62
-
63
- export class FormSpec_FormSpecVersion$1<FieldType> extends Union<0, "Latest"> {
64
- constructor(Item: Spec_FormSpec$1<FieldType>) {
65
- super();
66
- this.tag = 0;
67
- this.fields = [Item];
68
- }
69
- readonly tag: 0;
70
- readonly fields: [Spec_FormSpec$1<FieldType>];
71
- cases() {
72
- return ["Latest"];
73
- }
74
- }
75
-
76
- export function FormSpec_FormSpecVersion$1_$reflection(gen0: TypeInfo): TypeInfo {
77
- return union_type("F1.Studio.Migrator.FormSpec.FormSpecVersion`1", [gen0], FormSpec_FormSpecVersion$1, () => [[["Item", Spec_FormSpec$1_$reflection(gen0)]]]);
78
- }
79
-
80
- export function FormSpec_migrateTo<FieldType>(outputVersion: FormSpec_FormSpecOutput, formSpec: FormSpec_FormSpecVersion$1<FieldType>): FormSpec_FormSpecVersion$1<FieldType> {
81
- return new FormSpec_FormSpecVersion$1<FieldType>(formSpec.fields[0]);
82
- }
83
-
84
- export function FormSpec_decodeFormSpec<FieldType>(inputVersion: FormSpec_FormSpecInput_$union, formSpecJson: string): FormSpec_FormSpecVersion$1<FieldType> {
85
- if (inputVersion.tag === /* Latest */ 0) {
86
- }
87
- const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined)), formSpecJson);
88
- if (matchValue.tag === /* Error */ 1) {
89
- const err: string = matchValue.fields[0];
90
- throw new Error("The input format does not match 3.0.0");
91
- }
92
- else {
93
- return new FormSpec_FormSpecVersion$1<FieldType>(matchValue.fields[0] as Spec_FormSpec$1<FieldType>);
94
- }
95
- }
96
-
97
- export function FormSpec_decodeFormSpecB64<$a>(inputVersion: FormSpec_FormSpecInput_$union, formSpecB64: string): FormSpec_FormSpecVersion$1<$a> {
98
- return FormSpec_decodeFormSpec<$a>(inputVersion, Base64_decode(formSpecB64));
99
- }
100
-
101
- export function FormSpec_decodeAndMigrateFormSpecBase64<$a>(inputVersion: FormSpec_FormSpecInput_$union, formSpecB64: string): Spec_FormSpec$1<$a> {
102
- return FormSpec_migrateTo<$a>(new FormSpec_FormSpecOutput(), FormSpec_decodeFormSpecB64<$a>(inputVersion, formSpecB64)).fields[0];
103
- }
104
-
105
- export class Values_FormValuesInput extends Union<0, "Latest"> {
106
- constructor() {
107
- super();
108
- this.tag = 0;
109
- this.fields = [];
110
- }
111
- readonly tag: 0;
112
- readonly fields: [];
113
- cases() {
114
- return ["Latest"];
115
- }
116
- }
117
-
118
- export function Values_FormValuesInput_$reflection(): TypeInfo {
119
- return union_type("F1.Studio.Migrator.Values.FormValuesInput", [], Values_FormValuesInput, () => [[]]);
120
- }
121
-
122
- export class Values_FormValuesOutput extends Union<0, "Latest"> {
123
- constructor() {
124
- super();
125
- this.tag = 0;
126
- this.fields = [];
127
- }
128
- readonly tag: 0;
129
- readonly fields: [];
130
- cases() {
131
- return ["Latest"];
132
- }
133
- }
134
-
135
- export function Values_FormValuesOutput_$reflection(): TypeInfo {
136
- return union_type("F1.Studio.Migrator.Values.FormValuesOutput", [], Values_FormValuesOutput, () => [[]]);
137
- }
138
-
139
- export class Values_FormValuesVersion$1<FieldType> extends Union<0, "Latest"> {
140
- constructor(Item: string) {
141
- super();
142
- this.tag = 0;
143
- this.fields = [Item];
144
- }
145
- readonly tag: 0;
146
- readonly fields: [string];
147
- cases() {
148
- return ["Latest"];
149
- }
150
- }
151
-
152
- export function Values_FormValuesVersion$1_$reflection(gen0: TypeInfo): TypeInfo {
153
- return union_type("F1.Studio.Migrator.Values.FormValuesVersion`1", [gen0], Values_FormValuesVersion$1, () => [[["Item", string_type]]]);
154
- }
155
-
156
- //# sourceMappingURL=Migrator.ts.map
1
+ import { Union } from "@fable-org/fable-library-js/Types.js";
2
+ import { string_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
3
+ import { Spec_FieldType_$union, Spec_FieldType_$reflection, Spec_FormSpec$1_$reflection, Spec_FormSpec$1 } from "./FormSpec.js";
4
+ import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "./fable_modules/Thoth.Json.10.4.1/Decode.fs.js";
5
+ import { uncurry2 } from "@fable-org/fable-library-js/Util.js";
6
+ import { FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
7
+
8
+ export function Base64_decode(text: string): string {
9
+ return window.atob(text);
10
+ }
11
+
12
+ export function Base64_encode(text: string): string {
13
+ return window.btoa(text);
14
+ }
15
+
16
+ export type FormSpec_FormSpecInput_$union =
17
+ | FormSpec_FormSpecInput<0>
18
+ | FormSpec_FormSpecInput<1>
19
+
20
+ export type FormSpec_FormSpecInput_$cases = {
21
+ 0: ["Latest", []],
22
+ 1: ["Unknown", []]
23
+ }
24
+
25
+ export function FormSpec_FormSpecInput_Latest() {
26
+ return new FormSpec_FormSpecInput<0>(0, []);
27
+ }
28
+
29
+ export function FormSpec_FormSpecInput_Unknown() {
30
+ return new FormSpec_FormSpecInput<1>(1, []);
31
+ }
32
+
33
+ export class FormSpec_FormSpecInput<Tag extends keyof FormSpec_FormSpecInput_$cases> extends Union<Tag, FormSpec_FormSpecInput_$cases[Tag][0]> {
34
+ constructor(readonly tag: Tag, readonly fields: FormSpec_FormSpecInput_$cases[Tag][1]) {
35
+ super();
36
+ }
37
+ cases() {
38
+ return ["Latest", "Unknown"];
39
+ }
40
+ }
41
+
42
+ export function FormSpec_FormSpecInput_$reflection(): TypeInfo {
43
+ return union_type("F1.Studio.Migrator.FormSpec.FormSpecInput", [], FormSpec_FormSpecInput, () => [[], []]);
44
+ }
45
+
46
+ export class FormSpec_FormSpecOutput extends Union<0, "Latest"> {
47
+ constructor() {
48
+ super();
49
+ this.tag = 0;
50
+ this.fields = [];
51
+ }
52
+ readonly tag: 0;
53
+ readonly fields: [];
54
+ cases() {
55
+ return ["Latest"];
56
+ }
57
+ }
58
+
59
+ export function FormSpec_FormSpecOutput_$reflection(): TypeInfo {
60
+ return union_type("F1.Studio.Migrator.FormSpec.FormSpecOutput", [], FormSpec_FormSpecOutput, () => [[]]);
61
+ }
62
+
63
+ export class FormSpec_FormSpecVersion$1<FieldType> extends Union<0, "Latest"> {
64
+ constructor(Item: Spec_FormSpec$1<FieldType>) {
65
+ super();
66
+ this.tag = 0;
67
+ this.fields = [Item];
68
+ }
69
+ readonly tag: 0;
70
+ readonly fields: [Spec_FormSpec$1<FieldType>];
71
+ cases() {
72
+ return ["Latest"];
73
+ }
74
+ }
75
+
76
+ export function FormSpec_FormSpecVersion$1_$reflection(gen0: TypeInfo): TypeInfo {
77
+ return union_type("F1.Studio.Migrator.FormSpec.FormSpecVersion`1", [gen0], FormSpec_FormSpecVersion$1, () => [[["Item", Spec_FormSpec$1_$reflection(gen0)]]]);
78
+ }
79
+
80
+ export function FormSpec_migrateTo<FieldType>(outputVersion: FormSpec_FormSpecOutput, formSpec: FormSpec_FormSpecVersion$1<FieldType>): FormSpec_FormSpecVersion$1<FieldType> {
81
+ return new FormSpec_FormSpecVersion$1<FieldType>(formSpec.fields[0]);
82
+ }
83
+
84
+ export function FormSpec_decodeFormSpec<FieldType>(inputVersion: FormSpec_FormSpecInput_$union, formSpecJson: string): FormSpec_FormSpecVersion$1<FieldType> {
85
+ if (inputVersion.tag === /* Latest */ 0) {
86
+ }
87
+ const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined)), formSpecJson);
88
+ if (matchValue.tag === /* Error */ 1) {
89
+ const err: string = matchValue.fields[0];
90
+ throw new Error("The input format does not match 3.0.0");
91
+ }
92
+ else {
93
+ return new FormSpec_FormSpecVersion$1<FieldType>(matchValue.fields[0] as Spec_FormSpec$1<FieldType>);
94
+ }
95
+ }
96
+
97
+ export function FormSpec_decodeFormSpecB64<$a>(inputVersion: FormSpec_FormSpecInput_$union, formSpecB64: string): FormSpec_FormSpecVersion$1<$a> {
98
+ return FormSpec_decodeFormSpec<$a>(inputVersion, Base64_decode(formSpecB64));
99
+ }
100
+
101
+ export function FormSpec_decodeAndMigrateFormSpecBase64<$a>(inputVersion: FormSpec_FormSpecInput_$union, formSpecB64: string): Spec_FormSpec$1<$a> {
102
+ return FormSpec_migrateTo<$a>(new FormSpec_FormSpecOutput(), FormSpec_decodeFormSpecB64<$a>(inputVersion, formSpecB64)).fields[0];
103
+ }
104
+
105
+ export class Values_FormValuesInput extends Union<0, "Latest"> {
106
+ constructor() {
107
+ super();
108
+ this.tag = 0;
109
+ this.fields = [];
110
+ }
111
+ readonly tag: 0;
112
+ readonly fields: [];
113
+ cases() {
114
+ return ["Latest"];
115
+ }
116
+ }
117
+
118
+ export function Values_FormValuesInput_$reflection(): TypeInfo {
119
+ return union_type("F1.Studio.Migrator.Values.FormValuesInput", [], Values_FormValuesInput, () => [[]]);
120
+ }
121
+
122
+ export class Values_FormValuesOutput extends Union<0, "Latest"> {
123
+ constructor() {
124
+ super();
125
+ this.tag = 0;
126
+ this.fields = [];
127
+ }
128
+ readonly tag: 0;
129
+ readonly fields: [];
130
+ cases() {
131
+ return ["Latest"];
132
+ }
133
+ }
134
+
135
+ export function Values_FormValuesOutput_$reflection(): TypeInfo {
136
+ return union_type("F1.Studio.Migrator.Values.FormValuesOutput", [], Values_FormValuesOutput, () => [[]]);
137
+ }
138
+
139
+ export class Values_FormValuesVersion$1<FieldType> extends Union<0, "Latest"> {
140
+ constructor(Item: string) {
141
+ super();
142
+ this.tag = 0;
143
+ this.fields = [Item];
144
+ }
145
+ readonly tag: 0;
146
+ readonly fields: [string];
147
+ cases() {
148
+ return ["Latest"];
149
+ }
150
+ }
151
+
152
+ export function Values_FormValuesVersion$1_$reflection(gen0: TypeInfo): TypeInfo {
153
+ return union_type("F1.Studio.Migrator.Values.FormValuesVersion`1", [gen0], Values_FormValuesVersion$1, () => [[["Item", string_type]]]);
154
+ }
155
+
156
+ //# sourceMappingURL=Migrator.ts.map