@vonq/hapi-elements-types 1.44.0 → 1.45.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/_window/window.ts CHANGED
@@ -168,6 +168,11 @@ export type WindowHapiClassInterface = {
168
168
  logDeprecationNotice: () => void
169
169
  logLatestTypesPackageVersion: () => Promise<void>
170
170
  logFeatureBranches: () => Promise<void>
171
+ querySelectorAllThatAlsoSearchesShadowDOM: (
172
+ node: Element | ShadowRoot | Document,
173
+ selector: string,
174
+ ) => Element[]
175
+ querySelectorThatAlsoSearchesShadowDOM: (selector: string) => Element
171
176
  }
172
177
 
173
178
  export type WindowHapi = {
package/alert/enums.ts CHANGED
@@ -2,6 +2,8 @@ export enum AlertKey {
2
2
  backendErrorMessage = "backend-error-message",
3
3
  topupSuccess = "topup-success",
4
4
  contractRemoveSuccess = "contract-removed",
5
+ contractGroupRemoveSuccess = "contract-group-removed",
6
+ contractGroupUpdateSuccess = "contract-group-updated",
5
7
  contractCreateSuccess = "contract-created",
6
8
  contractEditSuccess = "contract-edited",
7
9
  contractGroupCreateSuccess = "contract-group-created",
package/alert/types.ts CHANGED
@@ -23,6 +23,14 @@ export type ContractGroupCreateSuccessAlertProps = {
23
23
  groupName: string
24
24
  }
25
25
 
26
+ export type ContractGroupUpdateSuccessAlertProps = {
27
+ groupName: string
28
+ }
29
+
30
+ export type ContractGroupRemoveSuccessAlertProps = {
31
+ groupName: string
32
+ }
33
+
26
34
  export type BackendErrorMessageAlertProps = {
27
35
  errorMessage: string
28
36
  }
package/common/types.ts CHANGED
@@ -280,6 +280,8 @@ export type FormFacetsFieldType =
280
280
  | "questionnaire"
281
281
  | "unknown"
282
282
 
283
+ export type FormFacetsFormOfThisOrderedProductSpec = Record<string, any>
284
+
283
285
  // keep this for backwards compatability
284
286
  export type ContractPostingRequirementFieldAutocompleteRequestOption =
285
287
  PostingRequirementsAutocompleteRequestOption
@@ -3,8 +3,9 @@ import {
3
3
  Contract,
4
4
  ContractCreateForm,
5
5
  ContractGroup,
6
- ContractGroupCreateForm,
7
6
  ContractEditForm,
7
+ ContractGroupCreateForm,
8
+ ContractGroupUpdateForm,
8
9
  } from "./types"
9
10
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
10
11
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
@@ -19,12 +20,15 @@ export type WindowHapiAPIContractConfigs = {
19
20
  removeContract: AxiosRequestConfig
20
21
  getPostingRequirementOptions: AxiosRequestConfig
21
22
  getGroups: AxiosRequestConfig
23
+ removeContractGroup: AxiosRequestConfig
24
+ updateContractGroup: AxiosRequestConfig
22
25
  createGroup: AxiosRequestConfig
23
26
  }
24
27
  export type WindowHapiAPIContractRequests = {
25
28
  getContracts: (
26
29
  limitOffset?: PaginationLimitOffset,
27
30
  labels?: Record<string, string> | null,
31
+ filters?: URLSearchParams,
28
32
  ) => Promise<PaginatedAPIResponseV1<Contract>>
29
33
  getContractsByIds: (
30
34
  contractIds: (string | number)[],
@@ -39,6 +43,11 @@ export type WindowHapiAPIContractRequests = {
39
43
  autocompleteRequestOptions: Record<string, string | string[]>,
40
44
  ) => Promise<any>
41
45
  getGroups: () => Promise<ContractGroup[]>
46
+ removeContractGroup: (groupIdx: number) => Promise<ContractGroup>
47
+ updateContractGroup: (
48
+ groupIdx: number,
49
+ group: ContractGroupUpdateForm,
50
+ ) => Promise<ContractGroup>
42
51
  createGroup: (group: ContractGroupCreateForm) => Promise<ContractGroup>
43
52
  removeContract: (contractId: string) => Promise<Contract>
44
53
  }
@@ -32,6 +32,11 @@ export type ContractServiceGetContractPostingRequirementOptionsHandler = (
32
32
 
33
33
  export type ContractServiceGetContractsHandler = (
34
34
  offset: number,
35
+ queryParams?: URLSearchParams,
36
+ ) => Promise<PaginatedAPIResponseV1<Contract>>
37
+
38
+ export type ContractServiceGetFilteredContractsHandler = (
39
+ offset: number,
35
40
  ) => Promise<PaginatedAPIResponseV1<Contract>>
36
41
 
37
42
  export type ContractServiceGetContractGroupsHandler = () => Promise<
@@ -52,6 +57,15 @@ export type ContractServiceRemoveContractHandler = (
52
57
  contractId: string,
53
58
  ) => Promise<void>
54
59
 
60
+ export type ContractServiceRemoveContractGroupHandler = (
61
+ groupIdx: number,
62
+ ) => Promise<void>
63
+
64
+ export type ContractServiceUpdateContractGroupHandler = (
65
+ groupIdx: number,
66
+ groupName: string,
67
+ ) => Promise<void>
68
+
55
69
  export type ContractServiceCreateContractGroupHandler =
56
70
  () => Promise<ContractGroup>
57
71
 
@@ -112,6 +126,7 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
112
126
  previousModals: Modals,
113
127
  ) => void
114
128
  getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
129
+ getFilteredContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetFilteredContractsHandler>
115
130
  getContractsLabeled: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsLabeledHandler>
116
131
  getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
117
132
  getContractGroups: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractGroupsHandler>
@@ -26,6 +26,11 @@ export type ContractState = {
26
26
  groupsAreLoading: boolean
27
27
  groupIsCreating: boolean
28
28
  groupCreateError: string | null
29
+ groupUpdateError: string | null
29
30
  groupForm: ContractGroupCreateForm
31
+ groupUpdateNameInput: string
30
32
  groupFormIsValid: boolean
33
+ filterChannelName: string
34
+ filterGroupId: string
35
+ filtersAccordionIsOpen: boolean
31
36
  }
package/contract/types.ts CHANGED
@@ -37,6 +37,8 @@ export type ContractPurchasePrice = {
37
37
 
38
38
  export type ContractCreateFormCredentials = Record<string, string>
39
39
 
40
+ export type ContractCreateCredentialsValidation = "if_supported"
41
+
40
42
  export type ContractCreateForm = {
41
43
  id?: number | string
42
44
  credentials?: ContractCreateFormCredentials
@@ -50,6 +52,7 @@ export type ContractCreateForm = {
50
52
  allow_renegotiation: boolean
51
53
  labels: Record<string, string> | null
52
54
  posting_requirements_defaults: Record<string, string | string[]> | null
55
+ credentials_validation?: ContractCreateCredentialsValidation
53
56
  }
54
57
 
55
58
  export type ContractEditForm = ContractCreateForm
@@ -58,6 +61,10 @@ export type ContractGroupCreateForm = {
58
61
  name: string
59
62
  }
60
63
 
64
+ export type ContractGroupUpdateForm = {
65
+ name: string
66
+ }
67
+
61
68
  export type ContractChannel = ProductLogos &
62
69
  ProductType & {
63
70
  allows_edit?: boolean
@@ -265,8 +272,13 @@ export type ContractPostingRequirementsOptionsPayload = [
265
272
  export type ContractPostingRequirementsOptionsMapState = {
266
273
  isLoading: boolean
267
274
  data: any | null
275
+ lastAccessedDate: string
268
276
  }
269
277
  export type ContractProductsSupportingContractsMap = Map<
270
278
  StringifiedJSON<ContractPostingRequirementsOptionsPayload>,
271
279
  ContractPostingRequirementsOptionsMapState
272
280
  >
281
+ export type ContractFilterQueryParams = {
282
+ filterChannelName: string
283
+ filterGroupId: string
284
+ }
@@ -3,6 +3,7 @@ import {
3
3
  ContractDirectApplyChannelPrefillVariablesMap,
4
4
  ContractCreateForm,
5
5
  ContractGroupCreateForm,
6
+ ContractFilterQueryParams,
6
7
  } from "./types"
7
8
  import { WindowHapiUtils } from "../_window/utils.types"
8
9
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
@@ -10,6 +11,7 @@ import {
10
11
  ContractDirectApplyChannelName,
11
12
  ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
12
13
  } from "./enums"
14
+ import { PaginationResponseV1 } from "types/common"
13
15
 
14
16
  export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
15
17
  {
@@ -21,6 +23,9 @@ export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
21
23
  directApplyIgnoreReasonWarning: typeof ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode
22
24
  getInitialContractForm: () => ContractCreateForm
23
25
  getInitialGroupForm: () => ContractGroupCreateForm
26
+ getContractsQueryParams: (
27
+ params: Partial<ContractFilterQueryParams>,
28
+ ) => URLSearchParams
24
29
  getContractNameWithGroupSuffix: (contract: Contract) => string
25
30
  },
26
31
  { readonly utils: WindowHapiUtils }
package/modal/enums.ts CHANGED
@@ -18,6 +18,8 @@ export enum ModalKeys {
18
18
  basketProductBundleParentClashConfirmation = "basket-product-bundle-parent-clash-confirmation",
19
19
  basketProductBundleChildClashConfirmation = "basket-product-bundle-child-clash-confirmation",
20
20
  contractRemoveConfirmation = "contract-remove-confirmation",
21
+ contractGroupRemoveConfirmation = "contract-group-remove-confirmation",
22
+ contractGroupUpdateConfirmation = "contract-group-update-confirmation",
21
23
  contractEdit = "contract-edit",
22
24
  contractGroupConflictInfo = "contract-group-conflict-info",
23
25
  filePicker = "file-picker",
package/modal/types.ts CHANGED
@@ -28,6 +28,10 @@ export type CampaignProductTakeOfflineConfirmationModalProps = {
28
28
  productId: string
29
29
  }
30
30
  export type ContractRemoveConfirmationModalProps = { contractId: string }
31
+ export type ContractGroupRemoveConfirmationModalProps = {
32
+ groupId: string
33
+ groupIdx: number
34
+ }
31
35
  export type ContractEditJourneyModalProps = { contractId: string }
32
36
  export type ContractGroupConflictInfoModalProps = {
33
37
  contract: Contract
@@ -1,12 +1,13 @@
1
1
  import { WindowHapiUtils } from "../_window/utils.types"
2
2
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
- import { ModalKeys } from "./enums"
3
+ import { ModalKeys, ModalZone } from "./enums"
4
4
  import { Modals } from "./types"
5
5
 
6
6
  export type WindowHapiUtilsModal = WindowHapiModuleWithConstructorArgs<
7
7
  {
8
8
  modalKeys: typeof ModalKeys
9
9
  getIsModalOpen: (key: ModalKeys, modals: Modals) => boolean
10
+ getZoneOfOpenModal: (key: ModalKeys, modals: Modals) => ModalZone | null
10
11
  },
11
12
  { readonly utils: WindowHapiUtils }
12
13
  >
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.44.0",
4
+ "version": "1.45.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
package/product/types.ts CHANGED
@@ -175,6 +175,7 @@ export type ProductProductsSupportingContractsPayload = [
175
175
  export type ProductProductsSupportingContractsMapState = {
176
176
  isLoading: boolean
177
177
  data: ProductSupportingContractsComplete | null
178
+ lastAccessedDate: string
178
179
  }
179
180
  export type ProductProductsSupportingContractsMap = Map<
180
181
  StringifiedJSON<ProductProductsSupportingContractsPayload>,