@vonq/hapi-elements-types 1.49.0 → 1.51.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/_window/api.types.ts +32 -1
- package/_window/sdk.types.ts +8 -3
- package/_window/service.types.ts +1 -0
- package/_window/state.types.ts +4 -0
- package/_window/utils.types.ts +21 -1
- package/_window/validation.types.ts +2 -0
- package/_window/window.ts +5 -18
- package/alert/enums.ts +1 -0
- package/alert/index.ts +1 -0
- package/alert/index.ts.bak +1 -0
- package/alert/types.ts +7 -0
- package/ats/types.ts +1 -0
- package/basket/service.types.ts +5 -0
- package/basket/utils.types.ts +4 -0
- package/campaign/api.types.ts +13 -1
- package/campaign/service.types.ts +2 -2
- package/campaign/types.ts +53 -4
- package/campaign/utils.types.ts +0 -1
- package/common/events/EventCommand/enums.ts +1 -0
- package/common/logger/types.ts +2 -0
- package/common/types.ts +1 -1
- package/common/validations.types.ts +4 -0
- package/contract/index.ts +9 -8
- package/contract/index.ts.bak +2 -0
- package/contract/service.types.ts +8 -3
- package/contract/state.types.ts +1 -0
- package/contract/types.ts +2 -0
- package/contract/utils.types.ts +7 -0
- package/experimental/api.types.ts +2 -16
- package/experimental/index.ts +3 -3
- package/experimental/index.ts.bak +5 -0
- package/experimental/service.types.ts +1 -36
- package/experimental/state.types.ts +0 -15
- package/index.ts +17 -16
- package/index.ts.bak +1 -0
- package/modal/enums.ts +1 -0
- package/modal/service.types.ts +2 -4
- package/modal/types.ts +10 -8
- package/orderJourney/service.types.ts +37 -4
- package/orderJourney/state.types.ts +18 -0
- package/orderJourney/types.ts +5 -2
- package/orderJourney/utils.types.ts +12 -0
- package/package.json +1 -1
- package/product/api.types.ts +21 -0
- package/product/enums.ts +4 -0
- package/product/index.ts +1 -0
- package/product/index.ts.bak +1 -0
- package/product/service.types.ts +22 -0
- package/product/state.types.ts +11 -0
- package/product/types.ts +45 -0
- package/product/utils.types.ts +14 -2
- package/ui/enums.ts +9 -0
- package/ui/index.ts +4 -0
- package/ui/index.ts.bak +5 -1
- package/ui/service.types.ts +3 -0
- package/ui/state.types.ts +3 -0
- package/ui/types.ts +10 -0
- package/ui/utils.types.ts +10 -0
- package/ui/validations.types.ts +18 -0
- package/experimental/enums.ts +0 -5
- package/experimental/types.ts +0 -14
package/_window/api.types.ts
CHANGED
@@ -18,6 +18,8 @@ import { WindowHapiLogger } from "../common/logger/types"
|
|
18
18
|
import { ATSUserTokenResponse } from "../ats"
|
19
19
|
import { PartialRecord } from "../common"
|
20
20
|
import { WindowHapiAPIExperimental } from "../experimental"
|
21
|
+
import { IAxiosRetryConfig } from "axios-retry"
|
22
|
+
import { AxiosInterceptorOptions } from "axios/index"
|
21
23
|
|
22
24
|
export type WindowHapiAPIModule<ModuleRequests, ModuleConfig> = {
|
23
25
|
propertiesThatShouldNotBeDocumented: string[]
|
@@ -49,6 +51,11 @@ export type WindowHapiAPIRefreshJWTTokenHandler = () => Promise<
|
|
49
51
|
|
50
52
|
export type WindowHapiAPIValidateJWTTokenHandler = () => Promise<boolean>
|
51
53
|
|
54
|
+
export type WindowHapiAPIOnAfterResponseFullfilledHandler = (
|
55
|
+
value: AxiosResponse,
|
56
|
+
) => AxiosResponse | Promise<AxiosResponse>
|
57
|
+
export type WindowHapiAPIOnAfterResponseRejectedHandler = (error: any) => any
|
58
|
+
|
52
59
|
export type WindowHapiAPIModules = {
|
53
60
|
[WindowHapiModuleName.contract]: WindowHapiAPIContract
|
54
61
|
[WindowHapiModuleName.wallet]: WindowHapiAPIWallet
|
@@ -58,7 +65,15 @@ export type WindowHapiAPIModules = {
|
|
58
65
|
[WindowHapiModuleName.experimental]: WindowHapiAPIExperimental
|
59
66
|
}
|
60
67
|
|
61
|
-
type
|
68
|
+
export type WindowHapiModuleConfig = {
|
69
|
+
key: keyof WindowHapiAPIModules
|
70
|
+
configs: Record<string, RawAxiosRequestConfig>
|
71
|
+
}
|
72
|
+
|
73
|
+
export type WindowHapiAPIFlattenedModuleConfig = {
|
74
|
+
key: string
|
75
|
+
config: RawAxiosRequestConfig
|
76
|
+
}
|
62
77
|
|
63
78
|
export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
64
79
|
{
|
@@ -74,6 +89,11 @@ export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
|
74
89
|
) => void
|
75
90
|
propertiesThatShouldNotBeDocumented: string[]
|
76
91
|
mergePropertiesThatShouldNotBeDocumented: (klass: any) => void
|
92
|
+
responseInterceptorId: number | null
|
93
|
+
responseInterceptorOptions: AxiosInterceptorOptions | null
|
94
|
+
onAfterResponseFulfilledHandler: WindowHapiAPIOnAfterResponseFullfilledHandler | null
|
95
|
+
onAfterResponseRejectedHandler: WindowHapiAPIOnAfterResponseRejectedHandler | null
|
96
|
+
retryOptions: IAxiosRetryConfig
|
77
97
|
request: <T = any, R = AxiosResponse<T>, D = any>(
|
78
98
|
config: Partial<HapiRequestConfig<D>>,
|
79
99
|
) => Promise<R>
|
@@ -93,6 +113,7 @@ export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
|
93
113
|
config: Partial<HapiRequestConfig<D>>,
|
94
114
|
) => Promise<R>
|
95
115
|
jwtHeaderKey: string
|
116
|
+
jwtHeaderValuePrefix: string
|
96
117
|
jwtRefreshIntervalInSeconds: number
|
97
118
|
setJWTRefreshIntervalInSeconds: (seconds: number) => void
|
98
119
|
jwtRefreshInterval: number | undefined
|
@@ -123,6 +144,16 @@ export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
|
123
144
|
functionType?: string,
|
124
145
|
) => void
|
125
146
|
modules: WindowHapiAPIModules
|
147
|
+
addResponseInterceptorToAxiosInstance: () => void
|
148
|
+
removeResponseInterceptorFromAxiosInstance: (
|
149
|
+
interceptorId: number,
|
150
|
+
) => void
|
151
|
+
setJWTHeaderValuePrefix: (prefix: string) => void
|
152
|
+
setJWTHeaderKey: (key: string) => void
|
153
|
+
getModuleConfigs: () => WindowHapiModuleConfig[]
|
154
|
+
getFlattenedModuleConfigs: () => WindowHapiAPIFlattenedModuleConfig[]
|
155
|
+
getFlattenedModuleConfigURLs: () => string[]
|
156
|
+
getFlattenedModuleConfigURLPaths: () => string[]
|
126
157
|
} & WindowHapiAPIModules,
|
127
158
|
{ readonly core: WindowHapiClassInterface }
|
128
159
|
>
|
package/_window/sdk.types.ts
CHANGED
@@ -51,6 +51,10 @@ import {
|
|
51
51
|
WindowHapiServiceExperimental,
|
52
52
|
} from "../experimental"
|
53
53
|
import { ExperimentalState } from "../experimental/state.types"
|
54
|
+
import { ProductCacheState } from "../product/state.cache.types"
|
55
|
+
import { WindowHapiValidationsUI } from "../ui/validations.types"
|
56
|
+
import { WindowHapiUtilsUI } from "../ui/utils.types"
|
57
|
+
import { UIState } from "types/ui/state.types"
|
54
58
|
|
55
59
|
export type WindowHapiSDKModule<
|
56
60
|
APIModule,
|
@@ -118,7 +122,7 @@ export type WindowHapiSDKProduct = WindowHapiSDKModule<
|
|
118
122
|
WindowHapiAPIProduct,
|
119
123
|
WindowHapiServiceProduct,
|
120
124
|
WindowHapiValidationsProduct,
|
121
|
-
WindowHapiStateModule<ProductState>,
|
125
|
+
WindowHapiStateModule<ProductState, ProductCacheState>,
|
122
126
|
WindowHapiUtilsProduct
|
123
127
|
>
|
124
128
|
export type WindowHapiSDKTheming = WindowHapiSDKModule<
|
@@ -136,8 +140,9 @@ export type WindowHapiSDKWallet = WindowHapiSDKModule<
|
|
136
140
|
export type WindowHapiSDKUI = WindowHapiSDKModule<
|
137
141
|
undefined,
|
138
142
|
WindowHapiServiceUI,
|
139
|
-
|
140
|
-
|
143
|
+
WindowHapiValidationsUI,
|
144
|
+
WindowHapiStateModule<UIState>,
|
145
|
+
WindowHapiUtilsUI
|
141
146
|
>
|
142
147
|
export type WindowHapiSDKATS = WindowHapiSDKModule<
|
143
148
|
WindowHapiAPIATS,
|
package/_window/service.types.ts
CHANGED
@@ -28,6 +28,7 @@ export type HapiServiceFunctionLifecycleHookHandler = (
|
|
28
28
|
) => void
|
29
29
|
|
30
30
|
export type HapiServiceFunctionWithLifecycleHooks<HandlerType> = {
|
31
|
+
functionName: string
|
31
32
|
run: HandlerType
|
32
33
|
runWithoutSDKUsageLog: HandlerType
|
33
34
|
onStart: HapiServiceFunctionLifecycleHookHandler
|
package/_window/state.types.ts
CHANGED
@@ -6,6 +6,7 @@ import { DebuggingState } from "../debugging/state.types"
|
|
6
6
|
import { LanguageState } from "../language/state.types"
|
7
7
|
import { ProductState } from "../product/state.types"
|
8
8
|
import { ThemingState } from "../theming/state.types"
|
9
|
+
import { UIState } from "types/ui/state.types"
|
9
10
|
import { OrderJourneyState } from "../orderJourney/state.types"
|
10
11
|
import { WalletState } from "../wallet/state.types"
|
11
12
|
import { ModalState } from "../modal/state.types"
|
@@ -46,6 +47,7 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
46
47
|
ProductCacheState
|
47
48
|
>
|
48
49
|
[WindowHapiModuleName.theming]: WindowHapiStateModule<ThemingState>
|
50
|
+
[WindowHapiModuleName.ui]: WindowHapiStateModule<UIState>
|
49
51
|
[WindowHapiModuleName.orderJourney]: WindowHapiStateModule<OrderJourneyState>
|
50
52
|
[WindowHapiModuleName.wallet]: WindowHapiStateModule<WalletState>
|
51
53
|
[WindowHapiModuleName.modal]: WindowHapiStateModule<ModalState>
|
@@ -75,6 +77,7 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
75
77
|
ProductCacheState
|
76
78
|
>
|
77
79
|
[WindowHapiModuleName.theming]: WindowHapiStateModule<ThemingState>
|
80
|
+
[WindowHapiModuleName.ui]: WindowHapiStateModule<UIState>
|
78
81
|
[WindowHapiModuleName.orderJourney]: WindowHapiStateModule<OrderJourneyState>
|
79
82
|
[WindowHapiModuleName.wallet]: WindowHapiStateModule<WalletState>
|
80
83
|
[WindowHapiModuleName.modal]: WindowHapiStateModule<ModalState>
|
@@ -98,6 +101,7 @@ export type WindowHapiStatesJSON = {
|
|
98
101
|
[WindowHapiModuleName.language]: LanguageState
|
99
102
|
[WindowHapiModuleName.product]: ProductState
|
100
103
|
[WindowHapiModuleName.theming]: ThemingState
|
104
|
+
[WindowHapiModuleName.ui]: UIState
|
101
105
|
[WindowHapiModuleName.orderJourney]: OrderJourneyState
|
102
106
|
[WindowHapiModuleName.wallet]: WalletState
|
103
107
|
[WindowHapiModuleName.modal]: ModalState
|
package/_window/utils.types.ts
CHANGED
@@ -13,7 +13,8 @@ import { WindowHapiUtilsRouter } from "../routing/utils.types"
|
|
13
13
|
import { WindowHapiUtilsLanguage } from "../language/utils.types"
|
14
14
|
import { WindowHapiUtilsAlert } from "../alert/utils.types"
|
15
15
|
|
16
|
-
import { FlattenedItem, WindowHapiLogger } from "../common"
|
16
|
+
import { FlattenedItem, WindowHapiLogger, WindowHapiTimer } from "../common"
|
17
|
+
import { WindowHapiUtilsUI } from "../ui/utils.types"
|
17
18
|
|
18
19
|
export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
19
20
|
{
|
@@ -44,6 +45,23 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
44
45
|
) => any[]
|
45
46
|
getComponentNameIndexSuffix: (instanceName: string) => string
|
46
47
|
getIframeLoadingSpinner: () => HTMLDivElement
|
48
|
+
timeoutIds: WindowHapiTimer[]
|
49
|
+
intervalIds: WindowHapiTimer[]
|
50
|
+
setTimeout: (
|
51
|
+
callingFunctionName: string,
|
52
|
+
handler: TimerHandler,
|
53
|
+
timeout?: number,
|
54
|
+
...args: any[]
|
55
|
+
) => number
|
56
|
+
setInterval: (
|
57
|
+
callingFunctionName: string,
|
58
|
+
handler: TimerHandler,
|
59
|
+
timeout?: number,
|
60
|
+
...args: any[]
|
61
|
+
) => number
|
62
|
+
clearTimeout: (id: number) => void
|
63
|
+
clearInterval: (id: number) => void
|
64
|
+
clearAllTimers: () => void
|
47
65
|
product: WindowHapiUtilsProduct
|
48
66
|
contract: WindowHapiUtilsContract
|
49
67
|
campaign: WindowHapiUtilsCampaign
|
@@ -53,6 +71,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
53
71
|
router: WindowHapiUtilsRouter
|
54
72
|
language: WindowHapiUtilsLanguage
|
55
73
|
alert: WindowHapiUtilsAlert
|
74
|
+
ui: WindowHapiUtilsUI
|
56
75
|
|
57
76
|
utilities: {
|
58
77
|
[WindowHapiModuleName.basket]: WindowHapiUtilsBasket
|
@@ -64,6 +83,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
64
83
|
[WindowHapiModuleName.router]: WindowHapiUtilsRouter
|
65
84
|
[WindowHapiModuleName.language]: WindowHapiUtilsLanguage
|
66
85
|
[WindowHapiModuleName.alert]: WindowHapiUtilsAlert
|
86
|
+
[WindowHapiModuleName.ui]: WindowHapiUtilsUI
|
67
87
|
}
|
68
88
|
},
|
69
89
|
{ readonly core: WindowHapiClassInterface }
|
@@ -13,6 +13,7 @@ import { WindowHapiValidationsWallet } from "../wallet/validations.types"
|
|
13
13
|
import { WindowHapiValidationsTheming } from "../theming/validations.types"
|
14
14
|
import { WindowHapiValidationsLanguage } from "../language/validations.types"
|
15
15
|
import { WindowHapiValidationsOrderJourney } from "../orderJourney/validations.types"
|
16
|
+
import { WindowHapiValidationsUI } from "../ui/validations.types"
|
16
17
|
|
17
18
|
export type WindowHapiValidations = WindowHapiModuleWithConstructorArgs<
|
18
19
|
{
|
@@ -27,6 +28,7 @@ export type WindowHapiValidations = WindowHapiModuleWithConstructorArgs<
|
|
27
28
|
[WindowHapiModuleName.theming]: WindowHapiValidationsTheming
|
28
29
|
[WindowHapiModuleName.language]: WindowHapiValidationsLanguage
|
29
30
|
[WindowHapiModuleName.orderJourney]: WindowHapiValidationsOrderJourney
|
31
|
+
[WindowHapiModuleName.ui]: WindowHapiValidationsUI
|
30
32
|
throwError: (error: string | undefined) => void
|
31
33
|
throwHasNoSetterError: (propertyName: string) => void
|
32
34
|
checkAndThrowArgumentUndefinedOrInvalidTypeError: (
|
package/_window/window.ts
CHANGED
@@ -87,7 +87,7 @@ export type WindowHapiQASubmodule = WindowHapiModuleWithConstructorArgs<
|
|
87
87
|
{ readonly core: WindowHapiClassInterface }
|
88
88
|
>
|
89
89
|
|
90
|
-
export type
|
90
|
+
export type WindowHapiConfigBase = {
|
91
91
|
apiHost: string
|
92
92
|
partnerToken: string //used for impersonation purposes
|
93
93
|
clientToken: string
|
@@ -102,35 +102,22 @@ export type WindowHapiInjectorConfig = {
|
|
102
102
|
debugPanelPosition: DebugPanelPosition
|
103
103
|
testMode: boolean
|
104
104
|
debugMode: boolean
|
105
|
-
walletCurrency: ProductPriceCurrency
|
105
|
+
walletCurrency: ProductPriceCurrency | undefined
|
106
106
|
}
|
107
107
|
|
108
|
+
export type WindowHapiInjectorConfig = {} & WindowHapiConfigBase
|
109
|
+
|
108
110
|
export type WindowHapiConfigSubmodule = {
|
109
|
-
apiHost: string
|
110
111
|
initialState: RecursivePartial<any>
|
111
|
-
partnerToken: string
|
112
|
-
clientToken: string
|
113
112
|
loadingSpinnerDefaultFillColor: string
|
114
|
-
appOrigin: string
|
115
|
-
docsOrigin: string
|
116
|
-
enableLogs: boolean
|
117
|
-
enableRemoteLogs: boolean
|
118
113
|
webComponents: HapiWebComponent[]
|
119
114
|
isInvalidToken: boolean
|
120
|
-
useJWTAuthHeaders: boolean
|
121
|
-
addModal: boolean
|
122
|
-
addAlertBar: boolean
|
123
|
-
addDebugPanel: boolean
|
124
|
-
debugPanelPosition: DebugPanelPosition
|
125
115
|
env: string
|
126
116
|
appVersion: string
|
127
|
-
testMode: boolean
|
128
|
-
debugMode: boolean
|
129
117
|
htmlTemplates: Record<string, string>
|
130
|
-
walletCurrency: ProductPriceCurrency
|
131
118
|
isUsingGETMethod: boolean
|
132
119
|
featureBranches: HapiFeatureBranch[]
|
133
|
-
}
|
120
|
+
} & WindowHapiConfigBase
|
134
121
|
|
135
122
|
export type WindowPropertiesMap = {
|
136
123
|
windowKey: WindowHapiSubmoduleName
|
package/alert/enums.ts
CHANGED
@@ -19,6 +19,7 @@ export enum AlertKey {
|
|
19
19
|
productRemoveFromBasket = "remove-product-from-basket-warning",
|
20
20
|
utmCodeConfirmation = "utm-code-confirmation",
|
21
21
|
campaignAISmartfillFailedError = "campaign-ai-smartfill-failed-error",
|
22
|
+
productSearchFiltersAISmartfillFailedError = "product-search-filters-ai-smartfill-failed-error",
|
22
23
|
}
|
23
24
|
|
24
25
|
export enum AlertType {
|
package/alert/index.ts
CHANGED
package/alert/index.ts.bak
CHANGED
package/alert/types.ts
CHANGED
@@ -45,11 +45,16 @@ export type UTMCodesSuccessAlertProps = {
|
|
45
45
|
}
|
46
46
|
|
47
47
|
export type CampaignAISmartfillFailedAlertProps = {}
|
48
|
+
export type ProductSearchFiltersAISmartfillFailedAlertProps = {}
|
48
49
|
|
49
50
|
export type ButtonCopySuccessAlertProps = {}
|
50
51
|
|
51
52
|
export type CampaignOrderSuccessAlertProps = {}
|
52
53
|
|
54
|
+
export type CampaignOrderFailAlertProps = {
|
55
|
+
errorMessage?: string
|
56
|
+
}
|
57
|
+
|
53
58
|
export type CampaignCopySuccessAlertProps = {}
|
54
59
|
|
55
60
|
export type CampaignCopyProductsContractsDeletedWarningAlertProps = {}
|
@@ -73,6 +78,8 @@ export type AlertProps = AnyNonFunction<
|
|
73
78
|
| CampaignTakeOfflineSuccessAlertProps
|
74
79
|
| ProductAddToBasketSuccessAlertProps
|
75
80
|
| ProductRemoveFromBasketWarningAlertProps
|
81
|
+
| CampaignAISmartfillFailedAlertProps
|
82
|
+
| ProductSearchFiltersAISmartfillFailedAlertProps
|
76
83
|
>
|
77
84
|
|
78
85
|
export type Alert = {
|
package/ats/types.ts
CHANGED
package/basket/service.types.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
WindowHapiService,
|
7
7
|
} from "../_window/service.types"
|
8
8
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
|
+
import { ModalKeys } from "types/modal"
|
9
10
|
|
10
11
|
export type BasketServiceGetProductsHandler = (
|
11
12
|
products: BasketProduct[],
|
@@ -23,6 +24,9 @@ export type BasketServiceRemoveContractsWithConflictingGroupsHandler = (
|
|
23
24
|
contractThatUserTriedToAdd: Contract,
|
24
25
|
) => void
|
25
26
|
export type BasketServiceKeepContractsWithConflictingGroupsHandler = () => void
|
27
|
+
export type BasketServiceRemoveProductOrContractFromBeingAddedRemovedHandler = (
|
28
|
+
contractOrProductId: string,
|
29
|
+
) => void
|
26
30
|
export type BasketServiceSetProductsMetaHandler = (
|
27
31
|
meta: BasketProduct[],
|
28
32
|
) => void
|
@@ -40,6 +44,7 @@ export type WindowHapiServiceBasket = WindowHapiModuleWithConstructorArgs<
|
|
40
44
|
removeProductOrContractById: HapiServiceFunctionWithLifecycleHooks<BasketServiceRemoveProductOrContractByIdHandler>
|
41
45
|
removeContractsWithConflictingGroups: HapiServiceFunctionWithLifecycleHooks<BasketServiceRemoveContractsWithConflictingGroupsHandler>
|
42
46
|
keepContractsWithConflictingGroups: HapiServiceFunctionWithLifecycleHooks<BasketServiceKeepContractsWithConflictingGroupsHandler>
|
47
|
+
removeProductOrContractFromBeingAddedRemoved: HapiServiceFunctionWithLifecycleHooks<BasketServiceRemoveProductOrContractFromBeingAddedRemovedHandler>
|
43
48
|
clear: () => BasketProduct[]
|
44
49
|
},
|
45
50
|
{ readonly service: WindowHapiService }
|
package/basket/utils.types.ts
CHANGED
@@ -22,6 +22,10 @@ export type WindowHapiUtilsBasket = WindowHapiModuleWithConstructorArgs<
|
|
22
22
|
product: Product | Contract,
|
23
23
|
displayCurrency: ProductPriceCurrency,
|
24
24
|
) => ProductPrice | undefined
|
25
|
+
getBasketProductOriginalPrice: (
|
26
|
+
product: Product | Contract,
|
27
|
+
displayCurrency: ProductPriceCurrency,
|
28
|
+
) => ProductPrice | undefined
|
25
29
|
getBasketProductBoardType: (
|
26
30
|
product: Product | Contract,
|
27
31
|
) => ProductBoardType | undefined
|
package/campaign/api.types.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import { AxiosRequestConfig } from "axios"
|
2
2
|
import {
|
3
3
|
Campaign,
|
4
|
+
CampaignApplication,
|
5
|
+
CampaignApplicationFileGenerated,
|
4
6
|
CampaignEditRequestBody,
|
5
7
|
CampaignIdResponse,
|
6
8
|
CampaignOrderRequestBody,
|
@@ -16,13 +18,15 @@ import {
|
|
16
18
|
} from "./types"
|
17
19
|
import { ProductSupportingContractsComplete } from "../product/types"
|
18
20
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
19
|
-
import { PaginatedAPIResponseV2 } from "../common/types"
|
21
|
+
import { PaginatedAPIResponseV1, PaginatedAPIResponseV2 } from "../common/types"
|
20
22
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
21
23
|
|
22
24
|
export type WindowHapiAPICampaignConfigs = {
|
23
25
|
getCampaigns: AxiosRequestConfig
|
24
26
|
getCampaign: AxiosRequestConfig
|
25
27
|
getCampaignDetail: AxiosRequestConfig
|
28
|
+
getCampaignApplications: AxiosRequestConfig
|
29
|
+
generateCampaignApplicationFile: AxiosRequestConfig
|
26
30
|
setCampaignCancellation: AxiosRequestConfig
|
27
31
|
getEducationLevels: AxiosRequestConfig
|
28
32
|
getSeniorities: AxiosRequestConfig
|
@@ -51,6 +55,14 @@ export type WindowHapiAPICampaignRequests = {
|
|
51
55
|
campaignId: string,
|
52
56
|
detail: "status",
|
53
57
|
) => Promise<ProductSupportingContractsComplete>
|
58
|
+
getCampaignApplications: (
|
59
|
+
campaignId: string,
|
60
|
+
) => Promise<PaginatedAPIResponseV1<CampaignApplication>>
|
61
|
+
generateCampaignApplicationFile: (
|
62
|
+
campaignId: string,
|
63
|
+
applicationId: string,
|
64
|
+
filename: string,
|
65
|
+
) => Promise<CampaignApplicationFileGenerated>
|
54
66
|
setCampaignCancellation: (
|
55
67
|
campaignId: string,
|
56
68
|
body: Partial<Campaign>,
|
@@ -82,9 +82,10 @@ export type CampaignServiceGetEmploymentTypesHandler = () => Promise<
|
|
82
82
|
TaxonomyEmploymentTypes[]
|
83
83
|
>
|
84
84
|
export type CampaignServiceCreateSuggestionOfPostingRequirementsHandler = (
|
85
|
-
|
85
|
+
contractOrProductId: string | number,
|
86
86
|
customDescription?: string,
|
87
87
|
customContextObject?: Record<string, any>,
|
88
|
+
isProduct?: boolean,
|
88
89
|
) => Promise<CampaignPostingRequirementsSuggestionCreateRequestResponse>
|
89
90
|
export type CampaignServiceGetSuggestionOfPostingRequirementsHandler = (
|
90
91
|
taskId: string,
|
@@ -95,7 +96,6 @@ export type CampaignServiceCreateSuggestionOfVacancyFieldsHandler = (
|
|
95
96
|
) => Promise<CampaignVacancyFieldsSuggestionCreateRequestResponse>
|
96
97
|
export type CampaignServiceGetSuggestionOfVacancyFieldsHandler = (
|
97
98
|
taskId: string,
|
98
|
-
excludedDotNotatedObjectPathsOfCampaignForm?: string[],
|
99
99
|
) => Promise<CampaignVacancyFieldsSuggestionsGetRequestResponse>
|
100
100
|
|
101
101
|
export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
package/campaign/types.ts
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import {
|
2
|
+
ProductCPA,
|
3
|
+
ProductDuration,
|
4
|
+
ProductIndustry,
|
5
|
+
ProductJobFunctionPartial,
|
6
|
+
} from "../product/types"
|
7
|
+
import {
|
8
|
+
ProductCPAHiringGoalUnit,
|
9
|
+
ProductPriceCurrency,
|
10
|
+
} from "../product/enums"
|
3
11
|
import { EmploymentType, SalaryPeriod } from "./enums"
|
4
12
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
5
13
|
import {
|
@@ -20,6 +28,8 @@ export type CampaignProductSpecs = {
|
|
20
28
|
status: CampaignStatus
|
21
29
|
utm: string | null
|
22
30
|
statusDescription: string | null
|
31
|
+
metadata?: CampaignMetadata
|
32
|
+
orderedCpa?: ProductCPA
|
23
33
|
}
|
24
34
|
|
25
35
|
export type CampaignProductStatus = {
|
@@ -97,6 +107,7 @@ export type CampaignPosting = {
|
|
97
107
|
clicks: number
|
98
108
|
name: string
|
99
109
|
productId: string
|
110
|
+
cpaResults?: Record<ProductCPAHiringGoalUnit, number>
|
100
111
|
}
|
101
112
|
|
102
113
|
export type CampaignRecruiterInfo = {
|
@@ -163,6 +174,8 @@ export type CampaignDraftV2 = {
|
|
163
174
|
}
|
164
175
|
}
|
165
176
|
|
177
|
+
export type CampaignMetadata = Record<string, any>
|
178
|
+
|
166
179
|
export type Campaign = Pick<CampaignDraft, "campaignId"> &
|
167
180
|
CampaignDraftOldBackwardsCompatability &
|
168
181
|
CampaignDraftV2 & {
|
@@ -187,6 +200,7 @@ export type Campaign = Pick<CampaignDraft, "campaignId"> &
|
|
187
200
|
detailedStatus?: CampaignDetailedStatus //this is only added virtually on FE on demand
|
188
201
|
isEditable: boolean
|
189
202
|
modifiedOn: string
|
203
|
+
metadata?: CampaignMetadata
|
190
204
|
}
|
191
205
|
|
192
206
|
export type CampaignCreateFormTargetGroupEducationLevel =
|
@@ -303,6 +317,18 @@ export type CampaignOrderRequestBody = {
|
|
303
317
|
currency?: ProductPriceCurrency
|
304
318
|
}
|
305
319
|
|
320
|
+
export type CampaignOrderRequestBodyProvidedBySmartFill = Omit<
|
321
|
+
CampaignOrderRequestBody,
|
322
|
+
"targetGroup"
|
323
|
+
> & {
|
324
|
+
taxonomy: {
|
325
|
+
industry: ProductIndustry
|
326
|
+
seniority: TaxonomyEducationAndSeniorityLevel
|
327
|
+
jobFunction: ProductJobFunctionPartial
|
328
|
+
educationLevel: TaxonomyEducationAndSeniorityLevel
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
306
332
|
export type CampaignEditRequestBody = Omit<
|
307
333
|
CampaignOrderRequestBody,
|
308
334
|
| "walletId"
|
@@ -373,7 +399,8 @@ export type CampaignIdResponse = {
|
|
373
399
|
}
|
374
400
|
|
375
401
|
export type CampaignPostingRequirementsSuggestionCreateRequest = {
|
376
|
-
contract_id
|
402
|
+
contract_id?: string | number
|
403
|
+
product_id?: string | number
|
377
404
|
context: {
|
378
405
|
structured: Record<string, any>
|
379
406
|
unstructured: string
|
@@ -405,6 +432,7 @@ export type CampaignPostingRequirementsSuggestionsGetRequestResponse = {
|
|
405
432
|
id: string
|
406
433
|
status: CampaignSuggestionStatus
|
407
434
|
contract_id: string
|
435
|
+
product_id: string
|
408
436
|
channel_id: string
|
409
437
|
created_at: string
|
410
438
|
updated_at: string
|
@@ -416,5 +444,26 @@ export type CampaignVacancyFieldsSuggestionsGetRequestResponse = {
|
|
416
444
|
status: CampaignSuggestionStatus
|
417
445
|
created_at: string
|
418
446
|
updated_at: string
|
419
|
-
prefill_data: RecursivePartial<
|
447
|
+
prefill_data: RecursivePartial<CampaignOrderRequestBodyProvidedBySmartFill>
|
448
|
+
}
|
449
|
+
|
450
|
+
export type CampaignApplicationFile = {
|
451
|
+
type: string
|
452
|
+
mimeType: string
|
453
|
+
filename: string
|
454
|
+
}
|
455
|
+
|
456
|
+
export type CampaignApplicationFileGenerated = {
|
457
|
+
filename: string
|
458
|
+
url: string
|
459
|
+
generated_at: string
|
460
|
+
}
|
461
|
+
|
462
|
+
export type CampaignApplication = {
|
463
|
+
id: string
|
464
|
+
name: string
|
465
|
+
email: string
|
466
|
+
phone: string
|
467
|
+
files: CampaignApplicationFile[]
|
468
|
+
updated: string
|
420
469
|
}
|
package/campaign/utils.types.ts
CHANGED
@@ -48,6 +48,7 @@ export enum WindowHapiEventCommandName {
|
|
48
48
|
domSlotAvailable = "dom:slot-available",
|
49
49
|
domElementMounted = "dom:element-mounted",
|
50
50
|
domElementUnmounted = "dom:element-unmounted",
|
51
|
+
domChangeIcons = "dom:change-icons",
|
51
52
|
|
52
53
|
/* Location */
|
53
54
|
locationSetHref = "location:href",
|
package/common/logger/types.ts
CHANGED
package/common/types.ts
CHANGED
@@ -119,7 +119,6 @@ export type HapiWebComponent = {
|
|
119
119
|
// some widgets have query params, we need to mock them
|
120
120
|
qaMockQueryParams?: Record<string, string>
|
121
121
|
optionalAttributes?: string[]
|
122
|
-
enableNextJSDivScroll?: boolean
|
123
122
|
loadingLazyIframe?: boolean
|
124
123
|
isHiddenOnDocumentation?: boolean
|
125
124
|
// isProxyToOtherWidget exists to properly resize iframe
|
@@ -297,6 +296,7 @@ export type HapiFeatureBranch = {
|
|
297
296
|
changelogUrls: { url: string; scope: string }[]
|
298
297
|
releaseDate: string
|
299
298
|
}
|
299
|
+
|
300
300
|
export type FlattenedItem = { label: string; value: any }
|
301
301
|
|
302
302
|
export type StringifiedJSON<T> = string
|
@@ -16,6 +16,8 @@ import {
|
|
16
16
|
} from "zod"
|
17
17
|
import { Validators } from "./validator"
|
18
18
|
|
19
|
+
import { HapiUIIconType } from "../ui"
|
20
|
+
|
19
21
|
export type ZodIntlDescriptor = ZodObject<{
|
20
22
|
id: ZodString
|
21
23
|
defaultMessage: ZodString
|
@@ -56,6 +58,7 @@ export type ZodPaginationResponseV2 = ZodObject<
|
|
56
58
|
meta: ZodOptional<ZodPaginationMeta>
|
57
59
|
} & ZodPaginationLimitOffsetDefinition
|
58
60
|
>
|
61
|
+
|
59
62
|
export type WindowHapiValidationsCommon = {
|
60
63
|
genericBoolean: ZodBoolean
|
61
64
|
genericNumber: ZodNumber
|
@@ -73,6 +76,7 @@ export type WindowHapiValidationsCommon = {
|
|
73
76
|
genericBooleanOrNull: ZodNullable<ZodBoolean>
|
74
77
|
genericRecordAny: ZodRecord<ZodString, ZodAny>
|
75
78
|
genericNullableRecordAny: ZodNullable<ZodRecord<ZodString, ZodAny>>
|
79
|
+
genericNullableRecordBoolean: ZodNullable<ZodRecord<ZodString, ZodBoolean>>
|
76
80
|
genericRecordString: ZodRecord<ZodString, ZodString>
|
77
81
|
genericStringOrNumber: ZodUnion<[ZodNumber, ZodString]>
|
78
82
|
genericNullableStringOrNumber: ZodNullable<ZodUnion<[ZodNumber, ZodString]>>
|
package/contract/index.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
7
|
-
export * from
|
8
|
-
export * from
|
9
|
-
export * from
|
10
|
-
export * from
|
3
|
+
export * from './api.types';
|
4
|
+
export * from './enums';
|
5
|
+
export * from './qa.types';
|
6
|
+
export * from './service.types';
|
7
|
+
export * from './state.cache.types';
|
8
|
+
export * from './state.types';
|
9
|
+
export * from './types';
|
10
|
+
export * from './utils.types';
|
11
|
+
export * from './validations.types';
|
package/contract/index.ts.bak
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
3
|
export * from './api.types';
|
4
|
+
export * from './enums';
|
4
5
|
export * from './qa.types';
|
5
6
|
export * from './service.types';
|
7
|
+
export * from './state.cache.types';
|
6
8
|
export * from './state.types';
|
7
9
|
export * from './types';
|
8
10
|
export * from './utils.types';
|