@vonq/hapi-elements-types 1.34.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,
@@ -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>>
@@ -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]>>
@@ -42,12 +42,7 @@ export type WindowHapiAPIExperimentalRequests = {
42
42
  createSuggestionOfPostingRequirementsV2: (
43
43
  facets: PostingRequirement[],
44
44
  description: string,
45
- extras: {
46
- ai_instructions: string
47
- auth_key: string
48
- customer_id: string
49
- contract_id: string
50
- },
45
+ extras: Record<string, any>,
51
46
  ) => Promise<any>
52
47
  getSuggestionOfPostingRequirementsV2: (
53
48
  taskId: string | number,
@@ -52,22 +52,22 @@ export type WindowHapiServiceExperimental = WindowHapiModuleWithConstructorArgs<
52
52
  >
53
53
  getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementOptionsHandler>
54
54
  getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementsHandler>
55
- createSuggestionOfPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceCreateSuggestionOfPostingRequirementsHandler>
56
55
  createSuggestionOfPostingRequirementsV2: (
57
- contractId: string,
58
- facets: PostingRequirement[],
59
- description: string,
60
- extras: {
61
- ai_instructions: string
62
- auth_key: string
63
- customer_id: string
64
- contract_id: string
56
+ contractId: string | number,
57
+ customDescription?: string,
58
+ customExtras?: Record<string, any>,
59
+ hardcodedPrefills?: {
60
+ requirements: Record<string, any>
61
+ requirementsLabels: Record<string, any>
65
62
  },
66
63
  ) => Promise<any>
67
- getSuggestionOfPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetSuggestionOfPostingRequirementsHandler>
68
64
  getSuggestionOfPostingRequirementsV2: (
69
- contractId: string,
65
+ contractId: string | number,
70
66
  taskId: string | number,
67
+ hardcodedPrefills?: {
68
+ requirements: Record<string, any>
69
+ requirementsLabels: Record<string, any>
70
+ },
71
71
  ) => Promise<any>
72
72
  setProductStepsBlurredFields: (
73
73
  fields: Record<string, Record<string, boolean>>,
@@ -10,6 +10,10 @@ export type ExperimentalState = {
10
10
  snakeScore: number
11
11
  snakeSpeed: number
12
12
  snakeInterval: number
13
+ postingRequirementsSuggestionsPollingIntervalsMap: Record<
14
+ string | number,
15
+ string | number
16
+ >
13
17
  postingRequirementsSuggestionsPollingMap: Record<string, string[]>
14
18
  postingRequirementsSuggestionsPollingStatusMap: Record<
15
19
  string,
@@ -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.34.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",