@vonq/hapi-elements-types 1.50.0 → 1.52.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/sdk.types.ts +2 -1
- package/_window/service.types.ts +1 -0
- package/_window/state.types.ts +4 -0
- package/_window/utils.types.ts +18 -1
- package/alert/types.ts +4 -0
- package/basket/service.types.ts +5 -0
- package/campaign/api.types.ts +13 -1
- package/campaign/types.ts +34 -3
- package/common/logger/types.ts +2 -0
- package/common/types.ts +1 -0
- package/modal/enums.ts +1 -0
- package/modal/types.ts +8 -0
- package/package.json +1 -1
- package/product/enums.ts +4 -0
- package/product/types.ts +6 -0
- package/ui/state.types.ts +3 -0
package/_window/sdk.types.ts
CHANGED
@@ -54,6 +54,7 @@ import { ExperimentalState } from "../experimental/state.types"
|
|
54
54
|
import { ProductCacheState } from "../product/state.cache.types"
|
55
55
|
import { WindowHapiValidationsUI } from "../ui/validations.types"
|
56
56
|
import { WindowHapiUtilsUI } from "../ui/utils.types"
|
57
|
+
import { UIState } from "types/ui/state.types"
|
57
58
|
|
58
59
|
export type WindowHapiSDKModule<
|
59
60
|
APIModule,
|
@@ -140,7 +141,7 @@ export type WindowHapiSDKUI = WindowHapiSDKModule<
|
|
140
141
|
undefined,
|
141
142
|
WindowHapiServiceUI,
|
142
143
|
WindowHapiValidationsUI,
|
143
|
-
|
144
|
+
WindowHapiStateModule<UIState>,
|
144
145
|
WindowHapiUtilsUI
|
145
146
|
>
|
146
147
|
export type WindowHapiSDKATS = WindowHapiSDKModule<
|
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,7 @@ 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
17
|
import { WindowHapiUtilsUI } from "../ui/utils.types"
|
18
18
|
|
19
19
|
export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
@@ -45,6 +45,23 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
45
45
|
) => any[]
|
46
46
|
getComponentNameIndexSuffix: (instanceName: string) => string
|
47
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
|
48
65
|
product: WindowHapiUtilsProduct
|
49
66
|
contract: WindowHapiUtilsContract
|
50
67
|
campaign: WindowHapiUtilsCampaign
|
package/alert/types.ts
CHANGED
@@ -51,6 +51,10 @@ export type ButtonCopySuccessAlertProps = {}
|
|
51
51
|
|
52
52
|
export type CampaignOrderSuccessAlertProps = {}
|
53
53
|
|
54
|
+
export type CampaignOrderFailAlertProps = {
|
55
|
+
errorMessage?: string
|
56
|
+
}
|
57
|
+
|
54
58
|
export type CampaignCopySuccessAlertProps = {}
|
55
59
|
|
56
60
|
export type CampaignCopyProductsContractsDeletedWarningAlertProps = {}
|
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/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>,
|
package/campaign/types.ts
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
import {
|
2
|
+
ProductCPA,
|
2
3
|
ProductDuration,
|
3
4
|
ProductIndustry,
|
4
5
|
ProductJobFunctionPartial,
|
5
6
|
} from "../product/types"
|
6
|
-
import {
|
7
|
+
import {
|
8
|
+
ProductCPAHiringGoalUnit,
|
9
|
+
ProductPriceCurrency,
|
10
|
+
} from "../product/enums"
|
7
11
|
import { EmploymentType, SalaryPeriod } from "./enums"
|
8
12
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
9
13
|
import {
|
@@ -24,6 +28,8 @@ export type CampaignProductSpecs = {
|
|
24
28
|
status: CampaignStatus
|
25
29
|
utm: string | null
|
26
30
|
statusDescription: string | null
|
31
|
+
metadata?: CampaignMetadata
|
32
|
+
orderedCpa?: ProductCPA
|
27
33
|
}
|
28
34
|
|
29
35
|
export type CampaignProductStatus = {
|
@@ -101,6 +107,7 @@ export type CampaignPosting = {
|
|
101
107
|
clicks: number
|
102
108
|
name: string
|
103
109
|
productId: string
|
110
|
+
cpaResults?: Record<ProductCPAHiringGoalUnit, number>
|
104
111
|
}
|
105
112
|
|
106
113
|
export type CampaignRecruiterInfo = {
|
@@ -167,6 +174,8 @@ export type CampaignDraftV2 = {
|
|
167
174
|
}
|
168
175
|
}
|
169
176
|
|
177
|
+
export type CampaignMetadata = Record<string, any>
|
178
|
+
|
170
179
|
export type Campaign = Pick<CampaignDraft, "campaignId"> &
|
171
180
|
CampaignDraftOldBackwardsCompatability &
|
172
181
|
CampaignDraftV2 & {
|
@@ -191,6 +200,7 @@ export type Campaign = Pick<CampaignDraft, "campaignId"> &
|
|
191
200
|
detailedStatus?: CampaignDetailedStatus //this is only added virtually on FE on demand
|
192
201
|
isEditable: boolean
|
193
202
|
modifiedOn: string
|
203
|
+
metadata?: CampaignMetadata
|
194
204
|
}
|
195
205
|
|
196
206
|
export type CampaignCreateFormTargetGroupEducationLevel =
|
@@ -311,10 +321,10 @@ export type CampaignOrderRequestBodyProvidedBySmartFill = Omit<
|
|
311
321
|
CampaignOrderRequestBody,
|
312
322
|
"targetGroup"
|
313
323
|
> & {
|
314
|
-
|
324
|
+
taxonomy: {
|
315
325
|
industry: ProductIndustry
|
316
326
|
seniority: TaxonomyEducationAndSeniorityLevel
|
317
|
-
|
327
|
+
jobFunction: ProductJobFunctionPartial
|
318
328
|
educationLevel: TaxonomyEducationAndSeniorityLevel
|
319
329
|
}
|
320
330
|
}
|
@@ -436,3 +446,24 @@ export type CampaignVacancyFieldsSuggestionsGetRequestResponse = {
|
|
436
446
|
updated_at: string
|
437
447
|
prefill_data: RecursivePartial<CampaignOrderRequestBodyProvidedBySmartFill>
|
438
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
|
469
|
+
}
|
package/common/logger/types.ts
CHANGED
package/common/types.ts
CHANGED
@@ -118,6 +118,7 @@ export type HapiWebComponent = {
|
|
118
118
|
*/
|
119
119
|
// some widgets have query params, we need to mock them
|
120
120
|
qaMockQueryParams?: Record<string, string>
|
121
|
+
qaDocsPlaygroundCSS?: Record<string, string>
|
121
122
|
optionalAttributes?: string[]
|
122
123
|
loadingLazyIframe?: boolean
|
123
124
|
isHiddenOnDocumentation?: boolean
|
package/modal/enums.ts
CHANGED
@@ -17,6 +17,7 @@ export enum ModalKeys {
|
|
17
17
|
basketRemoveProductConfirmation = "remove-product-from-basket",
|
18
18
|
basketProductBundleParentClashConfirmation = "basket-product-bundle-parent-clash-confirmation",
|
19
19
|
basketProductBundleChildClashConfirmation = "basket-product-bundle-child-clash-confirmation",
|
20
|
+
basketProductCPAClashConfirmation = "basket-product-cpa-clash-confirmation",
|
20
21
|
contractRemoveConfirmation = "contract-remove-confirmation",
|
21
22
|
contractGroupRemoveConfirmation = "contract-group-remove-confirmation",
|
22
23
|
contractGroupUpdateConfirmation = "contract-group-update-confirmation",
|
package/modal/types.ts
CHANGED
@@ -45,6 +45,11 @@ export type BasketProductBundleParentClashConfirmationProps = {
|
|
45
45
|
bundleProduct: Product
|
46
46
|
childProducts: Product[]
|
47
47
|
}
|
48
|
+
export type BasketProductCPAClashConfirmationModalProps = {
|
49
|
+
itemsBeingClashed: (Product | Contract)[]
|
50
|
+
itemBeingAdded: Product | Contract
|
51
|
+
}
|
52
|
+
|
48
53
|
export type CampaignEditModalProps = {
|
49
54
|
campaign?: Campaign
|
50
55
|
}
|
@@ -103,6 +108,9 @@ export type ModalProps = AnyNonFunction<
|
|
103
108
|
| FilePickerModalProps
|
104
109
|
| BasketModalProps
|
105
110
|
| WalletModalProps
|
111
|
+
| BasketProductCPAClashConfirmationModalProps
|
112
|
+
| BasketProductBundleParentClashConfirmationModalProps
|
113
|
+
| BasketProductBundleParentClashConfirmationProps
|
106
114
|
>
|
107
115
|
|
108
116
|
export type ModalOptions = {
|
package/package.json
CHANGED
package/product/enums.ts
CHANGED
package/product/types.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import {
|
2
|
+
ProductCPAHiringGoalUnit,
|
2
3
|
ProductFilterRecommendations,
|
3
4
|
ProductPriceCurrency,
|
4
5
|
ProductSortBy,
|
@@ -47,6 +48,10 @@ export type ProductSupportingContractsPartial = {
|
|
47
48
|
|
48
49
|
export type ProductAudienceGroup = "niche" | "generic"
|
49
50
|
|
51
|
+
export type ProductCPA = {
|
52
|
+
hiring_goal: number
|
53
|
+
hiring_goal_unit: ProductCPAHiringGoalUnit
|
54
|
+
}
|
50
55
|
export type Product = {
|
51
56
|
allow_orders: boolean
|
52
57
|
audience_group: ProductAudienceGroup
|
@@ -69,6 +74,7 @@ export type Product = {
|
|
69
74
|
time_to_setup: ProductDuration
|
70
75
|
is_recommended?: boolean
|
71
76
|
has_product_specs: boolean
|
77
|
+
cpa: ProductCPA | null
|
72
78
|
} & ProductLogos &
|
73
79
|
ProductType
|
74
80
|
|