@vonq/hapi-elements-types 1.5.0 → 1.6.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 (156) hide show
  1. package/package.json +15 -4
  2. package/src/_window/api.types.ts +9 -7
  3. package/src/_window/auth.types.ts +6 -4
  4. package/src/_window/config.types.ts +0 -25
  5. package/src/_window/events.types.ts +15 -14
  6. package/src/_window/instances.types.ts +19 -10
  7. package/src/_window/qa.types.ts +7 -5
  8. package/src/_window/routing.types.ts +6 -4
  9. package/src/_window/sdk.types.ts +29 -27
  10. package/src/_window/service.types.ts +9 -7
  11. package/src/_window/state.types.ts +55 -53
  12. package/src/_window/ui.types.ts +6 -4
  13. package/src/_window/utils.types.ts +7 -5
  14. package/src/_window/validation.types.ts +7 -5
  15. package/src/_window/window.ts +126 -42
  16. package/src/alert/index.ts +4 -7
  17. package/src/alert/service.types.ts +2 -2
  18. package/src/alert/state.types.ts +1 -19
  19. package/src/ats/api.types.ts +2 -2
  20. package/src/ats/index.ts +4 -7
  21. package/src/ats/service.types.ts +2 -2
  22. package/src/ats/state.types.ts +1 -1
  23. package/src/basket/index.ts +5 -10
  24. package/src/basket/service.types.ts +2 -2
  25. package/src/basket/state.types.ts +1 -1
  26. package/src/basket/utils.types.ts +2 -2
  27. package/src/campaign/api.types.ts +2 -2
  28. package/src/campaign/index.ts +8 -13
  29. package/src/campaign/qa.types.ts +4 -4
  30. package/src/campaign/service.types.ts +2 -2
  31. package/src/campaign/state.types.ts +1 -1
  32. package/src/campaign/utils.types.ts +2 -2
  33. package/{enums.ts → src/common/enums.ts} +2 -1
  34. package/src/common/events/types.ts +6 -6
  35. package/src/common/index.ts +5 -20
  36. package/src/common/logger/types.ts +11 -0
  37. package/src/common/qa.types.ts +2 -2
  38. package/src/common/types.ts +5 -6
  39. package/src/common/validator/types.ts +4 -0
  40. package/src/contract/api.types.ts +2 -2
  41. package/src/contract/index.ts +7 -12
  42. package/src/contract/qa.types.ts +2 -2
  43. package/src/contract/service.types.ts +2 -2
  44. package/src/contract/state.types.ts +1 -1
  45. package/src/contract/utils.types.ts +2 -2
  46. package/src/debugging/index.ts +1 -4
  47. package/src/debugging/state.types.ts +1 -1
  48. package/src/index.ts +16 -20
  49. package/src/language/index.ts +3 -9
  50. package/src/language/qa.types.ts +2 -2
  51. package/src/language/state.types.ts +1 -1
  52. package/src/modal/index.ts +4 -9
  53. package/src/modal/service.types.ts +2 -2
  54. package/src/modal/state.types.ts +1 -1
  55. package/src/orderJourney/index.ts +6 -11
  56. package/src/orderJourney/qa.types.ts +2 -2
  57. package/src/orderJourney/state.types.ts +1 -1
  58. package/src/orderJourney/utils.types.ts +2 -2
  59. package/src/product/api.types.ts +2 -2
  60. package/src/product/index.ts +8 -12
  61. package/src/product/qa.types.ts +2 -2
  62. package/src/product/service.types.ts +2 -2
  63. package/src/product/state.types.ts +1 -1
  64. package/src/product/utils.types.ts +2 -2
  65. package/src/routing/index.ts +1 -3
  66. package/src/theming/index.ts +4 -9
  67. package/src/theming/qa.types.ts +2 -2
  68. package/src/theming/state.types.ts +1 -1
  69. package/src/ui/service.types.ts +2 -2
  70. package/src/wallet/api.types.ts +2 -2
  71. package/src/wallet/index.ts +5 -9
  72. package/src/wallet/service.types.ts +2 -2
  73. package/src/wallet/state.types.ts +1 -1
  74. package/tsconfig.json +6 -11
  75. package/src/alert/functions.types.ts +0 -13
  76. package/src/alert/state.initial.ts +0 -16
  77. package/src/alert/state.validations.ts +0 -11
  78. package/src/ats/functions.types.ts +0 -7
  79. package/src/ats/state.initial.ts +0 -5
  80. package/src/ats/state.validations.ts +0 -6
  81. package/src/basket/consts.ts +0 -1
  82. package/src/basket/functions.types.ts +0 -40
  83. package/src/basket/state.initial.ts +0 -11
  84. package/src/basket/state.validations.ts +0 -12
  85. package/src/basket/utils.ts +0 -79
  86. package/src/campaign/consts.ts +0 -1
  87. package/src/campaign/functions.types.ts +0 -90
  88. package/src/campaign/state.initial.ts +0 -84
  89. package/src/campaign/state.validations.ts +0 -16
  90. package/src/campaign/utils.ts +0 -53
  91. package/src/common/LocalStorage.ts +0 -123
  92. package/src/common/browser.ts +0 -2
  93. package/src/common/color.ts +0 -9
  94. package/src/common/immutable.ts +0 -28
  95. package/src/common/instances/Instance.ts +0 -13
  96. package/src/common/instances/consts.ts +0 -1
  97. package/src/common/instances/index.ts +0 -4
  98. package/src/common/json.ts +0 -25
  99. package/src/common/logger/Logger.ts +0 -70
  100. package/src/common/logger/index.ts +0 -5
  101. package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
  102. package/src/common/logger-datadog/index.ts +0 -3
  103. package/src/common/misc.ts +0 -114
  104. package/src/common/promise.ts +0 -161
  105. package/src/common/proxy.ts +0 -77
  106. package/src/common/regExTest.ts +0 -12
  107. package/src/common/tree.ts +0 -148
  108. package/src/common/utm.ts +0 -19
  109. package/src/common/validators.ts +0 -21
  110. package/src/common/webComponents.ts +0 -26
  111. package/src/config/functions.types.ts +0 -23
  112. package/src/config/index.ts +0 -5
  113. package/src/config/state.initial.ts +0 -11
  114. package/src/config/state.types.ts +0 -15
  115. package/src/consts.ts +0 -980
  116. package/src/contract/consts.ts +0 -1
  117. package/src/contract/functions.types.ts +0 -112
  118. package/src/contract/state.initial.ts +0 -39
  119. package/src/contract/state.validations.ts +0 -21
  120. package/src/contract/utils.ts +0 -36
  121. package/src/debugging/functions.types.ts +0 -34
  122. package/src/debugging/state.initial.ts +0 -10
  123. package/src/debugging/state.validations.ts +0 -10
  124. package/src/language/consts.ts +0 -6
  125. package/src/language/en.ts +0 -530
  126. package/src/language/functions.types.ts +0 -29
  127. package/src/language/state.initial.ts +0 -13
  128. package/src/language/state.validations.ts +0 -10
  129. package/src/language/utils.ts +0 -17
  130. package/src/modal/consts.ts +0 -6
  131. package/src/modal/functions.types.ts +0 -22
  132. package/src/modal/state.initial.ts +0 -9
  133. package/src/modal/state.validations.ts +0 -6
  134. package/src/modal/store.types.ts +0 -5
  135. package/src/orderJourney/consts.ts +0 -289
  136. package/src/orderJourney/functions.types.ts +0 -140
  137. package/src/orderJourney/state.initial.ts +0 -401
  138. package/src/orderJourney/state.validations.ts +0 -78
  139. package/src/orderJourney/utils.ts +0 -7
  140. package/src/product/consts.ts +0 -1
  141. package/src/product/functions.types.ts +0 -156
  142. package/src/product/state.initial.ts +0 -28
  143. package/src/product/state.validations.ts +0 -25
  144. package/src/routing/functions.types.ts +0 -48
  145. package/src/routing/state.initial.ts +0 -10
  146. package/src/theming/consts.ts +0 -7727
  147. package/src/theming/functions.types.ts +0 -13
  148. package/src/theming/state.initial.ts +0 -16
  149. package/src/theming/state.validations.ts +0 -8
  150. package/src/theming/utils.ts +0 -581
  151. package/src/types.ts +0 -229
  152. package/src/utils.ts +0 -3
  153. package/src/wallet/consts.ts +0 -3
  154. package/src/wallet/functions.types.ts +0 -58
  155. package/src/wallet/state.initial.ts +0 -18
  156. package/src/wallet/state.validations.ts +0 -18
@@ -1,8 +1,7 @@
1
1
  import validator from "validator"
2
- import validators from "./validators"
3
2
  import { MessageDescriptor } from "react-intl"
4
- import { Logger } from "./logger/Logger"
5
- import { Stores } from "../types"
3
+ import { WindowHapiLogger } from "./logger/types"
4
+ import { Validators } from "./validator/types"
6
5
 
7
6
  export type ValueOf<T> = T[keyof T]
8
7
  export type AnyNonFunction<T> = Omit<T, "function">
@@ -76,14 +75,14 @@ export type ValidatorKey =
76
75
  | "PostalCodeLocale"
77
76
  | "isPostalCodeLocales"
78
77
  >
79
- | keyof typeof validators
78
+ | keyof Validators
80
79
  export type NestedValidatorKeys =
81
80
  | ValidatorKey
82
81
  | {
83
82
  [k: string]: ValidatorKey | NestedValidatorKeys
84
83
  }
85
84
  export type BaseService = {
86
- logger: Logger
85
+ logger: WindowHapiLogger
87
86
  }
88
87
  // the reason there are no types like enums here is because
89
88
  // the options should be a serializable JSON during generation of web component files
@@ -97,7 +96,7 @@ export type HapiWebComponent = {
97
96
  key: string
98
97
  id: string
99
98
  injects?: string[]
100
- initialState?: Partial<Record<keyof Stores, any>>
99
+ initialState?: Partial<Record<string, any>>
101
100
  isUserJourney?: boolean
102
101
  webComponentCSS?: Record<string, any> //React.CSSProperties
103
102
  attributes?: Record<string, string>
@@ -0,0 +1,4 @@
1
+ export type Validators = {
2
+ isNotEmpty: (value: string | Record<string, any> | any[]) => boolean
3
+ isNotZero: (value: number) => boolean
4
+ }
@@ -7,7 +7,7 @@ import {
7
7
  } from "./types"
8
8
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
9
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
10
- import { ModuleWithConstructorArgs } from "../types"
10
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
11
11
 
12
12
  export type WindowHapiAPIContractConfigs = {
13
13
  getContracts: AxiosRequestConfig
@@ -38,7 +38,7 @@ export type WindowHapiAPIContractRequests = {
38
38
  createGroup: (group: ContractGroupCreateForm) => Promise<ContractGroup>
39
39
  removeContract: (contractId: string) => Promise<Contract>
40
40
  }
41
- export type WindowHapiAPIContract = ModuleWithConstructorArgs<
41
+ export type WindowHapiAPIContract = WindowHapiModuleWithConstructorArgs<
42
42
  WindowHapiAPIModule<
43
43
  WindowHapiAPIContractRequests,
44
44
  WindowHapiAPIContractConfigs
@@ -1,14 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './api.types';
4
- export * from './consts';
5
- export * from './functions.types';
6
- export * from './qa.types';
7
- export * from './service.types';
8
- export * from './state.initial';
9
- export * from './state.types';
10
- export * from './state.validations';
11
- export * from './types';
12
- export * from './utils';
13
- export * from './utils.types';
14
- 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"
@@ -1,8 +1,8 @@
1
1
  import { ContractCreateForm, ContractGroupCreateForm } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQAContract = ModuleWithConstructorArgs<
5
+ export type WindowHapiQAContract = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  getRandomContractId: () => Promise<string>
8
8
  useMockContractForm: () => ContractCreateForm
@@ -10,7 +10,7 @@ import {
10
10
  ContractPostingRequirementsAutocompleteRequestOption,
11
11
  } from "./types"
12
12
  import { PaginatedAPIResponseV1 } from "../common/types"
13
- import { ModuleWithConstructorArgs } from "../types"
13
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
14
14
 
15
15
  export type ContractServiceGetContractPostingRequirementOptionsHandler = (
16
16
  contractId: string,
@@ -33,7 +33,7 @@ export type ContractServiceGetContractHandler = (
33
33
  id: string,
34
34
  ) => Promise<Contract>
35
35
 
36
- export type WindowHapiServiceContract = ModuleWithConstructorArgs<
36
+ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
37
37
  {
38
38
  getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
39
39
  getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
@@ -8,7 +8,7 @@ import {
8
8
  } from "./types"
9
9
  import { PaginationResponseV1 } from "../common/types"
10
10
 
11
- export type ContractStoreState = {
11
+ export type ContractState = {
12
12
  /* Contracts */
13
13
  /**
14
14
  * Array of Contracts to be displayed in Contracts Landing or Contracts List widgets.
@@ -1,8 +1,8 @@
1
1
  import { ContractCreateForm, ContractGroupCreateForm } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiUtils } from "../_window/utils.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiUtilsContract = ModuleWithConstructorArgs<
5
+ export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  getInitialContractForm: () => ContractCreateForm
8
8
  getInitialGroupForm: () => ContractGroupCreateForm
@@ -1,6 +1,3 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './functions.types';
4
- export * from './state.initial';
5
- export * from './state.types';
6
- export * from './state.validations';
3
+ export * from "./state.types"
@@ -1,4 +1,4 @@
1
- export type DebuggingStoreState = {
1
+ export type DebuggingState = {
2
2
  /**
3
3
  * Shows or hides the debugging tool on Campaign Create Form's fields for Product & Contract steps
4
4
  */
package/src/index.ts CHANGED
@@ -1,22 +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 './config';
10
- export * from './contract';
11
- export * from './debugging';
12
- export * from './language';
13
- export * from './modal';
14
- export * from './orderJourney';
15
- export * from './product';
16
- export * from './routing';
17
- export * from './theming';
18
- export * from './ui';
19
- export * from './wallet';
20
- export * from './consts';
21
- export * from './types';
22
- export * from './utils';
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,11 +1,5 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './consts';
4
- export * from './en';
5
- export * from './functions.types';
6
- export * from './qa.types';
7
- export * from './state.initial';
8
- export * from './state.types';
9
- export * from './state.validations';
10
- export * from './utils';
11
- export * from './validations.types';
3
+ export * from "./qa.types"
4
+ export * from "./state.types"
5
+ export * from "./validations.types"
@@ -1,9 +1,9 @@
1
1
  import { ProductPriceCurrency } from "../product/enums"
2
2
  import { LanguageStoreTranslations } from "./state.types"
3
- import { ModuleWithConstructorArgs } from "../types"
4
3
  import { WindowHapiQA } from "../_window/qa.types"
4
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
5
5
 
6
- export type WindowHapiQALanguage = ModuleWithConstructorArgs<
6
+ export type WindowHapiQALanguage = WindowHapiModuleWithConstructorArgs<
7
7
  {
8
8
  setLocale: (locale: string) => string
9
9
  setDisplayCurrency: (
@@ -5,7 +5,7 @@ export type LanguageStoreTranslations = Record<
5
5
  string,
6
6
  LanguageStoreLocaleTranslations
7
7
  >
8
- export type LanguageStoreState = {
8
+ export type LanguageState = {
9
9
  /**
10
10
  * Locale of the user (navigator language) in RFC 5646 that can be changed via setLocale function
11
11
  */
@@ -1,11 +1,6 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './consts';
4
- export * from './enums';
5
- export * from './functions.types';
6
- export * from './service.types';
7
- export * from './state.initial';
8
- export * from './state.types';
9
- export * from './state.validations';
10
- export * from './store.types';
11
- export * from './types';
3
+ export * from "./enums"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
@@ -4,10 +4,10 @@ import { Product } from "../product/types"
4
4
  import { Contract } from "../contract/types"
5
5
  import { IObservableValue } from "mobx"
6
6
  import { AnyNonFunction } from "../common/types"
7
- import { ModuleWithConstructorArgs } from "../types"
8
7
  import { WindowHapiService } from "../_window/service.types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
- export type WindowHapiServiceModal = ModuleWithConstructorArgs<
10
+ export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
11
11
  {
12
12
  openModal: (
13
13
  key: ModalKeys,
@@ -1,6 +1,6 @@
1
1
  import { Modals } from "./types"
2
2
 
3
- export type ModalStoreState = {
3
+ export type ModalState = {
4
4
  /**
5
5
  * An object of modals that are seperated into different layers
6
6
  */
@@ -1,13 +1,8 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './consts';
4
- export * from './enums';
5
- export * from './functions.types';
6
- export * from './qa.types';
7
- export * from './state.initial';
8
- export * from './state.types';
9
- export * from './state.validations';
10
- export * from './types';
11
- export * from './utils';
12
- export * from './utils.types';
13
- export * from './validations.types';
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"
@@ -1,8 +1,8 @@
1
1
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQAOrderJourney = ModuleWithConstructorArgs<
5
+ export type WindowHapiQAOrderJourney = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  setEnabledSteps: (steps: OrderJourneyStepKey[]) => OrderJourneyStepKey[]
8
8
  setEnabledPaymentMethods: (
@@ -3,7 +3,7 @@ import { OrderJourneyStep, OrderJourneyContractStep } from "./types"
3
3
  import { MessageDescriptor } from "react-intl"
4
4
  import { NestedValidatorKeys, UseValidatorResult } from "../common/types"
5
5
 
6
- export type OrderJourneyStoreState = {
6
+ export type OrderJourneyState = {
7
7
  stepsEnabled: OrderJourneyStepKey[]
8
8
  steps: OrderJourneyStep[]
9
9
  stepPreviousIndex: number
@@ -1,8 +1,8 @@
1
1
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiUtils } from "../_window/utils.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiUtilsOrderJourney = ModuleWithConstructorArgs<
5
+ export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  stepKeys: typeof OrderJourneyStepKey
8
8
  paymentMethodKeys: typeof OrderJourneyPaymentMethod
@@ -11,11 +11,11 @@ import {
11
11
  } from "./types"
12
12
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
13
13
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
14
- import { ModuleWithConstructorArgs } from "../types"
15
14
  import {
16
15
  WindowHapiAPIATSConfigs,
17
16
  WindowHapiAPIATSRequests,
18
17
  } from "../ats/api.types"
18
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
19
19
 
20
20
  export type WindowHapiAPIProductConfigs = {
21
21
  getProduct: AxiosRequestConfig
@@ -53,7 +53,7 @@ export type WindowHapiAPIProductRequests = {
53
53
  ) => Promise<PaginatedAPIResponseV1<ProductJobTitle>>
54
54
  getLocations: (searchParam: string) => Promise<ProductLocation[]>
55
55
  }
56
- export type WindowHapiAPIProduct = ModuleWithConstructorArgs<
56
+ export type WindowHapiAPIProduct = WindowHapiModuleWithConstructorArgs<
57
57
  WindowHapiAPIModule<
58
58
  WindowHapiAPIProductRequests,
59
59
  WindowHapiAPIProductConfigs
@@ -1,14 +1,10 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './api.types';
4
- export * from './consts';
5
- export * from './enums';
6
- export * from './functions.types';
7
- export * from './qa.types';
8
- export * from './service.types';
9
- export * from './state.initial';
10
- export * from './state.types';
11
- export * from './state.validations';
12
- export * from './types';
13
- export * from './utils.types';
14
- 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"
@@ -1,7 +1,7 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
1
  import { WindowHapiQA } from "../_window/qa.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
- export type WindowHapiQAProduct = ModuleWithConstructorArgs<
4
+ export type WindowHapiQAProduct = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
6
  useMockFilters: () => Promise<void>
7
7
  getRandomChannelIdThatSupportsContracts: () => Promise<number>
@@ -13,7 +13,7 @@ import {
13
13
  ProductSupportingContractsPartial,
14
14
  } from "./types"
15
15
  import { PaginatedAPIResponseV1, PaginationResponseV1 } from "../common/types"
16
- import { ModuleWithConstructorArgs } from "../types"
16
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
17
17
 
18
18
  export type ProductServiceGetFilteredProductsHandler = (
19
19
  meta?: PaginationResponseV1 | null,
@@ -51,7 +51,7 @@ export type ProductServiceGetIndustriesHandler = () => Promise<
51
51
  ProductIndustry[]
52
52
  >
53
53
 
54
- export type WindowHapiServiceProduct = ModuleWithConstructorArgs<
54
+ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
55
55
  {
56
56
  getProductWithContractsSupportById: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductWithContractsSupportByIdHandler>
57
57
  getProductsWithContractsSupport: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsWithContractsSupportHandler>
@@ -8,7 +8,7 @@ import {
8
8
  } from "./types"
9
9
  import { PaginationResponseV1 } from "../common/types"
10
10
 
11
- export type ProductStoreState = {
11
+ export type ProductState = {
12
12
  /* Products */
13
13
  /**
14
14
  * Array of Products to be listed on Products Landing and Products List widgets. As user applies filters and sorting, this value gets overwritten
@@ -1,13 +1,13 @@
1
1
  import { ProductFilterQueryParams, ProductUserProvidedFilters } from "./types"
2
2
  import { PaginationResponseV1 } from "../common/types"
3
- import { ModuleWithConstructorArgs } from "../types"
4
3
  import {
5
4
  OrderJourneyPaymentMethod,
6
5
  OrderJourneyStepKey,
7
6
  } from "../orderJourney/enums"
8
7
  import { WindowHapiUtils } from "../_window/utils.types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
- export type WindowHapiUtilsProduct = ModuleWithConstructorArgs<
10
+ export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
11
11
  {
12
12
  getUserProvidedFilters: () => ProductUserProvidedFilters
13
13
  getProductsQueryParams: (
@@ -1,5 +1,3 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './functions.types';
4
- export * from './state.initial';
5
- export * from './state.types';
3
+ export * from "./state.types"
@@ -1,11 +1,6 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './consts';
4
- export * from './functions.types';
5
- export * from './qa.types';
6
- export * from './state.initial';
7
- export * from './state.types';
8
- export * from './state.validations';
9
- export * from './types';
10
- export * from './utils';
11
- export * from './validations.types';
3
+ export * from "./qa.types"
4
+ export * from "./state.types"
5
+ export * from "./types"
6
+ export * from "./validations.types"
@@ -1,8 +1,8 @@
1
1
  import { HapiFontOptions, HapiTheme } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQATheming = ModuleWithConstructorArgs<
5
+ export type WindowHapiQATheming = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  setTheme: (updatedTheme: Partial<HapiTheme>) => HapiTheme
8
8
  setFontOptions: (fontOptions: HapiFontOptions) => HapiFontOptions
@@ -1,6 +1,6 @@
1
1
  import { HapiFontOptions, HapiTheme } from "./types"
2
2
 
3
- export type ThemeStoreState = {
3
+ export type ThemingState = {
4
4
  theme: Partial<HapiTheme>
5
5
  fontOptions: HapiFontOptions
6
6
  }
@@ -1,7 +1,7 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
1
  import { WindowHapiService } from "../_window/service.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
- export type WindowHapiServiceUI = ModuleWithConstructorArgs<
4
+ export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
6
  setStyleAttribute: (
7
7
  selector: string,
@@ -6,7 +6,7 @@ import {
6
6
  WalletPaymentIntentRequest,
7
7
  } from "./types"
8
8
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
- import { ModuleWithConstructorArgs } from "../types"
9
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
10
10
 
11
11
  export type WindowHapiAPIWalletConfigs = {
12
12
  getWallet: RawAxiosRequestConfig
@@ -24,7 +24,7 @@ export type WindowHapiAPIWalletRequests = {
24
24
  paymentParams: WalletPaymentIntentRequest,
25
25
  ) => Promise<any>
26
26
  }
27
- export type WindowHapiAPIWallet = ModuleWithConstructorArgs<
27
+ export type WindowHapiAPIWallet = WindowHapiModuleWithConstructorArgs<
28
28
  WindowHapiAPIModule<
29
29
  WindowHapiAPIWalletRequests,
30
30
  WindowHapiAPIWalletConfigs
@@ -1,11 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from './api.types';
4
- export * from './consts';
5
- export * from './functions.types';
6
- export * from './service.types';
7
- export * from './state.initial';
8
- export * from './state.types';
9
- export * from './state.validations';
10
- export * from './types';
11
- 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"
@@ -3,7 +3,7 @@ import {
3
3
  HapiServiceFunctionWithLifecycleHooks,
4
4
  WindowHapiService,
5
5
  } from "../_window/service.types"
6
- import { ModuleWithConstructorArgs } from "../types"
6
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
7
7
 
8
8
  export type WalletServiceGetATSSettingsHandler =
9
9
  () => Promise<WalletATSSettings>
@@ -12,7 +12,7 @@ export type WalletServiceGetWalletHandler = (
12
12
  ) => Promise<Wallet>
13
13
  export type WalletServiceCreateWalletHandler = () => Promise<Wallet>
14
14
 
15
- export type WindowHapiServiceWallet = ModuleWithConstructorArgs<
15
+ export type WindowHapiServiceWallet = WindowHapiModuleWithConstructorArgs<
16
16
  {
17
17
  getATSSettings: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetATSSettingsHandler>
18
18
  getWallet: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetWalletHandler>
@@ -5,7 +5,7 @@ import {
5
5
  WalletPaymentIntentRequest,
6
6
  } from "./types"
7
7
 
8
- export type WalletStoreState = {
8
+ export type WalletState = {
9
9
  /**
10
10
  * User's Wallet that can hold credits to be used on Creating/Ordering a Campaign
11
11
  */
package/tsconfig.json CHANGED
@@ -18,16 +18,9 @@
18
18
  "jsx": "preserve",
19
19
  "incremental": false,
20
20
  "experimentalDecorators": true,
21
- "baseUrl": "./src",
22
- "forceConsistentCasingInFileNames": true,
23
- "paths": {
24
- "axios": ["../../node_modules/axios"],
25
- "zod": ["../../node_modules/zod"],
26
- "theming": ["../../node_modules/theming"],
27
- "react-intl": ["../../node_modules/react-intl"],
28
- "react": ["../../node_modules/react"],
29
- "lodash": ["../../node_modules/lodash"]
30
- }
21
+ "baseUrl": "./",
22
+ "outFile": "index.d.ts",
23
+ "forceConsistentCasingInFileNames": true
31
24
  },
32
25
  "include": [
33
26
  "./src/**/*",
@@ -36,6 +29,8 @@
36
29
  "node_modules",
37
30
  "../ats/**/*",
38
31
  "../common/**/*",
39
- "./dist/**/*"
32
+ "../src/**/*",
33
+ "./index.d.ts",
34
+ "./index.d.ts.map"
40
35
  ]
41
36
  }
@@ -1,13 +0,0 @@
1
- import { AlertKey } from "./enums"
2
- import { Alert, AlertOptions, AlertProps } from "./types"
3
-
4
- export type AlertStoreShowHandler = (
5
- key: AlertKey,
6
- props: AlertProps | undefined,
7
- options: AlertOptions,
8
- ) => void
9
- export type AlertStoreSetAlertsHandler = (alerts: Alert[]) => void
10
- export type AlertStoreFunctions = {
11
- showAlert: AlertStoreShowHandler
12
- setAlerts: AlertStoreSetAlertsHandler
13
- }
@@ -1,16 +0,0 @@
1
- import { AlertStoreState } from "./state.types"
2
- import { AlertType } from "./enums"
3
-
4
- export const initialAlertStoreState: AlertStoreState = {
5
- alerts: [],
6
- errorOptions: null,
7
- infoOptions: null,
8
- warningOptions: null,
9
- successOptions: null,
10
- defaultOptions: {
11
- shouldShowDismiss: true,
12
- position: "top-center",
13
- autoClose: 5000,
14
- type: AlertType.info,
15
- },
16
- }
@@ -1,11 +0,0 @@
1
- import { AlertStoreState } from "./state.types"
2
- import { StateValidations } from "../_window/state.types"
3
-
4
- export const alertStoreStateValidations: StateValidations<AlertStoreState> = {
5
- alerts: undefined,
6
- errorOptions: "throwHasNoSetterError",
7
- infoOptions: "throwHasNoSetterError",
8
- warningOptions: "throwHasNoSetterError",
9
- successOptions: "throwHasNoSetterError",
10
- defaultOptions: undefined,
11
- }