@vonq/hapi-elements-types 1.32.0 → 1.34.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.
@@ -17,6 +17,10 @@ export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
17
17
  {
18
18
  isObject: (item: any) => boolean
19
19
  mergeDeepOverwriteArrays: (original: any, overwrites: any) => any
20
+ flattenObject: (
21
+ object: Record<string, any>,
22
+ parentKey?: string,
23
+ ) => Record<string, any>
20
24
  getFlattenedTree: (
21
25
  values: any[],
22
26
  childAccessor: string,
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
@@ -13,6 +13,7 @@ export type BasketState = {
13
13
  totalExceedsMaxPurchaseOrder: boolean
14
14
  productsAreLoading: boolean
15
15
  productIdsBeingAdded: (string | number)[]
16
+ productIdsBeingRemoved: (string | number)[]
16
17
  deliveryAndProcessingTimes: ProductOrderDeliveryTime | null
17
18
  deliveryAndProcessingTimesAreLoading: boolean
18
19
  }
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[]
@@ -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,19 @@ export type WindowHapiAPIExperimentalRequests = {
39
39
  ExperimentalSuggestionPostingRequirementsGetResponseData
40
40
  >
41
41
  >
42
+ createSuggestionOfPostingRequirementsV2: (
43
+ facets: PostingRequirement[],
44
+ description: string,
45
+ extras: {
46
+ ai_instructions: string
47
+ auth_key: string
48
+ customer_id: string
49
+ contract_id: string
50
+ },
51
+ ) => Promise<any>
52
+ getSuggestionOfPostingRequirementsV2: (
53
+ taskId: string | number,
54
+ ) => Promise<any>
42
55
  createSuggestionOfVacancyFields: (
43
56
  payload: ExperimentalSuggestionCreateRequestData<ExperimentalSuggestionVacancyFieldsCreateRequestPayload>,
44
57
  ) => 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
+ createSuggestionOfPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceCreateSuggestionOfPostingRequirementsHandler>
56
+ 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
65
+ },
66
+ ) => Promise<any>
67
+ getSuggestionOfPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetSuggestionOfPostingRequirementsHandler>
68
+ getSuggestionOfPostingRequirementsV2: (
69
+ contractId: string,
70
+ taskId: string | number,
71
+ ) => Promise<any>
31
72
  setProductStepsBlurredFields: (
32
73
  fields: Record<string, Record<string, boolean>>,
33
74
  ) => Record<string, UseValidatorResult> | null
@@ -3,6 +3,21 @@ 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
+ postingRequirementsSuggestionsPollingMap: Record<string, string[]>
14
+ postingRequirementsSuggestionsPollingStatusMap: Record<
15
+ string,
16
+ {
17
+ createdAt: string
18
+ status: string
19
+ }
20
+ >
6
21
  /* Product Fields */
7
22
  productSteps: OrderJourneyProductStep[]
8
23
  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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.32.0",
4
+ "version": "1.34.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
  }