@uides/stepwise 2.2.1 → 2.2.3

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 (229) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/generators/extractStepwisePossibleValues.d.mts +1 -0
  3. package/index.js +1 -1
  4. package/package.json +1 -1
  5. package/schemas/action.d.ts +48 -168
  6. package/schemas/action.js +34 -47
  7. package/schemas/field/afm/index.d.ts +158 -6
  8. package/schemas/field/afm/index.js +6 -9
  9. package/schemas/field/amka/index.d.ts +152 -8
  10. package/schemas/field/amka/index.js +3 -7
  11. package/schemas/field/attachment/index.d.ts +184 -16
  12. package/schemas/field/attachment/index.js +9 -22
  13. package/schemas/field/captcha/index.d.ts +156 -2
  14. package/schemas/field/captcha/index.js +6 -9
  15. package/schemas/field/choice/index.d.ts +188 -15
  16. package/schemas/field/choice/index.js +4 -9
  17. package/schemas/field/common.d.ts +92 -40
  18. package/schemas/field/common.js +78 -11
  19. package/schemas/field/date/index.d.ts +152 -38
  20. package/schemas/field/date/index.js +6 -33
  21. package/schemas/field/doc_subtitle/index.d.ts +158 -5
  22. package/schemas/field/doc_subtitle/index.js +5 -6
  23. package/schemas/field/doc_title/index.d.ts +154 -8
  24. package/schemas/field/doc_title/index.js +5 -12
  25. package/schemas/field/dynamically-filled-text/index.d.ts +170 -33
  26. package/schemas/field/dynamically-filled-text/index.js +6 -23
  27. package/schemas/field/email/index.d.ts +152 -8
  28. package/schemas/field/email/index.js +5 -9
  29. package/schemas/field/fillable-string/index.d.ts +156 -12
  30. package/schemas/field/fillable-string/index.js +4 -10
  31. package/schemas/field/five-block-date/index.d.ts +156 -2
  32. package/schemas/field/five-block-date/index.js +5 -4
  33. package/schemas/field/hidden/index.d.ts +161 -14
  34. package/schemas/field/hidden/index.js +7 -15
  35. package/schemas/field/hierarchical-selector/index.d.ts +176 -37
  36. package/schemas/field/hierarchical-selector/index.js +5 -21
  37. package/schemas/field/iban/index.d.ts +168 -6
  38. package/schemas/field/iban/index.js +3 -3
  39. package/schemas/field/image/index.d.ts +168 -16
  40. package/schemas/field/image/index.js +7 -23
  41. package/schemas/field/index.d.ts +2 -7
  42. package/schemas/field/index.js +8 -15
  43. package/schemas/field/int/index.d.ts +152 -8
  44. package/schemas/field/int/index.js +5 -9
  45. package/schemas/field/intl_mobile_phone/index.d.ts +156 -3
  46. package/schemas/field/intl_mobile_phone/index.js +5 -5
  47. package/schemas/field/lab-results/index.d.ts +156 -3
  48. package/schemas/field/lab-results/index.js +6 -6
  49. package/schemas/field/mobile_phone/index.d.ts +158 -5
  50. package/schemas/field/mobile_phone/index.js +5 -6
  51. package/schemas/field/multiple-choice/index.d.ts +180 -12
  52. package/schemas/field/multiple-choice/index.js +3 -8
  53. package/schemas/field/password/index.d.ts +156 -2
  54. package/schemas/field/password/index.js +5 -5
  55. package/schemas/field/pdf-image/index.d.ts +152 -14
  56. package/schemas/field/pdf-image/index.js +6 -18
  57. package/schemas/field/postal_code/index.d.ts +156 -4
  58. package/schemas/field/postal_code/index.js +6 -8
  59. package/schemas/field/preference-multiple-choice/index.d.ts +211 -17
  60. package/schemas/field/preference-multiple-choice/index.js +5 -9
  61. package/schemas/field/qrcode/index.d.ts +168 -19
  62. package/schemas/field/qrcode/index.js +6 -18
  63. package/schemas/field/quote/index.d.ts +170 -11
  64. package/schemas/field/quote/index.js +4 -12
  65. package/schemas/field/radio-choice/index.d.ts +172 -9
  66. package/schemas/field/radio-choice/index.js +4 -10
  67. package/schemas/field/rate/index.d.ts +150 -8
  68. package/schemas/field/rate/index.js +4 -7
  69. package/schemas/field/recipient/index.d.ts +158 -5
  70. package/schemas/field/recipient/index.js +5 -9
  71. package/schemas/field/redirect/index.d.ts +156 -6
  72. package/schemas/field/redirect/index.js +6 -9
  73. package/schemas/field/refcode/index.d.ts +168 -16
  74. package/schemas/field/refcode/index.js +6 -20
  75. package/schemas/field/string/index.d.ts +226 -65
  76. package/schemas/field/string/index.js +5 -54
  77. package/schemas/field/text/index.d.ts +170 -33
  78. package/schemas/field/text/index.js +5 -30
  79. package/schemas/field/three-block-date/index.d.ts +176 -12
  80. package/schemas/field/three-block-date/index.js +4 -10
  81. package/schemas/field/url/index.d.ts +204 -0
  82. package/schemas/field/url/index.js +16 -0
  83. package/schemas/fieldset/component-params.d.ts +9 -41
  84. package/schemas/fieldset/component-params.js +5 -29
  85. package/schemas/fieldset/display-components.d.ts +16 -244
  86. package/schemas/fieldset/display-components.js +6 -19
  87. package/schemas/fieldset/enums.d.ts +0 -22
  88. package/schemas/fieldset/enums.js +1 -15
  89. package/schemas/fieldset/index.d.ts +9 -93
  90. package/schemas/index.d.ts +1 -1
  91. package/schemas/index.js +1 -1
  92. package/schemas/step.d.ts +7 -0
  93. package/schemas/step.js +2 -1
  94. package/schemas/{template/template.d.ts → template.d.ts} +47 -23
  95. package/schemas/template.js +26 -0
  96. package/src/generators/actions-possible-values/document-anon-create.json +19 -0
  97. package/src/generators/actions-possible-values/document-backstep.json +19 -0
  98. package/src/generators/actions-possible-values/document-create-new.json +43 -0
  99. package/src/generators/actions-possible-values/document-create.json +20 -0
  100. package/src/generators/actions-possible-values/document-dismiss.json +36 -0
  101. package/src/generators/actions-possible-values/document-download-pdf.json +69 -0
  102. package/src/generators/actions-possible-values/document-email.json +42 -0
  103. package/src/generators/actions-possible-values/document-resend-otp.json +30 -0
  104. package/src/generators/actions-possible-values/document-revoke.json +46 -0
  105. package/src/generators/actions-possible-values/document-share.json +29 -0
  106. package/src/generators/actions-possible-values/document-sms.json +38 -0
  107. package/src/generators/actions-possible-values/document-temporary-save.json +28 -0
  108. package/src/generators/actions-possible-values/document-update.json +111 -0
  109. package/src/generators/actions-possible-values/entity-forward.json +31 -0
  110. package/src/generators/actions-possible-values/entity-reply.json +31 -0
  111. package/src/generators/actions-possible-values/entity-send-message.json +34 -0
  112. package/src/generators/actions-possible-values/hidden.json +22 -0
  113. package/src/generators/actions-possible-values/link.json +43 -0
  114. package/src/generators/extractStepwisePossibleValues.mjs +139 -0
  115. package/src/generators/fields-possible-values/afm.json +94 -0
  116. package/src/generators/fields-possible-values/amka.json +26 -0
  117. package/src/generators/fields-possible-values/attachment.json +89 -0
  118. package/src/generators/fields-possible-values/captcha.json +16 -0
  119. package/src/generators/fields-possible-values/choice.json +432 -0
  120. package/src/generators/fields-possible-values/date.json +57 -0
  121. package/src/generators/fields-possible-values/doc_subtitle.json +26 -0
  122. package/src/generators/fields-possible-values/doc_title.json +63 -0
  123. package/src/generators/fields-possible-values/dynamically-filled-text.json +47 -0
  124. package/src/generators/fields-possible-values/email.json +65 -0
  125. package/src/generators/fields-possible-values/fillable-string.json +47 -0
  126. package/src/generators/fields-possible-values/five-block-date.json +23 -0
  127. package/src/generators/fields-possible-values/hidden.json +140 -0
  128. package/src/generators/fields-possible-values/hierarchical-selector.json +84 -0
  129. package/src/generators/fields-possible-values/iban.json +35 -0
  130. package/src/generators/fields-possible-values/image.json +37 -0
  131. package/src/generators/fields-possible-values/int.json +52 -0
  132. package/src/generators/fields-possible-values/intl_mobile_phone.json +32 -0
  133. package/src/generators/fields-possible-values/lab-results.json +19 -0
  134. package/src/generators/fields-possible-values/mobile_phone.json +45 -0
  135. package/src/generators/fields-possible-values/multiple-choice.json +128 -0
  136. package/src/generators/fields-possible-values/password.json +20 -0
  137. package/src/generators/fields-possible-values/pdf-image.json +70 -0
  138. package/src/generators/fields-possible-values/postal_code.json +32 -0
  139. package/src/generators/fields-possible-values/preference-multiple-choice.json +53 -0
  140. package/src/generators/fields-possible-values/qrcode.json +75 -0
  141. package/src/generators/fields-possible-values/quote.json +71 -0
  142. package/src/generators/fields-possible-values/radio-choice.json +209 -0
  143. package/src/generators/fields-possible-values/rate.json +26 -0
  144. package/src/generators/fields-possible-values/recipient.json +46 -0
  145. package/src/generators/fields-possible-values/redirect.json +22 -0
  146. package/src/generators/fields-possible-values/refcode.json +89 -0
  147. package/src/generators/fields-possible-values/string.json +778 -0
  148. package/src/generators/fields-possible-values/text.json +105 -0
  149. package/src/generators/fields-possible-values/three-block-date.json +83 -0
  150. package/src/generators/fields-possible-values/url.json +23 -0
  151. package/src/generators/fieldsets-possible-values/form.json +311 -0
  152. package/src/generators/fieldsets-possible-values/hidden.json +107 -0
  153. package/src/generators/fieldsets-possible-values/unknown.json +69 -0
  154. package/src/generators/fieldsets-possible-values/values-list.json +364 -0
  155. package/src/schemas/action.ts +44 -58
  156. package/src/schemas/field/afm/index.ts +8 -6
  157. package/src/schemas/field/amka/index.ts +7 -9
  158. package/src/schemas/field/attachment/index.ts +9 -23
  159. package/src/schemas/field/captcha/index.ts +8 -3
  160. package/src/schemas/field/choice/index.ts +7 -5
  161. package/src/schemas/field/common.spec.ts +0 -3
  162. package/src/schemas/field/common.ts +115 -53
  163. package/src/schemas/field/date/index.ts +8 -24
  164. package/src/schemas/field/doc_subtitle/index.ts +7 -4
  165. package/src/schemas/field/doc_title/index.ts +7 -14
  166. package/src/schemas/field/dynamically-filled-text/index.ts +7 -15
  167. package/src/schemas/field/email/index.ts +7 -9
  168. package/src/schemas/field/fillable-string/index.ts +7 -11
  169. package/src/schemas/field/five-block-date/index.ts +7 -2
  170. package/src/schemas/field/hidden/index.ts +15 -40
  171. package/src/schemas/field/hierarchical-selector/index.ts +8 -18
  172. package/src/schemas/field/iban/index.ts +7 -3
  173. package/src/schemas/field/image/index.ts +8 -10
  174. package/src/schemas/field/index.ts +8 -33
  175. package/src/schemas/field/int/index.ts +7 -9
  176. package/src/schemas/field/intl_mobile_phone/index.ts +7 -3
  177. package/src/schemas/field/lab-results/index.ts +7 -3
  178. package/src/schemas/field/mobile_phone/index.ts +7 -4
  179. package/src/schemas/field/multiple-choice/index.ts +7 -5
  180. package/src/schemas/field/password/index.ts +8 -3
  181. package/src/schemas/field/pdf-image/index.ts +8 -12
  182. package/src/schemas/field/postal_code/index.ts +8 -5
  183. package/src/schemas/field/preference-multiple-choice/index.ts +8 -7
  184. package/src/schemas/field/qrcode/index.ts +7 -10
  185. package/src/schemas/field/quote/index.ts +8 -8
  186. package/src/schemas/field/radio-choice/index.ts +7 -5
  187. package/src/schemas/field/rate/index.ts +7 -8
  188. package/src/schemas/field/recipient/index.ts +7 -4
  189. package/src/schemas/field/redirect/index.ts +7 -6
  190. package/src/schemas/field/refcode/index.ts +7 -21
  191. package/src/schemas/field/string/index.ts +7 -42
  192. package/src/schemas/field/text/index.ts +8 -16
  193. package/src/schemas/field/three-block-date/index.ts +7 -6
  194. package/src/schemas/field/url/index.ts +24 -0
  195. package/src/schemas/fieldset/component-params.ts +4 -20
  196. package/src/schemas/fieldset/display-components.ts +5 -36
  197. package/src/schemas/fieldset/enums.ts +0 -38
  198. package/src/schemas/step.ts +1 -0
  199. package/src/schemas/{template/template-base.ts → template.ts} +30 -6
  200. package/src/utils/index.ts +69 -2
  201. package/utils/index.js +28 -2
  202. package/schemas/field/consent-content/index.d.ts +0 -68
  203. package/schemas/field/consent-content/index.js +0 -19
  204. package/schemas/field/image-crop/index.d.ts +0 -59
  205. package/schemas/field/image-crop/index.js +0 -19
  206. package/schemas/field/landline_phone/index.d.ts +0 -48
  207. package/schemas/field/landline_phone/index.js +0 -14
  208. package/schemas/field/link/index.d.ts +0 -50
  209. package/schemas/field/link/index.js +0 -16
  210. package/schemas/field/phone/index.d.ts +0 -48
  211. package/schemas/field/phone/index.js +0 -14
  212. package/schemas/field/url-param/index.d.ts +0 -57
  213. package/schemas/field/url-param/index.js +0 -14
  214. package/schemas/template/index.d.ts +0 -2
  215. package/schemas/template/index.js +0 -2
  216. package/schemas/template/template-base.d.ts +0 -53
  217. package/schemas/template/template-base.js +0 -15
  218. package/schemas/template/template-source.d.ts +0 -50
  219. package/schemas/template/template-source.js +0 -14
  220. package/schemas/template/template.js +0 -22
  221. package/src/schemas/field/consent-content/index.ts +0 -28
  222. package/src/schemas/field/image-crop/index.ts +0 -25
  223. package/src/schemas/field/landline_phone/index.ts +0 -18
  224. package/src/schemas/field/link/index.ts +0 -20
  225. package/src/schemas/field/phone/index.ts +0 -18
  226. package/src/schemas/field/url-param/index.ts +0 -23
  227. package/src/schemas/template/index.ts +0 -2
  228. package/src/schemas/template/template-source.ts +0 -88
  229. package/src/schemas/template/template.ts +0 -49
@@ -1,22 +0,0 @@
1
- import { any, array, boolean as external_valibot_boolean, nullish, picklist, strictObject, string } from "valibot";
2
- import { TemplateBaseSchema } from "./template-base.js";
3
- const TemplateSchema = strictObject({
4
- ...TemplateBaseSchema.entries,
5
- enabled: nullish(external_valibot_boolean()),
6
- template_type: strictObject({
7
- refname: string(),
8
- fields: array(any())
9
- }),
10
- consent_method: picklist([
11
- 'login',
12
- 'otp',
13
- 'gov_wallet_or_otp'
14
- ]),
15
- recipient_hint: nullish(string()),
16
- required_claims: array(string()),
17
- owner: nullish(string()),
18
- login_endpoint: nullish(string()),
19
- fields: nullish(array(any())),
20
- 'ui:legacy_renderer': external_valibot_boolean()
21
- });
22
- export { TemplateSchema };
@@ -1,28 +0,0 @@
1
- import * as v from 'valibot';
2
- import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
3
-
4
- const ConsentContentDisplaySchema = createFieldDisplay(
5
- v.strictObject({
6
- component: v.literal('consent-content'),
7
- 'component-params': v.nullish(
8
- v.strictObject({
9
- 'display-values': v.nullish(v.boolean()),
10
- 'data-label': v.nullish(v.string()),
11
- 'recipient-label': v.nullish(v.string()),
12
- 'transaction-label': v.nullish(v.string()),
13
- })
14
- ),
15
- })
16
- );
17
-
18
- const ConsentContentSchema = v.strictObject({
19
- 'user-input-mode': v.literal('display'),
20
- display: ConsentContentDisplaySchema,
21
- sources: v.nullish(v.string()),
22
- 'value-constructor': v.nullish(v.string()),
23
- });
24
-
25
- export type ConsentContentType = v.InferOutput<typeof ConsentContentSchema>;
26
- export type ConsentContentSchemaType = v.GenericSchema<ConsentContentType>;
27
-
28
- export default ConsentContentSchema as ConsentContentSchemaType;
@@ -1,25 +0,0 @@
1
- import * as v from 'valibot';
2
- import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
3
-
4
- const ImageCropDisplaySchema = createFieldDisplay(
5
- v.strictObject({
6
- component: v.literal('image-crop'),
7
- 'component-params': v.nullish(
8
- v.strictObject({
9
- 'image-src-field-name': v.nullish(v.string()),
10
- })
11
- ),
12
- })
13
- );
14
-
15
- const ImageCropSchema = v.strictObject({
16
- 'user-input-mode': v.picklist(['noinput', 'required']),
17
- display: ImageCropDisplaySchema,
18
- datatype: v.nullish(v.literal('image-crop')),
19
- attribute: v.nullish(v.string()),
20
- });
21
-
22
- export type ImageCropType = v.InferOutput<typeof ImageCropSchema>;
23
- export type ImageCropSchemaType = v.GenericSchema<ImageCropType>;
24
-
25
- export default ImageCropSchema as ImageCropSchemaType;
@@ -1,18 +0,0 @@
1
- import * as v from 'valibot';
2
- import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
3
-
4
- const LandlinePhoneDisplaySchema = createFieldDisplay(
5
- v.strictObject({
6
- component: v.literal('landline_phone'),
7
- })
8
- );
9
-
10
- const LandlinePhoneSchema = v.strictObject({
11
- 'user-input-mode': v.picklist(['noinput', 'optional']),
12
- display: LandlinePhoneDisplaySchema,
13
- });
14
-
15
- export type LandlinePhoneType = v.InferOutput<typeof LandlinePhoneSchema>;
16
- export type LandlinePhoneSchemaType = v.GenericSchema<LandlinePhoneType>;
17
-
18
- export default LandlinePhoneSchema as LandlinePhoneSchemaType;
@@ -1,20 +0,0 @@
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;
@@ -1,18 +0,0 @@
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;
@@ -1,23 +0,0 @@
1
- import * as v from 'valibot';
2
- import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
3
-
4
- const UrlParamDisplaySchema = createFieldDisplay(
5
- v.strictObject({
6
- component: v.literal('url-param'),
7
- 'component-params': v.nullish(
8
- v.strictObject({
9
- 'param-name': v.nullish(v.string()),
10
- })
11
- ),
12
- })
13
- );
14
-
15
- const UrlParamSchema = v.strictObject({
16
- 'user-input-mode': v.literal('optional'),
17
- display: UrlParamDisplaySchema,
18
- });
19
-
20
- export type UrlParamType = v.InferOutput<typeof UrlParamSchema>;
21
- export type UrlParamSchemaType = v.GenericSchema<UrlParamType>;
22
-
23
- export default UrlParamSchema as UrlParamSchemaType;
@@ -1,2 +0,0 @@
1
- export * from '@uides/stepwise/schemas/template/template-source';
2
- export * from '@uides/stepwise/schemas/template/template';
@@ -1,88 +0,0 @@
1
- import * as v from 'valibot';
2
- import { TemplateBaseSchema } from '@uides/stepwise/schemas/template/template-base';
3
-
4
- /**
5
- * Template model used in the backend.
6
- *
7
- * This describes the template as it is stored in the database. Some of the fields present in the
8
- * backend model are not used in the frontend type.
9
- *
10
- * @see {@link TemplateBase} for the definition of a template.
11
- */
12
- export const TemplateSourceSchema = v.strictObject(
13
- {
14
- ...TemplateBaseSchema.entries,
15
- /**
16
- * Action to execute when the document is issued.
17
- */
18
- action_on_issue: v.nullish(v.string()),
19
- case_prefixes: v.nullish(v.array(v.string())),
20
- /**
21
- * Claims that are not checked for in the user's session
22
- */
23
- exempted_claims: v.nullish(v.array(v.string())),
24
- /**
25
- * Extra claims to check for in the user's session.
26
- *
27
- * When creating a new declaration that includes the template, the application checks
28
- * that the session contains all the claims specified in this field.
29
- */
30
- extra_required_claims: v.nullish(v.array(v.string())),
31
- posting_whitelist: v.nullish(v.array(v.string())),
32
- /**
33
- * Whether a case number is assigned on instantiation of the template.
34
- * @default false
35
- */
36
- requires_case: v.nullish(v.boolean()),
37
- validation_context: v.nullish(v.string()),
38
- /**
39
- * Defines the access policy of th document in the validation phase
40
- */
41
- validation_policy: v.nullish(v.string()),
42
- }
43
- // TODO: Is this validation pipeline necessary?
44
- // [
45
- // validateField('extra_required_claims', (claims) => {
46
- // return validateClaims(claims);
47
- // }),
48
- // validateField('exempted_claims', (claims) => {
49
- // return validateClaims(claims);
50
- // }),
51
- // ]
52
- );
53
-
54
- // const templateSessionClaims = [
55
- // 'mobile_certified_login',
56
- // 'is_citizen_user',
57
- // 'govgr_login',
58
- // 'gsis_login',
59
- // 'anonymous_login',
60
- // 'captcha_login',
61
- // 'is_system',
62
- // 'is_admin',
63
- // 'is_service',
64
- // 'oidc_login',
65
- // 'oidc_login_flow',
66
- // 'pre_login_flow',
67
- // 'test_login',
68
- // 'is_syntagografis,i_user',
69
- // ];
70
- //
71
- // function validateClaims(claims: string[] | null | undefined) {
72
- // if (!claims) return true;
73
- // for (const claimClause of claims) {
74
- // for (const claim of claimClause.split('|')) {
75
- // if (
76
- // !templateSessionClaims.includes(claim) &&
77
- // !claim.startsWith('oidc_login_aud')
78
- // ) {
79
- // return false;
80
- // }
81
- // }
82
- // }
83
- // return true;
84
- // }
85
-
86
- export type TemplateSource = v.InferOutput<typeof TemplateSourceSchema>;
87
-
88
- export default TemplateSource;
@@ -1,49 +0,0 @@
1
- import * as v from 'valibot';
2
- import { TemplateBaseSchema } from '@uides/stepwise/schemas/template/template-base';
3
-
4
- /**
5
- * Template type used in the frontend.
6
- *
7
- * This describes the template as it is returned by the API to the frontend.
8
- * Some of the fields present in the backend model are not used in the frontend type.
9
- *
10
- * @see {@link TemplateBase} for the definition of a template.
11
- */
12
- export const TemplateSchema = v.strictObject({
13
- ...TemplateBaseSchema.entries,
14
- /**
15
- * Whether the template is enabled or not.
16
- */
17
- enabled: v.nullish(v.boolean()),
18
- template_type: v.strictObject({
19
- /** @default 'application' */
20
- refname: v.string(),
21
- /** @default [] */
22
- fields: v.array(v.any()),
23
- }),
24
- consent_method: v.picklist(['login', 'otp', 'gov_wallet_or_otp']),
25
- /**
26
- * Recipient's business title
27
- * @deprecated
28
- */
29
- recipient_hint: v.nullish(v.string()),
30
- /**
31
- * Claims that the application checks for in the user's session.
32
- *
33
- * @default ['mobile_certified_login','is_citizen_user','govgr_login']
34
- */
35
- required_claims: v.array(v.string()),
36
- /**
37
- * Codename of the gate that owns the template
38
- *
39
- * An entity's gate can be the owner of a template. If not specified, the template is considered
40
- * to be owned by the "System".
41
- */
42
- owner: v.nullish(v.string()),
43
- login_endpoint: v.nullish(v.string()),
44
- fields: v.nullish(v.array(v.any())),
45
- 'ui:legacy_renderer': v.boolean(),
46
- });
47
- export type Template = v.InferOutput<typeof TemplateSchema>;
48
-
49
- export default Template;