@uides/stepwise 1.1.0-rc.26 → 2.0.0-061795a7

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 (73) hide show
  1. package/.rush/temp/chunked-rush-logs/stepwise.build.chunks.jsonl +4 -8
  2. package/.rush/temp/package-deps_build.json +67 -67
  3. package/.rush/temp/shrinkwrap-deps.json +2 -2
  4. package/package.json +6 -6
  5. package/rush-logs/stepwise.build.log +4 -8
  6. package/src/schemas/__tests__/step.spec.ts +2 -4
  7. package/src/schemas/action.ts +132 -131
  8. package/src/schemas/application.ts +7 -8
  9. package/src/schemas/attributes.ts +1 -1
  10. package/src/schemas/common.ts +15 -82
  11. package/src/schemas/document.ts +53 -49
  12. package/src/schemas/edupass-healthstate.ts +47 -44
  13. package/src/schemas/field/afm/index.ts +11 -12
  14. package/src/schemas/field/amka/index.ts +10 -9
  15. package/src/schemas/field/attachment/index.ts +21 -20
  16. package/src/schemas/field/captcha/index.ts +8 -7
  17. package/src/schemas/field/choice/index.ts +20 -19
  18. package/src/schemas/field/common.spec.ts +7 -13
  19. package/src/schemas/field/common.ts +103 -85
  20. package/src/schemas/field/date/index.ts +24 -23
  21. package/src/schemas/field/doc_subtitle/index.ts +10 -9
  22. package/src/schemas/field/doc_title/index.ts +18 -17
  23. package/src/schemas/field/dynamically-filled-text/index.ts +26 -24
  24. package/src/schemas/field/email/index.ts +12 -11
  25. package/src/schemas/field/fillable-string/index.ts +18 -17
  26. package/src/schemas/field/five-block-date/index.ts +8 -7
  27. package/src/schemas/field/green-pass-qrcode/index.ts +14 -15
  28. package/src/schemas/field/hidden/index.ts +58 -64
  29. package/src/schemas/field/hierarchical-selector/index.ts +27 -25
  30. package/src/schemas/field/iban/index.ts +11 -10
  31. package/src/schemas/field/image/index.ts +19 -18
  32. package/src/schemas/field/index.spec.ts +17 -19
  33. package/src/schemas/field/index.ts +176 -85
  34. package/src/schemas/field/int/index.ts +11 -10
  35. package/src/schemas/field/lab-results/index.ts +9 -8
  36. package/src/schemas/field/landline_phone/index.ts +8 -7
  37. package/src/schemas/field/mobile_phone/index.ts +12 -11
  38. package/src/schemas/field/multiple-choice/index.ts +15 -14
  39. package/src/schemas/field/pdf-image/index.ts +14 -13
  40. package/src/schemas/field/postal_code/index.ts +9 -8
  41. package/src/schemas/field/qrcode/index.ts +18 -17
  42. package/src/schemas/field/quote/index.ts +18 -17
  43. package/src/schemas/field/radio-choice/index.ts +21 -15
  44. package/src/schemas/field/rate/index.ts +10 -9
  45. package/src/schemas/field/recipient/index.ts +11 -10
  46. package/src/schemas/field/redirect/index.ts +12 -11
  47. package/src/schemas/field/refcode/index.ts +25 -24
  48. package/src/schemas/field/string/index.ts +42 -41
  49. package/src/schemas/field/text/index.ts +23 -22
  50. package/src/schemas/field/three-block-date/index.ts +15 -14
  51. package/src/schemas/fieldset/component-params.ts +40 -37
  52. package/src/schemas/fieldset/display-components.ts +42 -49
  53. package/src/schemas/fieldset/enums.ts +12 -6
  54. package/src/schemas/fieldset/index.ts +9 -10
  55. package/src/schemas/layout.ts +43 -32
  56. package/src/schemas/outputs.ts +7 -6
  57. package/src/schemas/resource/enums.ts +6 -6
  58. package/src/schemas/resource/field.ts +10 -8
  59. package/src/schemas/resource/object-action.ts +21 -16
  60. package/src/schemas/resource/resource-action.ts +19 -17
  61. package/src/schemas/resource/resource.ts +19 -20
  62. package/src/schemas/step.ts +116 -115
  63. package/src/schemas/template/enums.ts +2 -2
  64. package/src/schemas/template/template-base.ts +15 -13
  65. package/src/schemas/template/template-source.ts +12 -13
  66. package/src/schemas/template/template.ts +12 -13
  67. package/src/schemas/validation-context/enums.ts +5 -5
  68. package/src/schemas/validation-context/validation-context.ts +45 -44
  69. package/src/utils/index.spec.ts +2 -0
  70. package/src/utils/index.ts +5 -3
  71. package/.rush/temp/chunked-rush-logs/stepwise.lint.chunks.jsonl +0 -2
  72. package/rush-logs/stepwise.lint.error.log +0 -1
  73. package/rush-logs/stepwise.lint.log +0 -2
@@ -1,19 +1,18 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const QuoteDisplay = createFieldDisplay(
6
- object({
4
+ const QuoteDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('quote'),
8
- 'component-params': nullish(
9
- object({
7
+ 'component-params': v.nullish(
8
+ v.strictObject({
10
9
  mode: v.picklist(['error', 'info', 'warning']),
11
10
  })
12
11
  ),
13
12
  })
14
13
  );
15
14
 
16
- const QuoteSources = nullish(
15
+ const QuoteSourcesSchema = v.nullish(
17
16
  v.picklist([
18
17
  'declaration:user_id',
19
18
  'field:previous_attempt',
@@ -22,7 +21,7 @@ const QuoteSources = nullish(
22
21
  ])
23
22
  );
24
23
 
25
- const QuoteValueConstructor = nullish(
24
+ const QuoteValueConstructorSchema = v.nullish(
26
25
  v.picklist([
27
26
  'dilosi.applications.gov_wallet.claims.common.get_gov_wallet_method_info',
28
27
  'dilosi.applications.gov_wallet.claims.common.get_previous_attempt_info',
@@ -30,16 +29,18 @@ const QuoteValueConstructor = nullish(
30
29
  ])
31
30
  );
32
31
 
33
- const Quote = object({
32
+ const QuoteSchema = v.strictObject({
34
33
  'user-input-mode': v.picklist(['noinput', 'display']),
35
- display: QuoteDisplay,
36
- value: nullish(v.string()),
37
- sources: QuoteSources,
38
- 'value-constructor': QuoteValueConstructor,
39
- safe: nullish(v.boolean()),
40
- attribute: nullish(v.literal('chosen_auto:insurance1_error')),
41
- datatype: nullish(v.picklist(['quote', 'string'])),
34
+ display: QuoteDisplaySchema,
35
+ value: v.nullish(v.string()),
36
+ sources: QuoteSourcesSchema,
37
+ 'value-constructor': QuoteValueConstructorSchema,
38
+ safe: v.nullish(v.boolean()),
39
+ attribute: v.nullish(v.literal('chosen_auto:insurance1_error')),
40
+ datatype: v.nullish(v.picklist(['quote', 'string'])),
42
41
  });
43
- export type QuoteType = v.BaseSchema<v.Output<typeof Quote>>;
44
42
 
45
- export default Quote as QuoteType;
43
+ export type QuoteType = v.InferOutput<typeof QuoteSchema>;
44
+ export type QuoteSchemaType = v.GenericSchema<QuoteType>;
45
+
46
+ export default QuoteSchema as QuoteSchemaType;
@@ -1,27 +1,31 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const RadioChoiceDisplay = createFieldDisplay(
6
- object({
4
+ const RadioChoiceDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('radio-choice'),
8
- choices: nullish(v.record(v.union([v.string(), v.record(v.string())]))),
9
- 'choices-order': nullish(v.string()),
10
- 'component-params': nullish(
11
- object({
7
+ choices: v.nullish(
8
+ v.record(
9
+ v.string(),
10
+ v.union([v.string(), v.record(v.string(), v.string())])
11
+ )
12
+ ),
13
+ 'choices-order': v.nullish(v.string()),
14
+ 'component-params': v.nullish(
15
+ v.strictObject({
12
16
  'legacy-mode': v.boolean(),
13
17
  })
14
18
  ),
15
19
  })
16
20
  );
17
21
 
18
- const RadioChoice = object({
22
+ const RadioChoiceSchema = v.strictObject({
19
23
  'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
20
- display: RadioChoiceDisplay,
21
- 'default-value': nullish(v.string()),
22
- 'choices-source-fn': nullish(v.string()),
23
- datatype: nullish(v.picklist(['document_id', 'radio-choice', 'string'])),
24
- attribute: nullish(
24
+ display: RadioChoiceDisplaySchema,
25
+ 'default-value': v.nullish(v.string()),
26
+ 'choices-source-fn': v.nullish(v.string()),
27
+ datatype: v.nullish(v.picklist(['document_id', 'radio-choice', 'string'])),
28
+ attribute: v.nullish(
25
29
  v.picklist([
26
30
  'find_idiotiko_sym:locale',
27
31
  'find_yde:is_citizen_signing',
@@ -29,6 +33,8 @@ const RadioChoice = object({
29
33
  ])
30
34
  ),
31
35
  });
32
- export type RadioChoiceType = v.BaseSchema<v.Output<typeof RadioChoice>>;
33
36
 
34
- export default RadioChoice as RadioChoiceType;
37
+ export type RadioChoiceType = v.InferOutput<typeof RadioChoiceSchema>;
38
+ export type RadioChoiceSchemaType = v.GenericSchema<RadioChoiceType>;
39
+
40
+ export default RadioChoiceSchema as RadioChoiceSchemaType;
@@ -1,12 +1,11 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const RateDisplay = createFieldDisplay(
6
- object({
4
+ const RateDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('rate'),
8
- 'component-params': nullish(
9
- object({
7
+ 'component-params': v.nullish(
8
+ v.strictObject({
10
9
  dependencies: v.array(
11
10
  v.picklist([
12
11
  'diamonh_enoikiasth_me_makroxronia_misthwsh_pososto_xrhshs',
@@ -22,10 +21,12 @@ const RateDisplay = createFieldDisplay(
22
21
  })
23
22
  );
24
23
 
25
- const Rate = object({
24
+ const RateSchema = v.strictObject({
26
25
  'user-input-mode': v.picklist(['noinput', 'optional']),
27
- display: RateDisplay,
26
+ display: RateDisplaySchema,
28
27
  });
29
- export type RateType = v.BaseSchema<v.Output<typeof Rate>>;
30
28
 
31
- export default Rate as RateType;
29
+ export type RateType = v.InferOutput<typeof RateSchema>;
30
+ export type RateSchemaType = v.GenericSchema<RateType>;
31
+
32
+ export default RateSchema as RateSchemaType;
@@ -1,20 +1,21 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const RecipientDisplay = createFieldDisplay(
6
- object({
4
+ const RecipientDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('recipient'),
8
7
  })
9
8
  );
10
9
 
11
- const Recipient = object({
12
- display: RecipientDisplay,
10
+ const RecipientSchema = v.strictObject({
11
+ display: RecipientDisplaySchema,
13
12
  'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
14
- datatype: nullish(v.picklist(['recipient', 'entity_recipient'])),
15
- 'default-value': nullish(v.string()),
16
- attribute: nullish(v.literal('ekab:branch_name')),
13
+ datatype: v.nullish(v.picklist(['recipient', 'entity_recipient'])),
14
+ 'default-value': v.nullish(v.string()),
15
+ attribute: v.nullish(v.literal('ekab:branch_name')),
17
16
  });
18
- export type RecipientType = v.BaseSchema<v.Output<typeof Recipient>>;
19
17
 
20
- export default Recipient as RecipientType;
18
+ export type RecipientType = v.InferOutput<typeof RecipientSchema>;
19
+ export type RecipientSchemaType = v.GenericSchema<RecipientType>;
20
+
21
+ export default RecipientSchema as RecipientSchemaType;
@@ -1,14 +1,13 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const RedirectDisplay = createFieldDisplay(
6
- object({
4
+ const RedirectDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('redirect'),
8
7
  })
9
8
  );
10
9
 
11
- const RedirectAttribute = nullish(
10
+ const RedirectAttributeSchema = v.nullish(
12
11
  v.picklist([
13
12
  'panelladikes_sms_2021:last_declaration_url',
14
13
  'panelladikes_sms_2022:last_declaration_url',
@@ -16,15 +15,17 @@ const RedirectAttribute = nullish(
16
15
  ])
17
16
  );
18
17
 
19
- const Redirect = object({
18
+ const RedirectSchema = v.strictObject({
20
19
  'user-input-mode': v.literal('noinput'),
21
- display: RedirectDisplay,
22
- sources: nullish(v.literal('field:cont_code field:continuation_url')),
23
- 'value-constructor': nullish(
20
+ display: RedirectDisplaySchema,
21
+ sources: v.nullish(v.literal('field:cont_code field:continuation_url')),
22
+ 'value-constructor': v.nullish(
24
23
  v.literal('dilosi.interop_logic.authbroker.build_redirect_url')
25
24
  ),
26
- attribute: RedirectAttribute,
25
+ attribute: RedirectAttributeSchema,
27
26
  });
28
- export type RedirectType = v.BaseSchema<v.Output<typeof Redirect>>;
29
27
 
30
- export default Redirect as RedirectType;
28
+ export type RedirectType = v.InferOutput<typeof RedirectSchema>;
29
+ export type RedirectSchemaType = v.GenericSchema<RedirectType>;
30
+
31
+ export default RedirectSchema as RedirectSchemaType;
@@ -1,46 +1,47 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const RefcodeDisplay = createFieldDisplay(
6
- object({
4
+ const RefcodeDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('refcode'),
8
7
  'component-params': v.union([
9
- nullish(
10
- object({
11
- 'later-pages': nullish(v.boolean()),
12
- label: nullish(v.string()),
13
- coordinates: nullish(v.array(v.nullable(v.number()))),
8
+ v.nullish(
9
+ v.strictObject({
10
+ 'later-pages': v.nullish(v.boolean()),
11
+ label: v.nullish(v.string()),
12
+ coordinates: v.nullish(v.array(v.nullable(v.number()))),
14
13
  })
15
14
  ),
16
15
  v.object({}),
17
16
  ]),
18
17
  }),
19
- object({
18
+ v.strictObject({
20
19
  component: v.literal('refcode'),
21
20
  // TODO: Make pdf component-params also inherit default component-params
22
- 'component-params': nullish(
23
- object({
24
- 'later-pages': nullish(v.boolean()),
25
- label: nullish(v.string()),
26
- coordinates: nullish(v.array(v.nullable(v.number()))),
27
- fontName: nullish(v.literal('Font-Mono')),
21
+ 'component-params': v.nullish(
22
+ v.strictObject({
23
+ 'later-pages': v.nullish(v.boolean()),
24
+ label: v.nullish(v.string()),
25
+ coordinates: v.nullish(v.array(v.nullable(v.number()))),
26
+ fontName: v.nullish(v.literal('Font-Mono')),
28
27
  })
29
28
  ),
30
29
  })
31
30
  );
32
31
 
33
- const Refcode = object({
34
- display: RefcodeDisplay,
35
- sources: nullish(v.literal('declaration:reference_code')),
36
- 'value-constructor': nullish(
32
+ const RefcodeSchema = v.strictObject({
33
+ display: RefcodeDisplaySchema,
34
+ sources: v.nullish(v.literal('declaration:reference_code')),
35
+ 'value-constructor': v.nullish(
37
36
  v.literal('dilosi.interop_logic.common.from_singleton_list')
38
37
  ),
39
38
  'user-input-mode': v.literal('noinput'),
40
- 'is-display-field': nullish(v.boolean()),
41
- value: nullish(v.string()),
42
- datatype: nullish(v.picklist(['string', 'refcode'])),
39
+ 'is-display-field': v.nullish(v.boolean()),
40
+ value: v.nullish(v.string()),
41
+ datatype: v.nullish(v.picklist(['string', 'refcode'])),
43
42
  });
44
- export type RefcodeType = v.BaseSchema<v.Output<typeof Refcode>>;
45
43
 
46
- export default Refcode as RefcodeType;
44
+ export type RefcodeType = v.InferOutput<typeof RefcodeSchema>;
45
+ export type RefcodeSchemaType = v.GenericSchema<RefcodeType>;
46
+
47
+ export default RefcodeSchema as RefcodeSchemaType;
@@ -1,39 +1,38 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const StringFieldDisplay = createFieldDisplay(
6
- object({
7
- component: nullish(v.literal('string')),
8
- 'component-params': nullish(
9
- object({
10
- position: nullish(v.picklist(['center', 'justify', 'left', 'right'])),
11
- enforceUppercase: nullish(v.boolean()),
12
- multiplicity: nullish(v.number()),
13
- format: nullish(v.literal('plaintext')),
14
- textColor: nullish(v.string()),
15
- 'format-title': nullish(v.boolean()),
16
- emph: nullish(v.boolean()),
17
- bold: nullish(v.boolean()),
18
- cell_valign: nullish(v.picklist(['BOTTOM', 'MIDDLE', 'TOP'])),
19
- coordinates: nullish(v.array(v.nullable(v.number()))),
20
- fontSize: nullish(v.number()),
21
- leading: nullish(v.number()),
22
- fontName: nullish(v.string()),
23
- ignore_emph: nullish(v.boolean()),
24
- 'later-pages': nullish(v.boolean()),
25
- attachment_retrieval: nullish(v.literal('no-content')),
26
- backColor: nullish(v.string()),
4
+ const StringFieldDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
6
+ component: v.nullish(v.literal('string')),
7
+ 'component-params': v.nullish(
8
+ v.strictObject({
9
+ position: v.nullish(v.picklist(['center', 'justify', 'left', 'right'])),
10
+ enforceUppercase: v.nullish(v.boolean()),
11
+ multiplicity: v.nullish(v.number()),
12
+ format: v.nullish(v.literal('plaintext')),
13
+ textColor: v.nullish(v.string()),
14
+ 'format-title': v.nullish(v.boolean()),
15
+ emph: v.nullish(v.boolean()),
16
+ bold: v.nullish(v.boolean()),
17
+ cell_valign: v.nullish(v.picklist(['BOTTOM', 'MIDDLE', 'TOP'])),
18
+ coordinates: v.nullish(v.array(v.nullable(v.number()))),
19
+ fontSize: v.nullish(v.number()),
20
+ leading: v.nullish(v.number()),
21
+ fontName: v.nullish(v.string()),
22
+ ignore_emph: v.nullish(v.boolean()),
23
+ 'later-pages': v.nullish(v.boolean()),
24
+ attachment_retrieval: v.nullish(v.literal('no-content')),
25
+ backColor: v.nullish(v.string()),
27
26
  })
28
27
  ),
29
28
  }),
30
- object({
31
- component: nullish(v.literal('string')),
32
- emph: nullish(v.boolean()),
29
+ v.strictObject({
30
+ component: v.nullish(v.literal('string')),
31
+ emph: v.nullish(v.boolean()),
33
32
  })
34
33
  );
35
34
 
36
- const StringDatatype = nullish(
35
+ const StringDatatypeSchema = v.nullish(
37
36
  v.picklist([
38
37
  'amka',
39
38
  'attachment',
@@ -44,21 +43,23 @@ const StringDatatype = nullish(
44
43
  ])
45
44
  );
46
45
 
47
- const StringField = object({
48
- display: nullish(StringFieldDisplay),
49
- 'user-input-mode': nullish(
46
+ const StringSchema = v.strictObject({
47
+ display: v.nullish(StringFieldDisplaySchema),
48
+ 'user-input-mode': v.nullish(
50
49
  v.picklist(['display', 'noinput', 'optional', 'required'])
51
50
  ),
52
- attribute: nullish(v.string()),
53
- value: nullish(v.string()),
54
- 'default-value': nullish(v.string()),
55
- sources: nullish(v.string()),
56
- 'value-constructor': nullish(v.string()),
57
- 'is-display-field': nullish(v.boolean()),
58
- datatype: StringDatatype,
59
- 'default-on-empty': nullish(v.string()),
60
- safe: nullish(v.boolean()),
51
+ attribute: v.nullish(v.string()),
52
+ value: v.nullish(v.string()),
53
+ 'default-value': v.nullish(v.string()),
54
+ sources: v.nullish(v.string()),
55
+ 'value-constructor': v.nullish(v.string()),
56
+ 'is-display-field': v.nullish(v.boolean()),
57
+ datatype: StringDatatypeSchema,
58
+ 'default-on-empty': v.nullish(v.string()),
59
+ safe: v.nullish(v.boolean()),
61
60
  });
62
- export type StringFieldType = v.BaseSchema<v.Output<typeof StringField>>;
63
61
 
64
- export default StringField as StringFieldType;
62
+ export type StringType = v.InferOutput<typeof StringSchema>;
63
+ export type StringSchemaType = v.GenericSchema<StringType>;
64
+
65
+ export default StringSchema as StringSchemaType;
@@ -1,26 +1,25 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const TextDisplay = createFieldDisplay(
6
- object({
4
+ const TextDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('text'),
8
- 'component-params': nullish(
9
- object({
10
- format: nullish(v.literal('plaintext')),
11
- fontSize: nullish(v.number()),
12
- leading: nullish(v.number()),
13
- bold: nullish(v.boolean()),
14
- textColor: nullish(v.string()),
15
- position: nullish(v.picklist(['center', 'justify', 'left', 'right'])),
16
- cell_valign: nullish(v.picklist(['BOTTOM', 'MIDDLE', 'TOP'])),
17
- enforceUppercase: nullish(v.boolean()),
7
+ 'component-params': v.nullish(
8
+ v.strictObject({
9
+ format: v.nullish(v.literal('plaintext')),
10
+ fontSize: v.nullish(v.number()),
11
+ leading: v.nullish(v.number()),
12
+ bold: v.nullish(v.boolean()),
13
+ textColor: v.nullish(v.string()),
14
+ position: v.nullish(v.picklist(['center', 'justify', 'left', 'right'])),
15
+ cell_valign: v.nullish(v.picklist(['BOTTOM', 'MIDDLE', 'TOP'])),
16
+ enforceUppercase: v.nullish(v.boolean()),
18
17
  })
19
18
  ),
20
19
  })
21
20
  );
22
21
 
23
- const TextAttribute = nullish(
22
+ const TextAttributeSchema = v.nullish(
24
23
  v.picklist([
25
24
  'cert_registry:security_feature',
26
25
  'cert_registry_v2:security_feature',
@@ -37,14 +36,16 @@ const TextAttribute = nullish(
37
36
  ])
38
37
  );
39
38
 
40
- const Text = object({
39
+ const TextSchema = v.strictObject({
41
40
  'user-input-mode': v.picklist(['display', 'noinput', 'optional', 'required']),
42
- display: TextDisplay,
43
- value: nullish(v.string()),
44
- 'default-value': nullish(v.string()),
45
- attribute: TextAttribute,
46
- datatype: nullish(v.picklist(['text', 'string'])),
41
+ display: TextDisplaySchema,
42
+ value: v.nullish(v.string()),
43
+ 'default-value': v.nullish(v.string()),
44
+ attribute: TextAttributeSchema,
45
+ datatype: v.nullish(v.picklist(['text', 'string'])),
47
46
  });
48
- export type TextType = v.BaseSchema<v.Output<typeof Text>>;
49
47
 
50
- export default Text as TextType;
48
+ export type TextType = v.InferOutput<typeof TextSchema>;
49
+ export type TextSchemaType = v.GenericSchema<TextType>;
50
+
51
+ export default TextSchema as TextSchemaType;
@@ -1,27 +1,28 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
  import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
4
3
 
5
- const ThreeBlockDateDisplay = createFieldDisplay(
6
- object({
4
+ const ThreeBlockDateDisplaySchema = createFieldDisplay(
5
+ v.strictObject({
7
6
  component: v.literal('three-block-date'),
8
- 'component-params': nullish(
9
- object({
7
+ 'component-params': v.nullish(
8
+ v.strictObject({
10
9
  max: v.literal('now'),
11
- min: nullish(v.string()),
10
+ min: v.nullish(v.string()),
12
11
  })
13
12
  ),
14
13
  })
15
14
  );
16
15
 
17
- const ThreeBlockDate = object({
16
+ const ThreeBlockDateSchema = v.strictObject({
18
17
  'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
19
- attribute: nullish(v.string()),
20
- display: ThreeBlockDateDisplay,
21
- 'default-on-empty': nullish(v.string()),
22
- 'default-value': nullish(v.string()),
23
- datatype: nullish(v.picklist(['date', 'string'])),
18
+ attribute: v.nullish(v.string()),
19
+ display: ThreeBlockDateDisplaySchema,
20
+ 'default-on-empty': v.nullish(v.string()),
21
+ 'default-value': v.nullish(v.string()),
22
+ datatype: v.nullish(v.picklist(['date', 'string'])),
24
23
  });
25
- export type ThreeBlockDateType = v.BaseSchema<v.Output<typeof ThreeBlockDate>>;
26
24
 
27
- export default ThreeBlockDate as ThreeBlockDateType;
25
+ export type ThreeBlockDateType = v.InferOutput<typeof ThreeBlockDateSchema>;
26
+ export type ThreeBlockDateSchemaType = v.GenericSchema<ThreeBlockDateType>;
27
+
28
+ export default ThreeBlockDateSchema as ThreeBlockDateSchemaType;
@@ -1,60 +1,63 @@
1
1
  import * as v from 'valibot';
2
- import { nullish, object } from '@uides/stepwise/schemas/common';
3
2
 
4
- export const MultiplicityLabels = object({
3
+ export const MultiplicityLabelsSchema = v.strictObject({
5
4
  /** add dialog title */
6
- addTitle: nullish(v.string()),
5
+ addTitle: v.nullish(v.string()),
7
6
  /** edit dialog title */
8
- editTitle: nullish(v.string()),
7
+ editTitle: v.nullish(v.string()),
9
8
  /** add action */
10
- addItem: nullish(v.string()),
9
+ addItem: v.nullish(v.string()),
11
10
  /** remove item action */
12
- removeItem: nullish(v.string()),
11
+ removeItem: v.nullish(v.string()),
13
12
  /** edit item action */
14
- editItem: nullish(v.string()),
13
+ editItem: v.nullish(v.string()),
15
14
  /** submit form action (add case) */
16
- submitAdd: nullish(v.string()),
15
+ submitAdd: v.nullish(v.string()),
17
16
  /** submit form action (edit case) */
18
- submitEdit: nullish(v.string()),
17
+ submitEdit: v.nullish(v.string()),
19
18
  /** cancel action */
20
- cancel: nullish(v.string()),
19
+ cancel: v.nullish(v.string()),
21
20
  /** empty selection message (form field) */
22
- empty: nullish(v.string()),
21
+ empty: v.nullish(v.string()),
23
22
  /** empty selection message (field display) */
24
- emptyValueDisplay: nullish(v.string()),
23
+ emptyValueDisplay: v.nullish(v.string()),
25
24
  });
26
- export type MultiplicityLabels = v.Output<typeof MultiplicityLabels>;
25
+ export type MultiplicityLabels = v.InferOutput<typeof MultiplicityLabelsSchema>;
27
26
 
28
- export const OtherComponentParams = object({
29
- page_break: nullish(v.boolean()),
30
- sticky_title: nullish(v.boolean()),
31
- multiplicity: nullish(v.number()),
32
- multiplicityLabels: nullish(MultiplicityLabels),
33
- required: nullish(v.boolean()),
34
- fixed: nullish(v.boolean()),
35
- layout: nullish(v.picklist(['entry', 'card'])),
27
+ export const OtherComponentParamsSchema = v.strictObject({
28
+ page_break: v.nullish(v.boolean()),
29
+ sticky_title: v.nullish(v.boolean()),
30
+ multiplicity: v.nullish(v.number()),
31
+ multiplicityLabels: v.nullish(MultiplicityLabelsSchema),
32
+ required: v.nullish(v.boolean()),
33
+ fixed: v.nullish(v.boolean()),
34
+ layout: v.nullish(v.picklist(['entry', 'card'])),
36
35
  });
37
- export type OtherComponentParams = v.Output<typeof OtherComponentParams>;
36
+ export type OtherComponentParams = v.InferOutput<
37
+ typeof OtherComponentParamsSchema
38
+ >;
38
39
 
39
- export const TableComponentParams = object({
40
+ export const TableComponentParamsSchema = v.strictObject({
40
41
  lines: v.optional(
41
42
  v.nullable(v.picklist(['no', 'grid', 'outer', 'grid-round', 'outer-round']))
42
43
  ),
43
44
  table_halign: v.optional(v.nullable(v.picklist(['LEFT', 'CENTER', 'RIGHT']))),
44
- table_width_ratio: nullish(v.number()),
45
+ table_width_ratio: v.nullish(v.number()),
45
46
  cell_halign: v.optional(v.nullable(v.picklist(['left', 'center', 'right']))),
46
47
  cell_valign: v.optional(v.nullable(v.picklist(['BOTTOM', 'MIDDLE', 'TOP']))),
47
- cell_height: nullish(v.number()),
48
- auto_columns: nullish(v.boolean()),
49
- fontSize: nullish(v.number()),
50
- no_split: nullish(v.boolean()),
51
- spaceBefore: nullish(v.number()),
52
- spaceAfter: nullish(v.number()),
53
- omit_empty_values: nullish(v.boolean()),
54
- background: nullish(v.string()),
55
- coordinates: nullish(v.array(v.number())),
56
- mirrored: nullish(v.boolean()),
57
- handler: nullish(v.string()),
58
- ...OtherComponentParams.entries,
48
+ cell_height: v.nullish(v.number()),
49
+ auto_columns: v.nullish(v.boolean()),
50
+ fontSize: v.nullish(v.number()),
51
+ no_split: v.nullish(v.boolean()),
52
+ spaceBefore: v.nullish(v.number()),
53
+ spaceAfter: v.nullish(v.number()),
54
+ omit_empty_values: v.nullish(v.boolean()),
55
+ background: v.nullish(v.string()),
56
+ coordinates: v.nullish(v.array(v.number())),
57
+ mirrored: v.nullish(v.boolean()),
58
+ handler: v.nullish(v.string()),
59
+ ...OtherComponentParamsSchema.entries,
59
60
  });
60
- export type TableComponentParams = v.Output<typeof TableComponentParams>;
61
+ export type TableComponentParams = v.InferOutput<
62
+ typeof TableComponentParamsSchema
63
+ >;