@vonq/hapi-elements-types 1.49.0 → 1.50.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 +6 -2
- package/_window/utils.types.ts +3 -0
- 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 +3 -0
- package/ats/types.ts +1 -0
- package/basket/utils.types.ts +4 -0
- package/campaign/service.types.ts +2 -2
- package/campaign/types.ts +21 -3
- package/campaign/utils.types.ts +0 -1
- package/common/events/EventCommand/enums.ts +1 -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/service.types.ts +2 -4
- package/modal/types.ts +2 -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/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 +39 -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/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,9 @@ 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"
|
54
57
|
|
55
58
|
export type WindowHapiSDKModule<
|
56
59
|
APIModule,
|
@@ -118,7 +121,7 @@ export type WindowHapiSDKProduct = WindowHapiSDKModule<
|
|
118
121
|
WindowHapiAPIProduct,
|
119
122
|
WindowHapiServiceProduct,
|
120
123
|
WindowHapiValidationsProduct,
|
121
|
-
WindowHapiStateModule<ProductState>,
|
124
|
+
WindowHapiStateModule<ProductState, ProductCacheState>,
|
122
125
|
WindowHapiUtilsProduct
|
123
126
|
>
|
124
127
|
export type WindowHapiSDKTheming = WindowHapiSDKModule<
|
@@ -136,8 +139,9 @@ export type WindowHapiSDKWallet = WindowHapiSDKModule<
|
|
136
139
|
export type WindowHapiSDKUI = WindowHapiSDKModule<
|
137
140
|
undefined,
|
138
141
|
WindowHapiServiceUI,
|
142
|
+
WindowHapiValidationsUI,
|
139
143
|
undefined,
|
140
|
-
|
144
|
+
WindowHapiUtilsUI
|
141
145
|
>
|
142
146
|
export type WindowHapiSDKATS = WindowHapiSDKModule<
|
143
147
|
WindowHapiAPIATS,
|
package/_window/utils.types.ts
CHANGED
@@ -14,6 +14,7 @@ import { WindowHapiUtilsLanguage } from "../language/utils.types"
|
|
14
14
|
import { WindowHapiUtilsAlert } from "../alert/utils.types"
|
15
15
|
|
16
16
|
import { FlattenedItem, WindowHapiLogger } from "../common"
|
17
|
+
import { WindowHapiUtilsUI } from "../ui/utils.types"
|
17
18
|
|
18
19
|
export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
19
20
|
{
|
@@ -53,6 +54,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
53
54
|
router: WindowHapiUtilsRouter
|
54
55
|
language: WindowHapiUtilsLanguage
|
55
56
|
alert: WindowHapiUtilsAlert
|
57
|
+
ui: WindowHapiUtilsUI
|
56
58
|
|
57
59
|
utilities: {
|
58
60
|
[WindowHapiModuleName.basket]: WindowHapiUtilsBasket
|
@@ -64,6 +66,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
64
66
|
[WindowHapiModuleName.router]: WindowHapiUtilsRouter
|
65
67
|
[WindowHapiModuleName.language]: WindowHapiUtilsLanguage
|
66
68
|
[WindowHapiModuleName.alert]: WindowHapiUtilsAlert
|
69
|
+
[WindowHapiModuleName.ui]: WindowHapiUtilsUI
|
67
70
|
}
|
68
71
|
},
|
69
72
|
{ 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,6 +45,7 @@ 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
|
|
@@ -73,6 +74,8 @@ export type AlertProps = AnyNonFunction<
|
|
73
74
|
| CampaignTakeOfflineSuccessAlertProps
|
74
75
|
| ProductAddToBasketSuccessAlertProps
|
75
76
|
| ProductRemoveFromBasketWarningAlertProps
|
77
|
+
| CampaignAISmartfillFailedAlertProps
|
78
|
+
| ProductSearchFiltersAISmartfillFailedAlertProps
|
76
79
|
>
|
77
80
|
|
78
81
|
export type Alert = {
|
package/ats/types.ts
CHANGED
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
|
@@ -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,4 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
ProductDuration,
|
3
|
+
ProductIndustry,
|
4
|
+
ProductJobFunctionPartial,
|
5
|
+
} from "../product/types"
|
2
6
|
import { ProductPriceCurrency } from "../product/enums"
|
3
7
|
import { EmploymentType, SalaryPeriod } from "./enums"
|
4
8
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
@@ -303,6 +307,18 @@ export type CampaignOrderRequestBody = {
|
|
303
307
|
currency?: ProductPriceCurrency
|
304
308
|
}
|
305
309
|
|
310
|
+
export type CampaignOrderRequestBodyProvidedBySmartFill = Omit<
|
311
|
+
CampaignOrderRequestBody,
|
312
|
+
"targetGroup"
|
313
|
+
> & {
|
314
|
+
targetGroup: {
|
315
|
+
industry: ProductIndustry
|
316
|
+
seniority: TaxonomyEducationAndSeniorityLevel
|
317
|
+
jobCategory: ProductJobFunctionPartial
|
318
|
+
educationLevel: TaxonomyEducationAndSeniorityLevel
|
319
|
+
}
|
320
|
+
}
|
321
|
+
|
306
322
|
export type CampaignEditRequestBody = Omit<
|
307
323
|
CampaignOrderRequestBody,
|
308
324
|
| "walletId"
|
@@ -373,7 +389,8 @@ export type CampaignIdResponse = {
|
|
373
389
|
}
|
374
390
|
|
375
391
|
export type CampaignPostingRequirementsSuggestionCreateRequest = {
|
376
|
-
contract_id
|
392
|
+
contract_id?: string | number
|
393
|
+
product_id?: string | number
|
377
394
|
context: {
|
378
395
|
structured: Record<string, any>
|
379
396
|
unstructured: string
|
@@ -405,6 +422,7 @@ export type CampaignPostingRequirementsSuggestionsGetRequestResponse = {
|
|
405
422
|
id: string
|
406
423
|
status: CampaignSuggestionStatus
|
407
424
|
contract_id: string
|
425
|
+
product_id: string
|
408
426
|
channel_id: string
|
409
427
|
created_at: string
|
410
428
|
updated_at: string
|
@@ -416,5 +434,5 @@ export type CampaignVacancyFieldsSuggestionsGetRequestResponse = {
|
|
416
434
|
status: CampaignSuggestionStatus
|
417
435
|
created_at: string
|
418
436
|
updated_at: string
|
419
|
-
prefill_data: RecursivePartial<
|
437
|
+
prefill_data: RecursivePartial<CampaignOrderRequestBodyProvidedBySmartFill>
|
420
438
|
}
|
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/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';
|
@@ -7,13 +7,14 @@ import {
|
|
7
7
|
Contract,
|
8
8
|
ContractCredential,
|
9
9
|
ContractDirectApplyChannelPrefillVariablesMap,
|
10
|
-
ContractGroup,
|
11
10
|
ContractDirectApplyPostingRequirementQuestionnaireQuestionBody,
|
12
|
-
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
11
|
ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
|
+
ContractGroup,
|
14
14
|
} from "./types"
|
15
15
|
import {
|
16
16
|
PaginatedAPIResponseV1,
|
17
|
+
PaginationResponseV1,
|
17
18
|
PostingRequirementOption,
|
18
19
|
PostingRequirementsAutocompleteRequestOption,
|
19
20
|
TransformedPostingRequirement,
|
@@ -21,7 +22,6 @@ import {
|
|
21
22
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
22
23
|
import { Modals } from "../modal"
|
23
24
|
import { ContractDirectApplyChannelName } from "./enums"
|
24
|
-
import { ProductSupportingContractsComplete } from "../product"
|
25
25
|
import { OrderJourneyChannelPostingRequirementsStepOptions } from "../orderJourney"
|
26
26
|
|
27
27
|
export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
@@ -33,6 +33,7 @@ export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
|
33
33
|
export type ContractServiceGetContractsHandler = (
|
34
34
|
offset: number,
|
35
35
|
queryParams?: URLSearchParams,
|
36
|
+
shouldAppendResults?: boolean,
|
36
37
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
37
38
|
|
38
39
|
export type ContractServiceGetFilteredContractsHandler = (
|
@@ -118,6 +119,9 @@ export type ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHan
|
|
118
119
|
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
119
120
|
forceRefresh?: boolean,
|
120
121
|
) => Promise<PostingRequirementOption[]>
|
122
|
+
export type ContractServiceLoadMoreContractsHandler = () => Promise<
|
123
|
+
PaginatedAPIResponseV1<Contract>
|
124
|
+
>
|
121
125
|
|
122
126
|
export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
123
127
|
{
|
@@ -140,6 +144,7 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
|
140
144
|
getContractChannelPostingRequirementQuestionnaireRulesForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler>
|
141
145
|
setContractChannelPostingRequirementQuestionnaireOptionsDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler>
|
142
146
|
getContractPostingRequirementOptionsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler>
|
147
|
+
loadMoreContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceLoadMoreContractsHandler>
|
143
148
|
initiateOauthLogin: (
|
144
149
|
contractId: string | number,
|
145
150
|
orderJourneyStepActive: OrderJourneyStepKey,
|
package/contract/state.types.ts
CHANGED
@@ -20,6 +20,7 @@ export type ContractState = {
|
|
20
20
|
contractForm: ContractCreateForm | ContractEditForm
|
21
21
|
contractCreateError: any
|
22
22
|
contractFormIsValid: boolean | null
|
23
|
+
contractListShouldBeInfiniteScroll: boolean
|
23
24
|
/* Contracts Groups */
|
24
25
|
groups: ContractGroup[]
|
25
26
|
groupSelected: ContractGroupSelected
|
package/contract/types.ts
CHANGED
package/contract/utils.types.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
ContractDirectApplyChannelPrefillVariablesMap,
|
5
5
|
ContractFilterQueryParams,
|
6
6
|
ContractGroupCreateForm,
|
7
|
+
ContractUserProvidedFilters,
|
7
8
|
} from "./types"
|
8
9
|
import { WindowHapiUtils } from "../_window/utils.types"
|
9
10
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
@@ -11,6 +12,7 @@ import {
|
|
11
12
|
ContractDirectApplyChannelName,
|
12
13
|
ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
|
13
14
|
} from "./enums"
|
15
|
+
import { PaginationResponseV1 } from "../common"
|
14
16
|
|
15
17
|
export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
16
18
|
{
|
@@ -24,8 +26,13 @@ export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
|
24
26
|
getInitialGroupForm: () => ContractGroupCreateForm
|
25
27
|
getContractsQueryParams: (
|
26
28
|
params: Partial<ContractFilterQueryParams>,
|
29
|
+
paginationOptions?: PaginationResponseV1 | null,
|
27
30
|
) => URLSearchParams
|
31
|
+
getUserProvidedFilters: () => ContractUserProvidedFilters
|
28
32
|
getContractNameWithGroupSuffix: (contract: Contract) => string
|
33
|
+
getNextPageOffsetAndLimit: (
|
34
|
+
meta: PaginationResponseV1,
|
35
|
+
) => PaginationResponseV1
|
29
36
|
},
|
30
37
|
{ readonly utils: WindowHapiUtils }
|
31
38
|
>
|
@@ -1,22 +1,8 @@
|
|
1
1
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
2
2
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
-
import { AxiosRequestConfig } from "axios/index"
|
4
|
-
import { PostingRequirement } from "../common"
|
5
3
|
|
6
|
-
export type WindowHapiAPIExperimentalConfigs = {
|
7
|
-
|
8
|
-
getPostingRequirements: AxiosRequestConfig
|
9
|
-
}
|
10
|
-
export type WindowHapiAPIExperimentalRequests = {
|
11
|
-
getPostingRequirementOptions: (
|
12
|
-
productId: string,
|
13
|
-
fieldName: string,
|
14
|
-
autocompleteRequestOptions: Record<string, string | string[]>,
|
15
|
-
) => Promise<any>
|
16
|
-
getPostingRequirements: (
|
17
|
-
productId: string | number,
|
18
|
-
) => Promise<PostingRequirement[]>
|
19
|
-
}
|
4
|
+
export type WindowHapiAPIExperimentalConfigs = {}
|
5
|
+
export type WindowHapiAPIExperimentalRequests = {}
|
20
6
|
export type WindowHapiAPIExperimental = WindowHapiModuleWithConstructorArgs<
|
21
7
|
WindowHapiAPIModule<
|
22
8
|
WindowHapiAPIExperimentalRequests,
|
package/experimental/index.ts
CHANGED
@@ -1,44 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
HapiServiceFunctionWithLifecycleHooks,
|
3
2
|
WindowHapiService,
|
4
3
|
} from "../_window/service.types"
|
5
4
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
6
|
-
import {
|
7
|
-
NestedValidatorKeys,
|
8
|
-
PostingRequirement,
|
9
|
-
PostingRequirementsAutocompleteRequestOption,
|
10
|
-
UseValidatorResult,
|
11
|
-
} from "../common"
|
12
|
-
import { MessageDescriptor } from "react-intl"
|
13
|
-
|
14
|
-
export type ExperimentalServiceGetProductPostingRequirementOptionsHandler = (
|
15
|
-
productId: string,
|
16
|
-
fieldName: string,
|
17
|
-
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
18
|
-
) => Promise<any>
|
19
|
-
|
20
|
-
export type ExperimentalServiceGetProductPostingRequirementsHandler = (
|
21
|
-
productId: string | number,
|
22
|
-
) => Promise<PostingRequirement[]>
|
23
5
|
|
24
6
|
export type WindowHapiServiceExperimental = WindowHapiModuleWithConstructorArgs<
|
25
|
-
{
|
26
|
-
getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementOptionsHandler>
|
27
|
-
getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementsHandler>
|
28
|
-
setProductStepsBlurredFields: (
|
29
|
-
fields: Record<string, Record<string, boolean>>,
|
30
|
-
) => Record<string, UseValidatorResult> | null
|
31
|
-
setProductStepsErrorMessages: (
|
32
|
-
messages: Record<
|
33
|
-
string,
|
34
|
-
Record<string, MessageDescriptor | boolean>
|
35
|
-
>,
|
36
|
-
) => void
|
37
|
-
setProductStepsSubmittedSteps: (steps: Record<string, boolean>) => void
|
38
|
-
setProductStepsValidators: (
|
39
|
-
validators: NestedValidatorKeys,
|
40
|
-
replaceAsIs: boolean,
|
41
|
-
) => void
|
42
|
-
},
|
7
|
+
{},
|
43
8
|
{ readonly service: WindowHapiService }
|
44
9
|
>
|
@@ -1,7 +1,3 @@
|
|
1
|
-
import { MessageDescriptor } from "react-intl"
|
2
|
-
import { NestedValidatorKeys, UseValidatorResult } from "../common"
|
3
|
-
import { OrderJourneyProductStep } from "./types"
|
4
|
-
|
5
1
|
export type ExperimentalState = {
|
6
2
|
snakeIndex: number
|
7
3
|
snakeCurrent: number[]
|
@@ -10,15 +6,4 @@ export type ExperimentalState = {
|
|
10
6
|
snakeScore: number
|
11
7
|
snakeSpeed: number
|
12
8
|
snakeInterval: number
|
13
|
-
/* Product Fields */
|
14
|
-
productSteps: OrderJourneyProductStep[]
|
15
|
-
productStepsBlurredFields: Record<string, Record<string, boolean>>
|
16
|
-
productStepsSubmittedSteps: Record<string, boolean>
|
17
|
-
productStepsErrorMessages: Record<
|
18
|
-
string,
|
19
|
-
Record<string, MessageDescriptor | MessageDescriptor[]>
|
20
|
-
>
|
21
|
-
productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
22
|
-
productStepsData: Record<string, Record<string, any>>
|
23
|
-
productStepsValidations: Record<string, UseValidatorResult> | null
|
24
9
|
}
|
package/index.ts
CHANGED
@@ -1,18 +1,19 @@
|
|
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
|
11
|
-
export * from
|
12
|
-
export * from
|
13
|
-
export * from
|
14
|
-
export * from
|
15
|
-
export * from
|
16
|
-
export * from
|
17
|
-
export * from
|
18
|
-
export * from
|
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 './experimental';
|
12
|
+
export * from './language';
|
13
|
+
export * from './modal';
|
14
|
+
export * from './orderJourney';
|
15
|
+
export * from './product';
|
16
|
+
export * from './routing';
|
17
|
+
export * from './theming';
|
18
|
+
export * from './ui';
|
19
|
+
export * from './wallet';
|
package/index.ts.bak
CHANGED
package/modal/service.types.ts
CHANGED
@@ -2,16 +2,14 @@ import { ModalOptions } from "./types"
|
|
2
2
|
import { ModalKeys, ModalZone } from "./enums"
|
3
3
|
import { Product } from "../product/types"
|
4
4
|
import { Contract } from "../contract/types"
|
5
|
-
import { IObservableValue } from "mobx"
|
6
5
|
import { AnyNonFunction } from "../common/types"
|
7
6
|
import { WindowHapiService } from "../_window/service.types"
|
8
7
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
|
-
import { ExperimentalModalKeys } from "../experimental/enums"
|
10
8
|
|
11
9
|
export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
|
12
10
|
{
|
13
11
|
openModal: (
|
14
|
-
key: ModalKeys
|
12
|
+
key: ModalKeys,
|
15
13
|
props: AnyNonFunction<
|
16
14
|
| { product: Product }
|
17
15
|
| {
|
@@ -26,7 +24,7 @@ export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
|
|
26
24
|
options?: ModalOptions,
|
27
25
|
zone?: ModalZone,
|
28
26
|
) => void
|
29
|
-
closeModal: (key: ModalKeys
|
27
|
+
closeModal: (key: ModalKeys) => void
|
30
28
|
},
|
31
29
|
{ readonly service: WindowHapiService }
|
32
30
|
>
|
package/modal/types.ts
CHANGED
@@ -10,10 +10,6 @@ import { Campaign } from "../campaign"
|
|
10
10
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
11
11
|
import { PickerDisplayMode } from "filestack-js"
|
12
12
|
import { HapiSiteTheme } from "../theming"
|
13
|
-
import {
|
14
|
-
ExperimentalFilePickerModalPropsActionFor,
|
15
|
-
ExperimentalModalKeys,
|
16
|
-
} from "../experimental/enums"
|
17
13
|
|
18
14
|
export type ProductDetailModalProps = {
|
19
15
|
id: string
|
@@ -92,9 +88,7 @@ export type FilePickerModalPropsActionData =
|
|
92
88
|
FilePickerModalPropsActionDataPostingRequirements
|
93
89
|
|
94
90
|
export type FilePickerModalProps = {
|
95
|
-
actionFor:
|
96
|
-
| FilePickerModalPropsActionFor
|
97
|
-
| ExperimentalFilePickerModalPropsActionFor
|
91
|
+
actionFor: FilePickerModalPropsActionFor
|
98
92
|
actionData?: FilePickerModalPropsActionData
|
99
93
|
}
|
100
94
|
|
@@ -122,7 +116,7 @@ export type ModalOptions = {
|
|
122
116
|
|
123
117
|
export type Modal = {
|
124
118
|
zone: ModalZone
|
125
|
-
key: ModalKeys
|
119
|
+
key: ModalKeys
|
126
120
|
props: ModalProps | undefined
|
127
121
|
options: ModalOptions
|
128
122
|
}
|
@@ -4,9 +4,14 @@ import {
|
|
4
4
|
} from "../_window/service.types"
|
5
5
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
6
6
|
import { NestedValidatorKeys, UseValidatorResult } from "../common"
|
7
|
-
import {
|
7
|
+
import {
|
8
|
+
OrderJourneyStep,
|
9
|
+
OrderJourneyStepKeyType,
|
10
|
+
OrderJourneyUTMStepValidations,
|
11
|
+
} from "./types"
|
8
12
|
import { MessageDescriptor } from "react-intl"
|
9
13
|
import { OrderJourneyStepKey } from "./enums"
|
14
|
+
import { CampaignCreateForm, CampaignEditForm } from "../campaign"
|
10
15
|
|
11
16
|
export type OrderJourneyServiceSwitchToNextStepHandler = () => Promise<void>
|
12
17
|
export type OrderJourneyServiceSwitchToPreviousStepHandler = () => Promise<void>
|
@@ -26,6 +31,11 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
26
31
|
getStepValidators: (
|
27
32
|
stepKey: string | undefined,
|
28
33
|
) => NestedValidatorKeys | undefined
|
34
|
+
getValidationResultsOfStep: (stepKey: string) => any
|
35
|
+
getValidations: () => Record<
|
36
|
+
OrderJourneyStepKeyType,
|
37
|
+
UseValidatorResult
|
38
|
+
>
|
29
39
|
setOnboardingStep: (step: OrderJourneyStep) => UseValidatorResult
|
30
40
|
setSelectProductsStep: (step: OrderJourneyStep) => UseValidatorResult
|
31
41
|
setAddContractsStep: (step: OrderJourneyStep) => UseValidatorResult
|
@@ -58,13 +68,36 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
58
68
|
validators: NestedValidatorKeys,
|
59
69
|
replaceAsIs: boolean,
|
60
70
|
) => void
|
71
|
+
setProductStepsBlurredFields: (
|
72
|
+
fields: Record<string, Record<string, boolean>>,
|
73
|
+
) => Record<string, UseValidatorResult> | null
|
74
|
+
setProductStepsErrorMessages: (
|
75
|
+
messages: Record<
|
76
|
+
string,
|
77
|
+
Record<string, MessageDescriptor | boolean>
|
78
|
+
>,
|
79
|
+
) => void
|
80
|
+
setProductStepsSubmittedSteps: (
|
81
|
+
steps: Record<string, boolean>
|
82
|
+
) => void
|
83
|
+
setProductStepsValidators: (
|
84
|
+
validators: NestedValidatorKeys,
|
85
|
+
replaceAsIs: boolean,
|
86
|
+
) => void
|
87
|
+
setStepsAccordionsAreExpanded: (
|
88
|
+
expandedMap: Record<OrderJourneyStepKeyType, boolean>,
|
89
|
+
replaceAsIs: boolean,
|
90
|
+
) => void
|
61
91
|
|
62
92
|
getSetters: (
|
63
93
|
steps: Record<string, boolean>,
|
64
94
|
) => Record<string, (step: OrderJourneyStep) => any>
|
65
|
-
getData: (
|
66
|
-
|
67
|
-
|
95
|
+
getData: () => Record<string, Record<string, any>>
|
96
|
+
getDataOfStep: (stepKey: string) => Record<string, any>
|
97
|
+
getCampaignFormDataByStepKey: (
|
98
|
+
campaignForm: CampaignCreateForm | CampaignEditForm,
|
99
|
+
stepKey: OrderJourneyStepKeyType,
|
100
|
+
) => Record<string, any>
|
68
101
|
getSetBlurredFieldsAndSetSubmittedFunctions: (
|
69
102
|
stepKey: string | undefined,
|
70
103
|
) => {
|
@@ -17,7 +17,9 @@ import {
|
|
17
17
|
OrderJourneyOrderErrorsPostingDetailsURLs,
|
18
18
|
OrderJourneyOrderErrorsPostingDetailsWorkingLocation,
|
19
19
|
OrderJourneyOrderReviewStepData,
|
20
|
+
OrderJourneyProductStep,
|
20
21
|
OrderJourneyStep,
|
22
|
+
OrderJourneyStepKeyType,
|
21
23
|
OrderJourneyUTMStepData,
|
22
24
|
OrderJourneyUTMStepValidations,
|
23
25
|
} from "./types"
|
@@ -28,6 +30,8 @@ export type OrderJourneyState = {
|
|
28
30
|
stepsEnabled: (OrderJourneyStepKey | OrderJourneyStepKey[])[]
|
29
31
|
steps: (OrderJourneyStep | OrderJourneyStep[])[]
|
30
32
|
stepsAreGroups: boolean
|
33
|
+
stepsAccordionsShouldBeEnabled: boolean
|
34
|
+
stepsAccordionsAreExpanded: Record<OrderJourneyStepKeyType, boolean>
|
31
35
|
flattenedSteps: OrderJourneyStep[]
|
32
36
|
stepPreviousIndex: number
|
33
37
|
stepActiveIndex: number
|
@@ -36,6 +40,9 @@ export type OrderJourneyState = {
|
|
36
40
|
stepLastIndex: number
|
37
41
|
stepPrevious: OrderJourneyStep | null
|
38
42
|
stepActive: OrderJourneyStep | null
|
43
|
+
stepActiveGroup: OrderJourneyStep | OrderJourneyStep[] | null
|
44
|
+
stepActiveErrors: Record<OrderJourneyStepKeyType, UseValidatorResult | null> | null
|
45
|
+
stepActiveData: Record<OrderJourneyStepKeyType, any> | null
|
39
46
|
stepNext: OrderJourneyStep | null
|
40
47
|
stepsPopulatedAreHidden: boolean
|
41
48
|
stepIsSwitching: boolean
|
@@ -123,6 +130,17 @@ export type OrderJourneyState = {
|
|
123
130
|
Record<string, OrderJourneyChannelPostingRequirementsStepOptions>
|
124
131
|
>
|
125
132
|
contractStepsValidations: Record<string, UseValidatorResult> | null
|
133
|
+
/* Product Fields */
|
134
|
+
productSteps: OrderJourneyProductStep[]
|
135
|
+
productStepsBlurredFields: Record<string, Record<string, boolean>>
|
136
|
+
productStepsSubmittedSteps: Record<string, boolean>
|
137
|
+
productStepsErrorMessages: Record<
|
138
|
+
string,
|
139
|
+
Record<string, MessageDescriptor | MessageDescriptor[]>
|
140
|
+
>
|
141
|
+
productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
142
|
+
productStepsData: Record<string, Record<string, any>>
|
143
|
+
productStepsValidations: Record<string, UseValidatorResult> | null
|
126
144
|
/* UTM Codes */
|
127
145
|
utmCodesStep: OrderJourneyStep
|
128
146
|
utmCodesStepData: OrderJourneyUTMStepData
|
package/orderJourney/types.ts
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
import { MessageDescriptor } from "react-intl"
|
2
2
|
import { OrderJourneyStepKey } from "./enums"
|
3
3
|
import {
|
4
|
-
PostingRequirementOption,
|
5
4
|
TransformedPostingRequirementOption,
|
6
5
|
UseValidatorResult,
|
7
6
|
} from "../common"
|
8
|
-
import { OrderJourneyProductStep } from "../experimental"
|
9
7
|
|
10
8
|
export type OrderJourneyStepBlurredFields = {
|
11
9
|
[k: string]:
|
@@ -31,6 +29,11 @@ export type OrderJourneyStep = {
|
|
31
29
|
errorMessagesIntlDescriptors?: OrderJourneyStepErrorMessages
|
32
30
|
}
|
33
31
|
|
32
|
+
export type OrderJourneyProductStep = Omit<
|
33
|
+
OrderJourneyStep,
|
34
|
+
"blurredFields" | "isSubmitted" | "errorMessagesIntlDescriptors"
|
35
|
+
>
|
36
|
+
|
34
37
|
export type OrderJourneyContractStep = Omit<
|
35
38
|
OrderJourneyStep,
|
36
39
|
"blurredFields" | "isSubmitted" | "errorMessagesIntlDescriptors"
|
@@ -3,6 +3,7 @@ import { WindowHapiUtils } from "../_window/utils.types"
|
|
3
3
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
4
4
|
import { Contract } from "../contract"
|
5
5
|
import { Product } from "../product"
|
6
|
+
import { OrderJourneyStep, OrderJourneyStepKeyType } from "./types"
|
6
7
|
|
7
8
|
export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
8
9
|
{
|
@@ -10,6 +11,17 @@ export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
10
11
|
paymentMethodKeys: typeof OrderJourneyPaymentMethod
|
11
12
|
orderJourneyGetContractIdFromContractStepKey: (key: string) => string
|
12
13
|
orderJourneyGetContractStepKey: (contractId: string) => string
|
14
|
+
orderJourneyGetStepKeyFromContractOrProductStepKey: (key: string) =>
|
15
|
+
| OrderJourneyStepKey.contractChannelPostingRequirements
|
16
|
+
| OrderJourneyStepKey.productChannelPostingRequirements
|
17
|
+
| undefined
|
18
|
+
getKeyFromStepKey: (
|
19
|
+
stepKey: OrderJourneyStepKeyType
|
20
|
+
) => OrderJourneyStepKey | undefined
|
21
|
+
getGroupOfStep: (
|
22
|
+
stepsOrStepsGroups: OrderJourneyStep[][],
|
23
|
+
stepKey: OrderJourneyStepKeyType,
|
24
|
+
) => OrderJourneyStep[] | undefined
|
13
25
|
updateProductUTMsFromBasketItemData: (
|
14
26
|
basketItemData: (Contract | Product)[],
|
15
27
|
) => void
|
package/package.json
CHANGED
package/product/api.types.ts
CHANGED
@@ -6,6 +6,9 @@ import {
|
|
6
6
|
ProductJobTitle,
|
7
7
|
ProductLocation,
|
8
8
|
ProductOrderDeliveryTime,
|
9
|
+
ProductSearchFiltersSuggestionCreateRequest,
|
10
|
+
ProductSearchFiltersSuggestionCreateRequestResponse,
|
11
|
+
ProductSearchFiltersSuggestionsGetRequestResponse,
|
9
12
|
ProductSupportingContractsComplete,
|
10
13
|
ProductSupportingContractsPartial,
|
11
14
|
ProductWithSupportForContractsFilters,
|
@@ -29,6 +32,10 @@ export type WindowHapiAPIProductConfigs = {
|
|
29
32
|
getJobTitles: AxiosRequestConfig
|
30
33
|
getLocations: AxiosRequestConfig
|
31
34
|
calculateDeliveryTime: AxiosRequestConfig
|
35
|
+
getPostingRequirements: AxiosRequestConfig
|
36
|
+
getPostingRequirementOptions: AxiosRequestConfig
|
37
|
+
getSuggestionOfSearchFilters: AxiosRequestConfig
|
38
|
+
createSuggestionOfSearchFilters: AxiosRequestConfig
|
32
39
|
}
|
33
40
|
export type WindowHapiAPIProductRequests = {
|
34
41
|
getProduct: (productId: number | string) => Promise<Product>
|
@@ -57,6 +64,20 @@ export type WindowHapiAPIProductRequests = {
|
|
57
64
|
calculateDeliveryTime: (
|
58
65
|
productIds: (string | number)[],
|
59
66
|
) => Promise<ProductOrderDeliveryTime>
|
67
|
+
getPostingRequirementOptions: (
|
68
|
+
productId: string,
|
69
|
+
fieldName: string,
|
70
|
+
autocompleteRequestOptions: Record<string, string | string[]>,
|
71
|
+
) => Promise<any>
|
72
|
+
getPostingRequirements: (
|
73
|
+
productId: string | number,
|
74
|
+
) => Promise<PostingRequirement[]>
|
75
|
+
getSuggestionOfSearchFilters: (
|
76
|
+
suggestionId: string,
|
77
|
+
) => Promise<ProductSearchFiltersSuggestionsGetRequestResponse>
|
78
|
+
createSuggestionOfSearchFilters: (
|
79
|
+
payload: ProductSearchFiltersSuggestionCreateRequest,
|
80
|
+
) => Promise<ProductSearchFiltersSuggestionCreateRequestResponse>
|
60
81
|
}
|
61
82
|
export type WindowHapiAPIProduct = WindowHapiModuleWithConstructorArgs<
|
62
83
|
WindowHapiAPIModule<
|
package/product/index.ts
CHANGED
package/product/index.ts.bak
CHANGED
package/product/service.types.ts
CHANGED
@@ -9,6 +9,8 @@ import {
|
|
9
9
|
ProductJobFunction,
|
10
10
|
ProductJobTitle,
|
11
11
|
ProductLocation,
|
12
|
+
ProductSearchFiltersSuggestionCreateRequestResponse,
|
13
|
+
ProductSearchFiltersSuggestionsGetRequestResponse,
|
12
14
|
ProductSupportingContractsComplete,
|
13
15
|
ProductSupportingContractsPartial,
|
14
16
|
} from "./types"
|
@@ -72,6 +74,22 @@ export type ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler = (
|
|
72
74
|
forceRefresh?: boolean,
|
73
75
|
) => Promise<ProductSupportingContractsComplete | undefined>
|
74
76
|
|
77
|
+
export type ProductServiceGetProductPostingRequirementsHandler = (
|
78
|
+
productId: string | number,
|
79
|
+
) => Promise<PostingRequirement[]>
|
80
|
+
export type ProductServiceGetProductPostingRequirementOptionsHandler = (
|
81
|
+
productId: string,
|
82
|
+
fieldName: string,
|
83
|
+
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
84
|
+
) => Promise<any>
|
85
|
+
export type ProductServiceCreateSuggestionOfSearchFiltersHandler = (
|
86
|
+
customDescription?: string,
|
87
|
+
customContextObject?: Record<string, any>,
|
88
|
+
) => Promise<ProductSearchFiltersSuggestionCreateRequestResponse>
|
89
|
+
export type ProductServiceGetSuggestionOfSearchFiltersHandler = (
|
90
|
+
taskId: string,
|
91
|
+
) => Promise<ProductSearchFiltersSuggestionsGetRequestResponse>
|
92
|
+
|
75
93
|
export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
76
94
|
{
|
77
95
|
loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
|
@@ -89,6 +107,10 @@ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
|
89
107
|
getJobFunctions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobFunctionsHandler>
|
90
108
|
getIndustries: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetIndustriesHandler>
|
91
109
|
getProductSupportingContractsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler>
|
110
|
+
getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementsHandler>
|
111
|
+
getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementOptionsHandler>
|
112
|
+
createSuggestionOfSearchFilters: HapiServiceFunctionWithLifecycleHooks<ProductServiceCreateSuggestionOfSearchFiltersHandler>
|
113
|
+
getSuggestionOfSearchFilters: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetSuggestionOfSearchFiltersHandler>
|
92
114
|
},
|
93
115
|
{ readonly service: WindowHapiService }
|
94
116
|
>
|
package/product/state.types.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
ProductJobFunction,
|
5
5
|
ProductJobTitle,
|
6
6
|
ProductLocation,
|
7
|
+
ProductSuggestionStatus,
|
7
8
|
ProductSupportingContractsPartial,
|
8
9
|
} from "./types"
|
9
10
|
import { PaginationResponseV1 } from "../common/types"
|
@@ -12,6 +13,7 @@ import {
|
|
12
13
|
ProductPriceCurrency,
|
13
14
|
ProductSortBy,
|
14
15
|
} from "./enums"
|
16
|
+
import { CampaignSuggestionStatus } from "../campaign"
|
15
17
|
|
16
18
|
export type ProductState = {
|
17
19
|
/* Products */
|
@@ -51,4 +53,13 @@ export type ProductState = {
|
|
51
53
|
searchTextInput: string
|
52
54
|
/* Product Type */
|
53
55
|
searchTypeFilterBy: ProductTypeFilterBy
|
56
|
+
/* Vacancy Fields Suggestions */
|
57
|
+
searchFiltersSuggestionsPollingIntervalsMap: Record<string, number>
|
58
|
+
searchFiltersSuggestionsPollingStatusMap: Record<
|
59
|
+
string,
|
60
|
+
{
|
61
|
+
createdAt: string
|
62
|
+
status: ProductSuggestionStatus
|
63
|
+
}
|
64
|
+
>
|
54
65
|
}
|
package/product/types.ts
CHANGED
@@ -181,3 +181,42 @@ export type ProductProductsSupportingContractsMap = Map<
|
|
181
181
|
StringifiedJSON<ProductProductsSupportingContractsPayload>,
|
182
182
|
ProductProductsSupportingContractsMapState
|
183
183
|
>
|
184
|
+
|
185
|
+
export type ProductSuggestionStatus =
|
186
|
+
| "queued"
|
187
|
+
| "started"
|
188
|
+
| "completed"
|
189
|
+
| "errored"
|
190
|
+
|
191
|
+
export type ProductSearchFiltersSuggestionCreateRequest = {
|
192
|
+
context: {
|
193
|
+
structured: Record<string, any>
|
194
|
+
unstructured: string
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
export type ProductSearchFiltersSuggestionCreateRequestResponse = {
|
199
|
+
smartfill_task_id: string
|
200
|
+
}
|
201
|
+
|
202
|
+
export type ProductSearchFiltersSuggestionsPrefillData = {
|
203
|
+
job_title: ProductJobTitle
|
204
|
+
job_function: ProductJobFunctionPartial
|
205
|
+
location: ProductLocation
|
206
|
+
industry: ProductIndustry
|
207
|
+
}
|
208
|
+
|
209
|
+
export type ProductSearchFiltersSuggestionsGetRequestResponse = {
|
210
|
+
id: string
|
211
|
+
status: ProductSuggestionStatus
|
212
|
+
created_at: string
|
213
|
+
updated_at: string
|
214
|
+
prefill_data: Partial<ProductSearchFiltersSuggestionsPrefillData>
|
215
|
+
}
|
216
|
+
|
217
|
+
export type ProductSearchFilterIDs = {
|
218
|
+
jobTitlesIdsSelected: number[]
|
219
|
+
jobFunctionsIdsSelected: number[]
|
220
|
+
jobIndustriesIdsSelected: number[]
|
221
|
+
jobRegionsIdsSelected: number[]
|
222
|
+
}
|
package/product/utils.types.ts
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import {
|
2
|
+
ProductFilterQueryParams,
|
3
|
+
ProductIndustry,
|
4
|
+
ProductJobFunctionPartial,
|
5
|
+
ProductJobTitle,
|
6
|
+
ProductLocationPartial,
|
7
|
+
ProductSearchFilterIDs,
|
8
|
+
ProductSearchFiltersSuggestionsPrefillData,
|
9
|
+
ProductUserProvidedFilters,
|
10
|
+
} from "./types"
|
11
|
+
import { PaginationResponseV1, RecursivePartial } from "../common/types"
|
3
12
|
import { WindowHapiUtils } from "../_window/utils.types"
|
4
13
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
5
14
|
import {
|
@@ -21,6 +30,9 @@ export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
|
|
21
30
|
getNextPageOffsetAndLimit: (
|
22
31
|
meta: PaginationResponseV1,
|
23
32
|
) => PaginationResponseV1
|
33
|
+
getUpdatedSearchFiltersWithSmartFillData: (
|
34
|
+
prefillData: Partial<ProductSearchFiltersSuggestionsPrefillData>,
|
35
|
+
) => ProductSearchFilterIDs
|
24
36
|
},
|
25
37
|
{ readonly utils: WindowHapiUtils }
|
26
38
|
>
|
package/ui/enums.ts
ADDED
package/ui/index.ts
CHANGED
package/ui/index.ts.bak
CHANGED
package/ui/service.types.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import { WindowHapiService } from "../_window/service.types"
|
2
2
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
3
|
|
4
|
+
import { HapiUIIconConfig } from "./types"
|
5
|
+
|
4
6
|
export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
|
5
7
|
{
|
6
8
|
onIframeLoaded: (callback: (iframeName: string) => void) => void
|
@@ -23,6 +25,7 @@ export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
|
|
23
25
|
) => Promise<void>
|
24
26
|
hideElement: (elementSelector: string) => Promise<void>
|
25
27
|
showElement: (elementSelector: string) => Promise<void>
|
28
|
+
changeIcons: (configs: HapiUIIconConfig[]) => Promise<void>
|
26
29
|
},
|
27
30
|
{ readonly service: WindowHapiService }
|
28
31
|
>
|
package/ui/types.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
import { HapiUIIconType } from "./enums"
|
2
|
+
|
3
|
+
export type HapiUIIconConfig = {
|
4
|
+
fromType: HapiUIIconType
|
5
|
+
fromName: string
|
6
|
+
toType: HapiUIIconType
|
7
|
+
toName: string
|
8
|
+
// lottieFilePath can only be used when the 'toType' is of type 'lottie'
|
9
|
+
lottieFilePath?: string
|
10
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { WindowHapiUtils } from "../_window/utils.types"
|
2
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
+
import { HapiUIIconType } from "./enums"
|
4
|
+
|
5
|
+
export type WindowHapiUtilsUI = WindowHapiModuleWithConstructorArgs<
|
6
|
+
{
|
7
|
+
iconType: typeof HapiUIIconType
|
8
|
+
},
|
9
|
+
{ readonly utils: WindowHapiUtils }
|
10
|
+
>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { HapiUIIconType } from "./enums"
|
2
|
+
import { ZodArray, ZodObject, ZodOptional, ZodString } from "zod"
|
3
|
+
|
4
|
+
export type ZodIconConfig = ZodObject<{
|
5
|
+
fromType: ZodString
|
6
|
+
fromName: ZodString
|
7
|
+
toType: ZodString
|
8
|
+
toName: ZodString
|
9
|
+
lottieFilePath: ZodOptional<ZodString>
|
10
|
+
}>
|
11
|
+
|
12
|
+
export type WindowHapiValidationsUI = {
|
13
|
+
iconTypes: HapiUIIconType[]
|
14
|
+
iconTypeRegex: RegExp
|
15
|
+
iconType: ZodString
|
16
|
+
iconConfig: ZodIconConfig
|
17
|
+
iconConfigs: ZodArray<ZodIconConfig>
|
18
|
+
}
|
package/experimental/enums.ts
DELETED
package/experimental/types.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import { RecursivePartial } from "../common"
|
2
|
-
import { Campaign } from "../campaign"
|
3
|
-
import { OrderJourneyStep } from "../orderJourney"
|
4
|
-
|
5
|
-
export type ExperimentalSuggestionVacancyFieldsCreateRequestPayload = {
|
6
|
-
description: string
|
7
|
-
}
|
8
|
-
|
9
|
-
export type ExperimentalSuggestionVacancyFieldsGetResponseData =
|
10
|
-
RecursivePartial<Campaign>
|
11
|
-
export type OrderJourneyProductStep = Omit<
|
12
|
-
OrderJourneyStep,
|
13
|
-
"blurredFields" | "isSubmitted" | "errorMessagesIntlDescriptors"
|
14
|
-
>
|