@vonq/hapi-elements-types 1.20.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
  >
@@ -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: (storeName: string) => string,
60
+ getStateModuleName?: (storeName: string) => string,
61
61
  ) => void
62
62
  onBeforeStateChange: () => void
63
63
  onAfterStateChange: () => void
@@ -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: string | null
211
+ poNumber?: string | null
212
212
  orderReference?: string | null
213
- paymentMethod: OrderJourneyPaymentMethod | null
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: ZodNullable<ZodNativeEnum<typeof OrderJourneyPaymentMethod>>
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
- | "IMAGE-URL"
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?: PostingRequirementRule[] | null
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,26 @@ 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
+ }
@@ -1,4 +1,4 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
3
  export * from "./state.types"
4
- export type { HapiDebuggingLogs } from "./types"
4
+ export * from "./types"
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?: HapiBoxProps
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
  >
@@ -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
  >
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.20.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",