@vonq/hapi-elements-types 1.18.0 → 1.20.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.
Files changed (47) hide show
  1. package/_window/events.types.ts +15 -2
  2. package/_window/qa.types.ts +3 -1
  3. package/_window/routing.types.ts +1 -0
  4. package/_window/sdk.types.ts +3 -1
  5. package/_window/service.types.ts +5 -0
  6. package/_window/state.types.ts +4 -1
  7. package/_window/utils.types.ts +13 -0
  8. package/alert/enums.ts +2 -0
  9. package/ats/state.types.ts +1 -0
  10. package/basket/state.types.ts +3 -1
  11. package/basket/utils.types.ts +3 -0
  12. package/basket/validations.types.ts +7 -0
  13. package/campaign/api.types.ts +22 -1
  14. package/campaign/service.types.ts +44 -3
  15. package/campaign/state.types.ts +2 -1
  16. package/campaign/types.ts +89 -20
  17. package/campaign/utils.types.ts +21 -0
  18. package/campaign/validations.types.ts +8 -1
  19. package/common/events/EventCommand/enums.ts +1 -0
  20. package/common/events/types.ts +1 -0
  21. package/common/types.ts +122 -0
  22. package/contract/service.types.ts +5 -7
  23. package/contract/types.ts +2 -83
  24. package/contract/validations.types.ts +7 -1
  25. package/debugging/index.ts +1 -0
  26. package/debugging/service.types.ts +16 -0
  27. package/debugging/state.types.ts +4 -0
  28. package/debugging/types.ts +17 -0
  29. package/modal/enums.ts +2 -0
  30. package/modal/types.ts +28 -4
  31. package/orderJourney/enums.ts +1 -0
  32. package/orderJourney/service.types.ts +27 -1
  33. package/orderJourney/state.types.ts +17 -3
  34. package/orderJourney/types.ts +42 -0
  35. package/orderJourney/validations.types.ts +7 -0
  36. package/package.json +1 -1
  37. package/product/api.types.ts +15 -1
  38. package/product/enums.ts +9 -0
  39. package/product/service.types.ts +25 -2
  40. package/product/state.types.ts +4 -1
  41. package/product/types.ts +22 -16
  42. package/product/utils.types.ts +2 -1
  43. package/product/validations.types.ts +3 -2
  44. package/routing/utils.types.ts +14 -0
  45. package/theming/types.ts +1 -0
  46. package/wallet/service.types.ts +1 -0
  47. package/wallet/types.ts +1 -0
@@ -12,13 +12,19 @@ import {
12
12
  ProductSupportingContractsComplete,
13
13
  ProductSupportingContractsPartial,
14
14
  } from "./types"
15
- import { PaginatedAPIResponseV1, PaginationResponseV1 } from "../common/types"
15
+ import {
16
+ PaginatedAPIResponseV1,
17
+ PaginationResponseV1,
18
+ PostingRequirement,
19
+ PostingRequirementsAutocompleteRequestOption,
20
+ } from "../common/types"
16
21
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
17
22
 
18
23
  export type ProductServiceGetFilteredProductsHandler = (
19
24
  meta?: PaginationResponseV1 | null,
20
25
  filters?: Partial<ProductFilterQueryParams>,
21
26
  ) => Promise<Product[]>
27
+ export type ProductServiceLoadMoreProductsHandler = () => Promise<Product[]>
22
28
  export type ProductServiceGetProductWithContractsSupportByIdHandler = (
23
29
  id: string | number,
24
30
  ) => Promise<ProductSupportingContractsComplete>
@@ -51,10 +57,25 @@ export type ProductServiceGetIndustriesHandler = () => Promise<
51
57
  ProductIndustry[]
52
58
  >
53
59
 
54
- export type ProductServiceSetArbitraryJobTitle = (text: string) => void
60
+ export type ProductServiceSetArbitraryJobTitle = (
61
+ text: string,
62
+ shouldResetJobTitlesIds?: boolean,
63
+ shouldResetJobFunctionsIds?: boolean,
64
+ ) => void
65
+
66
+ export type ProductServiceGetProductPostingRequirementOptionsHandler = (
67
+ productId: string,
68
+ fieldName: string,
69
+ autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
70
+ ) => Promise<any>
71
+
72
+ export type ProductServiceGetProductPostingRequirementsHandler = (
73
+ productId: string | number,
74
+ ) => Promise<PostingRequirement[]>
55
75
 
56
76
  export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
57
77
  {
78
+ loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
58
79
  setArbitraryJobTitle: ProductServiceSetArbitraryJobTitle
59
80
  getProductWithContractsSupportById: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductWithContractsSupportByIdHandler>
60
81
  getProductsWithContractsSupport: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsWithContractsSupportHandler>
@@ -66,6 +87,8 @@ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
66
87
  getJobTitles: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobTitlesHandler>
67
88
  getJobFunctions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobFunctionsHandler>
68
89
  getIndustries: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetIndustriesHandler>
90
+ getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementOptionsHandler>
91
+ getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementsHandler>
69
92
  },
70
93
  { readonly service: WindowHapiService }
71
94
  >
@@ -7,7 +7,7 @@ import {
7
7
  ProductSupportingContractsPartial,
8
8
  } from "./types"
9
9
  import { PaginationResponseV1 } from "../common/types"
10
- import { ProductPriceCurrency } from "./enums"
10
+ import { ProductPriceCurrency, ProductSortBy } from "./enums"
11
11
 
12
12
  export type ProductState = {
13
13
  /* Products */
@@ -20,8 +20,11 @@ export type ProductState = {
20
20
  productsAreLoading: boolean
21
21
  productNameInput: string
22
22
  jobRegionsIdsSelected: number[]
23
+ filtersAccordionIsOpen: boolean
23
24
  /* Product Price Display Currency */
24
25
  displayCurrency: ProductPriceCurrency
26
+ /* Sort By */
27
+ searchSortBy: ProductSortBy
25
28
  /* Locations */
26
29
  jobRegions: ProductLocation[]
27
30
  /* Job Titles */
package/product/types.ts CHANGED
@@ -1,9 +1,14 @@
1
- import { ProductFilterRecommendations, ProductPriceCurrency } from "./enums"
2
1
  import {
3
- ContractCredential,
4
- ContractFacet,
5
- ContractPostingRequirement,
6
- } from "../contract/types"
2
+ ProductFilterRecommendations,
3
+ ProductPriceCurrency,
4
+ ProductSortBy,
5
+ } from "./enums"
6
+ import { ContractCredential } from "../contract/types"
7
+ import {
8
+ Facet,
9
+ PostingRequirement,
10
+ PostingRequirementLabelsMap,
11
+ } from "../common"
7
12
 
8
13
  export type ProductRange = "hours" | "days" | "weeks" | "months"
9
14
 
@@ -61,6 +66,8 @@ export type Product = {
61
66
  vonq_price: ProductPrice[]
62
67
  time_to_process: ProductDuration
63
68
  time_to_setup: ProductDuration
69
+ is_recommended?: boolean
70
+ has_product_specs: boolean
64
71
  } & ProductLogos &
65
72
  ProductType
66
73
 
@@ -127,6 +134,7 @@ export type ProductFilterQueryParams = {
127
134
  filterProductRecommendations: ProductFilterRecommendations
128
135
  filterMyContractSupportedOnly: boolean
129
136
  searchTextInput: string
137
+ searchSortBy: ProductSortBy
130
138
  }
131
139
 
132
140
  export type ProductSearchFilters = {
@@ -142,15 +150,7 @@ export type ProductSearchFilters = {
142
150
  mcEnabled?: boolean
143
151
  name?: string
144
152
  recommended?: boolean
145
- sortBy?:
146
- | "relevant"
147
- | "recent"
148
- | "order_frequency.desc"
149
- | "order_frequency.asc"
150
- | "created.desc"
151
- | "created.asc"
152
- | "list_price.desc"
153
- | "list_price.asc"
153
+ sortBy?: ProductSortBy
154
154
  }
155
155
 
156
156
  export type ProductWithSupportForContractsFilters = {
@@ -159,10 +159,11 @@ export type ProductWithSupportForContractsFilters = {
159
159
  export type ProductSupportingContractsComplete = ProductLogos &
160
160
  ProductSupportingContractsPartial & {
161
161
  contract_credentials: ContractCredential[]
162
- contract_facets?: ContractFacet[]
162
+ contract_facets?: Facet[]
163
163
  feed_url: string | null
164
164
  manual_setup_required: boolean
165
- posting_requirements: ContractPostingRequirement[]
165
+ posting_requirements: PostingRequirement[]
166
+ posting_requirements_labels: PostingRequirementLabelsMap
166
167
  setup_instructions: string //html;
167
168
  }
168
169
 
@@ -170,3 +171,8 @@ export type ProductUserProvidedFilters = Omit<
170
171
  ProductFilterQueryParams,
171
172
  "filterProductRecommendations" | "filterMyContractSupportedOnly"
172
173
  >
174
+
175
+ export type ProductPostingRequirementsAutocompleteRequestOption = {
176
+ key: string
177
+ value: string | string[]
178
+ }
@@ -2,11 +2,12 @@ import { ProductFilterQueryParams, ProductUserProvidedFilters } from "./types"
2
2
  import { PaginationResponseV1 } from "../common/types"
3
3
  import { WindowHapiUtils } from "../_window/utils.types"
4
4
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
5
- import { ProductPriceCurrency } from "./enums"
5
+ import { ProductPriceCurrency, ProductSortBy } from "./enums"
6
6
 
7
7
  export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
8
8
  {
9
9
  currencyKeys: typeof ProductPriceCurrency
10
+ sortByKeys: typeof ProductSortBy
10
11
  getUserProvidedFilters: () => ProductUserProvidedFilters
11
12
  getProductsQueryParams: (
12
13
  params: Partial<ProductFilterQueryParams>,
@@ -26,8 +26,8 @@ export type ZodProductChannel = ZodObject<{
26
26
  }>
27
27
 
28
28
  export type ZodProductDuration = ZodObject<{
29
- range: ZodString
30
- period: ZodNumber
29
+ range: ZodNullable<ZodString>
30
+ period: ZodNullable<ZodNumber>
31
31
  }>
32
32
 
33
33
  export type ZodProductIndustry = ZodObject<{
@@ -109,6 +109,7 @@ export type ZodProduct = ZodObject<{
109
109
  industries: ZodProductIndustries
110
110
  job_functions: ZodProductJobFunctions
111
111
  locations: ZodProductLocationsPartial
112
+ is_recommended: ZodOptional<ZodBoolean>
112
113
  mc_enabled: ZodBoolean
113
114
  mc_only: ZodBoolean
114
115
  product_id: ZodString
@@ -0,0 +1,14 @@
1
+ import { WindowHapiUtils } from "../_window/utils.types"
2
+ import {
3
+ WindowHapiModuleWithConstructorArgs,
4
+ WindowHapiRoutingQueryParams,
5
+ } from "../_window"
6
+
7
+ export type WindowHapiUtilsRouter = WindowHapiModuleWithConstructorArgs<
8
+ {
9
+ convertSearchStringToQueryParams: (
10
+ searchString?: string,
11
+ ) => WindowHapiRoutingQueryParams
12
+ },
13
+ { readonly utils: WindowHapiUtils }
14
+ >
package/theming/types.ts CHANGED
@@ -85,6 +85,7 @@ export type HapiThemeRule =
85
85
  | "userJourneyBar"
86
86
  | "card"
87
87
  | "productCard"
88
+ | "campaignCard"
88
89
  | "tabHeaders"
89
90
  | "tabHeader"
90
91
  | "tabPanels"
@@ -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