@vonq/hapi-elements-types 1.25.0 → 1.26.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/__experimental/index.ts +52 -0
- package/_window/utils.types.ts +3 -0
- package/alert/enums.ts +2 -0
- package/alert/types.ts +6 -0
- package/alert/utils.types.ts +10 -0
- package/ats/types.ts +1 -0
- package/campaign/enums.ts +3 -2
- package/campaign/qa.types.ts +1 -0
- package/campaign/utils.types.ts +8 -0
- package/common/types.ts +2 -2
- package/contract/api.types.ts +3 -6
- package/contract/service.types.ts +2 -0
- package/contract/state.types.ts +2 -2
- package/contract/types.ts +5 -3
- package/contract/validations.types.ts +7 -5
- package/debugging/state.types.ts +1 -0
- package/modal/enums.ts +2 -1
- package/modal/types.ts +9 -1
- package/package.json +1 -1
@@ -0,0 +1,52 @@
|
|
1
|
+
import { RecursivePartial } from "../common"
|
2
|
+
import { Campaign, CampaignOrderRequestBody } from "../campaign"
|
3
|
+
|
4
|
+
export enum ExperimentalSuggestionEndpointName {
|
5
|
+
"postingRequirements" = "posting_requirements",
|
6
|
+
"vacancyFields" = "vacancy_fields",
|
7
|
+
"primaryTaxonomy" = "primary_taxonomy",
|
8
|
+
}
|
9
|
+
|
10
|
+
export type ExperimentalSuggestionResponseStatus =
|
11
|
+
| "new"
|
12
|
+
| "pending"
|
13
|
+
| "error"
|
14
|
+
| "done"
|
15
|
+
|
16
|
+
export type ExperimentalSuggestionCreateRequestData<P> = {
|
17
|
+
contract_id?: string
|
18
|
+
payload: P
|
19
|
+
}
|
20
|
+
|
21
|
+
export type ExperimentalSuggestionGetResponseData<P, R> = {
|
22
|
+
id: string
|
23
|
+
status: ExperimentalSuggestionResponseStatus
|
24
|
+
contract_id?: string
|
25
|
+
type: ExperimentalSuggestionEndpointName
|
26
|
+
payload: P
|
27
|
+
response: R
|
28
|
+
}
|
29
|
+
|
30
|
+
export type ExperimentalSuggestionPostingRequirementsCreateRequestPayload =
|
31
|
+
RecursivePartial<CampaignOrderRequestBody>
|
32
|
+
|
33
|
+
export type ExperimentalSuggestionPostingRequirementsGetResponseData = Record<
|
34
|
+
string,
|
35
|
+
string | null | number | any[]
|
36
|
+
>
|
37
|
+
|
38
|
+
export type ExperimentalSuggestionVacancyFieldsCreateRequestPayload = {
|
39
|
+
description: string
|
40
|
+
}
|
41
|
+
|
42
|
+
export type ExperimentalSuggestionVacancyFieldsGetResponseData =
|
43
|
+
RecursivePartial<Campaign>
|
44
|
+
|
45
|
+
export type ExperimentalSuggestionPrimaryTaxonomyCreateRequestPayload = {
|
46
|
+
description: string
|
47
|
+
}
|
48
|
+
|
49
|
+
export type ExperimentalSuggestionPrimaryTaxonomyGetResponseData = Record<
|
50
|
+
string,
|
51
|
+
string
|
52
|
+
>
|
package/_window/utils.types.ts
CHANGED
@@ -11,6 +11,7 @@ import {
|
|
11
11
|
import { WindowHapiUtilsModal } from "../modal/utils.types"
|
12
12
|
import { WindowHapiUtilsRouter } from "../routing/utils.types"
|
13
13
|
import { WindowHapiUtilsLanguage } from "../language/utils.types"
|
14
|
+
import { WindowHapiUtilsAlert } from "../alert/utils.types"
|
14
15
|
|
15
16
|
export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
16
17
|
{
|
@@ -44,6 +45,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
44
45
|
modal: WindowHapiUtilsModal
|
45
46
|
router: WindowHapiUtilsRouter
|
46
47
|
language: WindowHapiUtilsLanguage
|
48
|
+
alert: WindowHapiUtilsAlert
|
47
49
|
|
48
50
|
utilities: {
|
49
51
|
[WindowHapiModuleName.basket]: WindowHapiUtilsBasket
|
@@ -54,6 +56,7 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
|
54
56
|
[WindowHapiModuleName.modal]: WindowHapiUtilsModal
|
55
57
|
[WindowHapiModuleName.router]: WindowHapiUtilsRouter
|
56
58
|
[WindowHapiModuleName.language]: WindowHapiUtilsLanguage
|
59
|
+
[WindowHapiModuleName.alert]: WindowHapiUtilsAlert
|
57
60
|
}
|
58
61
|
},
|
59
62
|
{ readonly core: WindowHapiClassInterface }
|
package/alert/enums.ts
CHANGED
@@ -3,6 +3,7 @@ export enum AlertKey {
|
|
3
3
|
topupSuccess = "topup-success",
|
4
4
|
contractRemoveSuccess = "contract-removed",
|
5
5
|
contractCreateSuccess = "contract-created",
|
6
|
+
contractEditSuccess = "contract-edited",
|
6
7
|
contractGroupCreateSuccess = "contract-group-created",
|
7
8
|
campaignTakeOfflineSuccess = "campaign-take-offline-success",
|
8
9
|
campaignProductTakeOfflineSuccess = "campaign-product-take-offline-success",
|
@@ -14,6 +15,7 @@ export enum AlertKey {
|
|
14
15
|
productAddToBasket = "add-product-to-basket-success",
|
15
16
|
productRemoveFromBasket = "remove-product-from-basket-warning",
|
16
17
|
utmCodeConfirmation = "utm-code-confirmation",
|
18
|
+
__experimentalCampaignVacancyFieldsSmartFillEmpty = "__experimental-campaign-vacancy-fields-smart-fill-empty",
|
17
19
|
}
|
18
20
|
|
19
21
|
export enum AlertType {
|
package/alert/types.ts
CHANGED
@@ -11,6 +11,10 @@ export type ContractCreateSuccessAlertProps = {
|
|
11
11
|
contractName: string
|
12
12
|
}
|
13
13
|
|
14
|
+
export type ContractEditSuccessAlertProps = {
|
15
|
+
contractName: string
|
16
|
+
}
|
17
|
+
|
14
18
|
export type ContractRemoveSuccessAlertProps = {
|
15
19
|
contractName: string
|
16
20
|
}
|
@@ -32,6 +36,8 @@ export type UTMCodesSuccessAlertProps = {
|
|
32
36
|
type: "save" | "reset"
|
33
37
|
}
|
34
38
|
|
39
|
+
export type ExperimentalCampaignVacancyFieldsAIPrefillEmptyAlertProps = {}
|
40
|
+
|
35
41
|
export type ButtonCopySuccessAlertProps = {}
|
36
42
|
|
37
43
|
export type CampaignOrderSuccessAlertProps = {}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { WindowHapiUtils } from "../_window/utils.types"
|
2
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
+
import { AlertKey } from "./enums"
|
4
|
+
|
5
|
+
export type WindowHapiUtilsAlert = WindowHapiModuleWithConstructorArgs<
|
6
|
+
{
|
7
|
+
alertKeys: typeof AlertKey
|
8
|
+
},
|
9
|
+
{ readonly utils: WindowHapiUtils }
|
10
|
+
>
|
package/ats/types.ts
CHANGED
package/campaign/enums.ts
CHANGED
package/campaign/qa.types.ts
CHANGED
@@ -7,6 +7,7 @@ export type WindowHapiQACampaign = WindowHapiModuleWithConstructorArgs<
|
|
7
7
|
useMockCampaignForm: () => CampaignCreateForm
|
8
8
|
getRandomCampaignId: () => Promise<string>
|
9
9
|
setCampaignFormDebuggerIsShown: (isEnabled: boolean) => boolean
|
10
|
+
setCampaignCardDebuggerIsShown: (isEnabled: boolean) => boolean
|
10
11
|
},
|
11
12
|
{ readonly qa: WindowHapiQA }
|
12
13
|
>
|
package/campaign/utils.types.ts
CHANGED
@@ -24,6 +24,11 @@ import {
|
|
24
24
|
OrderJourneyOrderErrors,
|
25
25
|
OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid,
|
26
26
|
} from "../orderJourney"
|
27
|
+
import {
|
28
|
+
FormFacetsFieldType,
|
29
|
+
PostingRequirement,
|
30
|
+
TransformedPostingRequirement,
|
31
|
+
} from "../common"
|
27
32
|
|
28
33
|
export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
29
34
|
{
|
@@ -73,6 +78,9 @@ export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
|
73
78
|
newErrors: OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid,
|
74
79
|
indexOfNewPostingRequirements: number,
|
75
80
|
) => OrderJourneyOrderErrors
|
81
|
+
getPostingRequirementFormFieldType: (
|
82
|
+
requirement: TransformedPostingRequirement | PostingRequirement,
|
83
|
+
) => FormFacetsFieldType
|
76
84
|
},
|
77
85
|
{ readonly utils: WindowHapiUtils }
|
78
86
|
>
|
package/common/types.ts
CHANGED
@@ -268,10 +268,10 @@ export type FormFacetsFieldType =
|
|
268
268
|
| "select-tree-async"
|
269
269
|
| "select-tree"
|
270
270
|
| "select-tree-autocomplete"
|
271
|
-
| "input-tag"
|
272
|
-
| "date"
|
273
271
|
| "select-autocomplete"
|
274
272
|
| "select-multi-autocomplete"
|
273
|
+
| "input-tag"
|
274
|
+
| "date"
|
275
275
|
| "heading"
|
276
276
|
| "file-upload"
|
277
277
|
| "unknown"
|
package/contract/api.types.ts
CHANGED
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
ContractCreateForm,
|
5
5
|
ContractGroup,
|
6
6
|
ContractGroupCreateForm,
|
7
|
-
|
7
|
+
ContractEditForm,
|
8
8
|
} from "./types"
|
9
9
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
10
10
|
import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
|
@@ -15,7 +15,7 @@ export type WindowHapiAPIContractConfigs = {
|
|
15
15
|
getContractsByIds: AxiosRequestConfig
|
16
16
|
getContract: AxiosRequestConfig
|
17
17
|
createContract: AxiosRequestConfig
|
18
|
-
|
18
|
+
saveContract: AxiosRequestConfig
|
19
19
|
removeContract: AxiosRequestConfig
|
20
20
|
getPostingRequirementOptions: AxiosRequestConfig
|
21
21
|
getGroups: AxiosRequestConfig
|
@@ -32,10 +32,7 @@ export type WindowHapiAPIContractRequests = {
|
|
32
32
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
33
33
|
getContract: (contractId: string) => Promise<Contract>
|
34
34
|
createContract: (contract: ContractCreateForm) => Promise<Contract>
|
35
|
-
|
36
|
-
contractId: string,
|
37
|
-
contract: ContractUpdateForm,
|
38
|
-
) => Promise<Contract>
|
35
|
+
saveContract: (contract: ContractEditForm) => Promise<Contract>
|
39
36
|
getPostingRequirementOptions: (
|
40
37
|
contractId: string,
|
41
38
|
fieldName: string,
|
@@ -27,6 +27,7 @@ export type ContractServiceGetContractsLabeledHandler = (
|
|
27
27
|
labels?: Record<string, string> | null,
|
28
28
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
29
29
|
export type ContractServiceCreateContractHandler = () => Promise<Contract>
|
30
|
+
export type ContractServiceSaveContractHandler = () => Promise<Contract>
|
30
31
|
export type ContractServiceRemoveContractHandler = (
|
31
32
|
contractId: string,
|
32
33
|
) => Promise<void>
|
@@ -44,6 +45,7 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
|
44
45
|
getContractGroups: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractGroupsHandler>
|
45
46
|
createContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceCreateContractHandler>
|
46
47
|
removeContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceRemoveContractHandler>
|
48
|
+
saveContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceSaveContractHandler>
|
47
49
|
createContractGroup: HapiServiceFunctionWithLifecycleHooks<ContractServiceCreateContractGroupHandler>
|
48
50
|
getContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractHandler>
|
49
51
|
initiateOauthLogin: (
|
package/contract/state.types.ts
CHANGED
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
ContractGroup,
|
6
6
|
ContractGroupCreateForm,
|
7
7
|
ContractGroupSelected,
|
8
|
-
|
8
|
+
ContractEditForm,
|
9
9
|
} from "./types"
|
10
10
|
import { PaginationResponseV1 } from "../common/types"
|
11
11
|
|
@@ -17,7 +17,7 @@ export type ContractState = {
|
|
17
17
|
contractSelectedId: string | number | null
|
18
18
|
contractSelected: ProductSupportingContractsComplete | null
|
19
19
|
contractSelectedIsLoading: boolean
|
20
|
-
contractForm: ContractCreateForm |
|
20
|
+
contractForm: ContractCreateForm | ContractEditForm
|
21
21
|
contractCreateError: any
|
22
22
|
contractFormIsValid: boolean | null
|
23
23
|
/* Contracts Groups */
|
package/contract/types.ts
CHANGED
@@ -24,7 +24,7 @@ export type ContractPurchasePrice = {
|
|
24
24
|
export type ContractCreateFormCredentials = Record<string, string>
|
25
25
|
|
26
26
|
export type ContractCreateForm = {
|
27
|
-
id?: number
|
27
|
+
id?: number | string
|
28
28
|
credentials?: ContractCreateFormCredentials
|
29
29
|
facets?: any | null
|
30
30
|
expiry_date: string | null
|
@@ -35,10 +35,10 @@ export type ContractCreateForm = {
|
|
35
35
|
posting_duration_days: number | null
|
36
36
|
allow_renegotiation: boolean
|
37
37
|
labels: Record<string, string> | null
|
38
|
-
posting_requirements_defaults: Record<string, string> | null
|
38
|
+
posting_requirements_defaults: Record<string, string | string[]> | null
|
39
39
|
}
|
40
40
|
|
41
|
-
export type
|
41
|
+
export type ContractEditForm = ContractCreateForm
|
42
42
|
|
43
43
|
export type ContractGroupCreateForm = {
|
44
44
|
name: string
|
@@ -46,6 +46,7 @@ export type ContractGroupCreateForm = {
|
|
46
46
|
|
47
47
|
export type ContractChannel = ProductLogos &
|
48
48
|
ProductType & {
|
49
|
+
allows_edit?: boolean
|
49
50
|
id: number
|
50
51
|
name: string
|
51
52
|
url: string
|
@@ -65,6 +66,7 @@ export type Contract = {
|
|
65
66
|
purchase_price: ContractPurchasePrice | null
|
66
67
|
posting_duration_days: number | null
|
67
68
|
group: ContractGroup | null
|
69
|
+
posting_requirements_defaults: Record<string, string | string[]> | null
|
68
70
|
}
|
69
71
|
|
70
72
|
export type ContractGroup = {
|
@@ -34,10 +34,12 @@ export type ZodContractProduct = ZodObject<{
|
|
34
34
|
title: ZodString
|
35
35
|
}>
|
36
36
|
export type ZodContractPurchasePrice = ZodOptional<
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
ZodNullable<
|
38
|
+
ZodObject<{
|
39
|
+
amount: ZodNullable<ZodNumber>
|
40
|
+
currency: ZodNullable<ZodString>
|
41
|
+
}>
|
42
|
+
>
|
41
43
|
>
|
42
44
|
export type ZodContractGroup = ZodObject<{
|
43
45
|
id: ZodOptional<ZodString>
|
@@ -52,7 +54,7 @@ export type ZodContractGroupCreateForm = ZodObject<{
|
|
52
54
|
name: ZodString
|
53
55
|
}>
|
54
56
|
export type ZodContractCreateForm = ZodObject<{
|
55
|
-
id: ZodOptional<ZodNumber
|
57
|
+
id: ZodOptional<ZodUnion<[ZodNumber, ZodString]>>
|
56
58
|
credentials: ZodOptional<ZodObject<any>>
|
57
59
|
facets: ZodContractFacets
|
58
60
|
alias: ZodContractAlias
|
package/debugging/state.types.ts
CHANGED
package/modal/enums.ts
CHANGED
@@ -21,10 +21,11 @@ export enum ModalKeys {
|
|
21
21
|
contractEdit = "contract-edit",
|
22
22
|
contractGroupConflictInfo = "contract-group-conflict-info",
|
23
23
|
filePicker = "file-picker",
|
24
|
-
contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
|
25
24
|
"mediaEditor" = "media-editor",
|
26
25
|
"uploadWidget" = "upload-widget",
|
27
26
|
"mediaLibrary" = "media-library",
|
27
|
+
__experimentalContractPostingRequirementsSmartFillSuccess = "__experimental-contract-posting-requirements-smart-fill-success",
|
28
|
+
__experimentalCampaignVacancyFieldsSmartFillSuccess = "__experimental-campaign-vacancy-fields-smart-fill-success",
|
28
29
|
}
|
29
30
|
|
30
31
|
export enum FilePickerModalPropsActionFor {
|
package/modal/types.ts
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
import { Product } from "../product/types"
|
2
2
|
import { Contract } from "../contract/types"
|
3
3
|
import { FilePickerModalPropsActionFor, ModalKeys, ModalZone } from "./enums"
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
AnyNonFunction,
|
6
|
+
RecursivePartial,
|
7
|
+
TransformedPostingRequirement,
|
8
|
+
} from "../common/types"
|
5
9
|
import { Campaign } from "../campaign"
|
6
10
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
7
11
|
import { PickerDisplayMode } from "filestack-js"
|
@@ -20,6 +24,7 @@ export type CampaignProductTakeOfflineConfirmationModalProps = {
|
|
20
24
|
productId: string
|
21
25
|
}
|
22
26
|
export type ContractRemoveConfirmationModalProps = { contractId: string }
|
27
|
+
export type ContractEditJourneyModalProps = { contractId: string }
|
23
28
|
export type ContractGroupConflictInfoModalProps = {
|
24
29
|
contract: Contract
|
25
30
|
conflictingContracts: Contract[]
|
@@ -44,6 +49,9 @@ export type ContractPostingRequirementsSmartFillResponseModalProps = {
|
|
44
49
|
postingRequirements: Record<string, TransformedPostingRequirement>
|
45
50
|
contractId: string
|
46
51
|
}
|
52
|
+
export type CampaignVacancyFieldsSmartFillResponseModalProps = {
|
53
|
+
response: RecursivePartial<Campaign>
|
54
|
+
}
|
47
55
|
export type FilePickerOptions = {
|
48
56
|
accept?: string[]
|
49
57
|
uploadInBackground?: boolean
|
package/package.json
CHANGED