@vonq/hapi-elements-types 1.5.0 → 1.7.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/{src/_window → _window}/api.types.ts +9 -7
- package/_window/auth.types.ts +13 -0
- package/_window/config.types.ts +5 -0
- package/{src/_window → _window}/events.types.ts +15 -14
- package/_window/instances.types.ts +27 -0
- package/{src/_window → _window}/qa.types.ts +7 -5
- package/{src/_window → _window}/routing.types.ts +6 -4
- package/{src/_window → _window}/sdk.types.ts +29 -27
- package/{src/_window → _window}/service.types.ts +9 -7
- package/{src/_window → _window}/state.types.ts +55 -53
- package/_window/ui.types.ts +15 -0
- package/{src/_window → _window}/utils.types.ts +7 -5
- package/{src/_window → _window}/validation.types.ts +7 -5
- package/_window/window.ts +140 -0
- package/alert/index.ts +6 -0
- package/{src/alert → alert}/service.types.ts +2 -2
- package/alert/state.types.ts +9 -0
- package/{src/ats → ats}/api.types.ts +2 -2
- package/ats/index.ts +6 -0
- package/{src/ats → ats}/service.types.ts +2 -2
- package/{src/ats → ats}/state.types.ts +1 -1
- package/basket/index.ts +7 -0
- package/{src/basket → basket}/service.types.ts +2 -2
- package/{src/basket → basket}/state.types.ts +1 -1
- package/{src/basket → basket}/utils.types.ts +2 -2
- package/{src/campaign → campaign}/api.types.ts +2 -2
- package/campaign/index.ts +10 -0
- package/campaign/qa.types.ts +12 -0
- package/{src/campaign → campaign}/service.types.ts +2 -2
- package/{src/campaign → campaign}/state.types.ts +1 -1
- package/{src/campaign → campaign}/utils.types.ts +2 -2
- package/{enums.ts → common/enums.ts} +2 -1
- package/{src/common → common}/events/types.ts +6 -6
- package/common/index.ts +7 -0
- package/common/logger/types.ts +18 -0
- package/{src/common → common}/qa.types.ts +2 -2
- package/{src/common → common}/types.ts +5 -6
- package/common/validator/types.ts +4 -0
- package/{src/contract → contract}/api.types.ts +2 -2
- package/contract/index.ts +9 -0
- package/{src/contract → contract}/qa.types.ts +2 -2
- package/{src/contract → contract}/service.types.ts +2 -2
- package/{src/contract → contract}/state.types.ts +1 -1
- package/{src/contract → contract}/utils.types.ts +2 -2
- package/{src/common/logger-datadog → debugging}/index.ts +1 -1
- package/{src/debugging → debugging}/state.types.ts +1 -1
- package/index.ts +18 -0
- package/language/index.ts +5 -0
- package/{src/language → language}/qa.types.ts +2 -2
- package/{src/language → language}/state.types.ts +1 -1
- package/modal/index.ts +6 -0
- package/{src/modal → modal}/service.types.ts +2 -2
- package/{src/modal → modal}/state.types.ts +1 -1
- package/orderJourney/index.ts +8 -0
- package/{src/orderJourney → orderJourney}/qa.types.ts +2 -2
- package/{src/orderJourney → orderJourney}/state.types.ts +1 -1
- package/{src/orderJourney → orderJourney}/utils.types.ts +2 -2
- package/package.json +16 -5
- package/{src/product → product}/api.types.ts +2 -2
- package/product/index.ts +10 -0
- package/{src/product → product}/qa.types.ts +2 -2
- package/{src/product → product}/service.types.ts +2 -2
- package/{src/product → product}/state.types.ts +1 -1
- package/{src/product → product}/utils.types.ts +2 -2
- package/routing/index.ts +3 -0
- package/theming/index.ts +6 -0
- package/{src/theming → theming}/qa.types.ts +2 -2
- package/{src/theming → theming}/state.types.ts +1 -1
- package/{src/theming → theming}/types.ts +38 -1
- package/tsconfig.json +7 -12
- package/{src/ui → ui}/service.types.ts +2 -2
- package/{src/wallet → wallet}/api.types.ts +2 -2
- package/wallet/index.ts +7 -0
- package/{src/wallet → wallet}/service.types.ts +2 -2
- package/{src/wallet → wallet}/state.types.ts +1 -1
- package/src/_window/auth.types.ts +0 -11
- package/src/_window/config.types.ts +0 -30
- package/src/_window/instances.types.ts +0 -18
- package/src/_window/ui.types.ts +0 -13
- package/src/_window/window.ts +0 -56
- package/src/alert/functions.types.ts +0 -13
- package/src/alert/index.ts +0 -9
- package/src/alert/state.initial.ts +0 -16
- package/src/alert/state.types.ts +0 -27
- package/src/alert/state.validations.ts +0 -11
- package/src/ats/functions.types.ts +0 -7
- package/src/ats/index.ts +0 -9
- package/src/ats/state.initial.ts +0 -5
- package/src/ats/state.validations.ts +0 -6
- package/src/basket/consts.ts +0 -1
- package/src/basket/functions.types.ts +0 -40
- package/src/basket/index.ts +0 -12
- package/src/basket/state.initial.ts +0 -11
- package/src/basket/state.validations.ts +0 -12
- package/src/basket/utils.ts +0 -79
- package/src/campaign/consts.ts +0 -1
- package/src/campaign/functions.types.ts +0 -90
- package/src/campaign/index.ts +0 -15
- package/src/campaign/qa.types.ts +0 -12
- package/src/campaign/state.initial.ts +0 -84
- package/src/campaign/state.validations.ts +0 -16
- package/src/campaign/utils.ts +0 -53
- package/src/common/LocalStorage.ts +0 -123
- package/src/common/browser.ts +0 -2
- package/src/common/color.ts +0 -9
- package/src/common/immutable.ts +0 -28
- package/src/common/index.ts +0 -22
- package/src/common/instances/Instance.ts +0 -13
- package/src/common/instances/consts.ts +0 -1
- package/src/common/instances/index.ts +0 -4
- package/src/common/json.ts +0 -25
- package/src/common/logger/Logger.ts +0 -70
- package/src/common/logger/index.ts +0 -5
- package/src/common/logger/types.ts +0 -7
- package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
- package/src/common/misc.ts +0 -114
- package/src/common/promise.ts +0 -161
- package/src/common/proxy.ts +0 -77
- package/src/common/regExTest.ts +0 -12
- package/src/common/tree.ts +0 -148
- package/src/common/utm.ts +0 -19
- package/src/common/validators.ts +0 -21
- package/src/common/webComponents.ts +0 -26
- package/src/config/functions.types.ts +0 -23
- package/src/config/index.ts +0 -5
- package/src/config/state.initial.ts +0 -11
- package/src/config/state.types.ts +0 -15
- package/src/consts.ts +0 -980
- package/src/contract/consts.ts +0 -1
- package/src/contract/functions.types.ts +0 -112
- package/src/contract/index.ts +0 -14
- package/src/contract/state.initial.ts +0 -39
- package/src/contract/state.validations.ts +0 -21
- package/src/contract/utils.ts +0 -36
- package/src/debugging/functions.types.ts +0 -34
- package/src/debugging/index.ts +0 -6
- package/src/debugging/state.initial.ts +0 -10
- package/src/debugging/state.validations.ts +0 -10
- package/src/index.ts +0 -22
- package/src/language/consts.ts +0 -6
- package/src/language/en.ts +0 -530
- package/src/language/functions.types.ts +0 -29
- package/src/language/index.ts +0 -11
- package/src/language/state.initial.ts +0 -13
- package/src/language/state.validations.ts +0 -10
- package/src/language/utils.ts +0 -17
- package/src/modal/consts.ts +0 -6
- package/src/modal/functions.types.ts +0 -22
- package/src/modal/index.ts +0 -11
- package/src/modal/state.initial.ts +0 -9
- package/src/modal/state.validations.ts +0 -6
- package/src/modal/store.types.ts +0 -5
- package/src/orderJourney/consts.ts +0 -289
- package/src/orderJourney/functions.types.ts +0 -140
- package/src/orderJourney/index.ts +0 -13
- package/src/orderJourney/state.initial.ts +0 -401
- package/src/orderJourney/state.validations.ts +0 -78
- package/src/orderJourney/utils.ts +0 -7
- package/src/product/consts.ts +0 -1
- package/src/product/functions.types.ts +0 -156
- package/src/product/index.ts +0 -14
- package/src/product/state.initial.ts +0 -28
- package/src/product/state.validations.ts +0 -25
- package/src/routing/functions.types.ts +0 -48
- package/src/routing/index.ts +0 -5
- package/src/routing/state.initial.ts +0 -10
- package/src/theming/consts.ts +0 -7727
- package/src/theming/functions.types.ts +0 -13
- package/src/theming/index.ts +0 -11
- package/src/theming/state.initial.ts +0 -16
- package/src/theming/state.validations.ts +0 -8
- package/src/theming/utils.ts +0 -581
- package/src/types.ts +0 -229
- package/src/utils.ts +0 -3
- package/src/wallet/consts.ts +0 -3
- package/src/wallet/functions.types.ts +0 -58
- package/src/wallet/index.ts +0 -11
- package/src/wallet/state.initial.ts +0 -18
- package/src/wallet/state.validations.ts +0 -18
- /package/{src/_window → _window}/index.ts +0 -0
- /package/{src/alert → alert}/enums.ts +0 -0
- /package/{src/alert → alert}/types.ts +0 -0
- /package/{src/ats → ats}/types.ts +0 -0
- /package/{src/basket → basket}/types.ts +0 -0
- /package/{src/basket → basket}/validations.types.ts +0 -0
- /package/{src/campaign → campaign}/enums.ts +0 -0
- /package/{src/campaign → campaign}/types.ts +0 -0
- /package/{src/campaign → campaign}/validations.types.ts +0 -0
- /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
- /package/{src/common → common}/events/EventCommand/index.ts +0 -0
- /package/{src/common → common}/events/EventCommand/types.ts +0 -0
- /package/{src/common → common}/events/index.ts +0 -0
- /package/{src/common → common}/logger/enums.ts +0 -0
- /package/{src/common → common}/validations.types.ts +0 -0
- /package/{src/contract → contract}/types.ts +0 -0
- /package/{src/contract → contract}/validations.types.ts +0 -0
- /package/{src/language → language}/validations.types.ts +0 -0
- /package/{src/modal → modal}/enums.ts +0 -0
- /package/{src/modal → modal}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
- /package/{src/orderJourney → orderJourney}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
- /package/{src/product → product}/enums.ts +0 -0
- /package/{src/product → product}/types.ts +0 -0
- /package/{src/product → product}/validations.types.ts +0 -0
- /package/{src/routing → routing}/state.types.ts +0 -0
- /package/{src/theming → theming}/validations.types.ts +0 -0
- /package/{src/ui → ui}/index.ts +0 -0
- /package/{src/wallet → wallet}/types.ts +0 -0
- /package/{src/wallet → wallet}/validations.types.ts +0 -0
@@ -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 =
|
10
|
+
export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
|
11
11
|
{
|
12
12
|
openModal: (
|
13
13
|
key: ModalKeys,
|
@@ -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 =
|
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
|
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 =
|
5
|
+
export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
6
6
|
{
|
7
7
|
stepKeys: typeof OrderJourneyStepKey
|
8
8
|
paymentMethodKeys: typeof OrderJourneyPaymentMethod
|
package/package.json
CHANGED
@@ -1,24 +1,35 @@
|
|
1
1
|
{
|
2
2
|
"private": false,
|
3
3
|
"name": "@vonq/hapi-elements-types",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.7.0",
|
5
5
|
"description": "This package contains Typescript definitions for HAPI Elements",
|
6
6
|
"author": "VONQ HAPI Team",
|
7
7
|
"license": "BSD-3-Clause",
|
8
8
|
"type": "module",
|
9
9
|
"scripts": {
|
10
10
|
"version:minor": "npm version minor",
|
11
|
+
"build:types": "tsc -d --declarationMap --emitDeclarationOnly",
|
11
12
|
"publish:types": "npm publish --access public",
|
12
13
|
"generate:index": "cti create ./src"
|
13
14
|
},
|
14
|
-
"main": "
|
15
|
-
"
|
15
|
+
"main": "index.ts",
|
16
|
+
"types": "index.d.ts",
|
17
|
+
"dependencies": {
|
18
|
+
"@datadog/browser-logs": "^4.34.2",
|
19
|
+
"axios": "^1.3.4",
|
16
20
|
"color": "^4.2.3",
|
17
|
-
"
|
21
|
+
"is-promise": "^4.0.0",
|
22
|
+
"lodash": "^4.17.21",
|
18
23
|
"mobx": "^6.8.0",
|
19
24
|
"react": "^18.2.0",
|
20
|
-
"
|
25
|
+
"react-intl": "^6.2.10",
|
26
|
+
"react-toastify": "^9.1.1",
|
27
|
+
"theming": "^3.3.0",
|
21
28
|
"validator": "^13.9.0",
|
22
29
|
"zod": "^3.20.6"
|
30
|
+
},
|
31
|
+
"devDependencies": {
|
32
|
+
"create-ts-index": "^1.14.0",
|
33
|
+
"typescript": "^4.9.5"
|
23
34
|
}
|
24
35
|
}
|
@@ -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 =
|
56
|
+
export type WindowHapiAPIProduct = WindowHapiModuleWithConstructorArgs<
|
57
57
|
WindowHapiAPIModule<
|
58
58
|
WindowHapiAPIProductRequests,
|
59
59
|
WindowHapiAPIProductConfigs
|
package/product/index.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
// created from 'create-ts-index'
|
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"
|
@@ -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 =
|
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 {
|
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 =
|
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
|
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 =
|
10
|
+
export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
|
11
11
|
{
|
12
12
|
getUserProvidedFilters: () => ProductUserProvidedFilters
|
13
13
|
getProductsQueryParams: (
|
package/routing/index.ts
ADDED
package/theming/index.ts
ADDED
@@ -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 =
|
5
|
+
export type WindowHapiQATheming = WindowHapiModuleWithConstructorArgs<
|
6
6
|
{
|
7
7
|
setTheme: (updatedTheme: Partial<HapiTheme>) => HapiTheme
|
8
8
|
setFontOptions: (fontOptions: HapiFontOptions) => HapiFontOptions
|
@@ -1,4 +1,41 @@
|
|
1
|
-
import
|
1
|
+
import * as React from "react"
|
2
|
+
|
3
|
+
type DefaultTheme = object | null
|
4
|
+
|
5
|
+
type WithThemeFactory<Theme> = <
|
6
|
+
InnerProps extends { theme: NonNullable<Theme> },
|
7
|
+
InnerComponent extends React.ComponentType<InnerProps>,
|
8
|
+
OuterProps extends InnerProps & { theme?: NonNullable<Theme> },
|
9
|
+
>(
|
10
|
+
comp: InnerComponent,
|
11
|
+
) => React.ComponentType<OuterProps>
|
12
|
+
|
13
|
+
interface ThemeProviderProps<Theme> {
|
14
|
+
theme: NonNullable<Theme> | ((outerTheme: Theme) => NonNullable<Theme>)
|
15
|
+
children: React.ReactNode
|
16
|
+
}
|
17
|
+
|
18
|
+
type ThemeProviderFactory<Theme> = React.ComponentType<
|
19
|
+
ThemeProviderProps<Theme>
|
20
|
+
>
|
21
|
+
|
22
|
+
type UseThemeFactory<Theme> = <CustomTheme = Theme>() => CustomTheme
|
23
|
+
|
24
|
+
interface Theming<Theme> {
|
25
|
+
context: React.Context<Theme>
|
26
|
+
withTheme: WithThemeFactory<Theme>
|
27
|
+
ThemeProvider: ThemeProviderFactory<Theme>
|
28
|
+
useTheme: UseThemeFactory<Theme>
|
29
|
+
}
|
30
|
+
|
31
|
+
declare function createTheming<Theme>(
|
32
|
+
context: React.Context<Theme>,
|
33
|
+
): Theming<Theme>
|
34
|
+
|
35
|
+
declare const withTheme: WithThemeFactory<DefaultTheme>
|
36
|
+
declare const ThemeProvider: ThemeProviderFactory<DefaultTheme>
|
37
|
+
declare const ThemeContext: React.Context<DefaultTheme>
|
38
|
+
declare const useTheme: UseThemeFactory<DefaultTheme>
|
2
39
|
|
3
40
|
export type ThemeGlobalStyles = {
|
4
41
|
borderRadius: string
|
package/tsconfig.json
CHANGED
@@ -18,24 +18,19 @@
|
|
18
18
|
"jsx": "preserve",
|
19
19
|
"incremental": false,
|
20
20
|
"experimentalDecorators": true,
|
21
|
-
"baseUrl": "./
|
22
|
-
"
|
23
|
-
"
|
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
|
+
"**/*",
|
34
27
|
],
|
35
28
|
"exclude": [
|
36
29
|
"node_modules",
|
37
30
|
"../ats/**/*",
|
38
31
|
"../common/**/*",
|
39
|
-
"
|
32
|
+
"../src/**/*",
|
33
|
+
"./index.d.ts",
|
34
|
+
"./index.d.ts.map"
|
40
35
|
]
|
41
36
|
}
|
@@ -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 =
|
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 {
|
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 =
|
27
|
+
export type WindowHapiAPIWallet = WindowHapiModuleWithConstructorArgs<
|
28
28
|
WindowHapiAPIModule<
|
29
29
|
WindowHapiAPIWalletRequests,
|
30
30
|
WindowHapiAPIWalletConfigs
|
package/wallet/index.ts
ADDED
@@ -3,7 +3,7 @@ import {
|
|
3
3
|
HapiServiceFunctionWithLifecycleHooks,
|
4
4
|
WindowHapiService,
|
5
5
|
} from "../_window/service.types"
|
6
|
-
import {
|
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 =
|
15
|
+
export type WindowHapiServiceWallet = WindowHapiModuleWithConstructorArgs<
|
16
16
|
{
|
17
17
|
getATSSettings: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetATSSettingsHandler>
|
18
18
|
getWallet: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetWalletHandler>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { ModuleWithConstructorArgs } from "../types"
|
2
|
-
import { WindowHapi } from "./window"
|
3
|
-
|
4
|
-
export type WindowHapiAuth = ModuleWithConstructorArgs<
|
5
|
-
{
|
6
|
-
partnerId: string | undefined
|
7
|
-
clientId: string | undefined
|
8
|
-
clientToken: string | undefined
|
9
|
-
},
|
10
|
-
{ readonly core: WindowHapi }
|
11
|
-
>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { HapiWebComponent, RecursivePartial } from "../common/types"
|
2
|
-
|
3
|
-
export type DebugPanelPosition =
|
4
|
-
| "bottom-left"
|
5
|
-
| "bottom-right"
|
6
|
-
| "top-left"
|
7
|
-
| "top-right"
|
8
|
-
export type WindowHapiConfig = {
|
9
|
-
apiHost: string
|
10
|
-
initialState: RecursivePartial<any>
|
11
|
-
partnerId: string
|
12
|
-
clientId: string
|
13
|
-
clientToken: string
|
14
|
-
loadingSpinnerDefaultFillColor: string
|
15
|
-
appOrigin: string
|
16
|
-
enableLogs: boolean
|
17
|
-
webComponents: HapiWebComponent[]
|
18
|
-
isInvalidToken: boolean
|
19
|
-
useJWTAuthHeaders: boolean
|
20
|
-
addModal: boolean
|
21
|
-
addAlertBar: boolean
|
22
|
-
addDebugPanel: boolean
|
23
|
-
debugPanelPosition: DebugPanelPosition
|
24
|
-
datadogClientToken: string
|
25
|
-
env: string
|
26
|
-
appVersion: string
|
27
|
-
testMode: boolean
|
28
|
-
debugMode: boolean
|
29
|
-
htmlTemplates: Record<string, string>
|
30
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import HapiInstance from "../common/instances/Instance"
|
2
|
-
import { ModuleWithConstructorArgs } from "../types"
|
3
|
-
import { WindowHapi } from "./window"
|
4
|
-
|
5
|
-
export type WindowHapiInstances = ModuleWithConstructorArgs<
|
6
|
-
{
|
7
|
-
instances: HapiInstance[]
|
8
|
-
getFrameWindowByName: (name: string) => Window | undefined
|
9
|
-
hasInstance: (instanceName: string) => boolean
|
10
|
-
getInstanceByName: (instanceName: string) => HapiInstance | undefined
|
11
|
-
addInstanceByName: (instanceName: string, window: Window) => void
|
12
|
-
addInstance: (instance: HapiInstance) => void
|
13
|
-
removeInstance: (instanceName: string) => void
|
14
|
-
onAfterAddInstance: (instance: HapiInstance) => void
|
15
|
-
onAfterRemoveInstance: (instance: HapiInstance) => void
|
16
|
-
},
|
17
|
-
{ readonly core: WindowHapi }
|
18
|
-
>
|
package/src/_window/ui.types.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import { ModuleWithConstructorArgs } from "../types"
|
2
|
-
import { WindowHapi } from "./window"
|
3
|
-
|
4
|
-
export type WindowHapiUI = ModuleWithConstructorArgs<
|
5
|
-
{
|
6
|
-
addUIElementToBody: (
|
7
|
-
elementName: "he-ui-modals" | "he-ui-alertbar",
|
8
|
-
) => void
|
9
|
-
toggleModal: () => void
|
10
|
-
toggleAlertbar: () => void
|
11
|
-
},
|
12
|
-
{ readonly core: WindowHapi }
|
13
|
-
>
|
package/src/_window/window.ts
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
import { Logger } from "../common/logger/Logger"
|
2
|
-
import { WindowHapiUtils } from "./utils.types"
|
3
|
-
import { WindowHapiValidations } from "./validation.types"
|
4
|
-
import { WindowHapiState } from "./state.types"
|
5
|
-
import { WindowHapiInstances } from "./instances.types"
|
6
|
-
import { WindowHapiRouting } from "./routing.types"
|
7
|
-
import { WindowHapiAuth } from "./auth.types"
|
8
|
-
import { WindowHapiEvents } from "./events.types"
|
9
|
-
import { WindowHapiUI } from "./ui.types"
|
10
|
-
import { WindowHapiAPI } from "./api.types"
|
11
|
-
import { WindowHapiSDK } from "./sdk.types"
|
12
|
-
import { WindowHapiService } from "./service.types"
|
13
|
-
import HapiInstance from "../common/instances/Instance"
|
14
|
-
import { WindowHapiQA } from "./qa.types"
|
15
|
-
import { ModuleWithConstructorArgs } from "../types"
|
16
|
-
|
17
|
-
export type WindowHapi = {
|
18
|
-
logger: Logger
|
19
|
-
utils: ModuleWithConstructorArgs<
|
20
|
-
WindowHapiUtils,
|
21
|
-
{ readonly core: WindowHapi }
|
22
|
-
>
|
23
|
-
validation: ModuleWithConstructorArgs<
|
24
|
-
WindowHapiValidations,
|
25
|
-
{ readonly core: WindowHapi }
|
26
|
-
>
|
27
|
-
state: ModuleWithConstructorArgs<
|
28
|
-
WindowHapiState,
|
29
|
-
{ readonly core: WindowHapi }
|
30
|
-
>
|
31
|
-
instances: ModuleWithConstructorArgs<
|
32
|
-
WindowHapiInstances,
|
33
|
-
{ readonly core: WindowHapi }
|
34
|
-
>
|
35
|
-
routing: ModuleWithConstructorArgs<
|
36
|
-
WindowHapiRouting,
|
37
|
-
{ readonly core: WindowHapi }
|
38
|
-
>
|
39
|
-
auth: ModuleWithConstructorArgs<
|
40
|
-
WindowHapiAuth,
|
41
|
-
{ readonly core: WindowHapi }
|
42
|
-
>
|
43
|
-
events: ModuleWithConstructorArgs<
|
44
|
-
WindowHapiEvents,
|
45
|
-
{ readonly core: WindowHapi }
|
46
|
-
>
|
47
|
-
ui: ModuleWithConstructorArgs<WindowHapiUI, { readonly core: WindowHapi }>
|
48
|
-
api: ModuleWithConstructorArgs<WindowHapiAPI, { readonly core: WindowHapi }>
|
49
|
-
sdk: ModuleWithConstructorArgs<WindowHapiSDK, { readonly core: WindowHapi }>
|
50
|
-
service: ModuleWithConstructorArgs<
|
51
|
-
WindowHapiService,
|
52
|
-
{ readonly core: WindowHapi }
|
53
|
-
>
|
54
|
-
instance: HapiInstance
|
55
|
-
qa: ModuleWithConstructorArgs<WindowHapiQA, { readonly core: WindowHapi }>
|
56
|
-
}
|
@@ -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
|
-
}
|
package/src/alert/index.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
// created from 'create-ts-index'
|
2
|
-
|
3
|
-
export * from './enums';
|
4
|
-
export * from './functions.types';
|
5
|
-
export * from './service.types';
|
6
|
-
export * from './state.initial';
|
7
|
-
export * from './state.types';
|
8
|
-
export * from './state.validations';
|
9
|
-
export * from './types';
|
@@ -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
|
-
}
|
package/src/alert/state.types.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import { Alert, AlertOptions } from "./types"
|
2
|
-
export type AlertStoreState = {
|
3
|
-
/**
|
4
|
-
* List of alert objects to be shown
|
5
|
-
*/
|
6
|
-
alerts: Alert[]
|
7
|
-
/**
|
8
|
-
* Default options object for Toast (Snack) notifications. Contains options like duration, show/hide close button, position.
|
9
|
-
*/
|
10
|
-
defaultOptions: AlertOptions
|
11
|
-
/**
|
12
|
-
* Extends default options and sets the type to "success". **This value is a computed getter meaning that it cannot be set from outside**
|
13
|
-
*/
|
14
|
-
successOptions: AlertOptions | null
|
15
|
-
/**
|
16
|
-
* Extends default options and sets the type to "info". **This value is a computed getter meaning that it cannot be set from outside**
|
17
|
-
*/
|
18
|
-
infoOptions: AlertOptions | null
|
19
|
-
/**
|
20
|
-
* Extends default options and sets the type to "warning". **This value is a computed getter meaning that it cannot be set from outside**
|
21
|
-
*/
|
22
|
-
warningOptions: AlertOptions | null
|
23
|
-
/**
|
24
|
-
* Extends default options and sets the type to "error". **This value is a computed getter meaning that it cannot be set from outside**
|
25
|
-
*/
|
26
|
-
errorOptions: AlertOptions | null
|
27
|
-
}
|
@@ -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
|
-
}
|
package/src/ats/index.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
// created from 'create-ts-index'
|
2
|
-
|
3
|
-
export * from './api.types';
|
4
|
-
export * from './functions.types';
|
5
|
-
export * from './service.types';
|
6
|
-
export * from './state.initial';
|
7
|
-
export * from './state.types';
|
8
|
-
export * from './state.validations';
|
9
|
-
export * from './types';
|
package/src/ats/state.initial.ts
DELETED
package/src/basket/consts.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export const CAMPAIGN_BASKET_PRODUCTS_LOCALSTORAGE_KEY = "basketProducts"
|