@vonq/hapi-elements-types 1.20.0 → 1.22.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/README.md +2 -2
- package/_window/auth.types.ts +1 -1
- package/_window/service.types.ts +3 -4
- package/_window/state.types.ts +1 -1
- package/_window/window.ts +2 -0
- package/basket/service.types.ts +4 -0
- package/campaign/types.ts +2 -2
- package/campaign/validations.types.ts +4 -2
- package/common/types.ts +47 -5
- package/contract/state.types.ts +1 -0
- package/debugging/index.ts +1 -1
- package/modal/enums.ts +9 -0
- package/modal/types.ts +17 -3
- package/modal/utils.types.ts +2 -0
- package/orderJourney/state.types.ts +1 -0
- package/orderJourney/types.ts +41 -5
- package/package.json +2 -1
- package/product/types.ts +2 -0
- package/product/validations.types.ts +1 -0
package/README.md
CHANGED
@@ -15,7 +15,7 @@ yarn add -D @vonq/hapi-elements-types
|
|
15
15
|
|
16
16
|
All the types have been exported in a single file so you can get started using the types as such:
|
17
17
|
```
|
18
|
-
import {
|
18
|
+
import {CampaignCreateForm} from "@vonq/hapi-elements-types";
|
19
19
|
|
20
|
-
const campaignObject:
|
20
|
+
const campaignObject: CampaignCreateForm = {} //Typescript will warn about missing properties
|
21
21
|
```
|
package/_window/auth.types.ts
CHANGED
@@ -8,7 +8,7 @@ export type WindowHapiAuth = WindowHapiModuleWithConstructorArgs<
|
|
8
8
|
{
|
9
9
|
partnerToken: string | undefined // used for impersonation
|
10
10
|
clientToken: string | undefined
|
11
|
-
walletCurrency: ProductPriceCurrency
|
11
|
+
walletCurrency: ProductPriceCurrency
|
12
12
|
},
|
13
13
|
{ readonly core: WindowHapiClassInterface }
|
14
14
|
>
|
package/_window/service.types.ts
CHANGED
@@ -20,10 +20,9 @@ import { WindowHapiServiceTalentMindResume } from "../talentMindResume/service.t
|
|
20
20
|
import { WindowHapiServiceTalentMindEvaluation } from "../talentMindEvaluation/service.types"
|
21
21
|
import { WindowHapiServiceDebugging } from "../debugging/service.types"
|
22
22
|
|
23
|
-
export type HapiServiceFunctionLifecycleHookCallbackHandler = (
|
24
|
-
|
25
|
-
|
26
|
-
| Promise<void | never>
|
23
|
+
export type HapiServiceFunctionLifecycleHookCallbackHandler = (
|
24
|
+
...args: any[]
|
25
|
+
) => void | never | Promise<void | never>
|
27
26
|
|
28
27
|
export type HapiServiceFunctionLifecycleHookHandler = (
|
29
28
|
callback: HapiServiceFunctionLifecycleHookCallbackHandler,
|
package/_window/state.types.ts
CHANGED
@@ -57,7 +57,7 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
57
57
|
handleDefaultStateFromQueryParams: (params: string | string[]) => void
|
58
58
|
rehydrateInitialState: (
|
59
59
|
initialState: Record<string, any>,
|
60
|
-
getStateModuleName
|
60
|
+
getStateModuleName?: (storeName: string) => string,
|
61
61
|
) => void
|
62
62
|
onBeforeStateChange: () => void
|
63
63
|
onAfterStateChange: () => void
|
package/_window/window.ts
CHANGED
@@ -12,6 +12,7 @@ import { WindowHapiService } from "./service.types"
|
|
12
12
|
import { WindowHapiQA } from "./qa.types"
|
13
13
|
import { WindowHapiLogger } from "../common/logger/types"
|
14
14
|
import {
|
15
|
+
HapiFeatureBranch,
|
15
16
|
HapiWebComponent,
|
16
17
|
RecursivePartial,
|
17
18
|
WindowHapiSubmoduleName,
|
@@ -126,6 +127,7 @@ export type WindowHapiConfigSubmodule = {
|
|
126
127
|
htmlTemplates: Record<string, string>
|
127
128
|
walletCurrency: ProductPriceCurrency
|
128
129
|
isUsingGETMethod: boolean
|
130
|
+
featureBranches: HapiFeatureBranch[]
|
129
131
|
}
|
130
132
|
|
131
133
|
export type WindowHapiClassInterface = {
|
package/basket/service.types.ts
CHANGED
@@ -22,12 +22,16 @@ export type BasketServiceRemoveContractsWithConflictingGroupsHandler = (
|
|
22
22
|
contractThatUserTriedToAdd: Contract,
|
23
23
|
) => void
|
24
24
|
export type BasketServiceKeepContractsWithConflictingGroupsHandler = () => void
|
25
|
+
export type BasketServiceSetProductsMetaHandler = (
|
26
|
+
meta: BasketProduct[],
|
27
|
+
) => Promise<void>
|
25
28
|
|
26
29
|
export type WindowHapiServiceBasket = WindowHapiModuleWithConstructorArgs<
|
27
30
|
{
|
28
31
|
onAfterGetBasketData: (
|
29
32
|
basketItemData: (Contract | Product)[],
|
30
33
|
) => BasketProduct[]
|
34
|
+
setProductsMeta: BasketServiceSetProductsMetaHandler
|
31
35
|
getProducts: HapiServiceFunctionWithLifecycleHooks<BasketServiceGetProductsHandler>
|
32
36
|
addProductOrContractById: HapiServiceFunctionWithLifecycleHooks<BasketServiceAddProductOrContractByIdHandler>
|
33
37
|
removeProductOrContractById: HapiServiceFunctionWithLifecycleHooks<BasketServiceRemoveProductOrContractByIdHandler>
|
package/campaign/types.ts
CHANGED
@@ -208,9 +208,9 @@ export type CampaignCreateForm = {
|
|
208
208
|
companyId: string
|
209
209
|
currency: ProductPriceCurrency | null
|
210
210
|
campaignName?: string | null
|
211
|
-
poNumber
|
211
|
+
poNumber?: string | null
|
212
212
|
orderReference?: string | null
|
213
|
-
paymentMethod
|
213
|
+
paymentMethod?: OrderJourneyPaymentMethod | null
|
214
214
|
targetGroup: CampaignCreateFormTargetGroup
|
215
215
|
recruiterInfo: CampaignRecruiterInfo
|
216
216
|
postingDetails: CampaignCreateFormPostingDetails
|
@@ -185,8 +185,10 @@ export type ZodCampaignCreateFormTargetGroup = ZodObject<{
|
|
185
185
|
export type ZodCampaignCreateForm = ZodObject<{
|
186
186
|
companyId: ZodString
|
187
187
|
campaignName: ZodOptional<ZodNullable<ZodString>>
|
188
|
-
poNumber: ZodNullable<ZodString
|
189
|
-
paymentMethod:
|
188
|
+
poNumber: ZodOptional<ZodNullable<ZodString>>
|
189
|
+
paymentMethod: ZodOptional<
|
190
|
+
ZodNullable<ZodNativeEnum<typeof OrderJourneyPaymentMethod>>
|
191
|
+
>
|
190
192
|
targetGroup: ZodCampaignCreateFormTargetGroup
|
191
193
|
recruiterInfo: ZodCampaignRecruiterInfo
|
192
194
|
postingDetails: ZodCampaignCreateFormPostingDetails
|
package/common/types.ts
CHANGED
@@ -126,10 +126,7 @@ export type PostingRequirementType =
|
|
126
126
|
| "TEXTAREA"
|
127
127
|
| "AUTOCOMPLETE"
|
128
128
|
| "STATISCH"
|
129
|
-
| "
|
130
|
-
| "VIDEO-URL"
|
131
|
-
| "IMAGE-PREVIEW"
|
132
|
-
| "DYNAMISCH"
|
129
|
+
| "FILE-URL"
|
133
130
|
|
134
131
|
export type PostingRequirementRuleName =
|
135
132
|
| "int"
|
@@ -148,11 +145,23 @@ export type PostingRequirementRuleName =
|
|
148
145
|
| "before"
|
149
146
|
| "after"
|
150
147
|
| "url"
|
148
|
+
| "fileMimeType"
|
149
|
+
| "fileMimeSubType"
|
150
|
+
| "editorTest"
|
151
|
+
| "libraryTest"
|
152
|
+
| "autocomplete"
|
153
|
+
| "statictype"
|
154
|
+
| "staticsubtype"
|
151
155
|
|
152
156
|
export type PostingRequirementRule = {
|
153
157
|
rule: PostingRequirementRuleName
|
154
158
|
data: string
|
155
159
|
}
|
160
|
+
|
161
|
+
export type PostingRequirementRuleWithObjectData = {
|
162
|
+
data: Record<string, any>
|
163
|
+
} & Omit<PostingRequirementRule, "data">
|
164
|
+
|
156
165
|
export type PostingRequirementDisplayRuleShow = {
|
157
166
|
facet: string
|
158
167
|
value: any
|
@@ -193,7 +202,9 @@ export type PostingRequirement = {
|
|
193
202
|
required: boolean
|
194
203
|
sort: string
|
195
204
|
type: PostingRequirementType
|
196
|
-
rules?:
|
205
|
+
rules?:
|
206
|
+
| (PostingRequirementRule | PostingRequirementRuleWithObjectData)[]
|
207
|
+
| null
|
197
208
|
group_id?: string | number
|
198
209
|
}
|
199
210
|
export type PostingRequirementLabelsMap = Record<string, string>
|
@@ -232,3 +243,34 @@ export type PostingRequirementsAutocompleteRequestOption = {
|
|
232
243
|
key: string
|
233
244
|
value: string | string[]
|
234
245
|
}
|
246
|
+
export type FormFacetsFieldType =
|
247
|
+
| "input"
|
248
|
+
| "textarea"
|
249
|
+
| "select"
|
250
|
+
| "select-multi"
|
251
|
+
| "select-tree-async"
|
252
|
+
| "select-tree"
|
253
|
+
| "select-tree-autocomplete"
|
254
|
+
| "input-tag"
|
255
|
+
| "date"
|
256
|
+
| "select-autocomplete"
|
257
|
+
| "select-multi-autocomplete"
|
258
|
+
| "heading"
|
259
|
+
| "file-upload"
|
260
|
+
| "unknown"
|
261
|
+
export type ContractPostingRequirementFieldAutocompleteRequestOption = {
|
262
|
+
key: string
|
263
|
+
value: string | string[]
|
264
|
+
}
|
265
|
+
export type ProductPostingRequirementFieldAutocompleteRequestOption = {
|
266
|
+
key: string
|
267
|
+
value: string | string[]
|
268
|
+
}
|
269
|
+
|
270
|
+
export type HapiFeatureBranch = {
|
271
|
+
name: string
|
272
|
+
url: string
|
273
|
+
docsUrl: string
|
274
|
+
changelogUrls: { url: string; scope: string }[]
|
275
|
+
releaseDate: string
|
276
|
+
}
|
package/contract/state.types.ts
CHANGED
package/debugging/index.ts
CHANGED
package/modal/enums.ts
CHANGED
@@ -20,4 +20,13 @@ export enum ModalKeys {
|
|
20
20
|
contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
|
21
21
|
talentMindEvaluateJobWithResume = "talentmind-evaluate-job-with-resume",
|
22
22
|
talentMindEvaluateResumeWithJob = "talentmind-evaluate-resume-with-job",
|
23
|
+
"mediaEditor" = "media-editor",
|
24
|
+
"uploadWidget" = "upload-widget",
|
25
|
+
"mediaLibrary" = "media-library",
|
26
|
+
}
|
27
|
+
|
28
|
+
export enum FilePickerModalPropsActionFor {
|
29
|
+
postingOrganization = "posting-organization",
|
30
|
+
talentmindResume = "talentmind-resume",
|
31
|
+
postingRequirements = "posting-requirements",
|
23
32
|
}
|
package/modal/types.ts
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
import { Product } from "../product/types"
|
2
2
|
import { Contract } from "../contract/types"
|
3
|
-
import { ModalKeys, ModalZone } from "./enums"
|
3
|
+
import { FilePickerModalPropsActionFor, ModalKeys, ModalZone } from "./enums"
|
4
4
|
import { AnyNonFunction, TransformedPostingRequirement } from "../common/types"
|
5
5
|
import { Campaign } from "../campaign"
|
6
6
|
import { TalentMindResume } from "../talentMindResume/types"
|
7
7
|
import { TalentMindJob } from "../talentMindJob/types"
|
8
8
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
9
9
|
import { PickerDisplayMode } from "filestack-js"
|
10
|
-
import { HapiBoxProps } from "../../src/components/reusable/Box"
|
11
10
|
|
12
11
|
export type ProductDetailModalProps = {
|
13
12
|
id: string
|
@@ -45,7 +44,7 @@ export type FilePickerOptions = {
|
|
45
44
|
maxSize?: number
|
46
45
|
displayMode?: PickerDisplayMode
|
47
46
|
container?: string
|
48
|
-
containerProps?:
|
47
|
+
containerProps?: Record<string, any>
|
49
48
|
imageMax?: [number, number]
|
50
49
|
imageMin?: [number, number]
|
51
50
|
showTransformations?: boolean
|
@@ -67,6 +66,20 @@ export type TalentMindEvaluateResumeWithJobModalProps = {
|
|
67
66
|
job: TalentMindJob
|
68
67
|
}
|
69
68
|
|
69
|
+
export type FilePickerModalPropsActionDataPostingRequirements = {
|
70
|
+
requirement: TransformedPostingRequirement
|
71
|
+
id: string | number
|
72
|
+
mimeTypesFull: string[]
|
73
|
+
mimeTypesSplit?: { mimeType: string; mimeSubType: string }[]
|
74
|
+
}
|
75
|
+
export type FilePickerModalPropsActionData =
|
76
|
+
FilePickerModalPropsActionDataPostingRequirements
|
77
|
+
|
78
|
+
export type FilePickerModalProps = {
|
79
|
+
actionFor: FilePickerModalPropsActionFor
|
80
|
+
actionData?: FilePickerModalPropsActionData
|
81
|
+
}
|
82
|
+
|
70
83
|
export type ModalProps = AnyNonFunction<
|
71
84
|
| ProductDetailModalProps
|
72
85
|
| UTMCodesModalProps
|
@@ -75,6 +88,7 @@ export type ModalProps = AnyNonFunction<
|
|
75
88
|
| ContractRemoveConfirmationModalProps
|
76
89
|
| ContractGroupConflictInfoModalProps
|
77
90
|
| ContractPostingRequirementsSmartFillResponseModalProps
|
91
|
+
| FilePickerModalProps
|
78
92
|
| BasketModalProps
|
79
93
|
| WalletModalProps
|
80
94
|
>
|
package/modal/utils.types.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import { WindowHapiUtils } from "../_window/utils.types"
|
2
2
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
3
|
import { ModalKeys } from "./enums"
|
4
|
+
import { Modals } from "./types"
|
4
5
|
|
5
6
|
export type WindowHapiUtilsModal = WindowHapiModuleWithConstructorArgs<
|
6
7
|
{
|
7
8
|
modalKeys: typeof ModalKeys
|
9
|
+
getIsModalOpen: (key: ModalKeys, modals: Modals) => boolean
|
8
10
|
},
|
9
11
|
{ readonly utils: WindowHapiUtils }
|
10
12
|
>
|
@@ -29,6 +29,7 @@ export type OrderJourneyState = {
|
|
29
29
|
paymentMethodsEnabled: OrderJourneyPaymentMethod[]
|
30
30
|
hidePrefilledFields: boolean
|
31
31
|
orderErrors: OrderJourneyOrderErrors | null
|
32
|
+
stepActiveOrderErrors: OrderJourneyOrderErrors | null
|
32
33
|
/* Onboarding */
|
33
34
|
onboardingStep: OrderJourneyStep
|
34
35
|
onboardingStepData: Record<string, any>
|
package/orderJourney/types.ts
CHANGED
@@ -87,13 +87,49 @@ export type OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid
|
|
87
87
|
has_errors: boolean
|
88
88
|
}
|
89
89
|
|
90
|
+
export type OrderJourneyOrderErrorsRecruiterInfo = {
|
91
|
+
name?: string[]
|
92
|
+
emailAddress?: string[]
|
93
|
+
}
|
94
|
+
|
95
|
+
export type OrderJourneyOrderErrorsTargetGroup = string[]
|
96
|
+
|
97
|
+
export type OrderJourneyOrderErrorsPostingDetails = {
|
98
|
+
title?: string[]
|
99
|
+
description?: string[]
|
100
|
+
employmentType?: string[]
|
101
|
+
organization?: {
|
102
|
+
name?: string[]
|
103
|
+
companyLogo?: string[]
|
104
|
+
}
|
105
|
+
salaryIndication?: {
|
106
|
+
period?: string[]
|
107
|
+
to?: string[]
|
108
|
+
from?: string[]
|
109
|
+
currency?: string[]
|
110
|
+
}
|
111
|
+
weeklyWorkingHours?: {
|
112
|
+
from?: string[]
|
113
|
+
to?: string[]
|
114
|
+
}
|
115
|
+
workingLocation?: {
|
116
|
+
addressLine1?: string[]
|
117
|
+
addressLine2?: string[]
|
118
|
+
city?: string[]
|
119
|
+
country?: string[]
|
120
|
+
postcode?: string[]
|
121
|
+
}
|
122
|
+
jobPageUrl?: string[]
|
123
|
+
applicationUrl?: string[]
|
124
|
+
}
|
125
|
+
|
90
126
|
export type OrderJourneyOrderErrorsCampaignIsInvalid = {
|
91
|
-
postingDetails
|
92
|
-
recruiterInfo
|
93
|
-
targetGroup
|
94
|
-
orderedProducts
|
127
|
+
postingDetails?: OrderJourneyOrderErrorsPostingDetails
|
128
|
+
recruiterInfo?: OrderJourneyOrderErrorsRecruiterInfo
|
129
|
+
targetGroup?: OrderJourneyOrderErrorsTargetGroup
|
130
|
+
orderedProducts?: string[]
|
95
131
|
orderedProductsSpecs?: any[]
|
96
|
-
walletId
|
132
|
+
walletId?: string
|
97
133
|
}
|
98
134
|
|
99
135
|
// HAPI Backend validation works in this order:
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"private": false,
|
3
3
|
"name": "@vonq/hapi-elements-types",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.22.0",
|
5
5
|
"description": "This package contains Typescript definitions for HAPI Elements",
|
6
6
|
"author": "VONQ HAPI Team",
|
7
7
|
"license": "BSD-3-Clause",
|
@@ -18,6 +18,7 @@
|
|
18
18
|
"@datadog/browser-logs": "^4.34.2",
|
19
19
|
"axios": "^1.3.4",
|
20
20
|
"color": "^4.2.3",
|
21
|
+
"filestack-js": "^3.27.0",
|
21
22
|
"is-promise": "^4.0.0",
|
22
23
|
"lodash": "^4.17.21",
|
23
24
|
"mobx": "^6.8.0",
|
package/product/types.ts
CHANGED
@@ -52,6 +52,7 @@ export type Product = {
|
|
52
52
|
audience_group: "niche" | "generic"
|
53
53
|
cross_postings: string[]
|
54
54
|
channel: ProductSupportingContractsPartial
|
55
|
+
bundle_products_ids?: string[]
|
55
56
|
description: string | null
|
56
57
|
title: string
|
57
58
|
duration: ProductDuration
|
@@ -78,6 +79,7 @@ export type ProductBoardType =
|
|
78
79
|
| "social media"
|
79
80
|
| "publication"
|
80
81
|
| "community"
|
82
|
+
| "product_bundle"
|
81
83
|
|
82
84
|
export type ProductType = {
|
83
85
|
type: ProductBoardType
|
@@ -99,6 +99,7 @@ export type ZodProductWithSupportForContractsFilters = ZodObject<{
|
|
99
99
|
}>
|
100
100
|
|
101
101
|
export type ZodProduct = ZodObject<{
|
102
|
+
bundle_products_ids: ZodOptional<ZodArray<ZodString>>
|
102
103
|
allow_orders: ZodBoolean
|
103
104
|
audience_group: ZodString
|
104
105
|
cross_postings: ZodProductCrossPostings
|