@uides/stepwise 2.0.0-a402a664 → 2.0.0-a64dc016
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/LICENSE +0 -0
- package/generators/componentExtractor.d.mts +1 -0
- package/generators/componentReducer.d.mts +1 -0
- package/generators/templateGenerator.d.mts +1 -0
- package/index.d.ts +2 -0
- package/index.js +7 -0
- package/package.json +6 -21
- package/schemas/action.d.ts +2366 -0
- package/schemas/action.js +196 -0
- package/schemas/application.d.ts +19 -0
- package/schemas/application.js +14 -0
- package/schemas/attributes.d.ts +16 -0
- package/schemas/attributes.js +14 -0
- package/schemas/common.d.ts +25 -0
- package/schemas/common.js +41 -0
- package/schemas/document.d.ts +395 -0
- package/schemas/document.js +79 -0
- package/schemas/edupass-healthstate.d.ts +77 -0
- package/schemas/edupass-healthstate.js +76 -0
- package/schemas/field/afm/index.d.ts +52 -0
- package/schemas/field/afm/index.js +20 -0
- package/schemas/field/amka/index.d.ts +60 -0
- package/schemas/field/amka/index.js +21 -0
- package/schemas/field/attachment/index.d.ts +68 -0
- package/schemas/field/attachment/index.js +38 -0
- package/schemas/field/captcha/index.d.ts +48 -0
- package/schemas/field/captcha/index.js +15 -0
- package/schemas/field/choice/index.d.ts +73 -0
- package/schemas/field/choice/index.js +32 -0
- package/schemas/field/common.d.ts +82 -0
- package/schemas/field/common.js +63 -0
- package/schemas/field/consent-content/index.d.ts +68 -0
- package/schemas/field/consent-content/index.js +19 -0
- package/schemas/field/date/index.d.ts +90 -0
- package/schemas/field/date/index.js +42 -0
- package/schemas/field/doc_subtitle/index.d.ts +51 -0
- package/schemas/field/doc_subtitle/index.js +14 -0
- package/schemas/field/doc_title/index.d.ts +60 -0
- package/schemas/field/doc_title/index.js +21 -0
- package/schemas/field/dynamically-filled-text/index.d.ts +85 -0
- package/schemas/field/dynamically-filled-text/index.js +36 -0
- package/schemas/field/email/index.d.ts +60 -0
- package/schemas/field/email/index.js +21 -0
- package/schemas/field/fillable-string/index.d.ts +64 -0
- package/schemas/field/fillable-string/index.js +25 -0
- package/schemas/field/five-block-date/index.d.ts +48 -0
- package/schemas/field/five-block-date/index.js +15 -0
- package/schemas/field/hidden/index.d.ts +59 -0
- package/schemas/field/hidden/index.js +25 -0
- package/schemas/field/hierarchical-selector/index.d.ts +89 -0
- package/schemas/field/hierarchical-selector/index.js +35 -0
- package/schemas/field/iban/index.d.ts +58 -0
- package/schemas/field/iban/index.js +19 -0
- package/schemas/field/image/index.d.ts +68 -0
- package/schemas/field/image/index.js +36 -0
- package/schemas/field/image-crop/index.d.ts +59 -0
- package/schemas/field/image-crop/index.js +19 -0
- package/schemas/field/index.d.ts +48 -0
- package/schemas/field/index.js +167 -0
- package/schemas/field/int/index.d.ts +60 -0
- package/schemas/field/int/index.js +21 -0
- package/schemas/field/intl_mobile_phone/index.d.ts +49 -0
- package/schemas/field/intl_mobile_phone/index.js +15 -0
- package/schemas/field/lab-results/index.d.ts +49 -0
- package/schemas/field/lab-results/index.js +12 -0
- package/schemas/field/landline_phone/index.d.ts +48 -0
- package/schemas/field/landline_phone/index.js +14 -0
- package/schemas/field/link/index.d.ts +50 -0
- package/schemas/field/link/index.js +16 -0
- package/schemas/field/mobile_phone/index.d.ts +51 -0
- package/schemas/field/mobile_phone/index.js +18 -0
- package/schemas/field/multiple-choice/index.d.ts +70 -0
- package/schemas/field/multiple-choice/index.js +31 -0
- package/schemas/field/password/index.d.ts +48 -0
- package/schemas/field/password/index.js +15 -0
- package/schemas/field/pdf-image/index.d.ts +66 -0
- package/schemas/field/pdf-image/index.js +27 -0
- package/schemas/field/phone/index.d.ts +48 -0
- package/schemas/field/phone/index.js +14 -0
- package/schemas/field/postal_code/index.d.ts +50 -0
- package/schemas/field/postal_code/index.js +17 -0
- package/schemas/field/preference-multiple-choice/index.d.ts +90 -0
- package/schemas/field/preference-multiple-choice/index.js +31 -0
- package/schemas/field/qrcode/index.d.ts +71 -0
- package/schemas/field/qrcode/index.js +30 -0
- package/schemas/field/quote/index.d.ts +63 -0
- package/schemas/field/quote/index.js +30 -0
- package/schemas/field/radio-choice/index.d.ts +67 -0
- package/schemas/field/radio-choice/index.js +31 -0
- package/schemas/field/rate/index.d.ts +60 -0
- package/schemas/field/rate/index.js +18 -0
- package/schemas/field/recipient/index.d.ts +51 -0
- package/schemas/field/recipient/index.js +20 -0
- package/schemas/field/redirect/index.d.ts +52 -0
- package/schemas/field/redirect/index.js +15 -0
- package/schemas/field/refcode/index.d.ts +68 -0
- package/schemas/field/refcode/index.js +29 -0
- package/schemas/field/string/index.d.ts +135 -0
- package/schemas/field/string/index.js +80 -0
- package/schemas/field/text/index.d.ts +85 -0
- package/schemas/field/text/index.js +45 -0
- package/schemas/field/three-block-date/index.d.ts +64 -0
- package/schemas/field/three-block-date/index.js +26 -0
- package/schemas/field/url-param/index.d.ts +57 -0
- package/schemas/field/url-param/index.js +14 -0
- package/schemas/fieldset/component-params.d.ts +102 -0
- package/schemas/fieldset/component-params.js +63 -0
- package/schemas/fieldset/display-components.d.ts +353 -0
- package/schemas/fieldset/display-components.js +36 -0
- package/schemas/fieldset/enums.d.ts +32 -0
- package/schemas/fieldset/enums.js +21 -0
- package/schemas/fieldset/index.d.ts +180 -0
- package/schemas/fieldset/index.js +11 -0
- package/schemas/index.d.ts +15 -0
- package/schemas/index.js +15 -0
- package/schemas/layout.d.ts +91 -0
- package/schemas/layout.js +43 -0
- package/schemas/outputs.d.ts +44 -0
- package/schemas/outputs.js +15 -0
- package/schemas/resolve.d.ts +5 -0
- package/schemas/resolve.js +13 -0
- package/schemas/resource/enums.d.ts +58 -0
- package/schemas/resource/enums.js +41 -0
- package/schemas/resource/field.d.ts +15 -0
- package/schemas/resource/field.js +12 -0
- package/schemas/resource/index.d.ts +5 -0
- package/schemas/resource/index.js +5 -0
- package/schemas/resource/object-action.d.ts +30 -0
- package/schemas/resource/object-action.js +24 -0
- package/schemas/resource/resource-action.d.ts +35 -0
- package/schemas/resource/resource-action.js +29 -0
- package/schemas/resource/resource.d.ts +133 -0
- package/schemas/resource/resource.js +31 -0
- package/schemas/step.d.ts +592 -0
- package/schemas/step.js +115 -0
- package/schemas/template/index.d.ts +2 -0
- package/schemas/template/index.js +2 -0
- package/schemas/template/template-base.d.ts +53 -0
- package/schemas/template/template-base.js +15 -0
- package/schemas/template/template-source.d.ts +50 -0
- package/schemas/template/template-source.js +14 -0
- package/schemas/template/template.d.ts +54 -0
- package/schemas/template/template.js +22 -0
- package/schemas/validation-context/enums.d.ts +10 -0
- package/schemas/validation-context/enums.js +7 -0
- package/schemas/validation-context/index.d.ts +2 -0
- package/schemas/validation-context/index.js +2 -0
- package/schemas/validation-context/validation-context.d.ts +131 -0
- package/schemas/validation-context/validation-context.js +55 -0
- package/src/schemas/action.ts +15 -0
- package/src/schemas/common.ts +16 -0
- package/src/schemas/field/afm/index.ts +2 -18
- package/src/schemas/field/amka/index.ts +7 -2
- package/src/schemas/field/attachment/index.ts +12 -24
- package/src/schemas/field/choice/index.ts +2 -13
- package/src/schemas/field/common.ts +75 -51
- package/src/schemas/field/consent-content/index.ts +28 -0
- package/src/schemas/field/date/index.ts +5 -32
- package/src/schemas/field/doc_subtitle/index.ts +1 -0
- package/src/schemas/field/doc_title/index.ts +9 -16
- package/src/schemas/field/dynamically-filled-text/index.ts +4 -5
- package/src/schemas/field/email/index.ts +6 -9
- package/src/schemas/field/fillable-string/index.ts +1 -1
- package/src/schemas/field/hidden/index.ts +4 -43
- package/src/schemas/field/hierarchical-selector/index.ts +3 -9
- package/src/schemas/field/image/index.ts +5 -24
- package/src/schemas/field/image-crop/index.ts +25 -0
- package/src/schemas/field/index.spec.ts +0 -42
- package/src/schemas/field/index.ts +64 -12
- package/src/schemas/field/int/index.ts +2 -0
- package/src/schemas/field/intl_mobile_phone/index.ts +19 -0
- package/src/schemas/field/lab-results/index.ts +1 -2
- package/src/schemas/field/link/index.ts +20 -0
- package/src/schemas/field/mobile_phone/index.ts +1 -12
- package/src/schemas/field/multiple-choice/index.ts +4 -3
- package/src/schemas/field/password/index.ts +18 -0
- package/src/schemas/field/pdf-image/index.ts +3 -15
- package/src/schemas/field/phone/index.ts +18 -0
- package/src/schemas/field/postal_code/index.ts +1 -1
- package/src/schemas/field/preference-multiple-choice/index.ts +41 -0
- package/src/schemas/field/qrcode/index.ts +1 -0
- package/src/schemas/field/quote/index.ts +2 -19
- package/src/schemas/field/radio-choice/index.ts +1 -7
- package/src/schemas/field/rate/index.ts +1 -9
- package/src/schemas/field/recipient/index.ts +2 -2
- package/src/schemas/field/redirect/index.ts +4 -13
- package/src/schemas/field/refcode/index.ts +10 -15
- package/src/schemas/field/string/index.ts +13 -0
- package/src/schemas/field/text/index.ts +4 -18
- package/src/schemas/field/url-param/index.ts +23 -0
- package/src/schemas/resolve.ts +3 -0
- package/src/schemas/step.ts +2 -0
- package/src/schemas/template/index.ts +0 -1
- package/src/schemas/template/template-base.ts +0 -10
- package/src/schemas/template/template.ts +1 -2
- package/src/schemas/validation-context/enums.ts +0 -16
- package/src/schemas/validation-context/validation-context.ts +2 -4
- package/src/utils/index.ts +10 -1
- package/utils/index.d.ts +6 -0
- package/utils/index.js +55 -0
- package/.prettierrc.js +0 -1
- package/.rush/temp/chunked-rush-logs/stepwise.build.chunks.jsonl +0 -6
- package/.rush/temp/package-deps_build.json +0 -185
- package/.rush/temp/shrinkwrap-deps.json +0 -303
- package/eslint.config.mjs +0 -3
- package/rush-logs/stepwise.build.log +0 -6
- package/src/schemas/field/green-pass-qrcode/index.ts +0 -27
- package/src/schemas/template/enums.ts +0 -22
- package/tsconfig.json +0 -25
|
@@ -30,48 +30,6 @@ describe('field schema', () => {
|
|
|
30
30
|
);
|
|
31
31
|
});
|
|
32
32
|
describe('display validation', () => {
|
|
33
|
-
it('should fail, given default display mode that is incompatible with specific display mode', () => {
|
|
34
|
-
const field: Field = {
|
|
35
|
-
'user-input-mode': 'noinput',
|
|
36
|
-
display: {
|
|
37
|
-
default: {
|
|
38
|
-
el: {
|
|
39
|
-
component: 'hierarchical-selector',
|
|
40
|
-
'component-params': {
|
|
41
|
-
dataset: 'some-dataset',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
pdf: {
|
|
46
|
-
el: {
|
|
47
|
-
component: 'hidden',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
const result = v.safeParse(FieldSchema, field);
|
|
53
|
-
expect(result.issues).toBeDefined();
|
|
54
|
-
});
|
|
55
|
-
it('should fail, given default display lang that is incompatible with specific display lang', () => {
|
|
56
|
-
const field: Field = {
|
|
57
|
-
'user-input-mode': 'noinput',
|
|
58
|
-
display: {
|
|
59
|
-
default: {
|
|
60
|
-
default: {
|
|
61
|
-
component: 'hierarchical-selector',
|
|
62
|
-
'component-params': {
|
|
63
|
-
dataset: 'some-dataset',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
el: {
|
|
67
|
-
component: 'hidden',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
const result = v.safeParse(FieldSchema, field);
|
|
73
|
-
expect(result.issues).toBeDefined();
|
|
74
|
-
});
|
|
75
33
|
it('should fail, given empty display', () => {
|
|
76
34
|
const field: Field = {
|
|
77
35
|
'user-input-mode': 'noinput',
|
|
@@ -8,6 +8,9 @@ import Attachment, {
|
|
|
8
8
|
import Captcha, { CaptchaType } from '@uides/stepwise/schemas/field/captcha';
|
|
9
9
|
import Choice, { ChoiceType } from '@uides/stepwise/schemas/field/choice';
|
|
10
10
|
import { DisplayModeAndLangSchema } from '@uides/stepwise/schemas/field/common';
|
|
11
|
+
import ConsentContent, {
|
|
12
|
+
ConsentContentType,
|
|
13
|
+
} from '@uides/stepwise/schemas/field/consent-content';
|
|
11
14
|
import DateField, { DateType } from '@uides/stepwise/schemas/field/date';
|
|
12
15
|
import DocSubtitle, {
|
|
13
16
|
DocSubtitleType,
|
|
@@ -25,34 +28,43 @@ import FillableString, {
|
|
|
25
28
|
import FiveBlockDate, {
|
|
26
29
|
FiveBlockDateType,
|
|
27
30
|
} from '@uides/stepwise/schemas/field/five-block-date';
|
|
28
|
-
import GreenPassQrcode, {
|
|
29
|
-
GreenPassQrcodeType,
|
|
30
|
-
} from '@uides/stepwise/schemas/field/green-pass-qrcode';
|
|
31
31
|
import Hidden, { HiddenType } from '@uides/stepwise/schemas/field/hidden';
|
|
32
32
|
import HierarchicalSelector, {
|
|
33
33
|
HierarchicalSelectorType,
|
|
34
34
|
} from '@uides/stepwise/schemas/field/hierarchical-selector';
|
|
35
35
|
import Iban, { IbanType } from '@uides/stepwise/schemas/field/iban';
|
|
36
36
|
import Image, { ImageType } from '@uides/stepwise/schemas/field/image';
|
|
37
|
+
import ImageCrop, {
|
|
38
|
+
ImageCropType,
|
|
39
|
+
} from '@uides/stepwise/schemas/field/image-crop';
|
|
37
40
|
import Int, { IntType } from '@uides/stepwise/schemas/field/int';
|
|
41
|
+
import IntlMobilePhone, {
|
|
42
|
+
IntlMobilePhoneType,
|
|
43
|
+
} from '@uides/stepwise/schemas/field/intl_mobile_phone';
|
|
38
44
|
import LabResults, {
|
|
39
45
|
LabResultsType,
|
|
40
46
|
} from '@uides/stepwise/schemas/field/lab-results';
|
|
41
47
|
import LandlinePhone, {
|
|
42
48
|
LandlinePhoneType,
|
|
43
49
|
} from '@uides/stepwise/schemas/field/landline_phone';
|
|
50
|
+
import Link, { LinkType } from '@uides/stepwise/schemas/field/link';
|
|
44
51
|
import MobilePhone, {
|
|
45
52
|
MobilePhoneType,
|
|
46
53
|
} from '@uides/stepwise/schemas/field/mobile_phone';
|
|
47
54
|
import MultipleChoice, {
|
|
48
55
|
MultipleChoiceType,
|
|
49
56
|
} from '@uides/stepwise/schemas/field/multiple-choice';
|
|
57
|
+
import Password, { PasswordType } from '@uides/stepwise/schemas/field/password';
|
|
50
58
|
import PdfImage, {
|
|
51
59
|
PdfImageType,
|
|
52
60
|
} from '@uides/stepwise/schemas/field/pdf-image';
|
|
61
|
+
import Phone, { PhoneType } from '@uides/stepwise/schemas/field/phone';
|
|
53
62
|
import PostalCode, {
|
|
54
63
|
PostalCodeType,
|
|
55
64
|
} from '@uides/stepwise/schemas/field/postal_code';
|
|
65
|
+
import PreferenceMultipleChoice, {
|
|
66
|
+
PreferenceMultipleChoiceType,
|
|
67
|
+
} from '@uides/stepwise/schemas/field/preference-multiple-choice';
|
|
56
68
|
import Qrcode, { QrcodeType } from '@uides/stepwise/schemas/field/qrcode';
|
|
57
69
|
import Quote, { QuoteType } from '@uides/stepwise/schemas/field/quote';
|
|
58
70
|
import RadioChoice, {
|
|
@@ -69,7 +81,11 @@ import Text, { TextType } from '@uides/stepwise/schemas/field/text';
|
|
|
69
81
|
import ThreeBlockDate, {
|
|
70
82
|
ThreeBlockDateType,
|
|
71
83
|
} from '@uides/stepwise/schemas/field/three-block-date';
|
|
84
|
+
import UrlParam, {
|
|
85
|
+
UrlParamType,
|
|
86
|
+
} from '@uides/stepwise/schemas/field/url-param';
|
|
72
87
|
import { resolveDisplay } from '@uides/stepwise/schemas/resolve';
|
|
88
|
+
import { isFailureDataset } from '@uides/stepwise/utils';
|
|
73
89
|
|
|
74
90
|
const allFieldSchemas = {
|
|
75
91
|
afm: Afm,
|
|
@@ -77,6 +93,7 @@ const allFieldSchemas = {
|
|
|
77
93
|
attachment: Attachment,
|
|
78
94
|
captcha: Captcha,
|
|
79
95
|
choice: Choice,
|
|
96
|
+
'consent-content': ConsentContent,
|
|
80
97
|
date: DateField,
|
|
81
98
|
doc_title: DocTitle,
|
|
82
99
|
doc_subtitle: DocSubtitle,
|
|
@@ -84,18 +101,23 @@ const allFieldSchemas = {
|
|
|
84
101
|
email: Email,
|
|
85
102
|
'fillable-string': FillableString,
|
|
86
103
|
'five-block-date': FiveBlockDate,
|
|
87
|
-
'green-pass-qrcode': GreenPassQrcode,
|
|
88
104
|
hidden: Hidden,
|
|
89
105
|
'hierarchical-selector': HierarchicalSelector,
|
|
90
106
|
iban: Iban,
|
|
91
107
|
image: Image,
|
|
108
|
+
'image-crop': ImageCrop,
|
|
92
109
|
int: Int,
|
|
110
|
+
intl_mobile_phone: IntlMobilePhone,
|
|
93
111
|
'lab-results': LabResults,
|
|
94
112
|
landline_phone: LandlinePhone,
|
|
113
|
+
link: Link,
|
|
95
114
|
mobile_phone: MobilePhone,
|
|
96
115
|
'multiple-choice': MultipleChoice,
|
|
116
|
+
password: Password,
|
|
97
117
|
'pdf-image': PdfImage,
|
|
118
|
+
phone: Phone,
|
|
98
119
|
postal_code: PostalCode,
|
|
120
|
+
'preference-multiple-choice': PreferenceMultipleChoice,
|
|
99
121
|
qrcode: Qrcode,
|
|
100
122
|
quote: Quote,
|
|
101
123
|
'radio-choice': RadioChoice,
|
|
@@ -106,12 +128,16 @@ const allFieldSchemas = {
|
|
|
106
128
|
string: StringField,
|
|
107
129
|
text: Text,
|
|
108
130
|
'three-block-date': ThreeBlockDate,
|
|
131
|
+
'url-param': UrlParam,
|
|
109
132
|
};
|
|
110
133
|
|
|
134
|
+
export const ComponentSchema = v.picklist(Object.keys(allFieldSchemas));
|
|
135
|
+
|
|
111
136
|
const FieldSchema = v.pipe(
|
|
112
|
-
v.record(v.string(), v.any()),
|
|
137
|
+
v.record(v.string(), v.any()),
|
|
113
138
|
v.rawCheck<Field>(({ dataset, addIssue }) => {
|
|
114
|
-
|
|
139
|
+
if (isFailureDataset(dataset)) return;
|
|
140
|
+
const { display, ...fieldAttrs } = dataset.value;
|
|
115
141
|
if (!display) {
|
|
116
142
|
const result = v.safeParse(allFieldSchemas['string'], fieldAttrs);
|
|
117
143
|
// TODO: DRY
|
|
@@ -145,7 +171,11 @@ const FieldSchema = v.pipe(
|
|
|
145
171
|
});
|
|
146
172
|
}
|
|
147
173
|
DisplayModeSchema.options.forEach((displayMode) => {
|
|
148
|
-
if (
|
|
174
|
+
if (
|
|
175
|
+
!(display && display[displayMode]) ||
|
|
176
|
+
displayMode === 'pdf' // TODO: Add PDF validation
|
|
177
|
+
)
|
|
178
|
+
return;
|
|
149
179
|
Object.keys(display[displayMode] as NonNullable<unknown>).forEach(
|
|
150
180
|
(displayLang) => {
|
|
151
181
|
const resolvedDisplay = resolveDisplay(
|
|
@@ -168,13 +198,28 @@ const FieldSchema = v.pipe(
|
|
|
168
198
|
};
|
|
169
199
|
|
|
170
200
|
const component = resolvedDisplay?.['component'] ?? 'string';
|
|
171
|
-
const
|
|
201
|
+
const componentParseResult = v.safeParse(ComponentSchema, component);
|
|
202
|
+
if (componentParseResult.issues) {
|
|
203
|
+
componentParseResult.issues.forEach((issue) => {
|
|
204
|
+
addIssue({
|
|
205
|
+
message: issue.message,
|
|
206
|
+
path: issue.path,
|
|
207
|
+
input: issue.input,
|
|
208
|
+
expected: issue.expected ?? undefined,
|
|
209
|
+
received: issue.received,
|
|
210
|
+
label: 'Component type',
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const fieldParseResult = v.safeParse(
|
|
172
217
|
allFieldSchemas[component as keyof typeof allFieldSchemas],
|
|
173
218
|
fieldToValidate
|
|
174
219
|
);
|
|
175
|
-
if (
|
|
220
|
+
if (fieldParseResult.issues) {
|
|
176
221
|
// TODO: Add subissues
|
|
177
|
-
|
|
222
|
+
fieldParseResult.issues.forEach((issue) => {
|
|
178
223
|
addIssue({
|
|
179
224
|
message: issue.message,
|
|
180
225
|
path: issue.path,
|
|
@@ -211,6 +256,7 @@ export type Field =
|
|
|
211
256
|
| AttachmentType
|
|
212
257
|
| CaptchaType
|
|
213
258
|
| ChoiceType
|
|
259
|
+
| ConsentContentType
|
|
214
260
|
| DateType
|
|
215
261
|
| DocSubtitleType
|
|
216
262
|
| DocTitleType
|
|
@@ -218,18 +264,23 @@ export type Field =
|
|
|
218
264
|
| EmailType
|
|
219
265
|
| FillableStringType
|
|
220
266
|
| FiveBlockDateType
|
|
221
|
-
| GreenPassQrcodeType
|
|
222
267
|
| HiddenType
|
|
223
268
|
| HierarchicalSelectorType
|
|
224
269
|
| IbanType
|
|
225
270
|
| ImageType
|
|
271
|
+
| ImageCropType
|
|
226
272
|
| IntType
|
|
273
|
+
| IntlMobilePhoneType
|
|
227
274
|
| LabResultsType
|
|
228
275
|
| LandlinePhoneType
|
|
276
|
+
| LinkType
|
|
229
277
|
| MobilePhoneType
|
|
230
278
|
| MultipleChoiceType
|
|
279
|
+
| PasswordType
|
|
231
280
|
| PdfImageType
|
|
281
|
+
| PhoneType
|
|
232
282
|
| PostalCodeType
|
|
283
|
+
| PreferenceMultipleChoiceType
|
|
233
284
|
| QrcodeType
|
|
234
285
|
| QuoteType
|
|
235
286
|
| RadioChoiceType
|
|
@@ -239,7 +290,8 @@ export type Field =
|
|
|
239
290
|
| RefcodeType
|
|
240
291
|
| StringType
|
|
241
292
|
| TextType
|
|
242
|
-
| ThreeBlockDateType
|
|
293
|
+
| ThreeBlockDateType
|
|
294
|
+
| UrlParamType;
|
|
243
295
|
|
|
244
296
|
export type Fields = Record<string, Field>;
|
|
245
297
|
|
|
@@ -16,6 +16,8 @@ const IntSchema = v.strictObject({
|
|
|
16
16
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
17
17
|
display: IntDisplaySchema,
|
|
18
18
|
'default-value': v.nullish(v.string()),
|
|
19
|
+
attribute: v.nullish(v.string()),
|
|
20
|
+
datatype: v.nullish(v.literal('int')),
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export type IntType = v.InferOutput<typeof IntSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
3
|
+
|
|
4
|
+
const IntlMobilePhoneDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
6
|
+
component: v.literal('intl_mobile_phone'),
|
|
7
|
+
})
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const IntlMobilePhoneSchema = v.strictObject({
|
|
11
|
+
'user-input-mode': v.picklist(['noinput', 'required']),
|
|
12
|
+
attribute: v.nullish(v.string()),
|
|
13
|
+
display: IntlMobilePhoneDisplaySchema,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type IntlMobilePhoneType = v.InferOutput<typeof IntlMobilePhoneSchema>;
|
|
17
|
+
export type IntlMobilePhoneSchemaType = v.GenericSchema<IntlMobilePhoneType>;
|
|
18
|
+
|
|
19
|
+
export default IntlMobilePhoneSchema as IntlMobilePhoneSchemaType;
|
|
@@ -10,8 +10,7 @@ const LabResultsDisplaySchema = createFieldDisplay(
|
|
|
10
10
|
const LabResultsSchema = v.strictObject({
|
|
11
11
|
'user-input-mode': v.literal('noinput'),
|
|
12
12
|
display: LabResultsDisplaySchema,
|
|
13
|
-
|
|
14
|
-
attribute: v.string(),
|
|
13
|
+
attribute: v.nullish(v.string()),
|
|
15
14
|
});
|
|
16
15
|
|
|
17
16
|
export type LabResultsType = v.InferOutput<typeof LabResultsSchema>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
3
|
+
|
|
4
|
+
const LinkDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
6
|
+
component: v.literal('link'),
|
|
7
|
+
})
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const LinkSchema = v.strictObject({
|
|
11
|
+
'user-input-mode': v.picklist(['noinput', 'optional']),
|
|
12
|
+
display: LinkDisplaySchema,
|
|
13
|
+
attribute: v.nullish(v.string()),
|
|
14
|
+
datatype: v.nullish(v.literal('link')),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type LinkType = v.InferOutput<typeof LinkSchema>;
|
|
18
|
+
export type LinkSchemaType = v.GenericSchema<LinkType>;
|
|
19
|
+
|
|
20
|
+
export default LinkSchema as LinkSchemaType;
|
|
@@ -7,20 +7,9 @@ const MobilePhoneDisplaySchema = createFieldDisplay(
|
|
|
7
7
|
})
|
|
8
8
|
);
|
|
9
9
|
|
|
10
|
-
const MobilePhoneAttributeSchema = v.nullish(
|
|
11
|
-
v.picklist([
|
|
12
|
-
'civil_registry:mobile',
|
|
13
|
-
'find_onomatodosia:mobile_phone',
|
|
14
|
-
'mobile_certified_login',
|
|
15
|
-
'panelladikes_sms_2021:mobile',
|
|
16
|
-
'panelladikes_sms_2022:mobile',
|
|
17
|
-
'panelladikes_sms_2023:mobile',
|
|
18
|
-
])
|
|
19
|
-
);
|
|
20
|
-
|
|
21
10
|
const MobilePhoneSchema = v.strictObject({
|
|
22
11
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
23
|
-
attribute:
|
|
12
|
+
attribute: v.nullish(v.string()),
|
|
24
13
|
display: MobilePhoneDisplaySchema,
|
|
25
14
|
'default-value': v.nullish(v.string()),
|
|
26
15
|
datatype: v.nullish(v.literal('mobile_phone')),
|
|
@@ -4,8 +4,8 @@ import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
|
4
4
|
const MultipleChoiceDisplaySchema = createFieldDisplay(
|
|
5
5
|
v.strictObject({
|
|
6
6
|
component: v.literal('multiple-choice'),
|
|
7
|
-
choices: v.record(v.string(), v.string()),
|
|
8
|
-
'choices-order': v.string(),
|
|
7
|
+
choices: v.nullish(v.record(v.string(), v.string())),
|
|
8
|
+
'choices-order': v.nullish(v.string()),
|
|
9
9
|
'component-params': v.nullish(
|
|
10
10
|
v.strictObject({
|
|
11
11
|
'legacy-mode': v.nullish(v.boolean()),
|
|
@@ -19,8 +19,9 @@ const MultipleChoiceSchema = v.strictObject({
|
|
|
19
19
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
20
20
|
display: MultipleChoiceDisplaySchema,
|
|
21
21
|
'default-value': v.nullish(v.string()),
|
|
22
|
-
attribute: v.
|
|
22
|
+
attribute: v.nullish(v.string()),
|
|
23
23
|
datatype: v.nullish(v.picklist(['multiple-choice', 'string'])),
|
|
24
|
+
'choices-source-fn': v.nullish(v.string()),
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
export type MultipleChoiceType = v.InferOutput<typeof MultipleChoiceSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
3
|
+
|
|
4
|
+
const PasswordDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
6
|
+
component: v.literal('password'),
|
|
7
|
+
})
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const PasswordSchema = v.strictObject({
|
|
11
|
+
'user-input-mode': v.picklist(['noinput', 'required', 'optional']),
|
|
12
|
+
display: PasswordDisplaySchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type PasswordType = v.InferOutput<typeof PasswordSchema>;
|
|
16
|
+
export type PasswordSchemaType = v.GenericSchema<PasswordType>;
|
|
17
|
+
|
|
18
|
+
export default PasswordSchema as PasswordSchemaType;
|
|
@@ -8,30 +8,18 @@ const PdfImageDisplaySchema = createFieldDisplay(
|
|
|
8
8
|
v.strictObject({
|
|
9
9
|
coordinates: v.array(v.nullable(v.number())),
|
|
10
10
|
position: v.nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
11
|
+
'later-pages': v.nullish(v.boolean()),
|
|
11
12
|
})
|
|
12
13
|
),
|
|
13
14
|
})
|
|
14
15
|
);
|
|
15
16
|
|
|
16
|
-
const PdfImageValueSchema = v.picklist([
|
|
17
|
-
'amea_footer_1_pdf',
|
|
18
|
-
'amea_opeka_logo_pdf',
|
|
19
|
-
'daktylios_backgroud_pdf',
|
|
20
|
-
'dgc_bg_2_pdf',
|
|
21
|
-
'ellada_2.0_pdf',
|
|
22
|
-
'epa_logo_pdf',
|
|
23
|
-
'general_sports_secretariat_pdf',
|
|
24
|
-
'hellenic_coat_of_arms_el_pdf',
|
|
25
|
-
'hellenic_coat_of_arms_el_without_text_opacity10_pdf',
|
|
26
|
-
'hellenic_republic_pdf',
|
|
27
|
-
'AADE_logo_small_pdf',
|
|
28
|
-
]);
|
|
29
|
-
|
|
30
17
|
const PdfImageSchema = v.strictObject({
|
|
31
18
|
display: PdfImageDisplaySchema,
|
|
32
|
-
value:
|
|
19
|
+
value: v.nullish(v.string()),
|
|
33
20
|
'user-input-mode': v.picklist(['noinput', 'display']),
|
|
34
21
|
datatype: v.nullish(v.literal('string')),
|
|
22
|
+
attribute: v.nullish(v.string()),
|
|
35
23
|
});
|
|
36
24
|
|
|
37
25
|
export type PdfImageType = v.InferOutput<typeof PdfImageSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
3
|
+
|
|
4
|
+
const PhoneDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
6
|
+
component: v.literal('phone'),
|
|
7
|
+
})
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const PhoneSchema = v.strictObject({
|
|
11
|
+
'user-input-mode': v.picklist(['noinput', 'required']),
|
|
12
|
+
display: PhoneDisplaySchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type PhoneType = v.InferOutput<typeof PhoneSchema>;
|
|
16
|
+
export type PhoneSchemaType = v.GenericSchema<PhoneType>;
|
|
17
|
+
|
|
18
|
+
export default PhoneSchema as PhoneSchemaType;
|
|
@@ -11,7 +11,7 @@ const PostalCodeSchema = v.strictObject({
|
|
|
11
11
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
12
12
|
display: PostalCodeDisplaySchema,
|
|
13
13
|
datatype: v.nullish(v.literal('postal_code')),
|
|
14
|
-
attribute: v.
|
|
14
|
+
attribute: v.nullish(v.string()),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export type PostalCodeType = v.InferOutput<typeof PostalCodeSchema>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
3
|
+
|
|
4
|
+
const PreferenceMultipleChoiceDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
6
|
+
component: v.literal('preference-multiple-choice'),
|
|
7
|
+
choices: v.nullish(v.record(v.string(), v.string())),
|
|
8
|
+
'choices-order': v.nullish(v.string()),
|
|
9
|
+
'component-params': v.nullish(
|
|
10
|
+
v.strictObject({
|
|
11
|
+
min: v.nullish(v.number()),
|
|
12
|
+
max: v.nullish(v.number()),
|
|
13
|
+
labels: v.nullish(
|
|
14
|
+
v.strictObject({
|
|
15
|
+
empty: v.nullish(v.string()),
|
|
16
|
+
addItem: v.nullish(v.string()),
|
|
17
|
+
addTitle: v.nullish(v.string()),
|
|
18
|
+
submitAdd: v.nullish(v.string()),
|
|
19
|
+
itemTitle: v.nullish(v.string()),
|
|
20
|
+
})
|
|
21
|
+
),
|
|
22
|
+
})
|
|
23
|
+
),
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const PreferenceMultipleChoiceSchema = v.strictObject({
|
|
28
|
+
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
29
|
+
display: PreferenceMultipleChoiceDisplaySchema,
|
|
30
|
+
attribute: v.nullish(v.string()),
|
|
31
|
+
datatype: v.nullish(v.literal('preference-multiple-choice')),
|
|
32
|
+
'choices-source-fn': v.nullish(v.string()),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type PreferenceMultipleChoiceType = v.InferOutput<
|
|
36
|
+
typeof PreferenceMultipleChoiceSchema
|
|
37
|
+
>;
|
|
38
|
+
export type PreferenceMultipleChoiceSchemaType =
|
|
39
|
+
v.GenericSchema<PreferenceMultipleChoiceType>;
|
|
40
|
+
|
|
41
|
+
export default PreferenceMultipleChoiceSchema as PreferenceMultipleChoiceSchemaType;
|
|
@@ -9,6 +9,7 @@ const QrcodeDisplaySchema = createFieldDisplay(
|
|
|
9
9
|
coordinates: v.nullish(v.array(v.nullable(v.number()))),
|
|
10
10
|
position: v.nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
11
11
|
size: v.nullish(v.number()),
|
|
12
|
+
'later-pages': v.nullish(v.boolean()),
|
|
12
13
|
})
|
|
13
14
|
),
|
|
14
15
|
})
|
|
@@ -12,29 +12,12 @@ const QuoteDisplaySchema = createFieldDisplay(
|
|
|
12
12
|
})
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
const QuoteSourcesSchema = v.nullish(
|
|
16
|
-
v.picklist([
|
|
17
|
-
'declaration:user_id',
|
|
18
|
-
'field:previous_attempt',
|
|
19
|
-
'field:related_gov_wallet',
|
|
20
|
-
'field:related_gov_wallet_id',
|
|
21
|
-
])
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const QuoteValueConstructorSchema = v.nullish(
|
|
25
|
-
v.picklist([
|
|
26
|
-
'dilosi.applications.gov_wallet.claims.common.get_gov_wallet_method_info',
|
|
27
|
-
'dilosi.applications.gov_wallet.claims.common.get_previous_attempt_info',
|
|
28
|
-
'dilosi.interop_logic.id_loss_gov_wallet.get_warning_maybe_with_gov_wallet',
|
|
29
|
-
])
|
|
30
|
-
);
|
|
31
|
-
|
|
32
15
|
const QuoteSchema = v.strictObject({
|
|
33
16
|
'user-input-mode': v.picklist(['noinput', 'display']),
|
|
34
17
|
display: QuoteDisplaySchema,
|
|
35
18
|
value: v.nullish(v.string()),
|
|
36
|
-
sources:
|
|
37
|
-
'value-constructor':
|
|
19
|
+
sources: v.nullish(v.string()),
|
|
20
|
+
'value-constructor': v.nullish(v.string()),
|
|
38
21
|
safe: v.nullish(v.boolean()),
|
|
39
22
|
attribute: v.nullish(v.literal('chosen_auto:insurance1_error')),
|
|
40
23
|
datatype: v.nullish(v.picklist(['quote', 'string'])),
|
|
@@ -25,13 +25,7 @@ const RadioChoiceSchema = v.strictObject({
|
|
|
25
25
|
'default-value': v.nullish(v.string()),
|
|
26
26
|
'choices-source-fn': v.nullish(v.string()),
|
|
27
27
|
datatype: v.nullish(v.picklist(['document_id', 'radio-choice', 'string'])),
|
|
28
|
-
attribute: v.nullish(
|
|
29
|
-
v.picklist([
|
|
30
|
-
'find_idiotiko_sym:locale',
|
|
31
|
-
'find_yde:is_citizen_signing',
|
|
32
|
-
'find_evaluation_b:question_b',
|
|
33
|
-
])
|
|
34
|
-
),
|
|
28
|
+
attribute: v.nullish(v.string()),
|
|
35
29
|
});
|
|
36
30
|
|
|
37
31
|
export type RadioChoiceType = v.InferOutput<typeof RadioChoiceSchema>;
|
|
@@ -6,15 +6,7 @@ const RateDisplaySchema = createFieldDisplay(
|
|
|
6
6
|
component: v.literal('rate'),
|
|
7
7
|
'component-params': v.nullish(
|
|
8
8
|
v.strictObject({
|
|
9
|
-
dependencies: v.array(
|
|
10
|
-
v.picklist([
|
|
11
|
-
'diamonh_enoikiasth_me_makroxronia_misthwsh_pososto_xrhshs',
|
|
12
|
-
'diamonh_epikarpwth_pososto_xrhshs',
|
|
13
|
-
'diamonh_idiokthth_me_plhrh_kyriothta_pososto_xrhshs',
|
|
14
|
-
'diamonh_idiokthth_me_psilh_kyriothta_pososto_xrhshs',
|
|
15
|
-
'diamonh_me_dwrean_paraxwrhsh_pososto_xrhshs',
|
|
16
|
-
])
|
|
17
|
-
),
|
|
9
|
+
dependencies: v.array(v.string()),
|
|
18
10
|
'dependencies-error-message': v.string(),
|
|
19
11
|
})
|
|
20
12
|
),
|
|
@@ -9,10 +9,10 @@ const RecipientDisplaySchema = createFieldDisplay(
|
|
|
9
9
|
|
|
10
10
|
const RecipientSchema = v.strictObject({
|
|
11
11
|
display: RecipientDisplaySchema,
|
|
12
|
-
'user-input-mode': v.picklist(['noinput', '
|
|
12
|
+
'user-input-mode': v.picklist(['noinput', 'required']),
|
|
13
13
|
datatype: v.nullish(v.picklist(['recipient', 'entity_recipient'])),
|
|
14
14
|
'default-value': v.nullish(v.string()),
|
|
15
|
-
attribute: v.nullish(v.
|
|
15
|
+
attribute: v.nullish(v.string()),
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
export type RecipientType = v.InferOutput<typeof RecipientSchema>;
|
|
@@ -7,22 +7,13 @@ const RedirectDisplaySchema = createFieldDisplay(
|
|
|
7
7
|
})
|
|
8
8
|
);
|
|
9
9
|
|
|
10
|
-
const RedirectAttributeSchema = v.nullish(
|
|
11
|
-
v.picklist([
|
|
12
|
-
'panelladikes_sms_2021:last_declaration_url',
|
|
13
|
-
'panelladikes_sms_2022:last_declaration_url',
|
|
14
|
-
'panelladikes_sms_2023:last_declaration_url',
|
|
15
|
-
])
|
|
16
|
-
);
|
|
17
|
-
|
|
18
10
|
const RedirectSchema = v.strictObject({
|
|
19
11
|
'user-input-mode': v.literal('noinput'),
|
|
20
12
|
display: RedirectDisplaySchema,
|
|
21
|
-
sources: v.nullish(v.
|
|
22
|
-
'value-constructor': v.nullish(
|
|
23
|
-
|
|
24
|
-
),
|
|
25
|
-
attribute: RedirectAttributeSchema,
|
|
13
|
+
sources: v.nullish(v.string()),
|
|
14
|
+
'value-constructor': v.nullish(v.string()),
|
|
15
|
+
attribute: v.nullish(v.string()),
|
|
16
|
+
datatype: v.nullish(v.literal('string')),
|
|
26
17
|
});
|
|
27
18
|
|
|
28
19
|
export type RedirectType = v.InferOutput<typeof RedirectSchema>;
|
|
@@ -4,16 +4,13 @@ import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
|
4
4
|
const RefcodeDisplaySchema = createFieldDisplay(
|
|
5
5
|
v.strictObject({
|
|
6
6
|
component: v.literal('refcode'),
|
|
7
|
-
'component-params': v.
|
|
8
|
-
v.
|
|
9
|
-
v.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
),
|
|
15
|
-
v.object({}),
|
|
16
|
-
]),
|
|
7
|
+
'component-params': v.nullish(
|
|
8
|
+
v.strictObject({
|
|
9
|
+
'later-pages': v.nullish(v.boolean()),
|
|
10
|
+
label: v.nullish(v.string()),
|
|
11
|
+
coordinates: v.nullish(v.array(v.nullable(v.number()))),
|
|
12
|
+
})
|
|
13
|
+
),
|
|
17
14
|
}),
|
|
18
15
|
v.strictObject({
|
|
19
16
|
component: v.literal('refcode'),
|
|
@@ -31,14 +28,12 @@ const RefcodeDisplaySchema = createFieldDisplay(
|
|
|
31
28
|
|
|
32
29
|
const RefcodeSchema = v.strictObject({
|
|
33
30
|
display: RefcodeDisplaySchema,
|
|
34
|
-
sources: v.nullish(v.
|
|
35
|
-
'value-constructor': v.nullish(
|
|
36
|
-
v.literal('dilosi.interop_logic.common.from_singleton_list')
|
|
37
|
-
),
|
|
31
|
+
sources: v.nullish(v.string()),
|
|
32
|
+
'value-constructor': v.nullish(v.string()),
|
|
38
33
|
'user-input-mode': v.literal('noinput'),
|
|
39
34
|
'is-display-field': v.nullish(v.boolean()),
|
|
40
35
|
value: v.nullish(v.string()),
|
|
41
|
-
datatype: v.nullish(v.
|
|
36
|
+
datatype: v.nullish(v.literal('string')),
|
|
42
37
|
});
|
|
43
38
|
|
|
44
39
|
export type RefcodeType = v.InferOutput<typeof RefcodeSchema>;
|