@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/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
|