@vonq/hapi-elements-types 1.19.0 → 1.20.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/events.types.ts +15 -2
- package/_window/qa.types.ts +3 -1
- package/_window/sdk.types.ts +3 -1
- package/_window/service.types.ts +5 -0
- package/_window/state.types.ts +4 -1
- package/alert/enums.ts +1 -0
- package/ats/state.types.ts +1 -0
- package/campaign/api.types.ts +11 -1
- package/campaign/service.types.ts +12 -1
- package/campaign/types.ts +24 -3
- package/campaign/validations.types.ts +8 -1
- package/common/events/EventCommand/enums.ts +1 -0
- package/common/events/types.ts +1 -0
- package/common/types.ts +28 -3
- package/contract/validations.types.ts +1 -1
- package/debugging/index.ts +1 -0
- package/debugging/service.types.ts +16 -0
- package/debugging/state.types.ts +4 -0
- package/debugging/types.ts +17 -0
- package/modal/enums.ts +1 -0
- package/modal/types.ts +4 -0
- package/orderJourney/service.types.ts +8 -2
- package/orderJourney/state.types.ts +7 -3
- package/orderJourney/types.ts +5 -0
- package/orderJourney/validations.types.ts +4 -0
- package/package.json +1 -1
- package/product/enums.ts +1 -0
- package/product/service.types.ts +5 -1
- package/product/types.ts +7 -2
- package/wallet/service.types.ts +1 -0
- package/wallet/types.ts +1 -0
package/_window/events.types.ts
CHANGED
@@ -106,6 +106,12 @@ export type WindowHapiEventMediator = WindowHapiModuleWithConstructorArgs<
|
|
106
106
|
readonly eventApiStrategy?: WindowHapiEventStrategy
|
107
107
|
readonly eventServiceStrategy?: WindowHapiEventStrategy
|
108
108
|
readonly eventQAStrategy?: WindowHapiEventStrategy
|
109
|
+
readonly onReceive?: (
|
110
|
+
eventCommand: WindowHapiEventCommand | undefined,
|
111
|
+
) => void
|
112
|
+
readonly onDispatch?: (
|
113
|
+
eventCommand: WindowHapiEventCommand | undefined,
|
114
|
+
) => void
|
109
115
|
}
|
110
116
|
>
|
111
117
|
|
@@ -127,7 +133,12 @@ export type WindowHapiEventStorage = WindowHapiModuleWithConstructorArgs<
|
|
127
133
|
name: string,
|
128
134
|
) => (WindowHapiEventCommand | WindowHapiEventListener)[]
|
129
135
|
},
|
130
|
-
{
|
136
|
+
{
|
137
|
+
readonly getInstances: WindowHapiEventMediatorGetInstancesHandler
|
138
|
+
readonly onAdd?: (
|
139
|
+
eventCommand: WindowHapiEventCommand | WindowHapiEventListener,
|
140
|
+
) => void
|
141
|
+
}
|
131
142
|
>
|
132
143
|
|
133
144
|
export type WindowHapiEvents = WindowHapiModuleWithConstructorArgs<
|
@@ -141,7 +152,9 @@ export type WindowHapiEvents = WindowHapiModuleWithConstructorArgs<
|
|
141
152
|
eventRoutingStrategy: WindowHapiEventStrategy
|
142
153
|
eventAppStrategy: WindowHapiEventStrategy
|
143
154
|
eventApiStrategy: WindowHapiEventStrategy
|
144
|
-
eventStateStrategy: WindowHapiEventStrategy
|
155
|
+
eventStateStrategy: WindowHapiEventStrategy & {
|
156
|
+
onHydrateState: (event: WindowHapiEventCommand) => void
|
157
|
+
}
|
145
158
|
eventServiceStrategy: WindowHapiEventStrategy
|
146
159
|
eventQAStrategy: WindowHapiEventStrategy
|
147
160
|
eventDOMStrategy: WindowHapiEventStrategy
|
package/_window/qa.types.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { WindowHapiModuleName } from "../common/enums"
|
2
2
|
import {
|
3
|
-
WindowHapiModuleWithConstructorArgs,
|
4
3
|
WindowHapiClassInterface,
|
4
|
+
WindowHapiModuleWithConstructorArgs,
|
5
5
|
} from "./window"
|
6
6
|
import { WindowHapiQACampaign } from "../campaign/qa.types"
|
7
7
|
import { WindowHapiQACommon } from "../common/qa.types"
|
@@ -22,7 +22,9 @@ export type WindowHapiQA = WindowHapiModuleWithConstructorArgs<
|
|
22
22
|
[WindowHapiModuleName.common]: WindowHapiQACommon
|
23
23
|
|
24
24
|
isDebugPanelOpen: boolean
|
25
|
+
|
25
26
|
getDebugPanelButtonEl: () => HTMLElement | null
|
27
|
+
onClickDebugPanel: () => void
|
26
28
|
addDebugPanelToDOM: () => void
|
27
29
|
setDebugPanelPosition: (buttonEl: HTMLElement | null) => void
|
28
30
|
},
|
package/_window/sdk.types.ts
CHANGED
@@ -42,6 +42,8 @@ import {
|
|
42
42
|
import { WindowHapiServiceUI } from "../ui/service.types"
|
43
43
|
import { ATSState, WindowHapiAPIATS, WindowHapiServiceATS } from "../ats"
|
44
44
|
import { WindowHapiServiceOrderJourney } from "../orderJourney/service.types"
|
45
|
+
import { WindowHapiQA } from "./qa.types"
|
46
|
+
import { WindowHapiServiceDebugging } from "../debugging/service.types"
|
45
47
|
|
46
48
|
export type WindowHapiSDKModule<
|
47
49
|
APIModule,
|
@@ -86,7 +88,7 @@ export type WindowHapiSDKContract = WindowHapiSDKModule<
|
|
86
88
|
>
|
87
89
|
export type WindowHapiSDKDebugging = WindowHapiSDKModule<
|
88
90
|
undefined,
|
89
|
-
|
91
|
+
WindowHapiServiceDebugging,
|
90
92
|
undefined,
|
91
93
|
WindowHapiStateModule<DebuggingState>
|
92
94
|
>
|
package/_window/service.types.ts
CHANGED
@@ -18,6 +18,7 @@ import { WindowHapiServiceTalentMindCompany } from "../talentMindCompany/service
|
|
18
18
|
import { WindowHapiServiceTalentMindJob } from "../talentMindJob/service.types"
|
19
19
|
import { WindowHapiServiceTalentMindResume } from "../talentMindResume/service.types"
|
20
20
|
import { WindowHapiServiceTalentMindEvaluation } from "../talentMindEvaluation/service.types"
|
21
|
+
import { WindowHapiServiceDebugging } from "../debugging/service.types"
|
21
22
|
|
22
23
|
export type HapiServiceFunctionLifecycleHookCallbackHandler = () =>
|
23
24
|
| void
|
@@ -45,6 +46,8 @@ export type HapiServiceBase = {
|
|
45
46
|
}
|
46
47
|
export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
|
47
48
|
{
|
49
|
+
propertiesThatShouldNotBeDocumented: string[]
|
50
|
+
mergePropertiesThatShouldNotBeDocumented: (klass: any) => void
|
48
51
|
[WindowHapiModuleName.alert]: WindowHapiServiceAlert
|
49
52
|
[WindowHapiModuleName.basket]: WindowHapiServiceBasket
|
50
53
|
[WindowHapiModuleName.campaign]: WindowHapiServiceCampaign
|
@@ -55,6 +58,7 @@ export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
|
|
55
58
|
[WindowHapiModuleName.orderJourney]: WindowHapiServiceOrderJourney
|
56
59
|
[WindowHapiModuleName.ui]: WindowHapiServiceUI
|
57
60
|
[WindowHapiModuleName.ats]: WindowHapiServiceATS
|
61
|
+
[WindowHapiModuleName.debugging]: WindowHapiServiceDebugging
|
58
62
|
[WindowHapiModuleName.talentMindCompany]: WindowHapiServiceTalentMindCompany
|
59
63
|
[WindowHapiModuleName.talentMindJob]: WindowHapiServiceTalentMindJob
|
60
64
|
[WindowHapiModuleName.talentMindResume]: WindowHapiServiceTalentMindResume
|
@@ -70,6 +74,7 @@ export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
|
|
70
74
|
[WindowHapiModuleName.orderJourney]: WindowHapiServiceOrderJourney
|
71
75
|
[WindowHapiModuleName.ui]: WindowHapiServiceUI
|
72
76
|
[WindowHapiModuleName.ats]: WindowHapiServiceATS
|
77
|
+
[WindowHapiModuleName.debugging]: WindowHapiServiceDebugging
|
73
78
|
[WindowHapiModuleName.talentMindCompany]: WindowHapiServiceTalentMindCompany
|
74
79
|
[WindowHapiModuleName.talentMindJob]: WindowHapiServiceTalentMindJob
|
75
80
|
[WindowHapiModuleName.talentMindResume]: WindowHapiServiceTalentMindResume
|
package/_window/state.types.ts
CHANGED
@@ -55,7 +55,10 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
55
55
|
[WindowHapiModuleName.talentMindEvaluation]: WindowHapiStateModule<TalentMindEvaluationState>
|
56
56
|
basePropertiesThatShouldNotBeDocumented: string[]
|
57
57
|
handleDefaultStateFromQueryParams: (params: string | string[]) => void
|
58
|
-
rehydrateInitialState: (
|
58
|
+
rehydrateInitialState: (
|
59
|
+
initialState: Record<string, any>,
|
60
|
+
getStateModuleName: (storeName: string) => string,
|
61
|
+
) => void
|
59
62
|
onBeforeStateChange: () => void
|
60
63
|
onAfterStateChange: () => void
|
61
64
|
stores: {
|
package/alert/enums.ts
CHANGED
@@ -5,6 +5,7 @@ export enum AlertKey {
|
|
5
5
|
contractCreateSuccess = "contract-created",
|
6
6
|
contractGroupCreateSuccess = "contract-group-created",
|
7
7
|
campaignTakeOfflineSuccess = "campaign-take-offline-success",
|
8
|
+
campaignProductTakeOfflineSuccess = "campaign-product-take-offline-success",
|
8
9
|
"campaignCopyProductsContractsDeletedWarning" = "campaign-copy-contract-warning",
|
9
10
|
campaignOrderSuccess = "campaign-order-success",
|
10
11
|
campaignCopySuccess = "campaign-copy-success",
|
package/ats/state.types.ts
CHANGED
package/campaign/api.types.ts
CHANGED
@@ -2,8 +2,10 @@ import { AxiosRequestConfig } from "axios"
|
|
2
2
|
import {
|
3
3
|
Campaign,
|
4
4
|
CampaignEditRequestBody,
|
5
|
+
CampaignIdResponse,
|
5
6
|
CampaignOrderRequestBody,
|
6
7
|
CampaignPostingRequirementsValidateRequestBody,
|
8
|
+
CampaignSetProductStatusRequestBody,
|
7
9
|
TaxonomyEducationAndSeniorityLevel,
|
8
10
|
} from "./types"
|
9
11
|
import { ProductSupportingContractsComplete } from "../product/types"
|
@@ -22,6 +24,7 @@ export type WindowHapiAPICampaignConfigs = {
|
|
22
24
|
validateCampaign: AxiosRequestConfig
|
23
25
|
validateCampaignPostingRequirements: AxiosRequestConfig
|
24
26
|
saveCampaign: AxiosRequestConfig
|
27
|
+
setProductStatus: AxiosRequestConfig
|
25
28
|
}
|
26
29
|
export type WindowHapiAPICampaignRequests = {
|
27
30
|
getCampaigns: (
|
@@ -29,7 +32,10 @@ export type WindowHapiAPICampaignRequests = {
|
|
29
32
|
limit?: number,
|
30
33
|
labels?: Record<string, string> | null,
|
31
34
|
) => Promise<PaginatedAPIResponseV2<Campaign>>
|
32
|
-
getCampaign: (
|
35
|
+
getCampaign: (
|
36
|
+
campaignId: string,
|
37
|
+
queryParams?: Record<string, any>,
|
38
|
+
) => Promise<Campaign>
|
33
39
|
getCampaignDetail: (
|
34
40
|
campaignId: string,
|
35
41
|
detail: "status",
|
@@ -46,6 +52,10 @@ export type WindowHapiAPICampaignRequests = {
|
|
46
52
|
validateCampaignPostingRequirements: (
|
47
53
|
campaign: CampaignPostingRequirementsValidateRequestBody,
|
48
54
|
) => Promise<Campaign>
|
55
|
+
setProductStatus: (
|
56
|
+
campaignId: string,
|
57
|
+
requestBody: CampaignSetProductStatusRequestBody,
|
58
|
+
) => Promise<CampaignIdResponse>
|
49
59
|
}
|
50
60
|
export type WindowHapiAPICampaign = WindowHapiModuleWithConstructorArgs<
|
51
61
|
WindowHapiAPIModule<
|
@@ -7,7 +7,9 @@ import {
|
|
7
7
|
Campaign,
|
8
8
|
CampaignCreateForm,
|
9
9
|
CampaignEditForm,
|
10
|
+
CampaignIdResponse,
|
10
11
|
CampaignOrderRequestBody,
|
12
|
+
CampaignSetProductStatusRequestBody,
|
11
13
|
TaxonomyEducationAndSeniorityLevel,
|
12
14
|
} from "./types"
|
13
15
|
import { PaginatedAPIResponseV2 } from "../common/types"
|
@@ -25,6 +27,7 @@ export type CampaignServiceGetCampaignDetailHandler = (
|
|
25
27
|
) => Promise<ProductSupportingContractsComplete>
|
26
28
|
export type CampaignServiceGetCampaignHandler = (
|
27
29
|
campaignId: string,
|
30
|
+
queryParams?: Record<string, any>,
|
28
31
|
) => Promise<ProductSupportingContractsComplete>
|
29
32
|
export type CampaignServiceSetCampaignCancellationHandler = (
|
30
33
|
campaignId: string,
|
@@ -58,6 +61,10 @@ export type CampaignServiceGetCopyCampaignRequestBodyHandler = (
|
|
58
61
|
export type CampaignServiceGetEditCampaignRequestBodyHandler = (
|
59
62
|
campaign: Campaign,
|
60
63
|
) => CampaignCreateForm
|
64
|
+
export type CampaignServiceSetProductStatusHandler = (
|
65
|
+
campaignId: string,
|
66
|
+
requestBody: CampaignSetProductStatusRequestBody,
|
67
|
+
) => Promise<CampaignIdResponse>
|
61
68
|
export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
62
69
|
{
|
63
70
|
getCampaigns: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsHandler>
|
@@ -69,12 +76,16 @@ export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
|
69
76
|
orderCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceOrderCampaignHandler>
|
70
77
|
copyCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceCopyCampaignHandler>
|
71
78
|
editCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceEditCampaignHandler>
|
72
|
-
onAfterOrderCampaignSuccess: (
|
79
|
+
onAfterOrderCampaignSuccess: (
|
80
|
+
alertKey?: AlertKey,
|
81
|
+
disclaimerTexts?: string[],
|
82
|
+
) => void
|
73
83
|
validateContractPostingRequirementsWithCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceValidateContractPostingRequirementsWithCampaignHandler>
|
74
84
|
saveCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceSaveCampaignHandler>
|
75
85
|
validateCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceValidateCampaignHandler>
|
76
86
|
getCopyCampaignRequestBody: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCopyCampaignRequestBodyHandler>
|
77
87
|
getEditCampaignRequestBody: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetEditCampaignRequestBodyHandler>
|
88
|
+
setProductStatus: HapiServiceFunctionWithLifecycleHooks<CampaignServiceSetProductStatusHandler>
|
78
89
|
},
|
79
90
|
{ readonly service: WindowHapiService }
|
80
91
|
>
|
package/campaign/types.ts
CHANGED
@@ -2,7 +2,7 @@ import { ProductDuration, ProductIndustry } from "../product/types"
|
|
2
2
|
import { ProductPriceCurrency } from "../product/enums"
|
3
3
|
import { EmploymentType, SalaryPeriod } from "./enums"
|
4
4
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
5
|
-
import { PostingRequirement } from "../common"
|
5
|
+
import { PostingRequirement, PostingRequirementLabelsMap } from "../common"
|
6
6
|
|
7
7
|
export type CampaignProductSpecs = {
|
8
8
|
contractId: string | null
|
@@ -11,6 +11,7 @@ export type CampaignProductSpecs = {
|
|
11
11
|
durationPeriod: ProductDuration
|
12
12
|
jobBoardLink: string | null
|
13
13
|
postingRequirements: Record<string, any> | null
|
14
|
+
postingRequirementsLabels?: PostingRequirementLabelsMap
|
14
15
|
productId: string
|
15
16
|
status: CampaignStatus
|
16
17
|
utm: string | null
|
@@ -129,10 +130,15 @@ export type CampaignDetailedStatus = {
|
|
129
130
|
orderedProductsStatuses: CampaignDetailsStatusOrderedProductStatus[]
|
130
131
|
}
|
131
132
|
|
132
|
-
export type
|
133
|
+
export type CampaignDraft = {
|
134
|
+
campaignId: string
|
135
|
+
isDraft: boolean
|
136
|
+
paymentStatus: "processing_payment"
|
137
|
+
}
|
138
|
+
|
139
|
+
export type Campaign = Pick<CampaignDraft, "campaignId"> & {
|
133
140
|
labels: Record<string, string> | null
|
134
141
|
currency: ProductPriceCurrency
|
135
|
-
campaignId: string
|
136
142
|
campaignName: string | null
|
137
143
|
companyId: string
|
138
144
|
createdOn: string
|
@@ -177,6 +183,7 @@ export type CampaignCreateFormOrderedProductSpecBase = {
|
|
177
183
|
utm: string
|
178
184
|
contractId: string
|
179
185
|
postingRequirements: PostingRequirement[]
|
186
|
+
postingRequirementsLabels?: PostingRequirementLabelsMap
|
180
187
|
postingDurationDays: number | null
|
181
188
|
}
|
182
189
|
export type CampaignCreateFormOrderedProductSpec =
|
@@ -209,6 +216,7 @@ export type CampaignCreateForm = {
|
|
209
216
|
postingDetails: CampaignCreateFormPostingDetails
|
210
217
|
orderedProducts: string[] //Array of UUIDs
|
211
218
|
orderedProductsSpecs: Record<string, CampaignCreateFormOrderedProductSpec>
|
219
|
+
orderedProductsSpecsLabels?: Record<string, PostingRequirementLabelsMap>
|
212
220
|
}
|
213
221
|
|
214
222
|
export type CampaignEditForm = Omit<
|
@@ -220,6 +228,7 @@ export type CampaignEditForm = Omit<
|
|
220
228
|
| "paymentMethod"
|
221
229
|
| "postingDetails"
|
222
230
|
| "orderedProductsSpecs"
|
231
|
+
| "orderedProductsSpecsLabels"
|
223
232
|
> & {
|
224
233
|
campaignId: string
|
225
234
|
postingDetails: Omit<
|
@@ -230,6 +239,7 @@ export type CampaignEditForm = Omit<
|
|
230
239
|
string,
|
231
240
|
Omit<CampaignCreateFormOrderedProductSpec, "postingDurationDays">
|
232
241
|
>
|
242
|
+
orderedProductsSpecsLabels: Record<string, PostingRequirementLabelsMap>
|
233
243
|
}
|
234
244
|
|
235
245
|
export type CampaignOrderRequestBodyOrderedProductsSpec = {
|
@@ -237,6 +247,7 @@ export type CampaignOrderRequestBodyOrderedProductsSpec = {
|
|
237
247
|
utm: string
|
238
248
|
productId?: string
|
239
249
|
postingRequirements?: Record<string, any>
|
250
|
+
postingRequirementsLabels?: PostingRequirementLabelsMap
|
240
251
|
postingDurationDays: number | null
|
241
252
|
}
|
242
253
|
|
@@ -253,6 +264,7 @@ export type CampaignOrderRequestBody = {
|
|
253
264
|
targetGroup: CampaignTargetGroup
|
254
265
|
orderedProducts: string[]
|
255
266
|
orderedProductsSpecs: CampaignOrderRequestBodyOrderedProductsSpec[]
|
267
|
+
currency?: ProductPriceCurrency
|
256
268
|
}
|
257
269
|
|
258
270
|
export type CampaignEditRequestBody = Omit<
|
@@ -314,3 +326,12 @@ export type CampaignPostingRequirementsValidateResponse = {
|
|
314
326
|
posting_requirements: Record<string, any>
|
315
327
|
}
|
316
328
|
}
|
329
|
+
|
330
|
+
export type CampaignSetProductStatusRequestBody = {
|
331
|
+
productId: string
|
332
|
+
status: "offline"
|
333
|
+
}
|
334
|
+
|
335
|
+
export type CampaignIdResponse = {
|
336
|
+
campaignId: string
|
337
|
+
}
|
@@ -149,7 +149,14 @@ export type ZodCampaign = ZodObject<{
|
|
149
149
|
walletId: ZodOptional<ZodNullable<ZodString>>
|
150
150
|
poNumber: ZodOptional<ZodNullable<ZodString>>
|
151
151
|
}>
|
152
|
-
|
152
|
+
|
153
|
+
export type ZodCampaignDraft = ZodObject<{
|
154
|
+
campaignId: ZodString
|
155
|
+
isDraft: ZodBoolean
|
156
|
+
paymentStatus: ZodString
|
157
|
+
}>
|
158
|
+
|
159
|
+
export type ZodCampaigns = ZodArray<ZodUnion<[ZodCampaign, ZodCampaignDraft]>>
|
153
160
|
export type ZodCampaignCreateFormPostingDetails = ZodObject<{
|
154
161
|
title: ZodString
|
155
162
|
description: ZodString
|
@@ -36,6 +36,7 @@ export enum WindowHapiEventCommandName {
|
|
36
36
|
domHideElement = "dom:hide-element",
|
37
37
|
domShowElement = "dom:show-element",
|
38
38
|
domSetStyleAttribute = "dom:set-style-attribute",
|
39
|
+
domSetAttribute = "dom:set-attribute",
|
39
40
|
domAddClass = "dom:add-class",
|
40
41
|
domRemoveClass = "dom:remove-class",
|
41
42
|
domSlotAvailable = "dom:slot-available",
|
package/common/events/types.ts
CHANGED
@@ -37,6 +37,7 @@ export type WindowHapiEventCommand = {
|
|
37
37
|
export type WindowHapiEventCommandCallbackHandler = (
|
38
38
|
data: any,
|
39
39
|
event: WindowHapiEventCommand | WindowHapiEventListener,
|
40
|
+
previousData?: any,
|
40
41
|
) => void
|
41
42
|
export type WindowHapiEventCommandCommitHandler = (
|
42
43
|
...args: any[]
|
package/common/types.ts
CHANGED
@@ -50,6 +50,7 @@ export type PaginatedAPIResponseV2<T> = {
|
|
50
50
|
} & PaginationResponseV2
|
51
51
|
export type HapiInputErrorMessageOrValidity =
|
52
52
|
| MessageDescriptor
|
53
|
+
| MessageDescriptor[]
|
53
54
|
| boolean
|
54
55
|
| undefined
|
55
56
|
| null
|
@@ -78,6 +79,7 @@ export type ValidatorKey =
|
|
78
79
|
| keyof Validators
|
79
80
|
export type NestedValidatorKeys =
|
80
81
|
| ValidatorKey
|
82
|
+
| ValidatorKey[]
|
81
83
|
| {
|
82
84
|
[k: string]: ValidatorKey | NestedValidatorKeys
|
83
85
|
}
|
@@ -128,14 +130,33 @@ export type PostingRequirementType =
|
|
128
130
|
| "VIDEO-URL"
|
129
131
|
| "IMAGE-PREVIEW"
|
130
132
|
| "DYNAMISCH"
|
133
|
+
|
134
|
+
export type PostingRequirementRuleName =
|
135
|
+
| "int"
|
136
|
+
| "regex"
|
137
|
+
| "maxlength"
|
138
|
+
| "minlength"
|
139
|
+
| "maxitems"
|
140
|
+
| "minitems"
|
141
|
+
| "date"
|
142
|
+
| "float"
|
143
|
+
| "email"
|
144
|
+
| "lower"
|
145
|
+
| "higher"
|
146
|
+
| "min"
|
147
|
+
| "max"
|
148
|
+
| "before"
|
149
|
+
| "after"
|
150
|
+
| "url"
|
151
|
+
|
131
152
|
export type PostingRequirementRule = {
|
132
|
-
rule:
|
153
|
+
rule: PostingRequirementRuleName
|
133
154
|
data: string
|
134
155
|
}
|
135
156
|
export type PostingRequirementDisplayRuleShow = {
|
136
157
|
facet: string
|
137
158
|
value: any
|
138
|
-
op: "notempty" | "equal" | "in"
|
159
|
+
op: "notempty" | "equal" | "in" | "selected_option_show_contains"
|
139
160
|
}
|
140
161
|
export type PostingRequirementDisplayRule = {
|
141
162
|
show: PostingRequirementDisplayRuleShow[]
|
@@ -168,12 +189,14 @@ export type PostingRequirement = {
|
|
168
189
|
display_rules: PostingRequirementDisplayRule | null
|
169
190
|
autocomplete: PostingRequirementAutocomplete | null
|
170
191
|
options: PostingRequirementOption[] | null
|
192
|
+
message?: string | null
|
171
193
|
required: boolean
|
172
194
|
sort: string
|
173
195
|
type: PostingRequirementType
|
174
196
|
rules?: PostingRequirementRule[] | null
|
175
|
-
group_id?: string
|
197
|
+
group_id?: string | number
|
176
198
|
}
|
199
|
+
export type PostingRequirementLabelsMap = Record<string, string>
|
177
200
|
export type PostingRequirementOptionRequiresField = {
|
178
201
|
field: {
|
179
202
|
name: string
|
@@ -188,12 +211,14 @@ export type PostingRequirementOption = {
|
|
188
211
|
sort: string
|
189
212
|
parent?: string
|
190
213
|
requires?: PostingRequirementOptionRequiresField[] | null
|
214
|
+
show?: string[]
|
191
215
|
}
|
192
216
|
export type TransformedPostingRequirementOption = {
|
193
217
|
value?: string
|
194
218
|
data?: any[]
|
195
219
|
requires?: PostingRequirementOptionRequiresField[] | null
|
196
220
|
label: string
|
221
|
+
show?: string[]
|
197
222
|
}
|
198
223
|
export type PostingRequirementReactiveDescription = { description: string }
|
199
224
|
export type TransformedPostingRequirement = Omit<
|
@@ -77,7 +77,7 @@ export type ZodContract = ZodObject<{
|
|
77
77
|
channel: ZodOptional<ZodContractChannel>
|
78
78
|
alias: ZodContractAlias
|
79
79
|
channel_id: ZodNumber
|
80
|
-
class_name: ZodString
|
80
|
+
class_name: ZodNullable<ZodString>
|
81
81
|
contract_id: ZodString
|
82
82
|
customer_id: ZodString
|
83
83
|
facets: ZodContractFacets
|
package/debugging/index.ts
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
import { WindowHapiService } from "../_window/service.types"
|
2
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
+
import { HapiDebuggingLogs } from "./types"
|
4
|
+
import { WindowHapiEventCommand, WindowHapiEventListener } from "../common"
|
5
|
+
|
6
|
+
export type WindowHapiServiceDebugging = WindowHapiModuleWithConstructorArgs<
|
7
|
+
{
|
8
|
+
logs: HapiDebuggingLogs
|
9
|
+
addStateEventToLogs: (eventCommand: WindowHapiEventCommand) => void
|
10
|
+
addNonStateEventToLogs: (eventCommand: WindowHapiEventCommand) => void
|
11
|
+
addListenerToLogs: (
|
12
|
+
eventCommand: WindowHapiEventCommand | WindowHapiEventListener,
|
13
|
+
) => void
|
14
|
+
},
|
15
|
+
{ readonly service: WindowHapiService }
|
16
|
+
>
|
package/debugging/state.types.ts
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
import { WindowHapiConfigSubmodule, WindowHapiInjectorConfig } from "../_window"
|
2
|
+
|
3
|
+
export type HapiDebuggingLogs = {
|
4
|
+
navigator: Record<string, any> | undefined
|
5
|
+
config: WindowHapiConfigSubmodule | undefined
|
6
|
+
injectorConfig: WindowHapiInjectorConfig | undefined
|
7
|
+
timestamps: {
|
8
|
+
timeStart: Date | undefined
|
9
|
+
timeFinish: Date | undefined
|
10
|
+
}
|
11
|
+
stateTimeline: any[]
|
12
|
+
nonStateTimeline: any[]
|
13
|
+
listenersTimeline: any[]
|
14
|
+
listeners: any[]
|
15
|
+
state: any | undefined
|
16
|
+
instances: any[]
|
17
|
+
}
|
package/modal/enums.ts
CHANGED
@@ -8,6 +8,7 @@ export enum ModalKeys {
|
|
8
8
|
basket = "layout-basket-modal",
|
9
9
|
productInfo = "product-info",
|
10
10
|
campaignTakeOfflineConfirmation = "campaign-confirm-take-offline",
|
11
|
+
campaignProductTakeOfflineConfirmation = "campaign-product-confirm-take-offline",
|
11
12
|
campaignCopyJourney = "campaign-confirm-copy",
|
12
13
|
campaignStatusDetail = "campaign-status-detail",
|
13
14
|
campaignCopySelection = "contract-copy-selection",
|
package/modal/types.ts
CHANGED
@@ -17,6 +17,10 @@ export type BasketRemoveProductConfirmationModalProps = {
|
|
17
17
|
basketProduct: Product | Contract
|
18
18
|
}
|
19
19
|
export type CampaignTakeOfflineConfirmationModalProps = { campaignId: string }
|
20
|
+
export type CampaignProductTakeOfflineConfirmationModalProps = {
|
21
|
+
campaignId: string
|
22
|
+
productId: string
|
23
|
+
}
|
20
24
|
export type ContractRemoveConfirmationModalProps = { contractId: string }
|
21
25
|
export type ContractGroupConflictInfoModalProps = {
|
22
26
|
contract: Contract
|
@@ -47,7 +47,10 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
47
47
|
setContractStepsErrorMessages: (
|
48
48
|
messages: Record<
|
49
49
|
string,
|
50
|
-
Record<
|
50
|
+
Record<
|
51
|
+
string,
|
52
|
+
MessageDescriptor | MessageDescriptor[] | boolean
|
53
|
+
>
|
51
54
|
>,
|
52
55
|
) => void
|
53
56
|
setContractStepsSubmittedSteps: (steps: Record<string, boolean>) => void
|
@@ -61,7 +64,10 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
61
64
|
setProductStepsErrorMessages: (
|
62
65
|
messages: Record<
|
63
66
|
string,
|
64
|
-
Record<
|
67
|
+
Record<
|
68
|
+
string,
|
69
|
+
MessageDescriptor | MessageDescriptor[] | boolean
|
70
|
+
>
|
65
71
|
>,
|
66
72
|
) => void
|
67
73
|
setProductStepsSubmittedSteps: (steps: Record<string, boolean>) => void
|
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
OrderJourneyOrderReviewStepData,
|
8
8
|
OrderJourneyProductStep,
|
9
9
|
OrderJourneyOrderErrors,
|
10
|
+
OrderJourneyOrderConfirmationStepData,
|
10
11
|
} from "./types"
|
11
12
|
import { MessageDescriptor } from "react-intl"
|
12
13
|
import { NestedValidatorKeys, UseValidatorResult } from "../common/types"
|
@@ -82,7 +83,7 @@ export type OrderJourneyState = {
|
|
82
83
|
contractStepsSubmittedSteps: Record<string, boolean>
|
83
84
|
contractStepsErrorMessages: Record<
|
84
85
|
string,
|
85
|
-
Record<string, MessageDescriptor>
|
86
|
+
Record<string, MessageDescriptor | MessageDescriptor[]>
|
86
87
|
>
|
87
88
|
contractStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
88
89
|
contractStepsData: Record<string, Record<string, any>>
|
@@ -91,7 +92,10 @@ export type OrderJourneyState = {
|
|
91
92
|
productSteps: OrderJourneyProductStep[]
|
92
93
|
productStepsBlurredFields: Record<string, Record<string, boolean>>
|
93
94
|
productStepsSubmittedSteps: Record<string, boolean>
|
94
|
-
productStepsErrorMessages: Record<
|
95
|
+
productStepsErrorMessages: Record<
|
96
|
+
string,
|
97
|
+
Record<string, MessageDescriptor | MessageDescriptor[]>
|
98
|
+
>
|
95
99
|
productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
96
100
|
productStepsData: Record<string, Record<string, any>>
|
97
101
|
productStepsValidations: Record<string, UseValidatorResult> | null
|
@@ -109,6 +113,6 @@ export type OrderJourneyState = {
|
|
109
113
|
paymentMethodStepValidations: UseValidatorResult
|
110
114
|
/* Order Confirmation */
|
111
115
|
orderConfirmationStep: OrderJourneyStep
|
112
|
-
orderConfirmationStepData:
|
116
|
+
orderConfirmationStepData: OrderJourneyOrderConfirmationStepData
|
113
117
|
orderConfirmationStepValidations: UseValidatorResult
|
114
118
|
}
|
package/orderJourney/types.ts
CHANGED
@@ -69,6 +69,10 @@ export type OrderJourneyOrderReviewStepData = {
|
|
69
69
|
accordionsEnabled: OrderJourneyStepKey[]
|
70
70
|
}
|
71
71
|
|
72
|
+
export type OrderJourneyOrderConfirmationStepData = {
|
73
|
+
disclaimerTexts: string[]
|
74
|
+
}
|
75
|
+
|
72
76
|
export type OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid =
|
73
77
|
{
|
74
78
|
errors: {
|
@@ -88,6 +92,7 @@ export type OrderJourneyOrderErrorsCampaignIsInvalid = {
|
|
88
92
|
recruiterInfo: Record<string, any>
|
89
93
|
targetGroup: Record<string, any>
|
90
94
|
orderedProducts: string[]
|
95
|
+
orderedProductsSpecs?: any[]
|
91
96
|
walletId: string
|
92
97
|
}
|
93
98
|
|
@@ -40,6 +40,9 @@ export type ZodOrderJourneyOrderReviewStepData = ZodObject<{
|
|
40
40
|
ZodUnion<[ZodNativeEnum<typeof OrderJourneyStepKey>, ZodString]>
|
41
41
|
>
|
42
42
|
}>
|
43
|
+
export type ZodOrderJourneyOrderConfirmationStepData = ZodObject<{
|
44
|
+
disclaimerTexts: ZodArray<ZodString>
|
45
|
+
}>
|
43
46
|
export type WindowHapiValidationsOrderJourney = {
|
44
47
|
supportedStepKeys: OrderJourneyStepKey[]
|
45
48
|
stepKeysRegex: RegExp
|
@@ -55,4 +58,5 @@ export type WindowHapiValidationsOrderJourney = {
|
|
55
58
|
utmMaps: ZodOrderJourneyUTMCodeMaps
|
56
59
|
utmCodesStepData: ZodOrderJourneyUTMCodesStepData
|
57
60
|
orderReviewStepData: ZodOrderJourneyOrderReviewStepData
|
61
|
+
orderConfirmationStepData: ZodOrderJourneyOrderConfirmationStepData
|
58
62
|
}
|
package/package.json
CHANGED
package/product/enums.ts
CHANGED
@@ -13,6 +13,7 @@ export enum ProductPriceCurrency {
|
|
13
13
|
|
14
14
|
export enum ProductSortBy {
|
15
15
|
"recommendedFirst" = "recommendedFirst",
|
16
|
+
"relevant" = "relevant",
|
16
17
|
"createdNewestToOldest" = "created.desc",
|
17
18
|
"createdOldestToNewest" = "created.asc",
|
18
19
|
"priceHighToLow" = "list_price.desc",
|
package/product/service.types.ts
CHANGED
@@ -57,7 +57,11 @@ export type ProductServiceGetIndustriesHandler = () => Promise<
|
|
57
57
|
ProductIndustry[]
|
58
58
|
>
|
59
59
|
|
60
|
-
export type ProductServiceSetArbitraryJobTitle = (
|
60
|
+
export type ProductServiceSetArbitraryJobTitle = (
|
61
|
+
text: string,
|
62
|
+
shouldResetJobTitlesIds?: boolean,
|
63
|
+
shouldResetJobFunctionsIds?: boolean,
|
64
|
+
) => void
|
61
65
|
|
62
66
|
export type ProductServiceGetProductPostingRequirementOptionsHandler = (
|
63
67
|
productId: string,
|
package/product/types.ts
CHANGED
@@ -4,7 +4,11 @@ import {
|
|
4
4
|
ProductSortBy,
|
5
5
|
} from "./enums"
|
6
6
|
import { ContractCredential } from "../contract/types"
|
7
|
-
import {
|
7
|
+
import {
|
8
|
+
Facet,
|
9
|
+
PostingRequirement,
|
10
|
+
PostingRequirementLabelsMap,
|
11
|
+
} from "../common"
|
8
12
|
|
9
13
|
export type ProductRange = "hours" | "days" | "weeks" | "months"
|
10
14
|
|
@@ -63,7 +67,7 @@ export type Product = {
|
|
63
67
|
time_to_process: ProductDuration
|
64
68
|
time_to_setup: ProductDuration
|
65
69
|
is_recommended?: boolean
|
66
|
-
|
70
|
+
has_product_specs: boolean
|
67
71
|
} & ProductLogos &
|
68
72
|
ProductType
|
69
73
|
|
@@ -159,6 +163,7 @@ export type ProductSupportingContractsComplete = ProductLogos &
|
|
159
163
|
feed_url: string | null
|
160
164
|
manual_setup_required: boolean
|
161
165
|
posting_requirements: PostingRequirement[]
|
166
|
+
posting_requirements_labels: PostingRequirementLabelsMap
|
162
167
|
setup_instructions: string //html;
|
163
168
|
}
|
164
169
|
|
package/wallet/service.types.ts
CHANGED
@@ -25,6 +25,7 @@ export type WindowHapiServiceWallet = WindowHapiModuleWithConstructorArgs<
|
|
25
25
|
) => Promise<void>
|
26
26
|
resetTopUpState: () => void
|
27
27
|
resetDirectChargeState: () => void
|
28
|
+
resetPurchaseOrderState: () => void
|
28
29
|
resetCheckoutFormState: () => void
|
29
30
|
},
|
30
31
|
{ readonly service: WindowHapiService }
|