@vonq/hapi-elements-types 1.19.0 → 1.21.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 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 {CreateCampaignForm} from "@vonq/hapi-elements-types";
18
+ import {CampaignCreateForm} from "@vonq/hapi-elements-types";
19
19
 
20
- const campaignObject: CreateCampaignForm = {} //Typescript will warn about missing properties
20
+ const campaignObject: CampaignCreateForm = {} //Typescript will warn about missing properties
21
21
  ```
@@ -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 | undefined
11
+ walletCurrency: ProductPriceCurrency
12
12
  },
13
13
  { readonly core: WindowHapiClassInterface }
14
14
  >
@@ -106,6 +106,12 @@ export type WindowHapiEventMediator = WindowHapiModuleWithConstructorArgs<
106
106
  readonly eventApiStrategy?: WindowHapiEventStrategy
107
107
  readonly eventServiceStrategy?: WindowHapiEventStrategy
108
108
  readonly eventQAStrategy?: WindowHapiEventStrategy
109
+ readonly onReceive?: (
110
+ eventCommand: WindowHapiEventCommand | undefined,
111
+ ) => void
112
+ readonly onDispatch?: (
113
+ eventCommand: WindowHapiEventCommand | undefined,
114
+ ) => void
109
115
  }
110
116
  >
111
117
 
@@ -127,7 +133,12 @@ export type WindowHapiEventStorage = WindowHapiModuleWithConstructorArgs<
127
133
  name: string,
128
134
  ) => (WindowHapiEventCommand | WindowHapiEventListener)[]
129
135
  },
130
- { readonly getInstances: WindowHapiEventMediatorGetInstancesHandler }
136
+ {
137
+ readonly getInstances: WindowHapiEventMediatorGetInstancesHandler
138
+ readonly onAdd?: (
139
+ eventCommand: WindowHapiEventCommand | WindowHapiEventListener,
140
+ ) => void
141
+ }
131
142
  >
132
143
 
133
144
  export type WindowHapiEvents = WindowHapiModuleWithConstructorArgs<
@@ -141,7 +152,9 @@ export type WindowHapiEvents = WindowHapiModuleWithConstructorArgs<
141
152
  eventRoutingStrategy: WindowHapiEventStrategy
142
153
  eventAppStrategy: WindowHapiEventStrategy
143
154
  eventApiStrategy: WindowHapiEventStrategy
144
- eventStateStrategy: WindowHapiEventStrategy
155
+ eventStateStrategy: WindowHapiEventStrategy & {
156
+ onHydrateState: (event: WindowHapiEventCommand) => void
157
+ }
145
158
  eventServiceStrategy: WindowHapiEventStrategy
146
159
  eventQAStrategy: WindowHapiEventStrategy
147
160
  eventDOMStrategy: WindowHapiEventStrategy
@@ -1,7 +1,7 @@
1
1
  import { WindowHapiModuleName } from "../common/enums"
2
2
  import {
3
- WindowHapiModuleWithConstructorArgs,
4
3
  WindowHapiClassInterface,
4
+ WindowHapiModuleWithConstructorArgs,
5
5
  } from "./window"
6
6
  import { WindowHapiQACampaign } from "../campaign/qa.types"
7
7
  import { WindowHapiQACommon } from "../common/qa.types"
@@ -22,7 +22,9 @@ export type WindowHapiQA = WindowHapiModuleWithConstructorArgs<
22
22
  [WindowHapiModuleName.common]: WindowHapiQACommon
23
23
 
24
24
  isDebugPanelOpen: boolean
25
+
25
26
  getDebugPanelButtonEl: () => HTMLElement | null
27
+ onClickDebugPanel: () => void
26
28
  addDebugPanelToDOM: () => void
27
29
  setDebugPanelPosition: (buttonEl: HTMLElement | null) => void
28
30
  },
@@ -42,6 +42,8 @@ import {
42
42
  import { WindowHapiServiceUI } from "../ui/service.types"
43
43
  import { ATSState, WindowHapiAPIATS, WindowHapiServiceATS } from "../ats"
44
44
  import { WindowHapiServiceOrderJourney } from "../orderJourney/service.types"
45
+ import { WindowHapiQA } from "./qa.types"
46
+ import { WindowHapiServiceDebugging } from "../debugging/service.types"
45
47
 
46
48
  export type WindowHapiSDKModule<
47
49
  APIModule,
@@ -86,7 +88,7 @@ export type WindowHapiSDKContract = WindowHapiSDKModule<
86
88
  >
87
89
  export type WindowHapiSDKDebugging = WindowHapiSDKModule<
88
90
  undefined,
89
- undefined,
91
+ WindowHapiServiceDebugging,
90
92
  undefined,
91
93
  WindowHapiStateModule<DebuggingState>
92
94
  >
@@ -18,6 +18,7 @@ import { WindowHapiServiceTalentMindCompany } from "../talentMindCompany/service
18
18
  import { WindowHapiServiceTalentMindJob } from "../talentMindJob/service.types"
19
19
  import { WindowHapiServiceTalentMindResume } from "../talentMindResume/service.types"
20
20
  import { WindowHapiServiceTalentMindEvaluation } from "../talentMindEvaluation/service.types"
21
+ import { WindowHapiServiceDebugging } from "../debugging/service.types"
21
22
 
22
23
  export type HapiServiceFunctionLifecycleHookCallbackHandler = () =>
23
24
  | void
@@ -45,6 +46,8 @@ export type HapiServiceBase = {
45
46
  }
46
47
  export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
47
48
  {
49
+ propertiesThatShouldNotBeDocumented: string[]
50
+ mergePropertiesThatShouldNotBeDocumented: (klass: any) => void
48
51
  [WindowHapiModuleName.alert]: WindowHapiServiceAlert
49
52
  [WindowHapiModuleName.basket]: WindowHapiServiceBasket
50
53
  [WindowHapiModuleName.campaign]: WindowHapiServiceCampaign
@@ -55,6 +58,7 @@ export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
55
58
  [WindowHapiModuleName.orderJourney]: WindowHapiServiceOrderJourney
56
59
  [WindowHapiModuleName.ui]: WindowHapiServiceUI
57
60
  [WindowHapiModuleName.ats]: WindowHapiServiceATS
61
+ [WindowHapiModuleName.debugging]: WindowHapiServiceDebugging
58
62
  [WindowHapiModuleName.talentMindCompany]: WindowHapiServiceTalentMindCompany
59
63
  [WindowHapiModuleName.talentMindJob]: WindowHapiServiceTalentMindJob
60
64
  [WindowHapiModuleName.talentMindResume]: WindowHapiServiceTalentMindResume
@@ -70,6 +74,7 @@ export type WindowHapiService = WindowHapiModuleWithConstructorArgs<
70
74
  [WindowHapiModuleName.orderJourney]: WindowHapiServiceOrderJourney
71
75
  [WindowHapiModuleName.ui]: WindowHapiServiceUI
72
76
  [WindowHapiModuleName.ats]: WindowHapiServiceATS
77
+ [WindowHapiModuleName.debugging]: WindowHapiServiceDebugging
73
78
  [WindowHapiModuleName.talentMindCompany]: WindowHapiServiceTalentMindCompany
74
79
  [WindowHapiModuleName.talentMindJob]: WindowHapiServiceTalentMindJob
75
80
  [WindowHapiModuleName.talentMindResume]: WindowHapiServiceTalentMindResume
@@ -55,7 +55,10 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
55
55
  [WindowHapiModuleName.talentMindEvaluation]: WindowHapiStateModule<TalentMindEvaluationState>
56
56
  basePropertiesThatShouldNotBeDocumented: string[]
57
57
  handleDefaultStateFromQueryParams: (params: string | string[]) => void
58
- rehydrateInitialState: (initialState: Record<string, any>) => void
58
+ rehydrateInitialState: (
59
+ initialState: Record<string, any>,
60
+ getStateModuleName?: (storeName: string) => string,
61
+ ) => void
59
62
  onBeforeStateChange: () => void
60
63
  onAfterStateChange: () => void
61
64
  stores: {
package/alert/enums.ts CHANGED
@@ -5,6 +5,7 @@ export enum AlertKey {
5
5
  contractCreateSuccess = "contract-created",
6
6
  contractGroupCreateSuccess = "contract-group-created",
7
7
  campaignTakeOfflineSuccess = "campaign-take-offline-success",
8
+ campaignProductTakeOfflineSuccess = "campaign-product-take-offline-success",
8
9
  "campaignCopyProductsContractsDeletedWarning" = "campaign-copy-contract-warning",
9
10
  campaignOrderSuccess = "campaign-order-success",
10
11
  campaignCopySuccess = "campaign-copy-success",
@@ -7,4 +7,5 @@ export type ATSState = {
7
7
  supportedCurrencies: ProductPriceCurrency[]
8
8
  walletCurrencyPaymentSettings: ATSUserPaymentSetting | null
9
9
  maxPurchaseOrderAmount: number | null
10
+ maxOutstandingBalance: number | null
10
11
  }
@@ -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>
@@ -2,8 +2,10 @@ import { AxiosRequestConfig } from "axios"
2
2
  import {
3
3
  Campaign,
4
4
  CampaignEditRequestBody,
5
+ CampaignIdResponse,
5
6
  CampaignOrderRequestBody,
6
7
  CampaignPostingRequirementsValidateRequestBody,
8
+ CampaignSetProductStatusRequestBody,
7
9
  TaxonomyEducationAndSeniorityLevel,
8
10
  } from "./types"
9
11
  import { ProductSupportingContractsComplete } from "../product/types"
@@ -22,6 +24,7 @@ export type WindowHapiAPICampaignConfigs = {
22
24
  validateCampaign: AxiosRequestConfig
23
25
  validateCampaignPostingRequirements: AxiosRequestConfig
24
26
  saveCampaign: AxiosRequestConfig
27
+ setProductStatus: AxiosRequestConfig
25
28
  }
26
29
  export type WindowHapiAPICampaignRequests = {
27
30
  getCampaigns: (
@@ -29,7 +32,10 @@ export type WindowHapiAPICampaignRequests = {
29
32
  limit?: number,
30
33
  labels?: Record<string, string> | null,
31
34
  ) => Promise<PaginatedAPIResponseV2<Campaign>>
32
- getCampaign: (campaignId: string) => Promise<Campaign>
35
+ getCampaign: (
36
+ campaignId: string,
37
+ queryParams?: Record<string, any>,
38
+ ) => Promise<Campaign>
33
39
  getCampaignDetail: (
34
40
  campaignId: string,
35
41
  detail: "status",
@@ -46,6 +52,10 @@ export type WindowHapiAPICampaignRequests = {
46
52
  validateCampaignPostingRequirements: (
47
53
  campaign: CampaignPostingRequirementsValidateRequestBody,
48
54
  ) => Promise<Campaign>
55
+ setProductStatus: (
56
+ campaignId: string,
57
+ requestBody: CampaignSetProductStatusRequestBody,
58
+ ) => Promise<CampaignIdResponse>
49
59
  }
50
60
  export type WindowHapiAPICampaign = WindowHapiModuleWithConstructorArgs<
51
61
  WindowHapiAPIModule<
@@ -7,7 +7,9 @@ import {
7
7
  Campaign,
8
8
  CampaignCreateForm,
9
9
  CampaignEditForm,
10
+ CampaignIdResponse,
10
11
  CampaignOrderRequestBody,
12
+ CampaignSetProductStatusRequestBody,
11
13
  TaxonomyEducationAndSeniorityLevel,
12
14
  } from "./types"
13
15
  import { PaginatedAPIResponseV2 } from "../common/types"
@@ -25,6 +27,7 @@ export type CampaignServiceGetCampaignDetailHandler = (
25
27
  ) => Promise<ProductSupportingContractsComplete>
26
28
  export type CampaignServiceGetCampaignHandler = (
27
29
  campaignId: string,
30
+ queryParams?: Record<string, any>,
28
31
  ) => Promise<ProductSupportingContractsComplete>
29
32
  export type CampaignServiceSetCampaignCancellationHandler = (
30
33
  campaignId: string,
@@ -58,6 +61,10 @@ export type CampaignServiceGetCopyCampaignRequestBodyHandler = (
58
61
  export type CampaignServiceGetEditCampaignRequestBodyHandler = (
59
62
  campaign: Campaign,
60
63
  ) => CampaignCreateForm
64
+ export type CampaignServiceSetProductStatusHandler = (
65
+ campaignId: string,
66
+ requestBody: CampaignSetProductStatusRequestBody,
67
+ ) => Promise<CampaignIdResponse>
61
68
  export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
62
69
  {
63
70
  getCampaigns: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsHandler>
@@ -69,12 +76,16 @@ export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
69
76
  orderCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceOrderCampaignHandler>
70
77
  copyCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceCopyCampaignHandler>
71
78
  editCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceEditCampaignHandler>
72
- onAfterOrderCampaignSuccess: (alertKey: AlertKey) => void
79
+ onAfterOrderCampaignSuccess: (
80
+ alertKey?: AlertKey,
81
+ disclaimerTexts?: string[],
82
+ ) => void
73
83
  validateContractPostingRequirementsWithCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceValidateContractPostingRequirementsWithCampaignHandler>
74
84
  saveCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceSaveCampaignHandler>
75
85
  validateCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceValidateCampaignHandler>
76
86
  getCopyCampaignRequestBody: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCopyCampaignRequestBodyHandler>
77
87
  getEditCampaignRequestBody: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetEditCampaignRequestBodyHandler>
88
+ setProductStatus: HapiServiceFunctionWithLifecycleHooks<CampaignServiceSetProductStatusHandler>
78
89
  },
79
90
  { readonly service: WindowHapiService }
80
91
  >
package/campaign/types.ts CHANGED
@@ -2,7 +2,7 @@ import { ProductDuration, ProductIndustry } from "../product/types"
2
2
  import { ProductPriceCurrency } from "../product/enums"
3
3
  import { EmploymentType, SalaryPeriod } from "./enums"
4
4
  import { OrderJourneyPaymentMethod } from "../orderJourney"
5
- import { PostingRequirement } from "../common"
5
+ import { PostingRequirement, PostingRequirementLabelsMap } from "../common"
6
6
 
7
7
  export type CampaignProductSpecs = {
8
8
  contractId: string | null
@@ -11,6 +11,7 @@ export type CampaignProductSpecs = {
11
11
  durationPeriod: ProductDuration
12
12
  jobBoardLink: string | null
13
13
  postingRequirements: Record<string, any> | null
14
+ postingRequirementsLabels?: PostingRequirementLabelsMap
14
15
  productId: string
15
16
  status: CampaignStatus
16
17
  utm: string | null
@@ -129,10 +130,15 @@ export type CampaignDetailedStatus = {
129
130
  orderedProductsStatuses: CampaignDetailsStatusOrderedProductStatus[]
130
131
  }
131
132
 
132
- export type Campaign = {
133
+ export type CampaignDraft = {
134
+ campaignId: string
135
+ isDraft: boolean
136
+ paymentStatus: "processing_payment"
137
+ }
138
+
139
+ export type Campaign = Pick<CampaignDraft, "campaignId"> & {
133
140
  labels: Record<string, string> | null
134
141
  currency: ProductPriceCurrency
135
- campaignId: string
136
142
  campaignName: string | null
137
143
  companyId: string
138
144
  createdOn: string
@@ -177,6 +183,7 @@ export type CampaignCreateFormOrderedProductSpecBase = {
177
183
  utm: string
178
184
  contractId: string
179
185
  postingRequirements: PostingRequirement[]
186
+ postingRequirementsLabels?: PostingRequirementLabelsMap
180
187
  postingDurationDays: number | null
181
188
  }
182
189
  export type CampaignCreateFormOrderedProductSpec =
@@ -201,14 +208,15 @@ export type CampaignCreateForm = {
201
208
  companyId: string
202
209
  currency: ProductPriceCurrency | null
203
210
  campaignName?: string | null
204
- poNumber: string | null
211
+ poNumber?: string | null
205
212
  orderReference?: string | null
206
- paymentMethod: OrderJourneyPaymentMethod | null
213
+ paymentMethod?: OrderJourneyPaymentMethod | null
207
214
  targetGroup: CampaignCreateFormTargetGroup
208
215
  recruiterInfo: CampaignRecruiterInfo
209
216
  postingDetails: CampaignCreateFormPostingDetails
210
217
  orderedProducts: string[] //Array of UUIDs
211
218
  orderedProductsSpecs: Record<string, CampaignCreateFormOrderedProductSpec>
219
+ orderedProductsSpecsLabels?: Record<string, PostingRequirementLabelsMap>
212
220
  }
213
221
 
214
222
  export type CampaignEditForm = Omit<
@@ -220,6 +228,7 @@ export type CampaignEditForm = Omit<
220
228
  | "paymentMethod"
221
229
  | "postingDetails"
222
230
  | "orderedProductsSpecs"
231
+ | "orderedProductsSpecsLabels"
223
232
  > & {
224
233
  campaignId: string
225
234
  postingDetails: Omit<
@@ -230,6 +239,7 @@ export type CampaignEditForm = Omit<
230
239
  string,
231
240
  Omit<CampaignCreateFormOrderedProductSpec, "postingDurationDays">
232
241
  >
242
+ orderedProductsSpecsLabels: Record<string, PostingRequirementLabelsMap>
233
243
  }
234
244
 
235
245
  export type CampaignOrderRequestBodyOrderedProductsSpec = {
@@ -237,6 +247,7 @@ export type CampaignOrderRequestBodyOrderedProductsSpec = {
237
247
  utm: string
238
248
  productId?: string
239
249
  postingRequirements?: Record<string, any>
250
+ postingRequirementsLabels?: PostingRequirementLabelsMap
240
251
  postingDurationDays: number | null
241
252
  }
242
253
 
@@ -253,6 +264,7 @@ export type CampaignOrderRequestBody = {
253
264
  targetGroup: CampaignTargetGroup
254
265
  orderedProducts: string[]
255
266
  orderedProductsSpecs: CampaignOrderRequestBodyOrderedProductsSpec[]
267
+ currency?: ProductPriceCurrency
256
268
  }
257
269
 
258
270
  export type CampaignEditRequestBody = Omit<
@@ -314,3 +326,12 @@ export type CampaignPostingRequirementsValidateResponse = {
314
326
  posting_requirements: Record<string, any>
315
327
  }
316
328
  }
329
+
330
+ export type CampaignSetProductStatusRequestBody = {
331
+ productId: string
332
+ status: "offline"
333
+ }
334
+
335
+ export type CampaignIdResponse = {
336
+ campaignId: string
337
+ }
@@ -149,7 +149,14 @@ export type ZodCampaign = ZodObject<{
149
149
  walletId: ZodOptional<ZodNullable<ZodString>>
150
150
  poNumber: ZodOptional<ZodNullable<ZodString>>
151
151
  }>
152
- export type ZodCampaigns = ZodArray<ZodCampaign>
152
+
153
+ export type ZodCampaignDraft = ZodObject<{
154
+ campaignId: ZodString
155
+ isDraft: ZodBoolean
156
+ paymentStatus: ZodString
157
+ }>
158
+
159
+ export type ZodCampaigns = ZodArray<ZodUnion<[ZodCampaign, ZodCampaignDraft]>>
153
160
  export type ZodCampaignCreateFormPostingDetails = ZodObject<{
154
161
  title: ZodString
155
162
  description: ZodString
@@ -178,8 +185,10 @@ export type ZodCampaignCreateFormTargetGroup = ZodObject<{
178
185
  export type ZodCampaignCreateForm = ZodObject<{
179
186
  companyId: ZodString
180
187
  campaignName: ZodOptional<ZodNullable<ZodString>>
181
- poNumber: ZodNullable<ZodString>
182
- paymentMethod: ZodNullable<ZodNativeEnum<typeof OrderJourneyPaymentMethod>>
188
+ poNumber: ZodOptional<ZodNullable<ZodString>>
189
+ paymentMethod: ZodOptional<
190
+ ZodNullable<ZodNativeEnum<typeof OrderJourneyPaymentMethod>>
191
+ >
183
192
  targetGroup: ZodCampaignCreateFormTargetGroup
184
193
  recruiterInfo: ZodCampaignRecruiterInfo
185
194
  postingDetails: ZodCampaignCreateFormPostingDetails
@@ -36,6 +36,7 @@ export enum WindowHapiEventCommandName {
36
36
  domHideElement = "dom:hide-element",
37
37
  domShowElement = "dom:show-element",
38
38
  domSetStyleAttribute = "dom:set-style-attribute",
39
+ domSetAttribute = "dom:set-attribute",
39
40
  domAddClass = "dom:add-class",
40
41
  domRemoveClass = "dom:remove-class",
41
42
  domSlotAvailable = "dom:slot-available",
@@ -37,6 +37,7 @@ export type WindowHapiEventCommand = {
37
37
  export type WindowHapiEventCommandCallbackHandler = (
38
38
  data: any,
39
39
  event: WindowHapiEventCommand | WindowHapiEventListener,
40
+ previousData?: any,
40
41
  ) => void
41
42
  export type WindowHapiEventCommandCommitHandler = (
42
43
  ...args: any[]
package/common/types.ts CHANGED
@@ -50,6 +50,7 @@ export type PaginatedAPIResponseV2<T> = {
50
50
  } & PaginationResponseV2
51
51
  export type HapiInputErrorMessageOrValidity =
52
52
  | MessageDescriptor
53
+ | MessageDescriptor[]
53
54
  | boolean
54
55
  | undefined
55
56
  | null
@@ -78,6 +79,7 @@ export type ValidatorKey =
78
79
  | keyof Validators
79
80
  export type NestedValidatorKeys =
80
81
  | ValidatorKey
82
+ | ValidatorKey[]
81
83
  | {
82
84
  [k: string]: ValidatorKey | NestedValidatorKeys
83
85
  }
@@ -124,18 +126,46 @@ export type PostingRequirementType =
124
126
  | "TEXTAREA"
125
127
  | "AUTOCOMPLETE"
126
128
  | "STATISCH"
127
- | "IMAGE-URL"
128
- | "VIDEO-URL"
129
- | "IMAGE-PREVIEW"
130
- | "DYNAMISCH"
129
+ | "FILE-URL"
130
+
131
+ export type PostingRequirementRuleName =
132
+ | "int"
133
+ | "regex"
134
+ | "maxlength"
135
+ | "minlength"
136
+ | "maxitems"
137
+ | "minitems"
138
+ | "date"
139
+ | "float"
140
+ | "email"
141
+ | "lower"
142
+ | "higher"
143
+ | "min"
144
+ | "max"
145
+ | "before"
146
+ | "after"
147
+ | "url"
148
+ | "fileMimeType"
149
+ | "fileMimeSubType"
150
+ | "editorTest"
151
+ | "libraryTest"
152
+ | "autocomplete"
153
+ | "statictype"
154
+ | "staticsubtype"
155
+
131
156
  export type PostingRequirementRule = {
132
- rule: string
157
+ rule: PostingRequirementRuleName
133
158
  data: string
134
159
  }
160
+
161
+ export type PostingRequirementRuleWithObjectData = {
162
+ data: Record<string, any>
163
+ } & Omit<PostingRequirementRule, "data">
164
+
135
165
  export type PostingRequirementDisplayRuleShow = {
136
166
  facet: string
137
167
  value: any
138
- op: "notempty" | "equal" | "in"
168
+ op: "notempty" | "equal" | "in" | "selected_option_show_contains"
139
169
  }
140
170
  export type PostingRequirementDisplayRule = {
141
171
  show: PostingRequirementDisplayRuleShow[]
@@ -168,12 +198,16 @@ export type PostingRequirement = {
168
198
  display_rules: PostingRequirementDisplayRule | null
169
199
  autocomplete: PostingRequirementAutocomplete | null
170
200
  options: PostingRequirementOption[] | null
201
+ message?: string | null
171
202
  required: boolean
172
203
  sort: string
173
204
  type: PostingRequirementType
174
- rules?: PostingRequirementRule[] | null
175
- group_id?: string
205
+ rules?:
206
+ | (PostingRequirementRule | PostingRequirementRuleWithObjectData)[]
207
+ | null
208
+ group_id?: string | number
176
209
  }
210
+ export type PostingRequirementLabelsMap = Record<string, string>
177
211
  export type PostingRequirementOptionRequiresField = {
178
212
  field: {
179
213
  name: string
@@ -188,12 +222,14 @@ export type PostingRequirementOption = {
188
222
  sort: string
189
223
  parent?: string
190
224
  requires?: PostingRequirementOptionRequiresField[] | null
225
+ show?: string[]
191
226
  }
192
227
  export type TransformedPostingRequirementOption = {
193
228
  value?: string
194
229
  data?: any[]
195
230
  requires?: PostingRequirementOptionRequiresField[] | null
196
231
  label: string
232
+ show?: string[]
197
233
  }
198
234
  export type PostingRequirementReactiveDescription = { description: string }
199
235
  export type TransformedPostingRequirement = Omit<
@@ -207,3 +243,26 @@ export type PostingRequirementsAutocompleteRequestOption = {
207
243
  key: string
208
244
  value: string | string[]
209
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
+ }
@@ -77,7 +77,7 @@ export type ZodContract = ZodObject<{
77
77
  channel: ZodOptional<ZodContractChannel>
78
78
  alias: ZodContractAlias
79
79
  channel_id: ZodNumber
80
- class_name: ZodString
80
+ class_name: ZodNullable<ZodString>
81
81
  contract_id: ZodString
82
82
  customer_id: ZodString
83
83
  facets: ZodContractFacets
@@ -1,3 +1,4 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
3
  export * from "./state.types"
4
+ export * from "./types"
@@ -0,0 +1,16 @@
1
+ import { WindowHapiService } from "../_window/service.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
+ import { HapiDebuggingLogs } from "./types"
4
+ import { WindowHapiEventCommand, WindowHapiEventListener } from "../common"
5
+
6
+ export type WindowHapiServiceDebugging = WindowHapiModuleWithConstructorArgs<
7
+ {
8
+ logs: HapiDebuggingLogs
9
+ addStateEventToLogs: (eventCommand: WindowHapiEventCommand) => void
10
+ addNonStateEventToLogs: (eventCommand: WindowHapiEventCommand) => void
11
+ addListenerToLogs: (
12
+ eventCommand: WindowHapiEventCommand | WindowHapiEventListener,
13
+ ) => void
14
+ },
15
+ { readonly service: WindowHapiService }
16
+ >
@@ -4,4 +4,8 @@ export type DebuggingState = {
4
4
  componentDebuggingIsEnabled: boolean
5
5
  consoleLogsAreEnabled: boolean
6
6
  isAIFeaturesEnabled: boolean
7
+ isCollectingLogs: boolean
8
+ isReplayingLogs: boolean
9
+ logReplayIndex: number
10
+ restoreLogs: any
7
11
  }
@@ -0,0 +1,17 @@
1
+ import { WindowHapiConfigSubmodule, WindowHapiInjectorConfig } from "../_window"
2
+
3
+ export type HapiDebuggingLogs = {
4
+ navigator: Record<string, any> | undefined
5
+ config: WindowHapiConfigSubmodule | undefined
6
+ injectorConfig: WindowHapiInjectorConfig | undefined
7
+ timestamps: {
8
+ timeStart: Date | undefined
9
+ timeFinish: Date | undefined
10
+ }
11
+ stateTimeline: any[]
12
+ nonStateTimeline: any[]
13
+ listenersTimeline: any[]
14
+ listeners: any[]
15
+ state: any | undefined
16
+ instances: any[]
17
+ }
package/modal/enums.ts CHANGED
@@ -8,6 +8,7 @@ export enum ModalKeys {
8
8
  basket = "layout-basket-modal",
9
9
  productInfo = "product-info",
10
10
  campaignTakeOfflineConfirmation = "campaign-confirm-take-offline",
11
+ campaignProductTakeOfflineConfirmation = "campaign-product-confirm-take-offline",
11
12
  campaignCopyJourney = "campaign-confirm-copy",
12
13
  campaignStatusDetail = "campaign-status-detail",
13
14
  campaignCopySelection = "contract-copy-selection",
@@ -19,4 +20,13 @@ export enum ModalKeys {
19
20
  contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
20
21
  talentMindEvaluateJobWithResume = "talentmind-evaluate-job-with-resume",
21
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",
22
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
@@ -17,6 +16,10 @@ export type BasketRemoveProductConfirmationModalProps = {
17
16
  basketProduct: Product | Contract
18
17
  }
19
18
  export type CampaignTakeOfflineConfirmationModalProps = { campaignId: string }
19
+ export type CampaignProductTakeOfflineConfirmationModalProps = {
20
+ campaignId: string
21
+ productId: string
22
+ }
20
23
  export type ContractRemoveConfirmationModalProps = { contractId: string }
21
24
  export type ContractGroupConflictInfoModalProps = {
22
25
  contract: Contract
@@ -41,7 +44,7 @@ export type FilePickerOptions = {
41
44
  maxSize?: number
42
45
  displayMode?: PickerDisplayMode
43
46
  container?: string
44
- containerProps?: HapiBoxProps
47
+ containerProps?: Record<string, any>
45
48
  imageMax?: [number, number]
46
49
  imageMin?: [number, number]
47
50
  showTransformations?: boolean
@@ -63,6 +66,20 @@ export type TalentMindEvaluateResumeWithJobModalProps = {
63
66
  job: TalentMindJob
64
67
  }
65
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
+
66
83
  export type ModalProps = AnyNonFunction<
67
84
  | ProductDetailModalProps
68
85
  | UTMCodesModalProps
@@ -71,6 +88,7 @@ export type ModalProps = AnyNonFunction<
71
88
  | ContractRemoveConfirmationModalProps
72
89
  | ContractGroupConflictInfoModalProps
73
90
  | ContractPostingRequirementsSmartFillResponseModalProps
91
+ | FilePickerModalProps
74
92
  | BasketModalProps
75
93
  | WalletModalProps
76
94
  >
@@ -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
  >
@@ -47,7 +47,10 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
47
47
  setContractStepsErrorMessages: (
48
48
  messages: Record<
49
49
  string,
50
- Record<string, MessageDescriptor | boolean>
50
+ Record<
51
+ string,
52
+ MessageDescriptor | MessageDescriptor[] | boolean
53
+ >
51
54
  >,
52
55
  ) => void
53
56
  setContractStepsSubmittedSteps: (steps: Record<string, boolean>) => void
@@ -61,7 +64,10 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
61
64
  setProductStepsErrorMessages: (
62
65
  messages: Record<
63
66
  string,
64
- Record<string, MessageDescriptor | boolean>
67
+ Record<
68
+ string,
69
+ MessageDescriptor | MessageDescriptor[] | boolean
70
+ >
65
71
  >,
66
72
  ) => void
67
73
  setProductStepsSubmittedSteps: (steps: Record<string, boolean>) => void
@@ -7,6 +7,7 @@ import {
7
7
  OrderJourneyOrderReviewStepData,
8
8
  OrderJourneyProductStep,
9
9
  OrderJourneyOrderErrors,
10
+ OrderJourneyOrderConfirmationStepData,
10
11
  } from "./types"
11
12
  import { MessageDescriptor } from "react-intl"
12
13
  import { NestedValidatorKeys, UseValidatorResult } from "../common/types"
@@ -82,7 +83,7 @@ export type OrderJourneyState = {
82
83
  contractStepsSubmittedSteps: Record<string, boolean>
83
84
  contractStepsErrorMessages: Record<
84
85
  string,
85
- Record<string, MessageDescriptor>
86
+ Record<string, MessageDescriptor | MessageDescriptor[]>
86
87
  >
87
88
  contractStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
88
89
  contractStepsData: Record<string, Record<string, any>>
@@ -91,7 +92,10 @@ export type OrderJourneyState = {
91
92
  productSteps: OrderJourneyProductStep[]
92
93
  productStepsBlurredFields: Record<string, Record<string, boolean>>
93
94
  productStepsSubmittedSteps: Record<string, boolean>
94
- productStepsErrorMessages: Record<string, Record<string, MessageDescriptor>>
95
+ productStepsErrorMessages: Record<
96
+ string,
97
+ Record<string, MessageDescriptor | MessageDescriptor[]>
98
+ >
95
99
  productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
96
100
  productStepsData: Record<string, Record<string, any>>
97
101
  productStepsValidations: Record<string, UseValidatorResult> | null
@@ -109,6 +113,6 @@ export type OrderJourneyState = {
109
113
  paymentMethodStepValidations: UseValidatorResult
110
114
  /* Order Confirmation */
111
115
  orderConfirmationStep: OrderJourneyStep
112
- orderConfirmationStepData: Record<string, any>
116
+ orderConfirmationStepData: OrderJourneyOrderConfirmationStepData
113
117
  orderConfirmationStepValidations: UseValidatorResult
114
118
  }
@@ -69,6 +69,10 @@ export type OrderJourneyOrderReviewStepData = {
69
69
  accordionsEnabled: OrderJourneyStepKey[]
70
70
  }
71
71
 
72
+ export type OrderJourneyOrderConfirmationStepData = {
73
+ disclaimerTexts: string[]
74
+ }
75
+
72
76
  export type OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid =
73
77
  {
74
78
  errors: {
@@ -88,6 +92,7 @@ export type OrderJourneyOrderErrorsCampaignIsInvalid = {
88
92
  recruiterInfo: Record<string, any>
89
93
  targetGroup: Record<string, any>
90
94
  orderedProducts: string[]
95
+ orderedProductsSpecs?: any[]
91
96
  walletId: string
92
97
  }
93
98
 
@@ -40,6 +40,9 @@ export type ZodOrderJourneyOrderReviewStepData = ZodObject<{
40
40
  ZodUnion<[ZodNativeEnum<typeof OrderJourneyStepKey>, ZodString]>
41
41
  >
42
42
  }>
43
+ export type ZodOrderJourneyOrderConfirmationStepData = ZodObject<{
44
+ disclaimerTexts: ZodArray<ZodString>
45
+ }>
43
46
  export type WindowHapiValidationsOrderJourney = {
44
47
  supportedStepKeys: OrderJourneyStepKey[]
45
48
  stepKeysRegex: RegExp
@@ -55,4 +58,5 @@ export type WindowHapiValidationsOrderJourney = {
55
58
  utmMaps: ZodOrderJourneyUTMCodeMaps
56
59
  utmCodesStepData: ZodOrderJourneyUTMCodesStepData
57
60
  orderReviewStepData: ZodOrderJourneyOrderReviewStepData
61
+ orderConfirmationStepData: ZodOrderJourneyOrderConfirmationStepData
58
62
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.19.0",
4
+ "version": "1.21.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/enums.ts CHANGED
@@ -13,6 +13,7 @@ export enum ProductPriceCurrency {
13
13
 
14
14
  export enum ProductSortBy {
15
15
  "recommendedFirst" = "recommendedFirst",
16
+ "relevant" = "relevant",
16
17
  "createdNewestToOldest" = "created.desc",
17
18
  "createdOldestToNewest" = "created.asc",
18
19
  "priceHighToLow" = "list_price.desc",
@@ -57,7 +57,11 @@ export type ProductServiceGetIndustriesHandler = () => Promise<
57
57
  ProductIndustry[]
58
58
  >
59
59
 
60
- export type ProductServiceSetArbitraryJobTitle = (text: string) => void
60
+ export type ProductServiceSetArbitraryJobTitle = (
61
+ text: string,
62
+ shouldResetJobTitlesIds?: boolean,
63
+ shouldResetJobFunctionsIds?: boolean,
64
+ ) => void
61
65
 
62
66
  export type ProductServiceGetProductPostingRequirementOptionsHandler = (
63
67
  productId: string,
package/product/types.ts CHANGED
@@ -4,7 +4,11 @@ import {
4
4
  ProductSortBy,
5
5
  } from "./enums"
6
6
  import { ContractCredential } from "../contract/types"
7
- import { Facet, PostingRequirement } from "../common"
7
+ import {
8
+ Facet,
9
+ PostingRequirement,
10
+ PostingRequirementLabelsMap,
11
+ } from "../common"
8
12
 
9
13
  export type ProductRange = "hours" | "days" | "weeks" | "months"
10
14
 
@@ -63,7 +67,7 @@ export type Product = {
63
67
  time_to_process: ProductDuration
64
68
  time_to_setup: ProductDuration
65
69
  is_recommended?: boolean
66
- has_posting_requirements: boolean
70
+ has_product_specs: boolean
67
71
  } & ProductLogos &
68
72
  ProductType
69
73
 
@@ -159,6 +163,7 @@ export type ProductSupportingContractsComplete = ProductLogos &
159
163
  feed_url: string | null
160
164
  manual_setup_required: boolean
161
165
  posting_requirements: PostingRequirement[]
166
+ posting_requirements_labels: PostingRequirementLabelsMap
162
167
  setup_instructions: string //html;
163
168
  }
164
169
 
@@ -25,6 +25,7 @@ export type WindowHapiServiceWallet = WindowHapiModuleWithConstructorArgs<
25
25
  ) => Promise<void>
26
26
  resetTopUpState: () => void
27
27
  resetDirectChargeState: () => void
28
+ resetPurchaseOrderState: () => void
28
29
  resetCheckoutFormState: () => void
29
30
  },
30
31
  { readonly service: WindowHapiService }
package/wallet/types.ts CHANGED
@@ -59,6 +59,7 @@ export type WalletPaymentIntentPaymentMethod =
59
59
  | "sofort"
60
60
  | "us_bank_account"
61
61
  | "wechat_pay"
62
+ | "bank_transfer"
62
63
 
63
64
  export type WalletPaymentIntentRequest = {
64
65
  walletId: string