@diia-inhouse/test 6.4.0 → 7.2.0

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 (210) hide show
  1. package/LICENCE.md +59 -59
  2. package/dist/dbUtilsBuilder.js +116 -0
  3. package/dist/dbUtilsBuilder.js.map +1 -0
  4. package/dist/documentsGenerator.js.map +1 -1
  5. package/dist/index.js +3 -5
  6. package/dist/index.js.map +1 -1
  7. package/dist/interfaces/documents/foreignPassport.js.map +1 -1
  8. package/dist/interfaces/documents/index.js.map +1 -1
  9. package/dist/publicServiceGenerator.js +3 -5
  10. package/dist/publicServiceGenerator.js.map +1 -1
  11. package/dist/sessionGenerator.js +7 -24
  12. package/dist/sessionGenerator.js.map +1 -1
  13. package/dist/stubs/documents/foreignPassport.js +17 -2
  14. package/dist/stubs/documents/foreignPassport.js.map +1 -1
  15. package/dist/stubs/documents/index.js +2 -2
  16. package/dist/stubs/documents/index.js.map +1 -1
  17. package/dist/stubs/documents/internalPassport.js +19 -4
  18. package/dist/stubs/documents/internalPassport.js.map +1 -1
  19. package/dist/types/dbUtilsBuilder.d.ts +29 -0
  20. package/dist/types/index.d.ts +1 -1
  21. package/dist/types/interfaces/documents/foreignPassport.d.ts +2 -1
  22. package/dist/types/interfaces/documents/index.d.ts +15 -0
  23. package/dist/types/interfaces/documents/internalPassport.d.ts +2 -1
  24. package/dist/types/publicServiceGenerator.d.ts +1 -1
  25. package/dist/types/sessionGenerator.d.ts +4 -5
  26. package/package.json +35 -39
  27. package/vitest/extend-expect.ts +25 -0
  28. package/vitest/interfaces/index.ts +8 -0
  29. package/vitest/matchers/designSystem/atoms/amountAtm.ts +13 -0
  30. package/vitest/matchers/designSystem/atoms/articlePicAtm.ts +12 -0
  31. package/vitest/matchers/designSystem/atoms/badgeCounterAtm.ts +11 -0
  32. package/vitest/matchers/designSystem/atoms/btnLinkAtm.ts +16 -0
  33. package/vitest/matchers/designSystem/atoms/btnLoadPlainIconAtm.ts +19 -0
  34. package/vitest/matchers/designSystem/atoms/btnPlainAtm.ts +16 -0
  35. package/vitest/matchers/designSystem/atoms/btnPlainIconAtm.ts +18 -0
  36. package/vitest/matchers/designSystem/atoms/btnPrimaryAdditionalAtm.ts +16 -0
  37. package/vitest/matchers/designSystem/atoms/btnPrimaryDefaultAtm.ts +17 -0
  38. package/vitest/matchers/designSystem/atoms/btnPrimaryLargeAtm.ts +16 -0
  39. package/vitest/matchers/designSystem/atoms/btnPrimaryWideAtm.ts +16 -0
  40. package/vitest/matchers/designSystem/atoms/btnSemiLightAtm.ts +16 -0
  41. package/vitest/matchers/designSystem/atoms/btnStrokeAdditionalAtm.ts +16 -0
  42. package/vitest/matchers/designSystem/atoms/btnStrokeDefaultAtm.ts +16 -0
  43. package/vitest/matchers/designSystem/atoms/btnWhiteAdditionalIconAtm.ts +20 -0
  44. package/vitest/matchers/designSystem/atoms/calendarItemAtm.ts +14 -0
  45. package/vitest/matchers/designSystem/atoms/chipStatusAtm.ts +14 -0
  46. package/vitest/matchers/designSystem/atoms/dotNavigationAtm.ts +11 -0
  47. package/vitest/matchers/designSystem/atoms/doubleIconAtm.ts +15 -0
  48. package/vitest/matchers/designSystem/atoms/greyTitleAtm.ts +12 -0
  49. package/vitest/matchers/designSystem/atoms/iconAtm.ts +12 -0
  50. package/vitest/matchers/designSystem/atoms/index.ts +65 -0
  51. package/vitest/matchers/designSystem/atoms/inputNumberLargeAtm.ts +15 -0
  52. package/vitest/matchers/designSystem/atoms/largeIconAtm.ts +16 -0
  53. package/vitest/matchers/designSystem/atoms/playerBtnAtm.ts +12 -0
  54. package/vitest/matchers/designSystem/atoms/sectionTitleAtm.ts +11 -0
  55. package/vitest/matchers/designSystem/atoms/shared/buttonAction.ts +15 -0
  56. package/vitest/matchers/designSystem/atoms/shared/iconAction.ts +13 -0
  57. package/vitest/matchers/designSystem/atoms/simpleIconAtm.ts +12 -0
  58. package/vitest/matchers/designSystem/atoms/smallIconAtm.ts +16 -0
  59. package/vitest/matchers/designSystem/atoms/textParameterAtm.ts +19 -0
  60. package/vitest/matchers/designSystem/atoms/tickerAtm.ts +20 -0
  61. package/vitest/matchers/designSystem/atoms/userPictureAtm.ts +14 -0
  62. package/vitest/matchers/designSystem/atoms/validationAtm.ts +13 -0
  63. package/vitest/matchers/designSystem/enums/button.ts +5 -0
  64. package/vitest/matchers/designSystem/enums/icon.ts +5 -0
  65. package/vitest/matchers/designSystem/index.ts +7 -0
  66. package/vitest/matchers/designSystem/molecules/articleVideoMlc.ts +13 -0
  67. package/vitest/matchers/designSystem/molecules/attentionIconMessageMlc.ts +15 -0
  68. package/vitest/matchers/designSystem/molecules/attentionMessageMlc.ts +18 -0
  69. package/vitest/matchers/designSystem/molecules/barCodeMlc.ts +12 -0
  70. package/vitest/matchers/designSystem/molecules/blackCardMlc.ts +20 -0
  71. package/vitest/matchers/designSystem/molecules/btnIconPlainGroupMlc.ts +17 -0
  72. package/vitest/matchers/designSystem/molecules/btnIconRoundedMlc.ts +15 -0
  73. package/vitest/matchers/designSystem/molecules/btnLoadIconPlainGroupMlc.ts +17 -0
  74. package/vitest/matchers/designSystem/molecules/btnToggleMlc.ts +26 -0
  75. package/vitest/matchers/designSystem/molecules/cardMlc.ts +33 -0
  76. package/vitest/matchers/designSystem/molecules/cardMlcTicker.ts +12 -0
  77. package/vitest/matchers/designSystem/molecules/checkIconMlc.ts +13 -0
  78. package/vitest/matchers/designSystem/molecules/checkboxRoundMlc.ts +11 -0
  79. package/vitest/matchers/designSystem/molecules/checkboxSquareMlc.ts +22 -0
  80. package/vitest/matchers/designSystem/molecules/chipMlc.ts +22 -0
  81. package/vitest/matchers/designSystem/molecules/chipTimeMlc.ts +15 -0
  82. package/vitest/matchers/designSystem/molecules/currentTimeMlc.ts +20 -0
  83. package/vitest/matchers/designSystem/molecules/dashboardCardMlc.ts +23 -0
  84. package/vitest/matchers/designSystem/molecules/docNumberCopyMlc.ts +15 -0
  85. package/vitest/matchers/designSystem/molecules/docNumberCopyWhiteMlc.ts +14 -0
  86. package/vitest/matchers/designSystem/molecules/docTableItemHorizontalLongerMlc.ts +18 -0
  87. package/vitest/matchers/designSystem/molecules/docTableItemHorizontalMlc.ts +19 -0
  88. package/vitest/matchers/designSystem/molecules/halvedCardMlc.ts +21 -0
  89. package/vitest/matchers/designSystem/molecules/headingWithSubtitleWhiteMlc.ts +12 -0
  90. package/vitest/matchers/designSystem/molecules/headingWithSubtitlesMlc.ts +13 -0
  91. package/vitest/matchers/designSystem/molecules/iconCardMlc.ts +15 -0
  92. package/vitest/matchers/designSystem/molecules/imageCardMlc.ts +21 -0
  93. package/vitest/matchers/designSystem/molecules/index.ts +121 -0
  94. package/vitest/matchers/designSystem/molecules/inputDateMlc.ts +19 -0
  95. package/vitest/matchers/designSystem/molecules/inputNumberFractionalMlc.ts +21 -0
  96. package/vitest/matchers/designSystem/molecules/inputNumberLargeMlc.ts +17 -0
  97. package/vitest/matchers/designSystem/molecules/inputNumberMlc.ts +20 -0
  98. package/vitest/matchers/designSystem/molecules/inputTextMlc.ts +21 -0
  99. package/vitest/matchers/designSystem/molecules/inputTextMultilineMlc.ts +21 -0
  100. package/vitest/matchers/designSystem/molecules/listItemMlc.ts +32 -0
  101. package/vitest/matchers/designSystem/molecules/listWidgetItemMlc.ts +24 -0
  102. package/vitest/matchers/designSystem/molecules/navigationPanelMlc.ts +49 -0
  103. package/vitest/matchers/designSystem/molecules/qrCodeMlc.ts +12 -0
  104. package/vitest/matchers/designSystem/molecules/radioBtnMlc.ts +28 -0
  105. package/vitest/matchers/designSystem/molecules/searchInputMlc.ts +19 -0
  106. package/vitest/matchers/designSystem/molecules/smallEmojiPanelMlc.ts +13 -0
  107. package/vitest/matchers/designSystem/molecules/smallEmojiPanelPlaneMlc.ts +13 -0
  108. package/vitest/matchers/designSystem/molecules/smallNotificationMlc.ts +20 -0
  109. package/vitest/matchers/designSystem/molecules/stackMlc.ts +13 -0
  110. package/vitest/matchers/designSystem/molecules/statusMessageMlc.ts +16 -0
  111. package/vitest/matchers/designSystem/molecules/stubMessageMlc.ts +18 -0
  112. package/vitest/matchers/designSystem/molecules/subtitleLabelMlc.ts +14 -0
  113. package/vitest/matchers/designSystem/molecules/tableItemHorizontalLargeMlc.ts +22 -0
  114. package/vitest/matchers/designSystem/molecules/tableItemHorizontalMlc.ts +19 -0
  115. package/vitest/matchers/designSystem/molecules/tableItemMlc.ts +23 -0
  116. package/vitest/matchers/designSystem/molecules/tableItemPrimaryMlc.ts +15 -0
  117. package/vitest/matchers/designSystem/molecules/tableItemVerticalMlc.ts +22 -0
  118. package/vitest/matchers/designSystem/molecules/tableMainHeadingMlc.ts +15 -0
  119. package/vitest/matchers/designSystem/molecules/tableSecondaryHeadingMlc.ts +14 -0
  120. package/vitest/matchers/designSystem/molecules/textLabelContainerMlc.ts +15 -0
  121. package/vitest/matchers/designSystem/molecules/textLabelMlc.ts +23 -0
  122. package/vitest/matchers/designSystem/molecules/timerMlc.ts +36 -0
  123. package/vitest/matchers/designSystem/molecules/titleGroupMlc.ts +27 -0
  124. package/vitest/matchers/designSystem/molecules/titleLabelMlc.ts +12 -0
  125. package/vitest/matchers/designSystem/molecules/userCardMlc.ts +15 -0
  126. package/vitest/matchers/designSystem/molecules/verticalCardMlc.ts +22 -0
  127. package/vitest/matchers/designSystem/molecules/whiteCardMlc.ts +19 -0
  128. package/vitest/matchers/designSystem/organisms/articlePicCarouselOrg.ts +20 -0
  129. package/vitest/matchers/designSystem/organisms/bottomGroupOrg.ts +25 -0
  130. package/vitest/matchers/designSystem/organisms/btnIconRoundedGroupOrg.ts +16 -0
  131. package/vitest/matchers/designSystem/organisms/calendarItemOrg.ts +16 -0
  132. package/vitest/matchers/designSystem/organisms/checkboxBtnOrg.ts +21 -0
  133. package/vitest/matchers/designSystem/organisms/checkboxRoundGroupOrg.ts +22 -0
  134. package/vitest/matchers/designSystem/organisms/chipGroupOrg.ts +21 -0
  135. package/vitest/matchers/designSystem/organisms/chipTabsOrg.ts +22 -0
  136. package/vitest/matchers/designSystem/organisms/dashboardCardTileOrg.ts +17 -0
  137. package/vitest/matchers/designSystem/organisms/docButtonHeadingOrg.ts +20 -0
  138. package/vitest/matchers/designSystem/organisms/docHeadingOrg.ts +19 -0
  139. package/vitest/matchers/designSystem/organisms/editAutomaticallyDeterminedValueOrg.ts +18 -0
  140. package/vitest/matchers/designSystem/organisms/fileUploadGroupOrg.ts +17 -0
  141. package/vitest/matchers/designSystem/organisms/fullScreenVideoOrg.ts +17 -0
  142. package/vitest/matchers/designSystem/organisms/groupFilesAddOrg.ts +19 -0
  143. package/vitest/matchers/designSystem/organisms/halvedCardCarouselOrg.ts +20 -0
  144. package/vitest/matchers/designSystem/organisms/index.ts +83 -0
  145. package/vitest/matchers/designSystem/organisms/inputDateTimeOrg.ts +16 -0
  146. package/vitest/matchers/designSystem/organisms/inputNumLargeTimeOrg.ts +19 -0
  147. package/vitest/matchers/designSystem/organisms/listItemGroupOrg.ts +11 -0
  148. package/vitest/matchers/designSystem/organisms/mediaTitleOrg.ts +14 -0
  149. package/vitest/matchers/designSystem/organisms/mediaUploadGroupOrg.ts +16 -0
  150. package/vitest/matchers/designSystem/organisms/paginationListOrg.ts +19 -0
  151. package/vitest/matchers/designSystem/organisms/paginationListWhiteOrg.ts +20 -0
  152. package/vitest/matchers/designSystem/organisms/paymentInfoOrg.ts +23 -0
  153. package/vitest/matchers/designSystem/organisms/questionFormsOrg.ts +28 -0
  154. package/vitest/matchers/designSystem/organisms/radioBtnAdditionalInputOrg.ts +14 -0
  155. package/vitest/matchers/designSystem/organisms/radioBtnGroupOrg.ts +28 -0
  156. package/vitest/matchers/designSystem/organisms/radioBtnWithAltOrg.ts +17 -0
  157. package/vitest/matchers/designSystem/organisms/searchBarOrg.ts +15 -0
  158. package/vitest/matchers/designSystem/organisms/selectorListWidgetOrg.ts +16 -0
  159. package/vitest/matchers/designSystem/organisms/selectorOrg.ts +24 -0
  160. package/vitest/matchers/designSystem/organisms/sharingCodesOrg.ts +24 -0
  161. package/vitest/matchers/designSystem/organisms/smallNotificationCarouselOrg.ts +20 -0
  162. package/vitest/matchers/designSystem/organisms/tableBlockAccordionOrg.ts +15 -0
  163. package/vitest/matchers/designSystem/organisms/tableBlockOrg.ts +17 -0
  164. package/vitest/matchers/designSystem/organisms/tableBlockPlaneOrg.ts +17 -0
  165. package/vitest/matchers/designSystem/organisms/tableBlockTwoColumnsOrg.ts +15 -0
  166. package/vitest/matchers/designSystem/organisms/tableBlockTwoColumnsPlaneOrg.ts +16 -0
  167. package/vitest/matchers/designSystem/organisms/toggleButtonGroupOrg.ts +18 -0
  168. package/vitest/matchers/designSystem/organisms/topGroupOrg.ts +17 -0
  169. package/vitest/matchers/designSystem/organisms/verificationCodesOrg.ts +31 -0
  170. package/vitest/matchers/designSystem/organisms/verticalCardCarouselOrg.ts +16 -0
  171. package/vitest/matchers/designSystem/utils.ts +14 -0
  172. package/vitest/matchers/index.ts +21 -0
  173. package/vitest/matchers/toBe.ts +38 -0
  174. package/vitest/matchers/toBeAttentionMessage/index.ts +19 -0
  175. package/vitest/matchers/toBeAttentionMessage/interfaces.ts +8 -0
  176. package/vitest/matchers/toBeAttentionMessageParameter.ts +20 -0
  177. package/vitest/matchers/toBeContextMenu/index.ts +25 -0
  178. package/vitest/matchers/toBeContextMenu/interfaces.ts +9 -0
  179. package/vitest/matchers/toBeDesignSystemElement/index.ts +8 -0
  180. package/vitest/matchers/toBeMainButton/index.ts +19 -0
  181. package/vitest/matchers/toBeMainButton/interfaces.ts +5 -0
  182. package/vitest/matchers/toBeNavigationPanel/index.ts +17 -0
  183. package/vitest/matchers/toBeNavigationPanel/interfaces.ts +6 -0
  184. package/vitest/matchers/toBeTextWithParameters/index.ts +17 -0
  185. package/vitest/matchers/toBeTextWithParameters/interfaces.ts +6 -0
  186. package/vitest/matchers/toBeValueWithLabel/index.ts +18 -0
  187. package/vitest/matchers/toBeValueWithLabel/interfaces.ts +4 -0
  188. package/vitest/matchers/toContainObjects.ts +17 -0
  189. package/vitest/matchers/toEqual.ts +26 -0
  190. package/vitest/matchers/toInterceptorsBeDone.ts +18 -0
  191. package/vitest/tsconfig.json +9 -0
  192. package/vitest/utils.ts +144 -0
  193. package/dist/interfaces/documents/eResidency.js +0 -15
  194. package/dist/interfaces/documents/eResidency.js.map +0 -1
  195. package/dist/interfaces/documents/residencePermit.js +0 -9
  196. package/dist/interfaces/documents/residencePermit.js.map +0 -1
  197. package/dist/mock.js +0 -29
  198. package/dist/mock.js.map +0 -1
  199. package/dist/mongooseMock.js +0 -43
  200. package/dist/mongooseMock.js.map +0 -1
  201. package/dist/stubs/documents/eResidency.js +0 -48
  202. package/dist/stubs/documents/eResidency.js.map +0 -1
  203. package/dist/stubs/documents/residencePermit.js +0 -48
  204. package/dist/stubs/documents/residencePermit.js.map +0 -1
  205. package/dist/types/interfaces/documents/eResidency.d.ts +0 -77
  206. package/dist/types/interfaces/documents/residencePermit.d.ts +0 -50
  207. package/dist/types/mock.d.ts +0 -5
  208. package/dist/types/mongooseMock.d.ts +0 -33
  209. package/dist/types/stubs/documents/eResidency.d.ts +0 -3
  210. package/dist/types/stubs/documents/residencePermit.d.ts +0 -3
@@ -0,0 +1,20 @@
1
+ import { Describe, array, object, optional } from 'superstruct'
2
+
3
+ import { HalvedCardCarouselItem, HalvedCardCarouselOrg } from '@diia-inhouse/types'
4
+
5
+ import { dotNavigationAtmSchema } from '../atoms/dotNavigationAtm'
6
+ import { halvedCardMlcSchema } from '../molecules/halvedCardMlc'
7
+ import { iconCardMlcSchema } from '../molecules/iconCardMlc'
8
+ import { schemaBuilder } from '../utils'
9
+
10
+ const halvedCardCarouselItemSchema: Describe<HalvedCardCarouselItem> = object({
11
+ halvedCardMlc: optional(halvedCardMlcSchema()),
12
+ iconCardMlc: optional(iconCardMlcSchema()),
13
+ })
14
+
15
+ const schema: Describe<HalvedCardCarouselOrg> = object({
16
+ dotNavigationAtm: optional(dotNavigationAtmSchema()),
17
+ items: array(halvedCardCarouselItemSchema),
18
+ })
19
+
20
+ export const halvedCardCarouselOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,83 @@
1
+ export * from './articlePicCarouselOrg'
2
+
3
+ export * from './bottomGroupOrg'
4
+
5
+ export * from './btnIconRoundedGroupOrg'
6
+
7
+ export * from './calendarItemOrg'
8
+
9
+ export * from './checkboxBtnOrg'
10
+
11
+ export * from './checkboxRoundGroupOrg'
12
+
13
+ export * from './chipGroupOrg'
14
+
15
+ export * from './chipTabsOrg'
16
+
17
+ export * from './dashboardCardTileOrg'
18
+
19
+ export * from './docButtonHeadingOrg'
20
+
21
+ export * from './docHeadingOrg'
22
+
23
+ export * from './editAutomaticallyDeterminedValueOrg'
24
+
25
+ export * from './fileUploadGroupOrg'
26
+
27
+ export * from './fullScreenVideoOrg'
28
+
29
+ export * from './groupFilesAddOrg'
30
+
31
+ export * from './halvedCardCarouselOrg'
32
+
33
+ export * from './inputDateTimeOrg'
34
+
35
+ export * from './inputNumLargeTimeOrg'
36
+
37
+ export * from './listItemGroupOrg'
38
+
39
+ export * from './mediaTitleOrg'
40
+
41
+ export * from './mediaUploadGroupOrg'
42
+
43
+ export * from './paginationListOrg'
44
+
45
+ export * from './paginationListWhiteOrg'
46
+
47
+ export * from './paymentInfoOrg'
48
+
49
+ export * from './questionFormsOrg'
50
+
51
+ export * from './radioBtnAdditionalInputOrg'
52
+
53
+ export * from './radioBtnGroupOrg'
54
+
55
+ export * from './radioBtnWithAltOrg'
56
+
57
+ export * from './selectorListWidgetOrg'
58
+
59
+ export * from './selectorOrg'
60
+
61
+ export * from './sharingCodesOrg'
62
+
63
+ export * from './smallNotificationCarouselOrg'
64
+
65
+ export * from './tableBlockAccordionOrg'
66
+
67
+ export * from './tableBlockOrg'
68
+
69
+ export * from './tableBlockPlaneOrg'
70
+
71
+ export * from './tableBlockTwoColumnsOrg'
72
+
73
+ export * from './tableBlockTwoColumnsPlaneOrg'
74
+
75
+ export * from './toggleButtonGroupOrg'
76
+
77
+ export * from './topGroupOrg'
78
+
79
+ export * from './verificationCodesOrg'
80
+
81
+ export * from './verticalCardCarouselOrg'
82
+
83
+ export * from './searchBarOrg'
@@ -0,0 +1,16 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { InputDateTimeOrg } from '@diia-inhouse/types'
4
+
5
+ import { inputDateMlcSchema } from '../molecules/inputDateMlc'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<InputDateTimeOrg> = object({
9
+ componentId: string(),
10
+ maxDate: optional(string()),
11
+ minDate: optional(string()),
12
+ inputCode: optional(string()),
13
+ inputDateMlc: optional(inputDateMlcSchema()),
14
+ })
15
+
16
+ export const inputDateTimeOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,19 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { InputNumLargeTimeItem, InputNumLargeTimeOrg } from '@diia-inhouse/types'
4
+
5
+ import { inputNumberLargeAtmSchema } from '../atoms/inputNumberLargeAtm'
6
+ import { textLabelMlcSchema } from '../molecules/textLabelMlc'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const inputNumLargeTimeItem: Describe<InputNumLargeTimeItem> = object({
10
+ inputNumberLargeAtm: optional(inputNumberLargeAtmSchema()),
11
+ })
12
+
13
+ const schema: Describe<InputNumLargeTimeOrg> = object({
14
+ componentId: string(),
15
+ textLabelMlc: optional(textLabelMlcSchema()),
16
+ items: array(inputNumLargeTimeItem),
17
+ })
18
+
19
+ export const inputNumLargeTimeOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,11 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { ListItemGroupOrg } from '@diia-inhouse/types'
4
+
5
+ import { listItemMlcSchema } from '../molecules/listItemMlc'
6
+
7
+ export const listItemGroupOrgSchema: Describe<ListItemGroupOrg> = object({
8
+ title: optional(string()),
9
+ componentId: optional(string()),
10
+ items: array(listItemMlcSchema()),
11
+ })
@@ -0,0 +1,14 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { MediaTitleOrg } from '@diia-inhouse/types'
4
+
5
+ import { btnPlainIconAtmSchema } from '../atoms/btnPlainIconAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<MediaTitleOrg> = object({
9
+ secondaryLabel: string(),
10
+ title: string(),
11
+ btnPlainIconAtm: optional(btnPlainIconAtmSchema()),
12
+ })
13
+
14
+ export const mediaTitleOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, number, object, optional, string } from 'superstruct'
2
+
3
+ import { MediaUploadGroupOrg } from '@diia-inhouse/types'
4
+
5
+ import { btnPlainIconAtmSchema } from '../atoms/btnPlainIconAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<MediaUploadGroupOrg> = object({
9
+ title: optional(string()),
10
+ description: optional(string()),
11
+ maxCount: optional(number()),
12
+ btnPlainIconAtm: optional(btnPlainIconAtmSchema()),
13
+ componentId: string(),
14
+ })
15
+
16
+ export const mediaUploadGroupOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,19 @@
1
+ import { Describe, array, number, object, optional, string } from 'superstruct'
2
+
3
+ import { PaginationListOrg, PaginationListOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { greyTitleAtmSchema } from '../atoms/greyTitleAtm'
6
+ import { cardMlcSchema } from '../molecules/cardMlc'
7
+ import { listItemMlcSchema } from '../molecules/listItemMlc'
8
+
9
+ const paginationListOrgItem: Describe<PaginationListOrgItem> = object({
10
+ cardMlc: optional(cardMlcSchema()),
11
+ listItemMlc: optional(listItemMlcSchema()),
12
+ greyTitleAtm: optional(greyTitleAtmSchema()),
13
+ })
14
+
15
+ export const paginationListOrgSchema: Describe<PaginationListOrg> = object({
16
+ componentId: string(),
17
+ limit: optional(number()),
18
+ items: array(paginationListOrgItem),
19
+ })
@@ -0,0 +1,20 @@
1
+ import { Describe, array, boolean, number, object, optional, string } from 'superstruct'
2
+
3
+ import { PaginationListWhiteOrg, PaginationListWhiteOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { greyTitleAtmSchema } from '../atoms/greyTitleAtm'
6
+ import { cardMlcSchema } from '../molecules/cardMlc'
7
+ import { listItemMlcSchema } from '../molecules/listItemMlc'
8
+
9
+ const paginationListWhiteOrgItemSchema: Describe<PaginationListWhiteOrgItem> = object({
10
+ cardMlc: optional(cardMlcSchema()),
11
+ listItemMlc: optional(listItemMlcSchema()),
12
+ greyTitleAtm: optional(greyTitleAtmSchema()),
13
+ })
14
+
15
+ export const paginationListWhiteOrgSchema: Describe<PaginationListWhiteOrg> = object({
16
+ componentId: string(),
17
+ limit: optional(number()),
18
+ items: array(paginationListWhiteOrgItemSchema),
19
+ showDivider: optional(boolean()),
20
+ })
@@ -0,0 +1,23 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { PaymentInfoItem, PaymentInfoOrg } from '@diia-inhouse/types'
4
+
5
+ import { tableItemHorizontalLargeMlcSchema } from '../molecules/tableItemHorizontalLargeMlc'
6
+ import { tableItemHorizontalMlcSchema } from '../molecules/tableItemHorizontalMlc'
7
+ import { tableMainHeadingMlcSchema } from '../molecules/tableMainHeadingMlc'
8
+ import { tableSecondaryHeadingMlcSchema } from '../molecules/tableSecondaryHeadingMlc'
9
+ import { schemaBuilder } from '../utils'
10
+
11
+ const paymentInfoItemSchema: Describe<PaymentInfoItem> = object({
12
+ tableItemHorizontalMlc: optional(tableItemHorizontalMlcSchema()),
13
+ tableItemHorizontalLargeMlc: optional(tableItemHorizontalLargeMlcSchema()),
14
+ })
15
+
16
+ const schema: Describe<PaymentInfoOrg> = object({
17
+ componentId: optional(string()),
18
+ tableMainHeadingMlc: optional(tableMainHeadingMlcSchema()),
19
+ tableSecondaryHeadingMlc: optional(tableSecondaryHeadingMlcSchema()),
20
+ items: array(paymentInfoItemSchema),
21
+ })
22
+
23
+ export const paymentInfoOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,28 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { QuestionFormsOrg, QuestionFormsOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { checkboxSquareMlcSchema } from '../molecules/checkboxSquareMlc'
6
+ import { inputDateMlcSchema } from '../molecules/inputDateMlc'
7
+ import { inputTextMlcSchema } from '../molecules/inputTextMlc'
8
+ import { schemaBuilder } from '../utils'
9
+ import { inputDateTimeOrgSchema } from './inputDateTimeOrg'
10
+ import { selectorOrgSchema } from './selectorOrg'
11
+
12
+ const questionFormsOrgItem: Describe<QuestionFormsOrgItem> = object({
13
+ inputTextMlc: optional(inputTextMlcSchema()),
14
+ inputDateMlc: optional(inputDateMlcSchema()),
15
+ selectorOrg: optional(selectorOrgSchema()),
16
+ checkboxSquareMlc: optional(checkboxSquareMlcSchema()),
17
+ inputDateTimeOrg: optional(inputDateTimeOrgSchema()),
18
+ })
19
+
20
+ const schema: Describe<QuestionFormsOrg> = object({
21
+ id: string(),
22
+ title: optional(string()),
23
+ condition: optional(string()),
24
+ componentId: optional(string()),
25
+ items: array(questionFormsOrgItem),
26
+ })
27
+
28
+ export const questionFormsOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,14 @@
1
+ import { Describe, object, optional } from 'superstruct'
2
+
3
+ import { RadioBtnAdditionalInputOrg } from '@diia-inhouse/types'
4
+
5
+ import { inputTextMlcSchema } from '../molecules/inputTextMlc'
6
+ import { radioBtnMlcSchema } from '../molecules/radioBtnMlc'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<RadioBtnAdditionalInputOrg> = object({
10
+ radioBtnMlc: optional(radioBtnMlcSchema()),
11
+ inputTextMlc: optional(inputTextMlcSchema()),
12
+ })
13
+
14
+ export const radioBtnAdditionalInputOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,28 @@
1
+ import { Describe, array, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { RadioBtnGroupOrg, RadioBtnGroupOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { btnPlainIconAtmSchema } from '../atoms/btnPlainIconAtm'
6
+ import { radioBtnMlcSchema } from '../molecules/radioBtnMlc'
7
+ import { schemaBuilder } from '../utils'
8
+ import { radioBtnAdditionalInputOrgSchema } from './radioBtnAdditionalInputOrg'
9
+
10
+ const radioBtnGroupOrgItemSchema: Describe<RadioBtnGroupOrgItem> = object({
11
+ condition: optional(string()),
12
+ radioBtnMlc: optional(radioBtnMlcSchema()),
13
+ radioBtnAdditionalInputOrg: optional(radioBtnAdditionalInputOrgSchema()),
14
+ })
15
+
16
+ const schema: Describe<RadioBtnGroupOrg> = object({
17
+ id: optional(string()),
18
+ blocker: optional(boolean()),
19
+ title: optional(string()),
20
+ condition: optional(string()),
21
+ items: array(radioBtnGroupOrgItemSchema),
22
+ componentId: optional(string()),
23
+ inputCode: optional(string()),
24
+ mandatory: optional(boolean()),
25
+ btnPlainIconAtm: optional(btnPlainIconAtmSchema()),
26
+ })
27
+
28
+ export const radioBtnGroupOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { RadioBtnWithAltOrg, RadioBtnWithAltOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+ import { radioBtnGroupOrgSchema } from './radioBtnGroupOrg'
7
+
8
+ const radioBtnWithAltOrgItemSchema: Describe<RadioBtnWithAltOrgItem> = object({
9
+ radioBtnGroupOrg: optional(radioBtnGroupOrgSchema()),
10
+ })
11
+
12
+ const schema: Describe<RadioBtnWithAltOrg> = object({
13
+ componentId: string(),
14
+ items: array(radioBtnWithAltOrgItemSchema),
15
+ })
16
+
17
+ export const radioBtnWithAltOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { SearchBarOrg } from '@diia-inhouse/types'
4
+
5
+ import { btnWhiteAdditionalIconSchema } from '../atoms/btnWhiteAdditionalIconAtm'
6
+ import { searchInputMlcSchema } from '../molecules'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<SearchBarOrg> = object({
10
+ componentId: optional(string()),
11
+ searchInputMlc: searchInputMlcSchema(),
12
+ btnWhiteAdditionalIconAtm: optional(btnWhiteAdditionalIconSchema()),
13
+ })
14
+
15
+ export const searchBarOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { SelectorListWidgetOrg, SelectorListWidgetOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { listItemMlcSchema } from '../molecules/listItemMlc'
6
+ import { listWidgetItemMlcSchema } from '../molecules/listWidgetItemMlc'
7
+
8
+ const selectorListWidgetOrgItemSchema: Describe<SelectorListWidgetOrgItem> = object({
9
+ listItemMlc: optional(listItemMlcSchema()),
10
+ listWidgetItemMlc: optional(listWidgetItemMlcSchema()),
11
+ })
12
+
13
+ export const selectorListWidgetOrgSchema: Describe<SelectorListWidgetOrg> = object({
14
+ items: array(selectorListWidgetOrgItemSchema),
15
+ componentId: optional(string()),
16
+ })
@@ -0,0 +1,24 @@
1
+ import { Describe, array, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { SelectorOrg } from '@diia-inhouse/types'
4
+
5
+ import { validationAtmSchema } from '../atoms/validationAtm'
6
+ import { schemaBuilder } from '../utils'
7
+ import { selectorListWidgetOrgSchema } from './selectorListWidgetOrg'
8
+
9
+ const schema: Describe<SelectorOrg> = object({
10
+ id: optional(string()),
11
+ blocker: optional(boolean()),
12
+ label: string(),
13
+ placeholder: string(),
14
+ hint: optional(string()),
15
+ value: optional(string()),
16
+ selectorListWidgetOrg: optional(selectorListWidgetOrgSchema),
17
+ validation: array(validationAtmSchema()),
18
+ componentId: optional(string()),
19
+ inputCode: optional(string()),
20
+ mandatory: optional(boolean()),
21
+ valueId: optional(string()),
22
+ })
23
+
24
+ export const selectorOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,24 @@
1
+ import { Describe, number, object, optional, string } from 'superstruct'
2
+
3
+ import { SharingCodesOrg, SharingCodesOrgExpireLabel } from '@diia-inhouse/types'
4
+
5
+ import { btnLoadIconPlainGroupMlcSchema } from '../molecules/btnLoadIconPlainGroupMlc'
6
+ import { qrCodeMlcSchema } from '../molecules/qrCodeMlc'
7
+ import { stubMessageMlcSchema } from '../molecules/stubMessageMlc'
8
+ import { schemaBuilder } from '../utils'
9
+
10
+ const sharingCodesOrgExpireLabelSchema: Describe<SharingCodesOrgExpireLabel> = object({
11
+ expireLabelFirst: string(),
12
+ expireLabelLast: optional(string()),
13
+ timer: number(),
14
+ })
15
+
16
+ const schema: Describe<SharingCodesOrg> = object({
17
+ componentId: optional(string()),
18
+ expireLabel: optional(sharingCodesOrgExpireLabelSchema),
19
+ qrCodeMlc: optional(qrCodeMlcSchema()),
20
+ btnLoadIconPlainGroupMlc: optional(btnLoadIconPlainGroupMlcSchema()),
21
+ stubMessageMlc: optional(stubMessageMlcSchema()),
22
+ })
23
+
24
+ export const sharingCodesOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,20 @@
1
+ import { Describe, array, object, optional } from 'superstruct'
2
+
3
+ import { SmallNotificationCarouselOrg, SmallNotificationCarouselOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { dotNavigationAtmSchema } from '../atoms/dotNavigationAtm'
6
+ import { iconCardMlcSchema } from '../molecules/iconCardMlc'
7
+ import { smallNotificationMlcSchema } from '../molecules/smallNotificationMlc'
8
+ import { schemaBuilder } from '../utils'
9
+
10
+ const smallNotificationCarouselOrgItemSchema: Describe<SmallNotificationCarouselOrgItem> = object({
11
+ smallNotificationMlc: optional(smallNotificationMlcSchema()),
12
+ iconCardMlc: optional(iconCardMlcSchema()),
13
+ })
14
+
15
+ const schema: Describe<SmallNotificationCarouselOrg> = object({
16
+ dotNavigationAtm: optional(dotNavigationAtmSchema()),
17
+ items: array(smallNotificationCarouselOrgItemSchema),
18
+ })
19
+
20
+ export const smallNotificationCarouselOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, array, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { TableBlockAccordionOrg } from '@diia-inhouse/types'
4
+
5
+ import { tableItemMlcSchema } from '../molecules/tableItemMlc'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<TableBlockAccordionOrg> = object({
9
+ componentId: optional(string()),
10
+ heading: string(),
11
+ isOpen: boolean(),
12
+ items: array(tableItemMlcSchema()),
13
+ })
14
+
15
+ export const tableBlockAccordionOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { TableBlockOrg } from '@diia-inhouse/types'
4
+
5
+ import { tableItemMlcSchema } from '../molecules/tableItemMlc'
6
+ import { tableMainHeadingMlcSchema } from '../molecules/tableMainHeadingMlc'
7
+ import { tableSecondaryHeadingMlcSchema } from '../molecules/tableSecondaryHeadingMlc'
8
+ import { schemaBuilder } from '../utils'
9
+
10
+ const schema: Describe<TableBlockOrg> = object({
11
+ componentId: optional(string()),
12
+ tableMainHeadingMlc: optional(tableMainHeadingMlcSchema()),
13
+ items: array(tableItemMlcSchema()),
14
+ tableSecondaryHeadingMlc: optional(tableSecondaryHeadingMlcSchema()),
15
+ })
16
+
17
+ export const tableBlockOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { TableBlockPlaneOrg } from '@diia-inhouse/types'
4
+
5
+ import { tableItemMlcSchema } from '../molecules/tableItemMlc'
6
+ import { tableMainHeadingMlcSchema } from '../molecules/tableMainHeadingMlc'
7
+ import { tableSecondaryHeadingMlcSchema } from '../molecules/tableSecondaryHeadingMlc'
8
+ import { schemaBuilder } from '../utils'
9
+
10
+ const schema: Describe<TableBlockPlaneOrg> = object({
11
+ componentId: optional(string()),
12
+ tableMainHeadingMlc: optional(tableMainHeadingMlcSchema()),
13
+ items: array(tableItemMlcSchema()),
14
+ tableSecondaryHeadingMlc: optional(tableSecondaryHeadingMlcSchema()),
15
+ })
16
+
17
+ export const tableBlockPlaneOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { TableBlockTwoColumnsOrg } from '@diia-inhouse/types'
4
+
5
+ import { headingWithSubtitlesMlcSchema } from '../molecules/headingWithSubtitlesMlc'
6
+ import { tableItemMlcSchema } from '../molecules/tableItemMlc'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<TableBlockTwoColumnsOrg> = object({
10
+ headingWithSubtitlesMlc: optional(headingWithSubtitlesMlcSchema()),
11
+ photo: optional(string()),
12
+ items: array(tableItemMlcSchema()),
13
+ })
14
+
15
+ export const tableBlockTwoColumnsOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { TableBlockTwoColumnsPlaneOrg } from '@diia-inhouse/types'
4
+
5
+ import { headingWithSubtitlesMlcSchema } from '../molecules/headingWithSubtitlesMlc'
6
+ import { tableItemMlcSchema } from '../molecules/tableItemMlc'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<TableBlockTwoColumnsPlaneOrg> = object({
10
+ photo: optional(string()),
11
+ items: array(tableItemMlcSchema()),
12
+ componentId: optional(string()),
13
+ headingWithSubtitlesMlc: optional(headingWithSubtitlesMlcSchema()),
14
+ })
15
+
16
+ export const tableBlockTwoColumnsPlaneOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,18 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { ToggleButtonGroupItem, ToggleButtonGroupOrg } from '@diia-inhouse/types'
4
+
5
+ import { btnToggleMlcSchema } from '../molecules/btnToggleMlc'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const toggleButtonGroupItemSchema: Describe<ToggleButtonGroupItem> = object({
9
+ btnToggleMlc: optional(btnToggleMlcSchema()),
10
+ })
11
+
12
+ const schema: Describe<ToggleButtonGroupOrg> = object({
13
+ preselected: string(),
14
+ componentId: optional(string()),
15
+ items: array(toggleButtonGroupItemSchema),
16
+ })
17
+
18
+ export const toggleButtonGroupOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { TopGroupOrg } from '@diia-inhouse/types'
4
+
5
+ import { navigationPanelMlcSchema } from '../molecules/navigationPanelMlc'
6
+ import { titleGroupMlcSchema } from '../molecules/titleGroupMlc'
7
+ import { schemaBuilder } from '../utils'
8
+ import { chipTabsOrgSchema } from './chipTabsOrg'
9
+
10
+ const schema: Describe<TopGroupOrg> = object({
11
+ componentId: optional(string()),
12
+ navigationPanelMlc: optional(navigationPanelMlcSchema()),
13
+ chipTabsOrg: optional(chipTabsOrgSchema()),
14
+ titleGroupMlc: optional(titleGroupMlcSchema()),
15
+ })
16
+
17
+ export const topGroupOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,31 @@
1
+ import { Describe, number, object, optional, string } from 'superstruct'
2
+
3
+ import { VerificationCode, VerificationCodeExpireLabel, VerificationCodesOrg } from '@diia-inhouse/types'
4
+
5
+ import { barCodeMlcSchema } from '../molecules/barCodeMlc'
6
+ import { qrCodeMlcSchema } from '../molecules/qrCodeMlc'
7
+ import { stubMessageMlcSchema } from '../molecules/stubMessageMlc'
8
+ import { schemaBuilder } from '../utils'
9
+ import { toggleButtonGroupOrgSchema } from './toggleButtonGroupOrg'
10
+
11
+ const verificationCodeExpireLabelSchema: Describe<VerificationCodeExpireLabel> = object({
12
+ expireLabelFirst: string(),
13
+ expireLabelLast: string(),
14
+ timer: number(),
15
+ })
16
+
17
+ const verificationCodeSchema: Describe<VerificationCode> = object({
18
+ qrCodeMlc: optional(qrCodeMlcSchema()),
19
+ barCodeMlc: optional(barCodeMlcSchema()),
20
+ toggleButtonGroupOrg: optional(toggleButtonGroupOrgSchema()),
21
+ stubMessageMlc: optional(stubMessageMlcSchema()),
22
+ expireLabel: optional(verificationCodeExpireLabelSchema),
23
+ })
24
+
25
+ const schema: Describe<VerificationCodesOrg> = object({
26
+ componentId: optional(string()),
27
+ UA: optional(verificationCodeSchema),
28
+ EN: optional(verificationCodeSchema),
29
+ })
30
+
31
+ export const verificationCodesOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, array, object, optional } from 'superstruct'
2
+
3
+ import { VerticalCardCarouselOrg, VerticalCardCarouselOrgItem } from '@diia-inhouse/types'
4
+
5
+ import { verticalCardMlcSchema } from '../molecules/verticalCardMlc'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const verticalCardCarouselOrgItem: Describe<VerticalCardCarouselOrgItem> = object({
9
+ verticalCardMlc: optional(verticalCardMlcSchema()),
10
+ })
11
+
12
+ const schema: Describe<VerticalCardCarouselOrg> = object({
13
+ items: array(verticalCardCarouselOrgItem),
14
+ })
15
+
16
+ export const verticalCardCarouselOrgSchema = schemaBuilder(schema)
@@ -0,0 +1,14 @@
1
+ import { Describe, Struct, assign, object } from 'superstruct'
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ export type AnyStruct = Struct<any, any>
5
+
6
+ type A<T> = { [k in keyof T]?: AnyStruct }
7
+
8
+ type Builder<T> = (params?: A<T>) => Describe<T>
9
+
10
+ export function schemaBuilder<T>(schema: Describe<T>): Builder<T> {
11
+ return (params?: A<T>): Describe<T> => {
12
+ return params ? (assign(schema as AnyStruct, object(params)) as Describe<T>) : schema
13
+ }
14
+ }