@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.
- package/{src/_window → _window}/api.types.ts +9 -7
- package/_window/auth.types.ts +13 -0
- package/_window/config.types.ts +5 -0
- package/{src/_window → _window}/events.types.ts +15 -14
- package/_window/instances.types.ts +27 -0
- package/{src/_window → _window}/qa.types.ts +7 -5
- package/{src/_window → _window}/routing.types.ts +6 -4
- package/{src/_window → _window}/sdk.types.ts +29 -27
- package/{src/_window → _window}/service.types.ts +9 -7
- package/{src/_window → _window}/state.types.ts +55 -53
- package/_window/ui.types.ts +15 -0
- package/{src/_window → _window}/utils.types.ts +7 -5
- package/{src/_window → _window}/validation.types.ts +7 -5
- package/_window/window.ts +140 -0
- package/alert/index.ts +6 -0
- package/{src/alert → alert}/service.types.ts +2 -2
- package/alert/state.types.ts +9 -0
- package/{src/ats → ats}/api.types.ts +2 -2
- package/ats/index.ts +6 -0
- package/{src/ats → ats}/service.types.ts +2 -2
- package/{src/ats → ats}/state.types.ts +1 -1
- package/basket/index.ts +7 -0
- package/{src/basket → basket}/service.types.ts +2 -2
- package/{src/basket → basket}/state.types.ts +1 -1
- package/{src/basket → basket}/utils.types.ts +2 -2
- package/{src/campaign → campaign}/api.types.ts +2 -2
- package/campaign/index.ts +10 -0
- package/campaign/qa.types.ts +12 -0
- package/{src/campaign → campaign}/service.types.ts +2 -2
- package/{src/campaign → campaign}/state.types.ts +1 -1
- package/{src/campaign → campaign}/utils.types.ts +2 -2
- package/{enums.ts → common/enums.ts} +2 -1
- package/{src/common → common}/events/types.ts +6 -6
- package/common/index.ts +7 -0
- package/common/logger/types.ts +18 -0
- package/{src/common → common}/qa.types.ts +2 -2
- package/{src/common → common}/types.ts +5 -6
- package/common/validator/types.ts +4 -0
- package/{src/contract → contract}/api.types.ts +2 -2
- package/contract/index.ts +9 -0
- package/{src/contract → contract}/qa.types.ts +2 -2
- package/{src/contract → contract}/service.types.ts +2 -2
- package/{src/contract → contract}/state.types.ts +1 -1
- package/{src/contract → contract}/utils.types.ts +2 -2
- package/{src/common/logger-datadog → debugging}/index.ts +1 -1
- package/{src/debugging → debugging}/state.types.ts +1 -1
- package/index.ts +18 -0
- package/language/index.ts +5 -0
- package/{src/language → language}/qa.types.ts +2 -2
- package/{src/language → language}/state.types.ts +1 -1
- package/modal/index.ts +6 -0
- package/{src/modal → modal}/service.types.ts +2 -2
- package/{src/modal → modal}/state.types.ts +1 -1
- package/orderJourney/index.ts +8 -0
- package/{src/orderJourney → orderJourney}/qa.types.ts +2 -2
- package/{src/orderJourney → orderJourney}/state.types.ts +1 -1
- package/{src/orderJourney → orderJourney}/utils.types.ts +2 -2
- package/package.json +16 -5
- package/{src/product → product}/api.types.ts +2 -2
- package/product/index.ts +10 -0
- package/{src/product → product}/qa.types.ts +2 -2
- package/{src/product → product}/service.types.ts +2 -2
- package/{src/product → product}/state.types.ts +1 -1
- package/{src/product → product}/utils.types.ts +2 -2
- package/routing/index.ts +3 -0
- package/theming/index.ts +6 -0
- package/{src/theming → theming}/qa.types.ts +2 -2
- package/{src/theming → theming}/state.types.ts +1 -1
- package/{src/theming → theming}/types.ts +38 -1
- package/tsconfig.json +7 -12
- package/{src/ui → ui}/service.types.ts +2 -2
- package/{src/wallet → wallet}/api.types.ts +2 -2
- package/wallet/index.ts +7 -0
- package/{src/wallet → wallet}/service.types.ts +2 -2
- package/{src/wallet → wallet}/state.types.ts +1 -1
- package/src/_window/auth.types.ts +0 -11
- package/src/_window/config.types.ts +0 -30
- package/src/_window/instances.types.ts +0 -18
- package/src/_window/ui.types.ts +0 -13
- package/src/_window/window.ts +0 -56
- package/src/alert/functions.types.ts +0 -13
- package/src/alert/index.ts +0 -9
- package/src/alert/state.initial.ts +0 -16
- package/src/alert/state.types.ts +0 -27
- package/src/alert/state.validations.ts +0 -11
- package/src/ats/functions.types.ts +0 -7
- package/src/ats/index.ts +0 -9
- package/src/ats/state.initial.ts +0 -5
- package/src/ats/state.validations.ts +0 -6
- package/src/basket/consts.ts +0 -1
- package/src/basket/functions.types.ts +0 -40
- package/src/basket/index.ts +0 -12
- package/src/basket/state.initial.ts +0 -11
- package/src/basket/state.validations.ts +0 -12
- package/src/basket/utils.ts +0 -79
- package/src/campaign/consts.ts +0 -1
- package/src/campaign/functions.types.ts +0 -90
- package/src/campaign/index.ts +0 -15
- package/src/campaign/qa.types.ts +0 -12
- package/src/campaign/state.initial.ts +0 -84
- package/src/campaign/state.validations.ts +0 -16
- package/src/campaign/utils.ts +0 -53
- package/src/common/LocalStorage.ts +0 -123
- package/src/common/browser.ts +0 -2
- package/src/common/color.ts +0 -9
- package/src/common/immutable.ts +0 -28
- package/src/common/index.ts +0 -22
- package/src/common/instances/Instance.ts +0 -13
- package/src/common/instances/consts.ts +0 -1
- package/src/common/instances/index.ts +0 -4
- package/src/common/json.ts +0 -25
- package/src/common/logger/Logger.ts +0 -70
- package/src/common/logger/index.ts +0 -5
- package/src/common/logger/types.ts +0 -7
- package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
- package/src/common/misc.ts +0 -114
- package/src/common/promise.ts +0 -161
- package/src/common/proxy.ts +0 -77
- package/src/common/regExTest.ts +0 -12
- package/src/common/tree.ts +0 -148
- package/src/common/utm.ts +0 -19
- package/src/common/validators.ts +0 -21
- package/src/common/webComponents.ts +0 -26
- package/src/config/functions.types.ts +0 -23
- package/src/config/index.ts +0 -5
- package/src/config/state.initial.ts +0 -11
- package/src/config/state.types.ts +0 -15
- package/src/consts.ts +0 -980
- package/src/contract/consts.ts +0 -1
- package/src/contract/functions.types.ts +0 -112
- package/src/contract/index.ts +0 -14
- package/src/contract/state.initial.ts +0 -39
- package/src/contract/state.validations.ts +0 -21
- package/src/contract/utils.ts +0 -36
- package/src/debugging/functions.types.ts +0 -34
- package/src/debugging/index.ts +0 -6
- package/src/debugging/state.initial.ts +0 -10
- package/src/debugging/state.validations.ts +0 -10
- package/src/index.ts +0 -22
- package/src/language/consts.ts +0 -6
- package/src/language/en.ts +0 -530
- package/src/language/functions.types.ts +0 -29
- package/src/language/index.ts +0 -11
- package/src/language/state.initial.ts +0 -13
- package/src/language/state.validations.ts +0 -10
- package/src/language/utils.ts +0 -17
- package/src/modal/consts.ts +0 -6
- package/src/modal/functions.types.ts +0 -22
- package/src/modal/index.ts +0 -11
- package/src/modal/state.initial.ts +0 -9
- package/src/modal/state.validations.ts +0 -6
- package/src/modal/store.types.ts +0 -5
- package/src/orderJourney/consts.ts +0 -289
- package/src/orderJourney/functions.types.ts +0 -140
- package/src/orderJourney/index.ts +0 -13
- package/src/orderJourney/state.initial.ts +0 -401
- package/src/orderJourney/state.validations.ts +0 -78
- package/src/orderJourney/utils.ts +0 -7
- package/src/product/consts.ts +0 -1
- package/src/product/functions.types.ts +0 -156
- package/src/product/index.ts +0 -14
- package/src/product/state.initial.ts +0 -28
- package/src/product/state.validations.ts +0 -25
- package/src/routing/functions.types.ts +0 -48
- package/src/routing/index.ts +0 -5
- package/src/routing/state.initial.ts +0 -10
- package/src/theming/consts.ts +0 -7727
- package/src/theming/functions.types.ts +0 -13
- package/src/theming/index.ts +0 -11
- package/src/theming/state.initial.ts +0 -16
- package/src/theming/state.validations.ts +0 -8
- package/src/theming/utils.ts +0 -581
- package/src/types.ts +0 -229
- package/src/utils.ts +0 -3
- package/src/wallet/consts.ts +0 -3
- package/src/wallet/functions.types.ts +0 -58
- package/src/wallet/index.ts +0 -11
- package/src/wallet/state.initial.ts +0 -18
- package/src/wallet/state.validations.ts +0 -18
- /package/{src/_window → _window}/index.ts +0 -0
- /package/{src/alert → alert}/enums.ts +0 -0
- /package/{src/alert → alert}/types.ts +0 -0
- /package/{src/ats → ats}/types.ts +0 -0
- /package/{src/basket → basket}/types.ts +0 -0
- /package/{src/basket → basket}/validations.types.ts +0 -0
- /package/{src/campaign → campaign}/enums.ts +0 -0
- /package/{src/campaign → campaign}/types.ts +0 -0
- /package/{src/campaign → campaign}/validations.types.ts +0 -0
- /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
- /package/{src/common → common}/events/EventCommand/index.ts +0 -0
- /package/{src/common → common}/events/EventCommand/types.ts +0 -0
- /package/{src/common → common}/events/index.ts +0 -0
- /package/{src/common → common}/logger/enums.ts +0 -0
- /package/{src/common → common}/validations.types.ts +0 -0
- /package/{src/contract → contract}/types.ts +0 -0
- /package/{src/contract → contract}/validations.types.ts +0 -0
- /package/{src/language → language}/validations.types.ts +0 -0
- /package/{src/modal → modal}/enums.ts +0 -0
- /package/{src/modal → modal}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
- /package/{src/orderJourney → orderJourney}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
- /package/{src/product → product}/enums.ts +0 -0
- /package/{src/product → product}/types.ts +0 -0
- /package/{src/product → product}/validations.types.ts +0 -0
- /package/{src/routing → routing}/state.types.ts +0 -0
- /package/{src/theming → theming}/validations.types.ts +0 -0
- /package/{src/ui → ui}/index.ts +0 -0
- /package/{src/wallet → wallet}/types.ts +0 -0
- /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
@@ -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 =
|
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 {
|
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 =
|
13
|
+
export type WindowHapiAPIATS = WindowHapiModuleWithConstructorArgs<
|
14
14
|
WindowHapiAPIModule<WindowHapiAPIATSRequests, WindowHapiAPIATSConfigs>,
|
15
15
|
{ readonly api: WindowHapiAPI }
|
16
16
|
>
|
package/ats/index.ts
ADDED
@@ -3,13 +3,13 @@ import {
|
|
3
3
|
WindowHapiService,
|
4
4
|
} from "../_window/service.types"
|
5
5
|
import { ATSSettings } from "./types"
|
6
|
-
import {
|
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 =
|
12
|
+
export type WindowHapiServiceATS = WindowHapiModuleWithConstructorArgs<
|
13
13
|
{
|
14
14
|
getUserSettings: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetUserSettingsHandler>
|
15
15
|
},
|
package/basket/index.ts
ADDED
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
HapiServiceFunctionWithLifecycleHooks,
|
6
6
|
WindowHapiService,
|
7
7
|
} from "../_window/service.types"
|
8
|
-
import {
|
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 =
|
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
|
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 =
|
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 {
|
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 =
|
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 {
|
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 =
|
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
|
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 =
|
21
|
+
export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
22
22
|
{
|
23
23
|
getInitialCampaignForm: () => CampaignCreateForm
|
24
24
|
mapCampaignsAndUpdateById: (
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export enum
|
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 {
|
7
|
-
import
|
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:
|
17
|
-
targets:
|
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:
|
30
|
-
instance?:
|
29
|
+
logger: WindowHapiLogger
|
30
|
+
instance?: WindowHapiInstance
|
31
31
|
data: WindowHapiEventCommandData | undefined
|
32
32
|
sourceInstanceName: string
|
33
33
|
targetInstancesNames: string[]
|
package/common/index.ts
ADDED
@@ -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 =
|
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 {
|
5
|
-
import {
|
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
|
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:
|
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<
|
99
|
+
initialState?: Partial<Record<string, any>>
|
101
100
|
isUserJourney?: boolean
|
102
101
|
webComponentCSS?: Record<string, any> //React.CSSProperties
|
103
102
|
attributes?: Record<string, string>
|
@@ -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 {
|
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 =
|
41
|
+
export type WindowHapiAPIContract = WindowHapiModuleWithConstructorArgs<
|
42
42
|
WindowHapiAPIModule<
|
43
43
|
WindowHapiAPIContractRequests,
|
44
44
|
WindowHapiAPIContractConfigs
|
@@ -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 =
|
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 {
|
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 =
|
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
|
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 =
|
5
|
+
export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
6
6
|
{
|
7
7
|
getInitialContractForm: () => ContractCreateForm
|
8
8
|
getInitialGroupForm: () => ContractGroupCreateForm
|
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"
|
@@ -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 =
|
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
|
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
|
*/
|