@vonq/hapi-elements-types 1.5.0 → 1.7.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/{src/_window → _window}/api.types.ts +9 -7
  2. package/_window/auth.types.ts +13 -0
  3. package/_window/config.types.ts +5 -0
  4. package/{src/_window → _window}/events.types.ts +15 -14
  5. package/_window/instances.types.ts +27 -0
  6. package/{src/_window → _window}/qa.types.ts +7 -5
  7. package/{src/_window → _window}/routing.types.ts +6 -4
  8. package/{src/_window → _window}/sdk.types.ts +29 -27
  9. package/{src/_window → _window}/service.types.ts +9 -7
  10. package/{src/_window → _window}/state.types.ts +55 -53
  11. package/_window/ui.types.ts +15 -0
  12. package/{src/_window → _window}/utils.types.ts +7 -5
  13. package/{src/_window → _window}/validation.types.ts +7 -5
  14. package/_window/window.ts +140 -0
  15. package/alert/index.ts +6 -0
  16. package/{src/alert → alert}/service.types.ts +2 -2
  17. package/alert/state.types.ts +9 -0
  18. package/{src/ats → ats}/api.types.ts +2 -2
  19. package/ats/index.ts +6 -0
  20. package/{src/ats → ats}/service.types.ts +2 -2
  21. package/{src/ats → ats}/state.types.ts +1 -1
  22. package/basket/index.ts +7 -0
  23. package/{src/basket → basket}/service.types.ts +2 -2
  24. package/{src/basket → basket}/state.types.ts +1 -1
  25. package/{src/basket → basket}/utils.types.ts +2 -2
  26. package/{src/campaign → campaign}/api.types.ts +2 -2
  27. package/campaign/index.ts +10 -0
  28. package/campaign/qa.types.ts +12 -0
  29. package/{src/campaign → campaign}/service.types.ts +2 -2
  30. package/{src/campaign → campaign}/state.types.ts +1 -1
  31. package/{src/campaign → campaign}/utils.types.ts +2 -2
  32. package/{enums.ts → common/enums.ts} +2 -1
  33. package/{src/common → common}/events/types.ts +6 -6
  34. package/common/index.ts +7 -0
  35. package/common/logger/types.ts +18 -0
  36. package/{src/common → common}/qa.types.ts +2 -2
  37. package/{src/common → common}/types.ts +5 -6
  38. package/common/validator/types.ts +4 -0
  39. package/{src/contract → contract}/api.types.ts +2 -2
  40. package/contract/index.ts +9 -0
  41. package/{src/contract → contract}/qa.types.ts +2 -2
  42. package/{src/contract → contract}/service.types.ts +2 -2
  43. package/{src/contract → contract}/state.types.ts +1 -1
  44. package/{src/contract → contract}/utils.types.ts +2 -2
  45. package/{src/common/logger-datadog → debugging}/index.ts +1 -1
  46. package/{src/debugging → debugging}/state.types.ts +1 -1
  47. package/index.ts +18 -0
  48. package/language/index.ts +5 -0
  49. package/{src/language → language}/qa.types.ts +2 -2
  50. package/{src/language → language}/state.types.ts +1 -1
  51. package/modal/index.ts +6 -0
  52. package/{src/modal → modal}/service.types.ts +2 -2
  53. package/{src/modal → modal}/state.types.ts +1 -1
  54. package/orderJourney/index.ts +8 -0
  55. package/{src/orderJourney → orderJourney}/qa.types.ts +2 -2
  56. package/{src/orderJourney → orderJourney}/state.types.ts +1 -1
  57. package/{src/orderJourney → orderJourney}/utils.types.ts +2 -2
  58. package/package.json +16 -5
  59. package/{src/product → product}/api.types.ts +2 -2
  60. package/product/index.ts +10 -0
  61. package/{src/product → product}/qa.types.ts +2 -2
  62. package/{src/product → product}/service.types.ts +2 -2
  63. package/{src/product → product}/state.types.ts +1 -1
  64. package/{src/product → product}/utils.types.ts +2 -2
  65. package/routing/index.ts +3 -0
  66. package/theming/index.ts +6 -0
  67. package/{src/theming → theming}/qa.types.ts +2 -2
  68. package/{src/theming → theming}/state.types.ts +1 -1
  69. package/{src/theming → theming}/types.ts +38 -1
  70. package/tsconfig.json +7 -12
  71. package/{src/ui → ui}/service.types.ts +2 -2
  72. package/{src/wallet → wallet}/api.types.ts +2 -2
  73. package/wallet/index.ts +7 -0
  74. package/{src/wallet → wallet}/service.types.ts +2 -2
  75. package/{src/wallet → wallet}/state.types.ts +1 -1
  76. package/src/_window/auth.types.ts +0 -11
  77. package/src/_window/config.types.ts +0 -30
  78. package/src/_window/instances.types.ts +0 -18
  79. package/src/_window/ui.types.ts +0 -13
  80. package/src/_window/window.ts +0 -56
  81. package/src/alert/functions.types.ts +0 -13
  82. package/src/alert/index.ts +0 -9
  83. package/src/alert/state.initial.ts +0 -16
  84. package/src/alert/state.types.ts +0 -27
  85. package/src/alert/state.validations.ts +0 -11
  86. package/src/ats/functions.types.ts +0 -7
  87. package/src/ats/index.ts +0 -9
  88. package/src/ats/state.initial.ts +0 -5
  89. package/src/ats/state.validations.ts +0 -6
  90. package/src/basket/consts.ts +0 -1
  91. package/src/basket/functions.types.ts +0 -40
  92. package/src/basket/index.ts +0 -12
  93. package/src/basket/state.initial.ts +0 -11
  94. package/src/basket/state.validations.ts +0 -12
  95. package/src/basket/utils.ts +0 -79
  96. package/src/campaign/consts.ts +0 -1
  97. package/src/campaign/functions.types.ts +0 -90
  98. package/src/campaign/index.ts +0 -15
  99. package/src/campaign/qa.types.ts +0 -12
  100. package/src/campaign/state.initial.ts +0 -84
  101. package/src/campaign/state.validations.ts +0 -16
  102. package/src/campaign/utils.ts +0 -53
  103. package/src/common/LocalStorage.ts +0 -123
  104. package/src/common/browser.ts +0 -2
  105. package/src/common/color.ts +0 -9
  106. package/src/common/immutable.ts +0 -28
  107. package/src/common/index.ts +0 -22
  108. package/src/common/instances/Instance.ts +0 -13
  109. package/src/common/instances/consts.ts +0 -1
  110. package/src/common/instances/index.ts +0 -4
  111. package/src/common/json.ts +0 -25
  112. package/src/common/logger/Logger.ts +0 -70
  113. package/src/common/logger/index.ts +0 -5
  114. package/src/common/logger/types.ts +0 -7
  115. package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
  116. package/src/common/misc.ts +0 -114
  117. package/src/common/promise.ts +0 -161
  118. package/src/common/proxy.ts +0 -77
  119. package/src/common/regExTest.ts +0 -12
  120. package/src/common/tree.ts +0 -148
  121. package/src/common/utm.ts +0 -19
  122. package/src/common/validators.ts +0 -21
  123. package/src/common/webComponents.ts +0 -26
  124. package/src/config/functions.types.ts +0 -23
  125. package/src/config/index.ts +0 -5
  126. package/src/config/state.initial.ts +0 -11
  127. package/src/config/state.types.ts +0 -15
  128. package/src/consts.ts +0 -980
  129. package/src/contract/consts.ts +0 -1
  130. package/src/contract/functions.types.ts +0 -112
  131. package/src/contract/index.ts +0 -14
  132. package/src/contract/state.initial.ts +0 -39
  133. package/src/contract/state.validations.ts +0 -21
  134. package/src/contract/utils.ts +0 -36
  135. package/src/debugging/functions.types.ts +0 -34
  136. package/src/debugging/index.ts +0 -6
  137. package/src/debugging/state.initial.ts +0 -10
  138. package/src/debugging/state.validations.ts +0 -10
  139. package/src/index.ts +0 -22
  140. package/src/language/consts.ts +0 -6
  141. package/src/language/en.ts +0 -530
  142. package/src/language/functions.types.ts +0 -29
  143. package/src/language/index.ts +0 -11
  144. package/src/language/state.initial.ts +0 -13
  145. package/src/language/state.validations.ts +0 -10
  146. package/src/language/utils.ts +0 -17
  147. package/src/modal/consts.ts +0 -6
  148. package/src/modal/functions.types.ts +0 -22
  149. package/src/modal/index.ts +0 -11
  150. package/src/modal/state.initial.ts +0 -9
  151. package/src/modal/state.validations.ts +0 -6
  152. package/src/modal/store.types.ts +0 -5
  153. package/src/orderJourney/consts.ts +0 -289
  154. package/src/orderJourney/functions.types.ts +0 -140
  155. package/src/orderJourney/index.ts +0 -13
  156. package/src/orderJourney/state.initial.ts +0 -401
  157. package/src/orderJourney/state.validations.ts +0 -78
  158. package/src/orderJourney/utils.ts +0 -7
  159. package/src/product/consts.ts +0 -1
  160. package/src/product/functions.types.ts +0 -156
  161. package/src/product/index.ts +0 -14
  162. package/src/product/state.initial.ts +0 -28
  163. package/src/product/state.validations.ts +0 -25
  164. package/src/routing/functions.types.ts +0 -48
  165. package/src/routing/index.ts +0 -5
  166. package/src/routing/state.initial.ts +0 -10
  167. package/src/theming/consts.ts +0 -7727
  168. package/src/theming/functions.types.ts +0 -13
  169. package/src/theming/index.ts +0 -11
  170. package/src/theming/state.initial.ts +0 -16
  171. package/src/theming/state.validations.ts +0 -8
  172. package/src/theming/utils.ts +0 -581
  173. package/src/types.ts +0 -229
  174. package/src/utils.ts +0 -3
  175. package/src/wallet/consts.ts +0 -3
  176. package/src/wallet/functions.types.ts +0 -58
  177. package/src/wallet/index.ts +0 -11
  178. package/src/wallet/state.initial.ts +0 -18
  179. package/src/wallet/state.validations.ts +0 -18
  180. /package/{src/_window → _window}/index.ts +0 -0
  181. /package/{src/alert → alert}/enums.ts +0 -0
  182. /package/{src/alert → alert}/types.ts +0 -0
  183. /package/{src/ats → ats}/types.ts +0 -0
  184. /package/{src/basket → basket}/types.ts +0 -0
  185. /package/{src/basket → basket}/validations.types.ts +0 -0
  186. /package/{src/campaign → campaign}/enums.ts +0 -0
  187. /package/{src/campaign → campaign}/types.ts +0 -0
  188. /package/{src/campaign → campaign}/validations.types.ts +0 -0
  189. /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
  190. /package/{src/common → common}/events/EventCommand/index.ts +0 -0
  191. /package/{src/common → common}/events/EventCommand/types.ts +0 -0
  192. /package/{src/common → common}/events/index.ts +0 -0
  193. /package/{src/common → common}/logger/enums.ts +0 -0
  194. /package/{src/common → common}/validations.types.ts +0 -0
  195. /package/{src/contract → contract}/types.ts +0 -0
  196. /package/{src/contract → contract}/validations.types.ts +0 -0
  197. /package/{src/language → language}/validations.types.ts +0 -0
  198. /package/{src/modal → modal}/enums.ts +0 -0
  199. /package/{src/modal → modal}/types.ts +0 -0
  200. /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
  201. /package/{src/orderJourney → orderJourney}/types.ts +0 -0
  202. /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
  203. /package/{src/product → product}/enums.ts +0 -0
  204. /package/{src/product → product}/types.ts +0 -0
  205. /package/{src/product → product}/validations.types.ts +0 -0
  206. /package/{src/routing → routing}/state.types.ts +0 -0
  207. /package/{src/theming → theming}/validations.types.ts +0 -0
  208. /package/{src/ui → ui}/index.ts +0 -0
  209. /package/{src/wallet → wallet}/types.ts +0 -0
  210. /package/{src/wallet → wallet}/validations.types.ts +0 -0
@@ -0,0 +1,140 @@
1
+ import { WindowHapiUtils } from "./utils.types"
2
+ import { WindowHapiValidations } from "./validation.types"
3
+ import { WindowHapiState } from "./state.types"
4
+ import { WindowHapiInstance, WindowHapiInstances } from "./instances.types"
5
+ import { WindowHapiRouting } from "./routing.types"
6
+ import { WindowHapiAuth } from "./auth.types"
7
+ import { WindowHapiEvents } from "./events.types"
8
+ import { WindowHapiUI } from "./ui.types"
9
+ import { WindowHapiAPI } from "./api.types"
10
+ import { WindowHapiSDK } from "./sdk.types"
11
+ import { WindowHapiService } from "./service.types"
12
+ import { WindowHapiQA } from "./qa.types"
13
+ import { WindowHapiLogger } from "../common/logger/types"
14
+ import {
15
+ HapiWebComponent,
16
+ RecursivePartial,
17
+ WindowHapiSubmoduleName,
18
+ } from "../common"
19
+ import { DebugPanelPosition } from "./config.types"
20
+
21
+ export type WindowHapiModuleWithConstructorArgs<Module, ConstructorArgs> =
22
+ Module & ConstructorArgs
23
+
24
+ export type WindowHapiUtilsSubmodule = WindowHapiModuleWithConstructorArgs<
25
+ WindowHapiUtils,
26
+ { readonly core: WindowHapiClassInterface }
27
+ >
28
+
29
+ export type WindowHapiValidationSubmodule = WindowHapiModuleWithConstructorArgs<
30
+ WindowHapiValidations,
31
+ { readonly core: WindowHapiClassInterface }
32
+ >
33
+
34
+ export type WindowHapiStateSubmodule = WindowHapiModuleWithConstructorArgs<
35
+ WindowHapiState,
36
+ { readonly core: WindowHapiClassInterface }
37
+ >
38
+
39
+ export type WindowHapiInstancesSubmodule = WindowHapiModuleWithConstructorArgs<
40
+ WindowHapiInstances,
41
+ { readonly core: WindowHapiClassInterface }
42
+ >
43
+
44
+ export type WindowHapiRoutingSubmodule = WindowHapiModuleWithConstructorArgs<
45
+ WindowHapiRouting,
46
+ { readonly core: WindowHapiClassInterface }
47
+ >
48
+
49
+ export type WindowHapiAuthSubmodule = WindowHapiModuleWithConstructorArgs<
50
+ WindowHapiAuth,
51
+ { readonly core: WindowHapiClassInterface }
52
+ >
53
+
54
+ export type WindowHapiEventsSubmodule = WindowHapiModuleWithConstructorArgs<
55
+ WindowHapiEvents,
56
+ { readonly core: WindowHapiClassInterface }
57
+ >
58
+
59
+ export type WindowHapiUISubmodule = WindowHapiModuleWithConstructorArgs<
60
+ WindowHapiUI,
61
+ { readonly core: WindowHapiClassInterface }
62
+ >
63
+
64
+ export type WindowHapiAPISubmodule = WindowHapiModuleWithConstructorArgs<
65
+ WindowHapiAPI,
66
+ { readonly core: WindowHapiClassInterface }
67
+ >
68
+
69
+ export type WindowHapiSDKSubmodule = WindowHapiModuleWithConstructorArgs<
70
+ WindowHapiSDK,
71
+ { readonly core: WindowHapiClassInterface }
72
+ >
73
+
74
+ export type WindowHapiServiceSubmodule = WindowHapiModuleWithConstructorArgs<
75
+ WindowHapiService,
76
+ { readonly core: WindowHapiClassInterface }
77
+ >
78
+
79
+ export type WindowHapiQASubmodule = WindowHapiModuleWithConstructorArgs<
80
+ WindowHapiQA,
81
+ { readonly core: WindowHapiClassInterface }
82
+ >
83
+
84
+ export type WindowHapiConfigSubmodule = {
85
+ apiHost: string
86
+ initialState: RecursivePartial<any>
87
+ partnerId: string
88
+ clientId: string
89
+ clientToken: string
90
+ loadingSpinnerDefaultFillColor: string
91
+ appOrigin: string
92
+ enableLogs: boolean
93
+ webComponents: HapiWebComponent[]
94
+ isInvalidToken: boolean
95
+ useJWTAuthHeaders: boolean
96
+ addModal: boolean
97
+ addAlertBar: boolean
98
+ addDebugPanel: boolean
99
+ debugPanelPosition: DebugPanelPosition
100
+ datadogClientToken: string
101
+ env: string
102
+ appVersion: string
103
+ testMode: boolean
104
+ debugMode: boolean
105
+ htmlTemplates: Record<string, string>
106
+ }
107
+
108
+ export type WindowHapiClassInterface = {
109
+ logger: WindowHapiLogger
110
+ utils: WindowHapiUtilsSubmodule
111
+ validation: WindowHapiValidationSubmodule
112
+ state: WindowHapiStateSubmodule
113
+ instances: WindowHapiInstancesSubmodule
114
+ routing: WindowHapiRoutingSubmodule
115
+ auth: WindowHapiAuthSubmodule
116
+ events: WindowHapiEventsSubmodule
117
+ ui: WindowHapiUISubmodule
118
+ api: WindowHapiAPISubmodule
119
+ sdk: WindowHapiSDKSubmodule
120
+ service: WindowHapiServiceSubmodule
121
+ instance: WindowHapiInstance
122
+ qa: WindowHapiQASubmodule
123
+ }
124
+
125
+ export type WindowHapi = {
126
+ [WindowHapiSubmoduleName.api]: WindowHapiAPISubmodule
127
+ [WindowHapiSubmoduleName.auth]: WindowHapiAuthSubmodule
128
+ [WindowHapiSubmoduleName.config]: WindowHapiConfigSubmodule
129
+ [WindowHapiSubmoduleName.instances]: WindowHapiInstancesSubmodule
130
+ [WindowHapiSubmoduleName.qa]: WindowHapiQASubmodule
131
+ [WindowHapiSubmoduleName.routing]: WindowHapiRoutingSubmodule
132
+ [WindowHapiSubmoduleName.sdk]: WindowHapiSDKSubmodule
133
+ [WindowHapiSubmoduleName.service]: WindowHapiServiceSubmodule
134
+ [WindowHapiSubmoduleName.state]: WindowHapiStateSubmodule
135
+ [WindowHapiSubmoduleName.ui]: WindowHapiUISubmodule
136
+ [WindowHapiSubmoduleName.utils]: WindowHapiUtilsSubmodule
137
+ [WindowHapiSubmoduleName.validation]: WindowHapiValidationSubmodule
138
+ [WindowHapiSubmoduleName.events]: WindowHapiEventsSubmodule
139
+ [WindowHapiSubmoduleName.instance]: WindowHapiInstance
140
+ }
package/alert/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./enums"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
@@ -1,9 +1,9 @@
1
1
  import { AlertKey } from "./enums"
2
2
  import { AlertOptions } from "./types"
3
- import { ModuleWithConstructorArgs } from "../types"
4
3
  import { WindowHapiService } from "../_window/service.types"
4
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
5
5
 
6
- export type WindowHapiServiceAlert = ModuleWithConstructorArgs<
6
+ export type WindowHapiServiceAlert = WindowHapiModuleWithConstructorArgs<
7
7
  {
8
8
  show: (
9
9
  key: AlertKey,
@@ -0,0 +1,9 @@
1
+ import { Alert, AlertOptions } from "./types"
2
+ export type AlertState = {
3
+ alerts: Alert[]
4
+ defaultOptions: AlertOptions
5
+ successOptions: AlertOptions | null
6
+ infoOptions: AlertOptions | null
7
+ warningOptions: AlertOptions | null
8
+ errorOptions: AlertOptions | null
9
+ }
@@ -1,7 +1,7 @@
1
1
  import { AxiosRequestConfig } from "axios/index"
2
2
  import { ATSSettings } from "./types"
3
3
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
4
- import { ModuleWithConstructorArgs } from "../types"
4
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
5
5
 
6
6
  export type WindowHapiAPIATSConfigs = {
7
7
  getUserSettings: AxiosRequestConfig<any>
@@ -10,7 +10,7 @@ export type WindowHapiAPIATSConfigs = {
10
10
  export type WindowHapiAPIATSRequests = {
11
11
  getUserSettings: () => Promise<ATSSettings>
12
12
  }
13
- export type WindowHapiAPIATS = ModuleWithConstructorArgs<
13
+ export type WindowHapiAPIATS = WindowHapiModuleWithConstructorArgs<
14
14
  WindowHapiAPIModule<WindowHapiAPIATSRequests, WindowHapiAPIATSConfigs>,
15
15
  { readonly api: WindowHapiAPI }
16
16
  >
package/ats/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
@@ -3,13 +3,13 @@ import {
3
3
  WindowHapiService,
4
4
  } from "../_window/service.types"
5
5
  import { ATSSettings } from "./types"
6
- import { ModuleWithConstructorArgs } from "../types"
6
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
7
7
 
8
8
  export type ATSServiceGetUserSettingsHandler = () => Promise<
9
9
  ATSSettings | undefined
10
10
  >
11
11
 
12
- export type WindowHapiServiceATS = ModuleWithConstructorArgs<
12
+ export type WindowHapiServiceATS = WindowHapiModuleWithConstructorArgs<
13
13
  {
14
14
  getUserSettings: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetUserSettingsHandler>
15
15
  },
@@ -1,5 +1,5 @@
1
1
  import { ATSSettings } from "./types"
2
2
 
3
- export type ATSStoreState = {
3
+ export type ATSState = {
4
4
  userSettings: ATSSettings | null
5
5
  }
@@ -0,0 +1,7 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./service.types"
4
+ export * from "./state.types"
5
+ export * from "./types"
6
+ export * from "./utils.types"
7
+ export * from "./validations.types"
@@ -5,7 +5,7 @@ import {
5
5
  HapiServiceFunctionWithLifecycleHooks,
6
6
  WindowHapiService,
7
7
  } from "../_window/service.types"
8
- import { ModuleWithConstructorArgs } from "../types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
10
  export type BasketServiceGetProductsHandler = () => Promise<
11
11
  (Product | Contract)[]
@@ -18,7 +18,7 @@ export type BasketServiceRemoveProductOrContractByIdHandler = (
18
18
  contractOrProductId: string,
19
19
  ) => void
20
20
 
21
- export type WindowHapiServiceBasket = ModuleWithConstructorArgs<
21
+ export type WindowHapiServiceBasket = WindowHapiModuleWithConstructorArgs<
22
22
  {
23
23
  setBasketProductsAndMetaByItemData: (
24
24
  basketItemData: (Contract | Product)[],
@@ -2,7 +2,7 @@ import { Product } from "../product/types"
2
2
  import { BasketProduct } from "./types"
3
3
  import { Contract } from "../contract/types"
4
4
 
5
- export type BasketStoreState = {
5
+ export type BasketState = {
6
6
  /**
7
7
  * Array of `BasketProduct`s. The price or other properties of a Product or Contract may change therefore this variable only contains ID of Product or Contract and whether it is a Product or not; via the `isProduct: boolean` variable. Elements of this array then are fetched from the API with their latest information and then set as `products`.
8
8
  */
@@ -1,8 +1,8 @@
1
1
  import { BasketProduct } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiUtils } from "../_window/utils.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiUtilsBasket = ModuleWithConstructorArgs<
5
+ export type WindowHapiUtilsBasket = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  getInitialBasketProductsMeta: () => BasketProduct[]
8
8
  },
@@ -7,7 +7,7 @@ import {
7
7
  import { ProductSupportingContractsComplete } from "../product/types"
8
8
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
9
  import { PaginatedAPIResponseV2 } from "../common/types"
10
- import { ModuleWithConstructorArgs } from "../types"
10
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
11
11
 
12
12
  export type WindowHapiAPICampaignConfigs = {
13
13
  getCampaigns: AxiosRequestConfig
@@ -36,7 +36,7 @@ export type WindowHapiAPICampaignRequests = {
36
36
  getSeniorities: () => Promise<TaxonomyEducationAndSeniorityLevel[]>
37
37
  orderCampaign: (postBody: CampaignOrderRequestBody) => Promise<Campaign>
38
38
  }
39
- export type WindowHapiAPICampaign = ModuleWithConstructorArgs<
39
+ export type WindowHapiAPICampaign = WindowHapiModuleWithConstructorArgs<
40
40
  WindowHapiAPIModule<
41
41
  WindowHapiAPICampaignRequests,
42
42
  WindowHapiAPICampaignConfigs
@@ -0,0 +1,10 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./enums"
5
+ export * from "./qa.types"
6
+ export * from "./service.types"
7
+ export * from "./state.types"
8
+ export * from "./types"
9
+ export * from "./utils.types"
10
+ export * from "./validations.types"
@@ -0,0 +1,12 @@
1
+ import { WindowHapiQA } from "../_window/qa.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
+ import { CampaignCreateForm } from "./types"
4
+
5
+ export type WindowHapiQACampaign = WindowHapiModuleWithConstructorArgs<
6
+ {
7
+ useMockCampaignForm: () => CampaignCreateForm
8
+ getRandomCampaignId: () => Promise<string>
9
+ setCampaignFormDebuggerIsShown: (isEnabled: boolean) => boolean
10
+ },
11
+ { readonly qa: WindowHapiQA }
12
+ >
@@ -5,7 +5,7 @@ import {
5
5
  import { ProductSupportingContractsComplete } from "../product/types"
6
6
  import { Campaign, TaxonomyEducationAndSeniorityLevel } from "./types"
7
7
  import { PaginatedAPIResponseV2 } from "../common/types"
8
- import { ModuleWithConstructorArgs } from "../types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
10
  export type CampaignServiceGetCampaignsHandler = (
11
11
  offset?: number,
@@ -33,7 +33,7 @@ export type CampaignServiceCopyCampaignHandler = (
33
33
  campaign: Campaign,
34
34
  ) => Promise<Campaign>
35
35
 
36
- export type WindowHapiServiceCampaign = ModuleWithConstructorArgs<
36
+ export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
37
37
  {
38
38
  getCampaigns: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsHandler>
39
39
  getCampaignDetail: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignDetailHandler>
@@ -7,7 +7,7 @@ import {
7
7
  } from "./types"
8
8
  import { PaginationResponseV2 } from "../common/types"
9
9
 
10
- export type CampaignStoreState = {
10
+ export type CampaignState = {
11
11
  /* Campaign */
12
12
  /**
13
13
  * Array of Campaign Objects for listing in Campaigns Landing and Campaigns List (both Card and Accordion Table Layout) widgets
@@ -14,11 +14,11 @@ import {
14
14
  } from "./types"
15
15
  import { Product } from "../product/types"
16
16
  import { Contract } from "../contract/types"
17
- import { ModuleWithConstructorArgs } from "../types"
18
17
  import { BasketProduct } from "../basket/types"
19
18
  import { WindowHapiUtils } from "../_window/utils.types"
19
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
20
20
 
21
- export type WindowHapiUtilsCampaign = ModuleWithConstructorArgs<
21
+ export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
22
22
  {
23
23
  getInitialCampaignForm: () => CampaignCreateForm
24
24
  mapCampaignsAndUpdateById: (
@@ -1,4 +1,4 @@
1
- export enum WindowHapiCoreModuleName {
1
+ export enum WindowHapiSubmoduleName {
2
2
  "api" = "hapiApi",
3
3
  auth = "hapiAuth",
4
4
  config = "hapiConfig",
@@ -11,6 +11,7 @@ export enum WindowHapiCoreModuleName {
11
11
  ui = "hapiUI",
12
12
  utils = "hapiUtils",
13
13
  validation = "hapiValidation",
14
+ events = "hapiEvents",
14
15
  instance = "hapiInstance",
15
16
  }
16
17
 
@@ -3,8 +3,8 @@ import {
3
3
  WindowHapiEventCommandNames,
4
4
  WindowHapiEventCommandStatus,
5
5
  } from "./EventCommand/types"
6
- import { Logger } from "../logger/Logger"
7
- import HapiInstance from "../instances/Instance"
6
+ import { WindowHapiInstance } from "../../_window"
7
+ import { WindowHapiLogger } from "../logger/types"
8
8
 
9
9
  export type WindowHapiEventStrategy = {
10
10
  handleEvent: (
@@ -13,8 +13,8 @@ export type WindowHapiEventStrategy = {
13
13
  }
14
14
 
15
15
  export type WindowHapiEventMediatorInstances = {
16
- source: HapiInstance
17
- targets: HapiInstance[]
16
+ source: WindowHapiInstance
17
+ targets: WindowHapiInstance[]
18
18
  }
19
19
 
20
20
  export type WindowHapiEventMediatorGetInstancesHandler =
@@ -26,8 +26,8 @@ export type WindowHapiEventCommand = {
26
26
  createdAt: string
27
27
  updatedAt: string | undefined
28
28
  status: WindowHapiEventCommandStatus
29
- logger: Logger
30
- instance?: HapiInstance
29
+ logger: WindowHapiLogger
30
+ instance?: WindowHapiInstance
31
31
  data: WindowHapiEventCommandData | undefined
32
32
  sourceInstanceName: string
33
33
  targetInstancesNames: string[]
@@ -0,0 +1,7 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./events"
4
+ export * from "./qa.types"
5
+ export * from "./types"
6
+ export * from "./validations.types"
7
+ export * from "./enums"
@@ -0,0 +1,18 @@
1
+ import { LogLevel } from "./enums"
2
+
3
+ export type LogOutput = (
4
+ source: string,
5
+ level: LogLevel,
6
+ ...objects: any[]
7
+ ) => void
8
+
9
+ export type WindowHapiLogger = {
10
+ id: string
11
+ setIsEnabled: (isEnabled: boolean) => void
12
+ debug: (...objects: any[]) => void
13
+ info: (...objects: any[]) => void
14
+ warn: (...objects: any[]) => void
15
+ error: (...objects: any[]) => void
16
+ timeStart: (message: string) => void
17
+ timeEnd: (message: string) => void
18
+ }
@@ -1,7 +1,7 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
1
  import { WindowHapiQA } from "../_window/qa.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
- export type WindowHapiQACommon = ModuleWithConstructorArgs<
4
+ export type WindowHapiQACommon = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
6
  setComponentDebuggingIsEnabled: (isEnabled: boolean) => boolean
7
7
  },
@@ -1,8 +1,7 @@
1
1
  import validator from "validator"
2
- import validators from "./validators"
3
2
  import { MessageDescriptor } from "react-intl"
4
- import { Logger } from "./logger/Logger"
5
- import { Stores } from "../types"
3
+ import { WindowHapiLogger } from "./logger/types"
4
+ import { Validators } from "./validator/types"
6
5
 
7
6
  export type ValueOf<T> = T[keyof T]
8
7
  export type AnyNonFunction<T> = Omit<T, "function">
@@ -76,14 +75,14 @@ export type ValidatorKey =
76
75
  | "PostalCodeLocale"
77
76
  | "isPostalCodeLocales"
78
77
  >
79
- | keyof typeof validators
78
+ | keyof Validators
80
79
  export type NestedValidatorKeys =
81
80
  | ValidatorKey
82
81
  | {
83
82
  [k: string]: ValidatorKey | NestedValidatorKeys
84
83
  }
85
84
  export type BaseService = {
86
- logger: Logger
85
+ logger: WindowHapiLogger
87
86
  }
88
87
  // the reason there are no types like enums here is because
89
88
  // the options should be a serializable JSON during generation of web component files
@@ -97,7 +96,7 @@ export type HapiWebComponent = {
97
96
  key: string
98
97
  id: string
99
98
  injects?: string[]
100
- initialState?: Partial<Record<keyof Stores, any>>
99
+ initialState?: Partial<Record<string, any>>
101
100
  isUserJourney?: boolean
102
101
  webComponentCSS?: Record<string, any> //React.CSSProperties
103
102
  attributes?: Record<string, string>
@@ -0,0 +1,4 @@
1
+ export type Validators = {
2
+ isNotEmpty: (value: string | Record<string, any> | any[]) => boolean
3
+ isNotZero: (value: number) => boolean
4
+ }
@@ -7,7 +7,7 @@ import {
7
7
  } from "./types"
8
8
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
9
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
10
- import { ModuleWithConstructorArgs } from "../types"
10
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
11
11
 
12
12
  export type WindowHapiAPIContractConfigs = {
13
13
  getContracts: AxiosRequestConfig
@@ -38,7 +38,7 @@ export type WindowHapiAPIContractRequests = {
38
38
  createGroup: (group: ContractGroupCreateForm) => Promise<ContractGroup>
39
39
  removeContract: (contractId: string) => Promise<Contract>
40
40
  }
41
- export type WindowHapiAPIContract = ModuleWithConstructorArgs<
41
+ export type WindowHapiAPIContract = WindowHapiModuleWithConstructorArgs<
42
42
  WindowHapiAPIModule<
43
43
  WindowHapiAPIContractRequests,
44
44
  WindowHapiAPIContractConfigs
@@ -0,0 +1,9 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./qa.types"
5
+ export * from "./service.types"
6
+ export * from "./state.types"
7
+ export * from "./types"
8
+ export * from "./utils.types"
9
+ export * from "./validations.types"
@@ -1,8 +1,8 @@
1
1
  import { ContractCreateForm, ContractGroupCreateForm } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQAContract = ModuleWithConstructorArgs<
5
+ export type WindowHapiQAContract = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  getRandomContractId: () => Promise<string>
8
8
  useMockContractForm: () => ContractCreateForm
@@ -10,7 +10,7 @@ import {
10
10
  ContractPostingRequirementsAutocompleteRequestOption,
11
11
  } from "./types"
12
12
  import { PaginatedAPIResponseV1 } from "../common/types"
13
- import { ModuleWithConstructorArgs } from "../types"
13
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
14
14
 
15
15
  export type ContractServiceGetContractPostingRequirementOptionsHandler = (
16
16
  contractId: string,
@@ -33,7 +33,7 @@ export type ContractServiceGetContractHandler = (
33
33
  id: string,
34
34
  ) => Promise<Contract>
35
35
 
36
- export type WindowHapiServiceContract = ModuleWithConstructorArgs<
36
+ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
37
37
  {
38
38
  getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
39
39
  getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
@@ -8,7 +8,7 @@ import {
8
8
  } from "./types"
9
9
  import { PaginationResponseV1 } from "../common/types"
10
10
 
11
- export type ContractStoreState = {
11
+ export type ContractState = {
12
12
  /* Contracts */
13
13
  /**
14
14
  * Array of Contracts to be displayed in Contracts Landing or Contracts List widgets.
@@ -1,8 +1,8 @@
1
1
  import { ContractCreateForm, ContractGroupCreateForm } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiUtils } from "../_window/utils.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiUtilsContract = ModuleWithConstructorArgs<
5
+ export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  getInitialContractForm: () => ContractCreateForm
8
8
  getInitialGroupForm: () => ContractGroupCreateForm
@@ -1,3 +1,3 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './LoggerDatadog';
3
+ export * from "./state.types"
@@ -1,4 +1,4 @@
1
- export type DebuggingStoreState = {
1
+ export type DebuggingState = {
2
2
  /**
3
3
  * Shows or hides the debugging tool on Campaign Create Form's fields for Product & Contract steps
4
4
  */
package/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./_window"
4
+ export * from "./alert"
5
+ export * from "./ats"
6
+ export * from "./basket"
7
+ export * from "./campaign"
8
+ export * from "./common"
9
+ export * from "./contract"
10
+ export * from "./debugging"
11
+ export * from "./language"
12
+ export * from "./modal"
13
+ export * from "./orderJourney"
14
+ export * from "./product"
15
+ export * from "./routing"
16
+ export * from "./theming"
17
+ export * from "./ui"
18
+ export * from "./wallet"
@@ -0,0 +1,5 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./qa.types"
4
+ export * from "./state.types"
5
+ export * from "./validations.types"
@@ -1,9 +1,9 @@
1
1
  import { ProductPriceCurrency } from "../product/enums"
2
2
  import { LanguageStoreTranslations } from "./state.types"
3
- import { ModuleWithConstructorArgs } from "../types"
4
3
  import { WindowHapiQA } from "../_window/qa.types"
4
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
5
5
 
6
- export type WindowHapiQALanguage = ModuleWithConstructorArgs<
6
+ export type WindowHapiQALanguage = WindowHapiModuleWithConstructorArgs<
7
7
  {
8
8
  setLocale: (locale: string) => string
9
9
  setDisplayCurrency: (
@@ -5,7 +5,7 @@ export type LanguageStoreTranslations = Record<
5
5
  string,
6
6
  LanguageStoreLocaleTranslations
7
7
  >
8
- export type LanguageStoreState = {
8
+ export type LanguageState = {
9
9
  /**
10
10
  * Locale of the user (navigator language) in RFC 5646 that can be changed via setLocale function
11
11
  */
package/modal/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./enums"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"