@vonq/hapi-elements-types 1.23.0 → 1.25.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.
@@ -26,6 +26,7 @@ export type WindowHapiQA = WindowHapiModuleWithConstructorArgs<
26
26
  getDebugPanelButtonEl: () => HTMLElement | null
27
27
  onClickDebugPanel: () => void
28
28
  addDebugPanelToDOM: () => void
29
+ removeDebugPanelFromDOM: () => void
29
30
  setDebugPanelPosition: (buttonEl: HTMLElement | null) => void
30
31
  },
31
32
  { readonly core: WindowHapiClassInterface }
@@ -3,10 +3,17 @@ import {
3
3
  WindowHapiClassInterface,
4
4
  } from "./window"
5
5
 
6
+ export type WindowHapiUIElementNameForAddingToBody =
7
+ | "he-ui-modals"
8
+ | "he-ui-alertbar"
9
+
6
10
  export type WindowHapiUI = WindowHapiModuleWithConstructorArgs<
7
11
  {
8
12
  addUIElementToBody: (
9
- elementName: "he-ui-modals" | "he-ui-alertbar",
13
+ elementName: WindowHapiUIElementNameForAddingToBody,
14
+ ) => void
15
+ removeUIElementFromBody: (
16
+ elementName: WindowHapiUIElementNameForAddingToBody,
10
17
  ) => void
11
18
  toggleModal: () => void
12
19
  toggleAlertbar: () => void
package/_window/window.ts CHANGED
@@ -5,7 +5,10 @@ import { WindowHapiInstance, WindowHapiInstances } from "./instances.types"
5
5
  import { WindowHapiRouting } from "./routing.types"
6
6
  import { WindowHapiAuth } from "./auth.types"
7
7
  import { WindowHapiEvents } from "./events.types"
8
- import { WindowHapiUI } from "./ui.types"
8
+ import {
9
+ WindowHapiUI,
10
+ WindowHapiUIElementNameForAddingToBody,
11
+ } from "./ui.types"
9
12
  import { WindowHapiAPI } from "./api.types"
10
13
  import { WindowHapiSDK } from "./sdk.types"
11
14
  import { WindowHapiService } from "./service.types"
@@ -129,6 +132,11 @@ export type WindowHapiConfigSubmodule = {
129
132
  featureBranches: HapiFeatureBranch[]
130
133
  }
131
134
 
135
+ export type WindowPropertiesMap = {
136
+ windowKey: WindowHapiSubmoduleName
137
+ klassProperty: keyof WindowHapiClassInterface
138
+ }
139
+
132
140
  export type WindowHapiClassInterface = {
133
141
  logger: WindowHapiLogger
134
142
  utils: WindowHapiUtilsSubmodule
@@ -148,6 +156,16 @@ export type WindowHapiClassInterface = {
148
156
  isReady: boolean
149
157
  enableLogs: boolean
150
158
  enableRemoteLogs: boolean
159
+ windowPropertiesMap: WindowPropertiesMap[]
160
+ uiElementsToAddToBody: WindowHapiUIElementNameForAddingToBody[]
161
+ attachWebComponents: () => void
162
+ attach: () => void
163
+ detach: () => void
164
+ bootstrap: () => Promise<void>
165
+ logWelcomeMessage: () => void
166
+ logDeprecationNotice: () => void
167
+ logLatestTypesPackageVersion: () => Promise<void>
168
+ logFeatureBranches: () => Promise<void>
151
169
  }
152
170
 
153
171
  export type WindowHapi = {
@@ -173,7 +191,9 @@ export type WindowHapiInjector = {
173
191
  key: K,
174
192
  value: WindowHapiInjectorConfig[K],
175
193
  ): WindowHapiInjectorConfig
176
- inject: () => Promise<void>
194
+ inject: () => Promise<never | true>
195
+ eject: () => Promise<void>
196
+ reinjectForNewUser: (newToken: string) => Promise<never | true>
177
197
  }
178
198
  hapiInjectorConfig: WindowHapiInjectorConfig
179
199
  }
@@ -1,6 +1,6 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./enums"
4
- export * from "./service.types"
5
- export * from "./state.types"
6
- export * from "./types"
3
+ export * from './enums';
4
+ export * from './service.types';
5
+ export * from './state.types';
6
+ export * from './types';
package/ats/index.ts.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./service.types"
5
- export * from "./state.types"
6
- export * from "./types"
3
+ export * from './api.types';
4
+ export * from './service.types';
5
+ export * from './state.types';
6
+ export * from './types';
@@ -1,7 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./service.types"
4
- export * from "./state.types"
5
- export * from "./types"
6
- export * from "./utils.types"
7
- export * from "./validations.types"
3
+ export * from './service.types';
4
+ export * from './state.types';
5
+ export * from './types';
6
+ export * from './utils.types';
7
+ export * from './validations.types';
@@ -9,6 +9,7 @@ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
10
  export type BasketServiceGetProductsHandler = (
11
11
  products?: BasketProduct[],
12
+ shouldSet?: boolean,
12
13
  ) => Promise<(Product | Contract)[]>
13
14
  export type BasketServiceAddProductOrContractByIdHandler = (
14
15
  contractOrProductId: string,
@@ -30,6 +31,7 @@ export type WindowHapiServiceBasket = WindowHapiModuleWithConstructorArgs<
30
31
  {
31
32
  onAfterGetBasketData: (
32
33
  basketItemData: (Contract | Product)[],
34
+ shouldSet: boolean,
33
35
  ) => BasketProduct[]
34
36
  setProductsMeta: BasketServiceSetProductsMetaHandler
35
37
  getProducts: HapiServiceFunctionWithLifecycleHooks<BasketServiceGetProductsHandler>
@@ -1,10 +1,10 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./enums"
5
- export * from "./qa.types"
6
- export * from "./service.types"
7
- export * from "./state.types"
8
- export * from "./types"
9
- export * from "./utils.types"
10
- export * from "./validations.types"
3
+ export * from './api.types';
4
+ export * from './enums';
5
+ export * from './qa.types';
6
+ export * from './service.types';
7
+ export * from './state.types';
8
+ export * from './types';
9
+ export * from './utils.types';
10
+ export * from './validations.types';
@@ -16,7 +16,6 @@ import {
16
16
  import { PaginatedAPIResponseV2 } from "../common/types"
17
17
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
18
18
  import { AlertKey } from "../alert"
19
- import { EmploymentType } from "./enums"
20
19
 
21
20
  export type CampaignServiceGetCampaignsHandler = (
22
21
  offset?: number,
@@ -1,7 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./events"
4
- export * from "./qa.types"
5
- export * from "./types"
6
- export * from "./validations.types"
7
- export * from "./enums"
3
+ export * from './events';
4
+ export * from './logger';
5
+ export * from './validator';
6
+ export * from './enums';
7
+ export * from './qa.types';
8
+ export * from './types';
9
+ export * from './validations.types';
@@ -0,0 +1,4 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './enums';
4
+ export * from './types';
package/common/types.ts CHANGED
@@ -223,16 +223,26 @@ export type PostingRequirementOption = {
223
223
  default?: string
224
224
  key: string
225
225
  label: string
226
- data?: any[]
226
+ data?: PostingRequirementOptionData
227
227
  labels?: Record<"default", string>
228
228
  sort: string
229
229
  parent?: string
230
230
  requires?: PostingRequirementOptionRequiresField[] | null
231
231
  show?: string[]
232
232
  }
233
+ export type PostingRequirementOptionDataImage = {
234
+ image: {
235
+ title: string
236
+ src: string
237
+ }
238
+ }
239
+ export type PostingRequirementOptionData = {
240
+ description?: string
241
+ images?: PostingRequirementOptionDataImage[]
242
+ }
233
243
  export type TransformedPostingRequirementOption = {
234
244
  value?: string
235
- data?: any[]
245
+ data?: PostingRequirementOptionData
236
246
  requires?: PostingRequirementOptionRequiresField[] | null
237
247
  label: string
238
248
  show?: string[]
@@ -0,0 +1,3 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './types';
@@ -4,6 +4,7 @@ import {
4
4
  ContractCreateForm,
5
5
  ContractGroup,
6
6
  ContractGroupCreateForm,
7
+ ContractUpdateForm,
7
8
  } from "./types"
8
9
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
10
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
@@ -14,6 +15,7 @@ export type WindowHapiAPIContractConfigs = {
14
15
  getContractsByIds: AxiosRequestConfig
15
16
  getContract: AxiosRequestConfig
16
17
  createContract: AxiosRequestConfig
18
+ updateContract: AxiosRequestConfig
17
19
  removeContract: AxiosRequestConfig
18
20
  getPostingRequirementOptions: AxiosRequestConfig
19
21
  getGroups: AxiosRequestConfig
@@ -30,6 +32,10 @@ export type WindowHapiAPIContractRequests = {
30
32
  ) => Promise<PaginatedAPIResponseV1<Contract>>
31
33
  getContract: (contractId: string) => Promise<Contract>
32
34
  createContract: (contract: ContractCreateForm) => Promise<Contract>
35
+ updateContract: (
36
+ contractId: string,
37
+ contract: ContractUpdateForm,
38
+ ) => Promise<Contract>
33
39
  getPostingRequirementOptions: (
34
40
  contractId: string,
35
41
  fieldName: string,
@@ -1,9 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./qa.types"
5
- export * from "./service.types"
6
- export * from "./state.types"
7
- export * from "./types"
8
- export * from "./utils.types"
9
- export * from "./validations.types"
3
+ export * from './api.types';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './types';
8
+ export * from './utils.types';
9
+ export * from './validations.types';
@@ -5,6 +5,7 @@ import {
5
5
  ContractGroup,
6
6
  ContractGroupCreateForm,
7
7
  ContractGroupSelected,
8
+ ContractUpdateForm,
8
9
  } from "./types"
9
10
  import { PaginationResponseV1 } from "../common/types"
10
11
 
@@ -16,7 +17,7 @@ export type ContractState = {
16
17
  contractSelectedId: string | number | null
17
18
  contractSelected: ProductSupportingContractsComplete | null
18
19
  contractSelectedIsLoading: boolean
19
- contractForm: ContractCreateForm
20
+ contractForm: ContractCreateForm | ContractUpdateForm
20
21
  contractCreateError: any
21
22
  contractFormIsValid: boolean | null
22
23
  /* Contracts Groups */
package/contract/types.ts CHANGED
@@ -26,17 +26,20 @@ export type ContractCreateFormCredentials = Record<string, string>
26
26
  export type ContractCreateForm = {
27
27
  id?: number
28
28
  credentials?: ContractCreateFormCredentials
29
- facets?: any
29
+ facets?: any | null
30
30
  expiry_date: string | null
31
31
  alias: string | null
32
- purchase_price: ContractPurchasePrice
32
+ purchase_price: ContractPurchasePrice | null
33
33
  credits: string | null
34
34
  followed_instructions: boolean
35
35
  posting_duration_days: number | null
36
36
  allow_renegotiation: boolean
37
37
  labels: Record<string, string> | null
38
+ posting_requirements_defaults: Record<string, string> | null
38
39
  }
39
40
 
41
+ export type ContractUpdateForm = Omit<ContractCreateForm, "id">
42
+
40
43
  export type ContractGroupCreateForm = {
41
44
  name: string
42
45
  }
@@ -58,7 +61,6 @@ export type Contract = {
58
61
  credits: number | null
59
62
  customer_id: string
60
63
  expiry_date: string | null
61
- facets?: any[]
62
64
  product: ContractProduct
63
65
  purchase_price: ContractPurchasePrice | null
64
66
  posting_duration_days: number | null
@@ -1,4 +1,5 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./state.types"
4
- export * from "./types"
3
+ export * from './service.types';
4
+ export * from './state.types';
5
+ export * from './types';
package/index.ts.bak CHANGED
@@ -1,18 +1,18 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./_window"
4
- export * from "./alert"
5
- export * from "./ats"
6
- export * from "./basket"
7
- export * from "./campaign"
8
- export * from "./common"
9
- export * from "./contract"
10
- export * from "./debugging"
11
- export * from "./language"
12
- export * from "./modal"
13
- export * from "./orderJourney"
14
- export * from "./product"
15
- export * from "./routing"
16
- export * from "./theming"
17
- export * from "./ui"
18
- export * from "./wallet"
3
+ export * from './_window';
4
+ export * from './alert';
5
+ export * from './ats';
6
+ export * from './basket';
7
+ export * from './campaign';
8
+ export * from './common';
9
+ export * from './contract';
10
+ export * from './debugging';
11
+ export * from './language';
12
+ export * from './modal';
13
+ export * from './orderJourney';
14
+ export * from './product';
15
+ export * from './routing';
16
+ export * from './theming';
17
+ export * from './ui';
18
+ export * from './wallet';
@@ -1,5 +1,8 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./qa.types"
4
- export * from "./state.types"
5
- export * from "./validations.types"
3
+ export * from './enums';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './utils.types';
8
+ export * from './validations.types';
package/modal/enums.ts CHANGED
@@ -18,6 +18,7 @@ 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
+ contractEdit = "contract-edit",
21
22
  contractGroupConflictInfo = "contract-group-conflict-info",
22
23
  filePicker = "file-picker",
23
24
  contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
@@ -1,6 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./enums"
4
- export * from "./service.types"
5
- export * from "./state.types"
6
- export * from "./types"
3
+ export * from './enums';
4
+ export * from './service.types';
5
+ export * from './state.types';
6
+ export * from './types';
7
+ export * from './utils.types';
@@ -1,8 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./enums"
4
- export * from "./qa.types"
5
- export * from "./state.types"
6
- export * from "./types"
7
- export * from "./utils.types"
8
- export * from "./validations.types"
3
+ export * from './enums';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './types';
8
+ export * from './utils.types';
9
+ export * from './validations.types';
@@ -17,6 +17,7 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
17
17
  switchToNextStep: HapiServiceFunctionWithLifecycleHooks<OrderJourneyServiceSwitchToNextStepHandler>
18
18
  switchToPreviousStep: HapiServiceFunctionWithLifecycleHooks<OrderJourneyServiceSwitchToPreviousStepHandler>
19
19
  restartJourney: HapiServiceFunctionWithLifecycleHooks<OrderJourneyServiceRestartJourneyHandler>
20
+ unblurOnboardingStepFields: () => void
20
21
  getValidators: () => Record<string, NestedValidatorKeys>
21
22
  getErrorMessages: () => Record<string, Record<string, any> | undefined>
22
23
  getBlurredFields: () => Record<string, Record<string, any> | undefined>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.23.0",
4
+ "version": "1.25.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -1,10 +1,10 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./enums"
5
- export * from "./qa.types"
6
- export * from "./service.types"
7
- export * from "./state.types"
8
- export * from "./types"
9
- export * from "./utils.types"
10
- export * from "./validations.types"
3
+ export * from './api.types';
4
+ export * from './enums';
5
+ export * from './qa.types';
6
+ export * from './service.types';
7
+ export * from './state.types';
8
+ export * from './types';
9
+ export * from './utils.types';
10
+ export * from './validations.types';
@@ -25,6 +25,9 @@ export type ProductServiceGetFilteredProductsHandler = (
25
25
  filters?: Partial<ProductFilterQueryParams>,
26
26
  ) => Promise<Product[]>
27
27
  export type ProductServiceLoadMoreProductsHandler = () => Promise<Product[]>
28
+ export type ProductServiceLoadMoreFreeAddOnProductsHandler = () => Promise<
29
+ Product[]
30
+ >
28
31
  export type ProductServiceGetProductWithContractsSupportByIdHandler = (
29
32
  id: string | number,
30
33
  ) => Promise<ProductSupportingContractsComplete>
@@ -34,6 +37,7 @@ export type ProductServiceGetProductsWithContractsSupportHandler = (
34
37
  export type ProductServiceGetRecommendedProductsHandler = () => Promise<
35
38
  Product[]
36
39
  >
40
+ export type ProductServiceGetFreeAddOnProductsHandler = () => Promise<Product[]>
37
41
  export type ProductServiceGetProductHandler = (
38
42
  productId: number | string,
39
43
  ) => Promise<Product>
@@ -76,11 +80,13 @@ export type ProductServiceGetProductPostingRequirementsHandler = (
76
80
  export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
77
81
  {
78
82
  loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
83
+ loadMoreFreeAddOnProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreFreeAddOnProductsHandler>
79
84
  setArbitraryJobTitle: ProductServiceSetArbitraryJobTitle
80
85
  getProductWithContractsSupportById: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductWithContractsSupportByIdHandler>
81
86
  getProductsWithContractsSupport: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsWithContractsSupportHandler>
82
87
  getFilteredProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetFilteredProductsHandler>
83
88
  getRecommendedProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetRecommendedProductsHandler>
89
+ getFreeAddOnProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetFreeAddOnProductsHandler>
84
90
  getProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsHandler>
85
91
  getProduct: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductHandler>
86
92
  getLocations: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetLocationsHandler>
@@ -13,6 +13,9 @@ export type ProductState = {
13
13
  /* Products */
14
14
  recommendedProducts: Product[]
15
15
  recommendedProductsAreLoading: boolean
16
+ freeAddOnProducts: Product[]
17
+ freeAddOnProductsAreLoading: boolean
18
+ freeAddOnProductsPaginationMeta: PaginationResponseV1 | null
16
19
  productsWithContractsSupport: ProductSupportingContractsPartial[]
17
20
  productsWithContractsSupportAreLoading: boolean
18
21
  products: Product[]
@@ -1,3 +1,4 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./state.types"
3
+ export * from './state.types';
4
+ export * from './utils.types';
@@ -1,6 +1,6 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./qa.types"
4
- export * from "./state.types"
5
- export * from "./types"
6
- export * from "./validations.types"
3
+ export * from './qa.types';
4
+ export * from './state.types';
5
+ export * from './types';
6
+ export * from './validations.types';
@@ -1,7 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./service.types"
5
- export * from "./state.types"
6
- export * from "./types"
7
- export * from "./validations.types"
3
+ export * from './api.types';
4
+ export * from './service.types';
5
+ export * from './state.types';
6
+ export * from './types';
7
+ export * from './validations.types';