@vonq/hapi-elements-types 1.33.0 → 1.35.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.
@@ -12,6 +12,7 @@ import { WindowHapiUtilsModal } from "../modal/utils.types"
12
12
  import { WindowHapiUtilsRouter } from "../routing/utils.types"
13
13
  import { WindowHapiUtilsLanguage } from "../language/utils.types"
14
14
  import { WindowHapiUtilsAlert } from "../alert/utils.types"
15
+ import { FlattenedItem } from "../../common/tree"
15
16
 
16
17
  export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
17
18
  {
@@ -26,9 +27,9 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
26
27
  childAccessor: string,
27
28
  labelAccessor: string,
28
29
  valueAccessor: string,
29
- parentLabel?: any,
30
+ parentLabelOrAccessor?: string | ((value: any) => string),
30
31
  canSelectParentCategoriesThatHasOptions?: boolean,
31
- ) => { label: string; value: any }[]
32
+ ) => FlattenedItem[]
32
33
  pushAfter: (
33
34
  array: any[],
34
35
  findPredicate: (item: any, index: number) => boolean,
package/_window/window.ts CHANGED
@@ -121,7 +121,6 @@ export type WindowHapiConfigSubmodule = {
121
121
  addAlertBar: boolean
122
122
  addDebugPanel: boolean
123
123
  debugPanelPosition: DebugPanelPosition
124
- datadogClientToken: string
125
124
  env: string
126
125
  appVersion: string
127
126
  testMode: boolean
@@ -163,6 +162,7 @@ export type WindowHapiClassInterface = {
163
162
  detach: () => void
164
163
  bootstrap: () => Promise<void>
165
164
  logWelcomeMessage: () => void
165
+ logDirectChargeDraftCampaignNotes: () => void
166
166
  logDeprecationNotice: () => void
167
167
  logLatestTypesPackageVersion: () => Promise<void>
168
168
  logFeatureBranches: () => Promise<void>
@@ -15,7 +15,7 @@ export type BasketServiceAddProductOrContractByIdHandler = (
15
15
  contractOrProductId: string,
16
16
  isProduct: boolean,
17
17
  showAlert?: boolean,
18
- ) => void
18
+ ) => Promise<void>
19
19
  export type BasketServiceRemoveProductOrContractByIdHandler = (
20
20
  contractOrProductId: string,
21
21
  ) => void
@@ -49,6 +49,7 @@ export type WindowHapiUtilsBasket = WindowHapiModuleWithConstructorArgs<
49
49
  ) => number
50
50
  prepareCampaignFormOrderedProducts: (
51
51
  productOrContractIds: (Product | Contract)[],
52
+ previousProductOrContractIds: (Product | Contract)[],
52
53
  ) => void
53
54
  },
54
55
  { readonly utils: WindowHapiUtils }
@@ -3,6 +3,7 @@ import {
3
3
  ZodArray,
4
4
  ZodBoolean,
5
5
  ZodNativeEnum,
6
+ ZodNull,
6
7
  ZodNullable,
7
8
  ZodNumber,
8
9
  ZodObject,
@@ -54,15 +55,9 @@ export type ZodCampaignPostingDetailsOrganization = ZodObject<{
54
55
  companyLogo: ZodString
55
56
  name: ZodString
56
57
  }>
58
+
57
59
  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
- }>
65
- }>
60
+ ZodRecord<ZodString, ZodAny>
66
61
  >
67
62
  export type ZodCampaignPostingDetailsWeeklyWorkingHours = ZodObject<{
68
63
  from: ZodOptional<ZodNullable<ZodNumber>>
package/common/types.ts CHANGED
@@ -201,6 +201,7 @@ export type PostingRequirement = {
201
201
  display_rules: PostingRequirementDisplayRule | null
202
202
  autocomplete: PostingRequirementAutocomplete | null
203
203
  options: PostingRequirementOption[] | null
204
+ primary_taxonomy?: string | null
204
205
  message?: string | null
205
206
  required: boolean
206
207
  sort: string
@@ -222,7 +223,7 @@ export type PostingRequirementOption = {
222
223
  label: string
223
224
  data?: PostingRequirementOptionData
224
225
  labels?: Record<"default", string>
225
- sort: string
226
+ sort?: string
226
227
  parent?: string
227
228
  requires?: PostingRequirementOptionRequiresField[] | null
228
229
  show?: string[]
@@ -70,6 +70,7 @@ export type WindowHapiValidationsCommon = {
70
70
  genericRecordBoolean: ZodRecord<ZodString, ZodBoolean>
71
71
  genericBooleanOrNull: ZodNullable<ZodBoolean>
72
72
  genericRecordAny: ZodRecord<ZodString, ZodAny>
73
+ genericNullableRecordAny: ZodNullable<ZodRecord<ZodString, ZodAny>>
73
74
  genericRecordString: ZodRecord<ZodString, ZodString>
74
75
  genericStringOrNumber: ZodUnion<[ZodNumber, ZodString]>
75
76
  genericNullableStringOrNumber: ZodNullable<ZodUnion<[ZodNumber, ZodString]>>
@@ -1,5 +1,6 @@
1
1
  export type DebuggingState = {
2
2
  campaignFormDebuggerIsShown: boolean
3
+ campaignFormPerformanceImprovementsAreEnabled: boolean
3
4
  campaignCardDebuggerIsShown: boolean
4
5
  localeDebuggingIsEnabled: boolean
5
6
  componentDebuggingIsEnabled: boolean
@@ -39,6 +39,14 @@ export type WindowHapiAPIExperimentalRequests = {
39
39
  ExperimentalSuggestionPostingRequirementsGetResponseData
40
40
  >
41
41
  >
42
+ createSuggestionOfPostingRequirementsV2: (
43
+ facets: PostingRequirement[],
44
+ description: string,
45
+ extras: Record<string, any>,
46
+ ) => Promise<any>
47
+ getSuggestionOfPostingRequirementsV2: (
48
+ taskId: string | number,
49
+ ) => Promise<any>
42
50
  createSuggestionOfVacancyFields: (
43
51
  payload: ExperimentalSuggestionCreateRequestData<ExperimentalSuggestionVacancyFieldsCreateRequestPayload>,
44
52
  ) => Promise<
@@ -10,6 +10,11 @@ import {
10
10
  UseValidatorResult,
11
11
  } from "../common"
12
12
  import { MessageDescriptor } from "react-intl"
13
+ import {
14
+ ExperimentalSuggestionGetResponseData,
15
+ ExperimentalSuggestionPostingRequirementsCreateRequestPayload,
16
+ ExperimentalSuggestionPostingRequirementsGetResponseData,
17
+ } from "."
13
18
 
14
19
  export type ExperimentalServiceGetProductPostingRequirementOptionsHandler = (
15
20
  productId: string,
@@ -21,6 +26,25 @@ export type ExperimentalServiceGetProductPostingRequirementsHandler = (
21
26
  productId: string | number,
22
27
  ) => Promise<PostingRequirement[]>
23
28
 
29
+ export type ExperimentalServiceCreateSuggestionOfPostingRequirementsHandler = (
30
+ contractId: string,
31
+ textInput?: string,
32
+ ) => Promise<
33
+ ExperimentalSuggestionGetResponseData<
34
+ ExperimentalSuggestionPostingRequirementsCreateRequestPayload,
35
+ ExperimentalSuggestionPostingRequirementsGetResponseData
36
+ >
37
+ >
38
+
39
+ export type ExperimentalServiceGetSuggestionOfPostingRequirementsHandler = (
40
+ suggestionId: string,
41
+ ) => Promise<
42
+ ExperimentalSuggestionGetResponseData<
43
+ ExperimentalSuggestionPostingRequirementsCreateRequestPayload,
44
+ ExperimentalSuggestionPostingRequirementsGetResponseData
45
+ >
46
+ >
47
+
24
48
  export type WindowHapiServiceExperimental = WindowHapiModuleWithConstructorArgs<
25
49
  {
26
50
  getExperimental: HapiServiceFunctionWithLifecycleHooks<
@@ -28,6 +52,23 @@ export type WindowHapiServiceExperimental = WindowHapiModuleWithConstructorArgs<
28
52
  >
29
53
  getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementOptionsHandler>
30
54
  getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementsHandler>
55
+ createSuggestionOfPostingRequirementsV2: (
56
+ contractId: string | number,
57
+ customDescription?: string,
58
+ customExtras?: Record<string, any>,
59
+ hardcodedPrefills?: {
60
+ requirements: Record<string, any>
61
+ requirementsLabels: Record<string, any>
62
+ },
63
+ ) => Promise<any>
64
+ getSuggestionOfPostingRequirementsV2: (
65
+ contractId: string | number,
66
+ taskId: string | number,
67
+ hardcodedPrefills?: {
68
+ requirements: Record<string, any>
69
+ requirementsLabels: Record<string, any>
70
+ },
71
+ ) => Promise<any>
31
72
  setProductStepsBlurredFields: (
32
73
  fields: Record<string, Record<string, boolean>>,
33
74
  ) => Record<string, UseValidatorResult> | null
@@ -3,6 +3,25 @@ import { NestedValidatorKeys, UseValidatorResult } from "../common"
3
3
  import { OrderJourneyProductStep } from "./types"
4
4
 
5
5
  export type ExperimentalState = {
6
+ snakeIndex: number
7
+ snakeCurrent: number[]
8
+ snakeDirection: "up" | "down" | "right" | "left"
9
+ snakeAppleIndex: number
10
+ snakeScore: number
11
+ snakeSpeed: number
12
+ snakeInterval: number
13
+ postingRequirementsSuggestionsPollingIntervalsMap: Record<
14
+ string | number,
15
+ string | number
16
+ >
17
+ postingRequirementsSuggestionsPollingMap: Record<string, string[]>
18
+ postingRequirementsSuggestionsPollingStatusMap: Record<
19
+ string,
20
+ {
21
+ createdAt: string
22
+ status: string
23
+ }
24
+ >
6
25
  /* Product Fields */
7
26
  productSteps: OrderJourneyProductStep[]
8
27
  productStepsBlurredFields: Record<string, Record<string, boolean>>
@@ -22,8 +22,9 @@ export type ExperimentalSuggestionGetResponseData<P, R> = {
22
22
  response: R
23
23
  }
24
24
 
25
- export type ExperimentalSuggestionPostingRequirementsCreateRequestPayload =
26
- RecursivePartial<CampaignOrderRequestBody>
25
+ export type ExperimentalSuggestionPostingRequirementsCreateRequestPayload = {
26
+ job_data?: string
27
+ } & RecursivePartial<CampaignOrderRequestBody>
27
28
 
28
29
  export type ExperimentalSuggestionPostingRequirementsGetResponseData = Record<
29
30
  string,
package/language/enums.ts CHANGED
@@ -2,4 +2,5 @@ export enum LanguageSupportedLocale {
2
2
  "en" = "en",
3
3
  "nl" = "nl",
4
4
  "de" = "de",
5
+ "fr" = "fr",
5
6
  }
@@ -111,16 +111,29 @@ export type OrderJourneyOrderErrorsPostingDetailsURLs = {
111
111
  applicationUrl?: string[]
112
112
  }
113
113
 
114
- export type OrderJourneyOrderErrorsPostingDetailsBase = {
115
- title?: string[]
116
- description?: string[]
117
- employmentType?: string[]
118
- salaryIndication?: {
119
- period?: string[]
114
+ export type OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV1 = {
115
+ period?: string[]
116
+ to?: string[]
117
+ from?: string[]
118
+ currency?: string[]
119
+ }
120
+
121
+ export type OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV2 = {
122
+ period?: string[]
123
+ range?: {
120
124
  to?: string[]
121
125
  from?: string[]
122
126
  currency?: string[]
123
127
  }
128
+ }
129
+
130
+ export type OrderJourneyOrderErrorsPostingDetailsBase = {
131
+ title?: string[]
132
+ description?: string[]
133
+ employmentType?: string[]
134
+ salaryIndication?:
135
+ | OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV1
136
+ | OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV2
124
137
  weeklyWorkingHours?: {
125
138
  from?: string[]
126
139
  to?: string[]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.33.0",
4
+ "version": "1.35.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -14,7 +14,6 @@
14
14
  "main": "index.ts",
15
15
  "types": "index.d.ts",
16
16
  "dependencies": {
17
- "@datadog/browser-logs": "^4.34.2",
18
17
  "axios": "^1.3.4",
19
18
  "color": "^4.2.3",
20
19
  "filestack-js": "^3.27.0",
@@ -1,11 +1,13 @@
1
1
  import { WindowHapiQA } from "../_window/qa.types"
2
2
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
+ import { Product } from "./types"
3
4
 
4
5
  export type WindowHapiQAProduct = WindowHapiModuleWithConstructorArgs<
5
6
  {
6
7
  useMockFilters: () => Promise<void>
7
8
  getRandomChannelIdThatSupportsContracts: () => Promise<number>
8
9
  getRandomProductId: () => Promise<string>
10
+ getRandomCheapestProduct: () => Promise<Product | undefined>
9
11
  },
10
12
  { readonly qa: WindowHapiQA }
11
13
  >
@@ -14,6 +14,7 @@ export type WalletState = {
14
14
  walletIsLoading: boolean
15
15
  paymentIntentRequestBody: WalletPaymentIntentRequest | null
16
16
  paymentIntentClientSecret: string | null
17
+ paymentIntentSuccessCallbackUrl: string | null
17
18
  topUpIsLoading: boolean
18
19
  topUpAmount: number | null
19
20
  topUpMinAmount: number
package/wallet/types.ts CHANGED
@@ -73,4 +73,5 @@ export type WalletPaymentIntentRequest = {
73
73
  agreeTerms: boolean
74
74
  draftCampaignId?: string
75
75
  paymentMethodTypes?: WalletPaymentIntentPaymentMethod[]
76
+ successCallbackUrl?: string
76
77
  }