@vonq/hapi-elements-types 1.31.0 → 1.33.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/utils.types.ts +4 -0
- package/alert/service.types.ts +1 -0
- package/alert/types.ts +1 -0
- package/basket/state.types.ts +2 -0
- package/campaign/qa.types.ts +1 -1
- package/campaign/state.types.ts +2 -0
- package/campaign/types.ts +7 -4
- package/campaign/validations.types.ts +22 -9
- package/common/types.ts +4 -3
- package/common/validations.types.ts +2 -2
- package/common/validator/types.ts +22 -4
- package/language/service.types.ts +3 -1
- package/orderJourney/state.types.ts +1 -0
- package/package.json +1 -1
- package/theming/types.ts +1 -0
package/_window/utils.types.ts
CHANGED
@@ -17,6 +17,10 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
17
17
|
{
|
18
18
|
isObject: (item: any) => boolean
|
19
19
|
mergeDeepOverwriteArrays: (original: any, overwrites: any) => any
|
20
|
+
flattenObject: (
|
21
|
+
object: Record<string, any>,
|
22
|
+
parentKey?: string,
|
23
|
+
) => Record<string, any>
|
20
24
|
getFlattenedTree: (
|
21
25
|
values: any[],
|
22
26
|
childAccessor: string,
|
package/alert/service.types.ts
CHANGED
package/alert/types.ts
CHANGED
package/basket/state.types.ts
CHANGED
@@ -12,6 +12,8 @@ export type BasketState = {
|
|
12
12
|
totalInWalletCurrency: number
|
13
13
|
totalExceedsMaxPurchaseOrder: boolean
|
14
14
|
productsAreLoading: boolean
|
15
|
+
productIdsBeingAdded: (string | number)[]
|
16
|
+
productIdsBeingRemoved: (string | number)[]
|
15
17
|
deliveryAndProcessingTimes: ProductOrderDeliveryTime | null
|
16
18
|
deliveryAndProcessingTimesAreLoading: boolean
|
17
19
|
}
|
package/campaign/qa.types.ts
CHANGED
@@ -4,7 +4,7 @@ import { CampaignCreateForm } from "./types"
|
|
4
4
|
|
5
5
|
export type WindowHapiQACampaign = WindowHapiModuleWithConstructorArgs<
|
6
6
|
{
|
7
|
-
useMockCampaignForm: () => CampaignCreateForm
|
7
|
+
useMockCampaignForm: () => Promise<CampaignCreateForm>
|
8
8
|
getRandomCampaignId: () => Promise<string>
|
9
9
|
setCampaignFormDebuggerIsShown: (isEnabled: boolean) => boolean
|
10
10
|
setCampaignCardDebuggerIsShown: (isEnabled: boolean) => boolean
|
package/campaign/state.types.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
Campaign,
|
3
3
|
CampaignCreateForm,
|
4
|
+
CampaignCreateFormDraft,
|
4
5
|
CampaignEditForm,
|
5
6
|
TaxonomyEducationAndSeniorityLevel,
|
6
7
|
TaxonomyEmploymentTypes,
|
@@ -14,6 +15,7 @@ export type CampaignState = {
|
|
14
15
|
campaignsPaginationMeta: PaginationResponseV2
|
15
16
|
campaignsAreLoading: boolean
|
16
17
|
campaignForm: CampaignCreateForm | CampaignEditForm
|
18
|
+
campaignFormDraft: CampaignCreateFormDraft | null
|
17
19
|
campaignIsCreating: boolean
|
18
20
|
/* Education Levels */
|
19
21
|
educationLevels: TaxonomyEducationAndSeniorityLevel[]
|
package/campaign/types.ts
CHANGED
@@ -46,11 +46,11 @@ export type CampaignPostingDetailsOrganization = {
|
|
46
46
|
export type CampaignProductPostingDetailsSalaryIndicationRange = {
|
47
47
|
currency?: string | null
|
48
48
|
from?: number | null
|
49
|
-
to
|
49
|
+
to?: number | null
|
50
50
|
}
|
51
51
|
|
52
52
|
export type CampaignPostingDetailsSalaryIndication = {
|
53
|
-
period: SalaryPeriod
|
53
|
+
period: SalaryPeriod | null
|
54
54
|
range: CampaignProductPostingDetailsSalaryIndicationRange
|
55
55
|
}
|
56
56
|
|
@@ -76,7 +76,7 @@ export type CampaignPostingDetails = {
|
|
76
76
|
employmentType: EmploymentType
|
77
77
|
jobPageUrl: string
|
78
78
|
organization: CampaignPostingDetailsOrganization
|
79
|
-
salaryIndication: CampaignPostingDetailsSalaryIndication
|
79
|
+
salaryIndication: CampaignPostingDetailsSalaryIndication | null
|
80
80
|
title: string
|
81
81
|
weeklyWorkingHours: CampaignPostingDetailsWeeklyWorkingHours
|
82
82
|
workingLocation: CampaignPostingDetailsWorkingLocation
|
@@ -216,7 +216,7 @@ export type CampaignCreateFormPostingDetails = {
|
|
216
216
|
yearsOfExperience: number
|
217
217
|
employmentType: EmploymentType
|
218
218
|
weeklyWorkingHours: CampaignPostingDetailsWeeklyWorkingHours
|
219
|
-
salaryIndication: CampaignPostingDetailsSalaryIndication
|
219
|
+
salaryIndication: CampaignPostingDetailsSalaryIndication | null
|
220
220
|
contactInfo: CampaignPostingDetailsContactInfo | null
|
221
221
|
jobPageUrl: string
|
222
222
|
applicationUrl: string
|
@@ -239,6 +239,9 @@ export type CampaignCreateForm = {
|
|
239
239
|
heStateSnapshotId?: string
|
240
240
|
}
|
241
241
|
|
242
|
+
export type CampaignCreateFormDraft = CampaignCreateForm &
|
243
|
+
Pick<Campaign, "campaignId">
|
244
|
+
|
242
245
|
export type CampaignEditForm = Omit<
|
243
246
|
CampaignCreateForm,
|
244
247
|
| "companyId"
|
@@ -54,14 +54,16 @@ export type ZodCampaignPostingDetailsOrganization = ZodObject<{
|
|
54
54
|
companyLogo: ZodString
|
55
55
|
name: ZodString
|
56
56
|
}>
|
57
|
-
export type ZodCampaignPostingDetailsSalaryIndication =
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
export type ZodCampaignPostingDetailsSalaryIndication = ZodNullable<
|
58
|
+
ZodObject<{
|
59
|
+
period: ZodOptional<ZodNullable<ZodString>>
|
60
|
+
range: ZodObject<{
|
61
|
+
currency: ZodOptional<ZodNullable<ZodString>>
|
62
|
+
from: ZodOptional<ZodNullable<ZodNumber>>
|
63
|
+
to: ZodOptional<ZodNullable<ZodNumber>>
|
64
|
+
}>
|
63
65
|
}>
|
64
|
-
|
66
|
+
>
|
65
67
|
export type ZodCampaignPostingDetailsWeeklyWorkingHours = ZodObject<{
|
66
68
|
from: ZodOptional<ZodNullable<ZodNumber>>
|
67
69
|
to: ZodNumber
|
@@ -193,7 +195,7 @@ export type ZodCampaignCreateFormTargetGroup = ZodObject<{
|
|
193
195
|
}>
|
194
196
|
>
|
195
197
|
}>
|
196
|
-
export type
|
198
|
+
export type ZodCampaignCreateFormRaw = {
|
197
199
|
labels: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodString>>>
|
198
200
|
companyId: ZodString
|
199
201
|
campaignName: ZodOptional<ZodNullable<ZodString>>
|
@@ -206,7 +208,16 @@ export type ZodCampaignCreateForm = ZodObject<{
|
|
206
208
|
postingDetails: ZodCampaignCreateFormPostingDetails
|
207
209
|
orderedProductsSpecs: ZodCampaignCreateFormOrderedProductSpecs
|
208
210
|
orderedProducts: ZodArray<ZodString>
|
209
|
-
}
|
211
|
+
}
|
212
|
+
export type ZodCampaignCreateForm = ZodObject<ZodCampaignCreateFormRaw>
|
213
|
+
export type ZodCampaignCampaignIdRaw = {
|
214
|
+
campaignId: ZodString
|
215
|
+
}
|
216
|
+
export type ZodCampaignCreateFormDraftPartials =
|
217
|
+
ZodObject<ZodCampaignCampaignIdRaw>
|
218
|
+
export type ZodCampaignCreateFormDraft = ZodNullable<
|
219
|
+
ZodObject<ZodCampaignCreateFormRaw & ZodCampaignCampaignIdRaw>
|
220
|
+
>
|
210
221
|
export type WindowHapiValidationsCampaign = {
|
211
222
|
status: string[]
|
212
223
|
draftStatus: CampaignDraftStatus[]
|
@@ -241,6 +252,8 @@ export type WindowHapiValidationsCampaign = {
|
|
241
252
|
campaign: ZodCampaign
|
242
253
|
campaigns: ZodCampaigns
|
243
254
|
campaignForm: ZodCampaignCreateForm
|
255
|
+
campaignFormDraft: ZodCampaignCreateFormDraft
|
256
|
+
campaignFormDraftPartials: ZodCampaignCreateFormDraftPartials
|
244
257
|
campaignFormTargetGroup: ZodCampaignCreateFormTargetGroup
|
245
258
|
campaignFormPostingDetails: ZodCampaignCreateFormPostingDetails
|
246
259
|
campaignFormOrderedProductsSpecs: ZodCampaignCreateFormOrderedProductSpecs
|
package/common/types.ts
CHANGED
@@ -82,12 +82,13 @@ export type ValidatorKey =
|
|
82
82
|
| "isPostalCodeLocales"
|
83
83
|
>
|
84
84
|
| keyof Validators
|
85
|
+
export type ValidatorKeyMap = {
|
86
|
+
[k: string]: ValidatorKey | NestedValidatorKeys
|
87
|
+
}
|
85
88
|
export type NestedValidatorKeys =
|
86
89
|
| ValidatorKey
|
87
90
|
| ValidatorKey[]
|
88
|
-
|
|
89
|
-
[k: string]: ValidatorKey | NestedValidatorKeys
|
90
|
-
}
|
91
|
+
| ValidatorKeyMap
|
91
92
|
export type BaseService = {
|
92
93
|
logger: WindowHapiLogger
|
93
94
|
}
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
ZodUnion,
|
14
14
|
ZodUnknown,
|
15
15
|
} from "zod"
|
16
|
+
import { Validators } from "./validator"
|
16
17
|
|
17
18
|
export type ZodIntlDescriptor = ZodObject<{
|
18
19
|
id: ZodString
|
@@ -55,7 +56,6 @@ export type ZodPaginationResponseV2 = ZodObject<
|
|
55
56
|
} & ZodPaginationLimitOffsetDefinition
|
56
57
|
>
|
57
58
|
export type WindowHapiValidationsCommon = {
|
58
|
-
isURL: (url: string) => boolean | never
|
59
59
|
genericBoolean: ZodBoolean
|
60
60
|
genericNumber: ZodNumber
|
61
61
|
genericNumberArray: ZodArray<ZodNumber>
|
@@ -90,4 +90,4 @@ export type WindowHapiValidationsCommon = {
|
|
90
90
|
url: ZodString
|
91
91
|
apiResourceRegex: RegExp
|
92
92
|
apiResource: ZodString
|
93
|
-
}
|
93
|
+
} & Validators
|
@@ -1,6 +1,24 @@
|
|
1
|
+
export type ValidatorsIsNotEmptyHandler = (
|
2
|
+
value: string | Record<string, any> | any[],
|
3
|
+
) => boolean
|
4
|
+
|
5
|
+
export type ValidatorsIsNotEmptyObjectHandler = (
|
6
|
+
value: Object | undefined | null,
|
7
|
+
) => boolean
|
8
|
+
|
9
|
+
export type ValidatorsIsNotZeroHandler = (value: number) => boolean
|
10
|
+
|
11
|
+
export type ValidatorsIsHandledByBackendHandler = (value: any) => false
|
12
|
+
|
13
|
+
export type ValidatorsIsURLHandler = (value: string) => boolean
|
14
|
+
|
15
|
+
export type ValidatorsIsRegExpHandler = (value: string) => boolean
|
16
|
+
|
1
17
|
export type Validators = {
|
2
|
-
isNotEmpty:
|
3
|
-
isNotEmptyObject:
|
4
|
-
isNotZero:
|
5
|
-
isHandledByBackend:
|
18
|
+
isNotEmpty: ValidatorsIsNotEmptyHandler
|
19
|
+
isNotEmptyObject: ValidatorsIsNotEmptyObjectHandler
|
20
|
+
isNotZero: ValidatorsIsNotZeroHandler
|
21
|
+
isHandledByBackend: ValidatorsIsHandledByBackendHandler
|
22
|
+
isURL: ValidatorsIsURLHandler
|
23
|
+
isRegExp: ValidatorsIsRegExpHandler
|
6
24
|
}
|
@@ -2,6 +2,8 @@ import { WindowHapiService } from "../_window/service.types"
|
|
2
2
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
3
|
|
4
4
|
export type WindowHapiServiceLanguage = WindowHapiModuleWithConstructorArgs<
|
5
|
-
{
|
5
|
+
{
|
6
|
+
resetAndRefreshTaxonomies: () => void
|
7
|
+
},
|
6
8
|
{ readonly service: WindowHapiService }
|
7
9
|
>
|
@@ -83,6 +83,7 @@ export type OrderJourneyState = {
|
|
83
83
|
/* Posting Details */
|
84
84
|
postingDetailsStep: OrderJourneyStep
|
85
85
|
postingDetailsStepData: Record<string, any>
|
86
|
+
postingDetailsStepValidators: NestedValidatorKeys
|
86
87
|
postingDetailsStepValidations: UseValidatorResult
|
87
88
|
/* Organization */
|
88
89
|
organizationStep: OrderJourneyStep
|
package/package.json
CHANGED