@diia-inhouse/test 6.6.4 → 7.3.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 (198) 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 +17 -2
  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 +34 -38
  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/mock.js +0 -44
  194. package/dist/mock.js.map +0 -1
  195. package/dist/mongooseMock.js +0 -43
  196. package/dist/mongooseMock.js.map +0 -1
  197. package/dist/types/mock.d.ts +0 -20
  198. package/dist/types/mongooseMock.d.ts +0 -33
@@ -0,0 +1,65 @@
1
+ export * from './amountAtm'
2
+
3
+ export * from './articlePicAtm'
4
+
5
+ export * from './badgeCounterAtm'
6
+
7
+ export * from './btnLinkAtm'
8
+
9
+ export * from './btnLoadPlainIconAtm'
10
+
11
+ export * from './btnPlainAtm'
12
+
13
+ export * from './btnPlainIconAtm'
14
+
15
+ export * from './btnPrimaryAdditionalAtm'
16
+
17
+ export * from './btnPrimaryDefaultAtm'
18
+
19
+ export * from './btnPrimaryLargeAtm'
20
+
21
+ export * from './btnPrimaryWideAtm'
22
+
23
+ export * from './btnSemiLightAtm'
24
+
25
+ export * from './btnStrokeAdditionalAtm'
26
+
27
+ export * from './btnStrokeDefaultAtm'
28
+
29
+ export * from './btnWhiteAdditionalIconAtm'
30
+
31
+ export * from './calendarItemAtm'
32
+
33
+ export * from './chipStatusAtm'
34
+
35
+ export * from './dotNavigationAtm'
36
+
37
+ export * from './doubleIconAtm'
38
+
39
+ export * from './greyTitleAtm'
40
+
41
+ export * from './iconAtm'
42
+
43
+ export * from './inputNumberLargeAtm'
44
+
45
+ export * from './largeIconAtm'
46
+
47
+ export * from './playerBtnAtm'
48
+
49
+ export * from './sectionTitleAtm'
50
+
51
+ export * from './simpleIconAtm'
52
+
53
+ export * from './smallIconAtm'
54
+
55
+ export * from './textParameterAtm'
56
+
57
+ export * from './tickerAtm'
58
+
59
+ export * from './userPictureAtm'
60
+
61
+ export * from './validationAtm'
62
+
63
+ export * from './shared/buttonAction'
64
+
65
+ export * from './shared/iconAction'
@@ -0,0 +1,15 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { InputNumberLargeAtm } from '@diia-inhouse/types'
4
+
5
+ import { buttonStateSchema } from '../enums/button'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<InputNumberLargeAtm> = object({
9
+ placeholder: string(),
10
+ componentId: optional(string()),
11
+ state: optional(buttonStateSchema),
12
+ value: optional(string()),
13
+ })
14
+
15
+ export const inputNumberLargeAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { LargeIconAtm } from '@diia-inhouse/types'
4
+
5
+ import { iconSchema } from '../enums/icon'
6
+ import { schemaBuilder } from '../utils'
7
+ import { iconActionSchema } from './shared/iconAction'
8
+
9
+ const schema: Describe<LargeIconAtm> = object({
10
+ code: iconSchema,
11
+ accessibilityDescription: optional(string()),
12
+ action: iconActionSchema(),
13
+ componentId: optional(string()),
14
+ })
15
+
16
+ export const largeIconAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,12 @@
1
+ import { Describe, enums, object, string } from 'superstruct'
2
+
3
+ import { PlayerBtnAtm, PlayerBtnAtmType } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<PlayerBtnAtm> = object({
8
+ icon: string(),
9
+ type: enums(Object.values(PlayerBtnAtmType)),
10
+ })
11
+
12
+ export const playerBtnAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,11 @@
1
+ import { Describe, object, string } from 'superstruct'
2
+
3
+ import { SectionTitleAtm } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<SectionTitleAtm> = object({
8
+ label: string(),
9
+ })
10
+
11
+ export const sectionTitleAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { ButtonAction } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../../utils'
6
+
7
+ const schema: Describe<ButtonAction> = object({
8
+ type: string(),
9
+ subtype: optional(string()),
10
+ resource: optional(string()),
11
+ condition: optional(string()),
12
+ subresource: optional(string()),
13
+ })
14
+
15
+ export const buttonActionSchema = schemaBuilder(schema)
@@ -0,0 +1,13 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { IconAction } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../../utils'
6
+
7
+ const schema: Describe<IconAction> = object({
8
+ type: string(),
9
+ subtype: optional(string()),
10
+ resource: optional(string()),
11
+ })
12
+
13
+ export const iconActionSchema = schemaBuilder(schema)
@@ -0,0 +1,12 @@
1
+ import { Describe, enums, object, string } from 'superstruct'
2
+
3
+ import { ActionCode, SimpleIconAtm } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<SimpleIconAtm> = object({
8
+ description: string(),
9
+ code: enums(Object.values(ActionCode)),
10
+ })
11
+
12
+ export const simpleIconAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,16 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { SmallIconAtm } from '@diia-inhouse/types'
4
+
5
+ import { iconSchema } from '../enums/icon'
6
+ import { schemaBuilder } from '../utils'
7
+ import { iconActionSchema } from './shared/iconAction'
8
+
9
+ const schema: Describe<SmallIconAtm> = object({
10
+ code: iconSchema,
11
+ accessibilityDescription: optional(string()),
12
+ action: optional(iconActionSchema()),
13
+ componentId: optional(string()),
14
+ })
15
+
16
+ export const smallIconAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,19 @@
1
+ import { Describe, enums, number, object, optional, string } from 'superstruct'
2
+
3
+ import { ContentType, TextParameterAtm, TextParameterAtmData } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const textParameterAtmDataSchema: Describe<TextParameterAtmData> = object({
8
+ name: string(),
9
+ alt: optional(string()),
10
+ resource: optional(string()),
11
+ timeTimer: optional(number()),
12
+ })
13
+
14
+ const schema: Describe<TextParameterAtm> = object({
15
+ type: enums(Object.values(ContentType)),
16
+ data: optional(textParameterAtmDataSchema),
17
+ })
18
+
19
+ export const textParameterAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,20 @@
1
+ import { Describe, enums, object, optional, string } from 'superstruct'
2
+
3
+ import { IconAtmActionType, TickerAtm, TickerAtmAction, TickerAtmType, TickerAtmUsage } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const tickerAtmActionSchema: Describe<TickerAtmAction> = object({
8
+ type: enums(Object.values(IconAtmActionType)),
9
+ subtype: optional(string()),
10
+ })
11
+
12
+ const schema: Describe<TickerAtm> = object({
13
+ componentId: optional(string()),
14
+ value: string(),
15
+ type: enums(Object.values(TickerAtmType)),
16
+ action: optional(tickerAtmActionSchema),
17
+ usage: enums(Object.values(TickerAtmUsage)),
18
+ })
19
+
20
+ export const tickerAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,14 @@
1
+ import { Describe, boolean, enums, object } from 'superstruct'
2
+
3
+ import { DefaultImage, UserPictureAtm } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+ import { buttonActionSchema } from './shared/buttonAction'
7
+
8
+ const schema: Describe<UserPictureAtm> = object({
9
+ defaultImageCode: enums(Object.values(DefaultImage)),
10
+ useDocPhoto: boolean(),
11
+ action: buttonActionSchema(),
12
+ })
13
+
14
+ export const userPictureAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,13 @@
1
+ import { Describe, array, object, string } from 'superstruct'
2
+
3
+ import { ValidationAtm } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<ValidationAtm> = object({
8
+ regexp: string(),
9
+ flags: array(string()),
10
+ errorMessage: string(),
11
+ })
12
+
13
+ export const validationAtmSchema = schemaBuilder(schema)
@@ -0,0 +1,5 @@
1
+ import { Describe, enums } from 'superstruct'
2
+
3
+ import { ButtonState } from '@diia-inhouse/types'
4
+
5
+ export const buttonStateSchema: Describe<ButtonState> = enums(Object.values(ButtonState))
@@ -0,0 +1,5 @@
1
+ import { Describe, enums } from 'superstruct'
2
+
3
+ import { Icon } from '@diia-inhouse/types'
4
+
5
+ export const iconSchema: Describe<Icon> = enums(Object.values(Icon))
@@ -0,0 +1,7 @@
1
+ export * from './atoms'
2
+
3
+ export * from './molecules'
4
+
5
+ export * from './organisms'
6
+
7
+ export * from './utils'
@@ -0,0 +1,13 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { ArticleVideoMlc } from '@diia-inhouse/types'
4
+
5
+ import { playerBtnAtmSchema } from '../atoms/playerBtnAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<ArticleVideoMlc> = object({
9
+ source: string(),
10
+ playerBtnAtm: optional(playerBtnAtmSchema()),
11
+ })
12
+
13
+ export const articleVideoMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, literal, object, optional, string } from 'superstruct'
2
+
3
+ import { AttentionIconMessageMlc, BackgroundMode } from '@diia-inhouse/types'
4
+
5
+ import { smallIconAtmSchema } from '../atoms'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<AttentionIconMessageMlc> = object({
9
+ backgroundMode: optional(literal(BackgroundMode.info)),
10
+ text: string(),
11
+ componentId: optional(string()),
12
+ smallIconAtm: optional(smallIconAtmSchema()),
13
+ })
14
+
15
+ export const attentionIconMessageMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,18 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { AttentionMessageMlc } from '@diia-inhouse/types'
4
+
5
+ import { smallIconAtmSchema } from '../atoms'
6
+ import { textParameterAtmSchema } from '../atoms/textParameterAtm'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<AttentionMessageMlc> = object({
10
+ icon: string(),
11
+ componentId: optional(string()),
12
+ text: optional(string()),
13
+ title: optional(string()),
14
+ parameters: array(textParameterAtmSchema()),
15
+ smallIconAtm: optional(smallIconAtmSchema()),
16
+ })
17
+
18
+ export const attentionMessageMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,12 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { BarCodeMlc } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<BarCodeMlc> = object({
8
+ barCode: string(),
9
+ componentId: optional(string()),
10
+ })
11
+
12
+ export const barCodeMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,20 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { BlackCardMlc } from '@diia-inhouse/types'
4
+
5
+ import { doubleIconAtmSchema } from '../atoms/doubleIconAtm'
6
+ import { iconAtmSchema } from '../atoms/iconAtm'
7
+ import { buttonActionSchema } from '../atoms/shared/buttonAction'
8
+ import { smallIconAtmSchema } from '../atoms/smallIconAtm'
9
+ import { schemaBuilder } from '../utils'
10
+
11
+ const schema: Describe<BlackCardMlc> = object({
12
+ smallIconAtm: optional(smallIconAtmSchema()),
13
+ iconAtm: optional(iconAtmSchema),
14
+ doubleIconAtm: optional(doubleIconAtmSchema()),
15
+ title: string(),
16
+ label: string(),
17
+ action: buttonActionSchema(),
18
+ })
19
+
20
+ export const blackCardMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { BtnIconPlainGroupMlc, BtnIconPlainGroupMlcItem } from '@diia-inhouse/types'
4
+
5
+ import { btnPlainIconAtmSchema } from '../atoms/btnPlainIconAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const btnIconPlainGroupMlcItemSchema: Describe<BtnIconPlainGroupMlcItem> = object({
9
+ btnPlainIconAtm: optional(btnPlainIconAtmSchema()),
10
+ })
11
+
12
+ const schema: Describe<BtnIconPlainGroupMlc> = object({
13
+ componentId: optional(string()),
14
+ items: array(btnIconPlainGroupMlcItemSchema),
15
+ })
16
+
17
+ export const btnIconPlainGroupMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { BtnIconRoundedMlc } from '@diia-inhouse/types'
4
+
5
+ import { buttonActionSchema } from '../atoms/shared/buttonAction'
6
+ import { iconSchema } from '../enums/icon'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<BtnIconRoundedMlc> = object({
10
+ icon: iconSchema,
11
+ label: optional(string()),
12
+ action: buttonActionSchema(),
13
+ })
14
+
15
+ export const btnIconRoundedMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,17 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { BtnLoadIconPlainGroupMlc, BtnLoadIconPlainGroupMlcItem } from '@diia-inhouse/types'
4
+
5
+ import { btnLoadPlainIconAtmSchema } from '../atoms/btnLoadPlainIconAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const btnLoadIconPlainGroupMlcItemSchema: Describe<BtnLoadIconPlainGroupMlcItem> = object({
9
+ btnLoadPlainIconAtm: btnLoadPlainIconAtmSchema(),
10
+ })
11
+
12
+ const schema: Describe<BtnLoadIconPlainGroupMlc> = object({
13
+ componentId: optional(string()),
14
+ items: array(btnLoadIconPlainGroupMlcItemSchema),
15
+ })
16
+
17
+ export const btnLoadIconPlainGroupMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,26 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { BtnToggleMlc, NotSelected, Selected } from '@diia-inhouse/types'
4
+
5
+ import { buttonActionSchema } from '../atoms/shared/buttonAction'
6
+ import { iconSchema } from '../enums/icon'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const selectedSchema: Describe<Selected> = object({
10
+ icon: iconSchema,
11
+ action: optional(buttonActionSchema()),
12
+ })
13
+
14
+ const notSelectedSchema: Describe<NotSelected> = object({
15
+ icon: iconSchema,
16
+ })
17
+
18
+ const schema: Describe<BtnToggleMlc> = object({
19
+ code: string(),
20
+ label: string(),
21
+ componentId: optional(string()),
22
+ selected: selectedSchema,
23
+ notSelected: notSelectedSchema,
24
+ })
25
+
26
+ export const btnToggleMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,33 @@
1
+ import { Describe, array, object, optional, string } from 'superstruct'
2
+
3
+ import { CardMlc, CardMlcSubtitle } from '@diia-inhouse/types'
4
+
5
+ import { btnPrimaryAdditionalAtmSchema } from '../atoms/btnPrimaryAdditionalAtm'
6
+ import { btnStrokeAdditionalAtmSchema } from '../atoms/btnStrokeAdditionalAtm'
7
+ import { chipStatusAtmSchema } from '../atoms/chipStatusAtm'
8
+ import { tickerAtmSchema } from '../atoms/tickerAtm'
9
+ import { schemaBuilder } from '../utils'
10
+ import { cardMlcTickerSchema } from './cardMlcTicker'
11
+
12
+ const cardMlcSubtitle: Describe<CardMlcSubtitle> = object({
13
+ icon: optional(string()),
14
+ value: string(),
15
+ })
16
+
17
+ const schema: Describe<CardMlc> = object({
18
+ id: string(),
19
+ label: optional(string()),
20
+ title: string(),
21
+ description: optional(string()),
22
+ botLabel: optional(string()),
23
+ componentId: optional(string()),
24
+ chipStatusAtm: chipStatusAtmSchema(),
25
+ tickerAtm: tickerAtmSchema(),
26
+ subtitle: optional(cardMlcSubtitle),
27
+ subtitles: array(cardMlcSubtitle),
28
+ ticker: optional(cardMlcTickerSchema()),
29
+ btnPrimaryAdditionalAtm: optional(btnPrimaryAdditionalAtmSchema()),
30
+ btnStrokeAdditionalAtm: optional(btnStrokeAdditionalAtmSchema()),
31
+ })
32
+
33
+ export const cardMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,12 @@
1
+ import { Describe, enums, object, string } from 'superstruct'
2
+
3
+ import { CardMlcTicker, TickerAtmType } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<CardMlcTicker> = object({
8
+ text: string(),
9
+ type: enums(Object.values(TickerAtmType)),
10
+ })
11
+
12
+ export const cardMlcTickerSchema = schemaBuilder(schema)
@@ -0,0 +1,13 @@
1
+ import { Describe, enums, object, optional, string } from 'superstruct'
2
+
3
+ import { ActionCode, CheckIconMlc, CheckableAtmType } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<CheckIconMlc> = object({
8
+ label: string(),
9
+ icon: enums(Object.values(ActionCode)),
10
+ state: optional(enums(Object.values(CheckableAtmType))),
11
+ })
12
+
13
+ export const checkIconMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,11 @@
1
+ import { Describe, enums, object, optional, string } from 'superstruct'
2
+
3
+ import { CheckableAtmType, CheckboxRoundMlc } from '@diia-inhouse/types'
4
+
5
+ export const checkboxRoundMlcSchema: Describe<CheckboxRoundMlc> = object({
6
+ label: string(),
7
+ id: optional(string()),
8
+ description: optional(string()),
9
+ status: optional(string()),
10
+ state: enums(Object.values(CheckableAtmType)),
11
+ })
@@ -0,0 +1,22 @@
1
+ import { Describe, array, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { CheckboxSquareMlc, CheckboxSquareMlcOption } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const checkboxSquareMlcOption: Describe<CheckboxSquareMlcOption> = object({
8
+ id: string(),
9
+ isSelected: boolean(),
10
+ })
11
+
12
+ const schema: Describe<CheckboxSquareMlc> = object({
13
+ label: string(),
14
+ blocker: optional(boolean()),
15
+ id: optional(string()),
16
+ isSelected: optional(boolean()),
17
+ isEnabled: optional(boolean()),
18
+ componentId: optional(string()),
19
+ options: array(checkboxSquareMlcOption),
20
+ })
21
+
22
+ export const checkboxSquareMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,22 @@
1
+ import { Describe, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { ChipInfo, ChipMlc } from '@diia-inhouse/types'
4
+
5
+ import { badgeCounterAtmSchema } from '../atoms/badgeCounterAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const chipInfo: Describe<ChipInfo> = object({
9
+ hallId: optional(string()),
10
+ })
11
+
12
+ const schema: Describe<ChipMlc> = object({
13
+ label: string(),
14
+ code: string(),
15
+ active: optional(boolean()),
16
+ selectedIcon: optional(string()),
17
+ componentId: optional(string()),
18
+ badgeCounterAtm: optional(badgeCounterAtmSchema()),
19
+ chipInfo: optional(chipInfo),
20
+ })
21
+
22
+ export const chipMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, boolean, object, optional, string } from 'superstruct'
2
+
3
+ import { ChipTimeMlc } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const schema: Describe<ChipTimeMlc> = object({
8
+ componentId: string(),
9
+ id: optional(string()),
10
+ label: string(),
11
+ active: optional(boolean()),
12
+ dataJson: optional(string()),
13
+ })
14
+
15
+ export const chipTimeMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,20 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { CurrentTimeMlc, CurrentTimeMlcAction } from '@diia-inhouse/types'
4
+
5
+ import { schemaBuilder } from '../utils'
6
+
7
+ const currentTimeMlcActionSchema: Describe<CurrentTimeMlcAction> = object({
8
+ type: string(),
9
+ subtype: optional(string()),
10
+ resource: optional(string()),
11
+ })
12
+
13
+ const schema: Describe<CurrentTimeMlc> = object({
14
+ label: string(),
15
+ componentId: optional(string()),
16
+ action: optional(currentTimeMlcActionSchema),
17
+ maxDate: optional(string()),
18
+ })
19
+
20
+ export const currentTimeMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,23 @@
1
+ import { Describe, enums, object, optional, string } from 'superstruct'
2
+
3
+ import { DashboardCardMlc, DashboardCardMlcType } from '@diia-inhouse/types'
4
+
5
+ import { btnSemiLightAtmSchema } from '../atoms/btnSemiLightAtm'
6
+ import { buttonActionSchema } from '../atoms/shared/buttonAction'
7
+ import { schemaBuilder } from '../utils'
8
+
9
+ const schema: Describe<DashboardCardMlc> = object({
10
+ componentId: string(),
11
+ icon: optional(string()),
12
+ label: optional(string()),
13
+ amountLarge: optional(string()),
14
+ amountSmall: optional(string()),
15
+ description: optional(string()),
16
+ iconCenter: optional(string()),
17
+ descriptionCenter: optional(string()),
18
+ action: optional(buttonActionSchema()),
19
+ btnSemiLightAtm: optional(btnSemiLightAtmSchema()),
20
+ type: enums(Object.values(DashboardCardMlcType)),
21
+ })
22
+
23
+ export const dashboardCardMlcSchema = schemaBuilder(schema)
@@ -0,0 +1,15 @@
1
+ import { Describe, object, optional, string } from 'superstruct'
2
+
3
+ import { DocNumberCopyMlc } from '@diia-inhouse/types'
4
+
5
+ import { iconAtmSchema } from '../atoms/iconAtm'
6
+ import { schemaBuilder } from '../utils'
7
+
8
+ const schema: Describe<DocNumberCopyMlc> = object({
9
+ value: string(),
10
+ label: optional(string()),
11
+ icon: optional(iconAtmSchema),
12
+ componentId: optional(string()),
13
+ })
14
+
15
+ export const docNumberCopyMlcSchema = schemaBuilder(schema)