@zengenti/contensis-react-base 3.0.2-beta.3 → 3.0.2-beta.30

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 (153) hide show
  1. package/cjs/{App-5b34574e.js → App-eefb5b8f.js} +161 -444
  2. package/cjs/App-eefb5b8f.js.map +1 -0
  3. package/cjs/{login-840860bc.js → ChangePassword.container-7306be55.js} +305 -191
  4. package/cjs/ChangePassword.container-7306be55.js.map +1 -0
  5. package/cjs/ContensisDeliveryApi-e2b3ce60.js +264 -0
  6. package/cjs/ContensisDeliveryApi-e2b3ce60.js.map +1 -0
  7. package/cjs/CookieConstants-000427db.js +10 -0
  8. package/cjs/CookieConstants-000427db.js.map +1 -0
  9. package/cjs/CookieHelper.class-daeb09dd.js +52 -0
  10. package/cjs/CookieHelper.class-daeb09dd.js.map +1 -0
  11. package/cjs/{RouteLoader-3aa6456e.js → RouteLoader-85bee645.js} +28 -38
  12. package/cjs/RouteLoader-85bee645.js.map +1 -0
  13. package/cjs/{ToJs-a9a8522b.js → ToJs-29de3c36.js} +3 -4
  14. package/cjs/ToJs-29de3c36.js.map +1 -0
  15. package/cjs/client.js +26 -29
  16. package/cjs/client.js.map +1 -1
  17. package/cjs/contensis-react-base.js +146 -529
  18. package/cjs/contensis-react-base.js.map +1 -1
  19. package/cjs/forms.js +1488 -272
  20. package/cjs/forms.js.map +1 -1
  21. package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-7c363211.js} +1 -4
  22. package/cjs/{fromJSLeaveImmer-e74c673c.js.map → fromJSLeaveImmer-7c363211.js.map} +1 -1
  23. package/cjs/{reducers-3a4f8971.js → reducers-9afb5f89.js} +14 -31
  24. package/cjs/reducers-9afb5f89.js.map +1 -0
  25. package/cjs/redux.js +17 -17
  26. package/cjs/redux.js.map +1 -1
  27. package/cjs/routing.js +8 -7
  28. package/cjs/routing.js.map +1 -1
  29. package/cjs/{sagas-8a20e424.js → sagas-e04b94c1.js} +225 -301
  30. package/cjs/sagas-e04b94c1.js.map +1 -0
  31. package/cjs/search.js +68 -94
  32. package/cjs/search.js.map +1 -1
  33. package/cjs/{selectors-656da4b7.js → selectors-a6eac513.js} +85 -8
  34. package/cjs/selectors-a6eac513.js.map +1 -0
  35. package/cjs/urls-6fcaf4c6.js.map +1 -1
  36. package/cjs/user.js +35 -169
  37. package/cjs/user.js.map +1 -1
  38. package/cjs/util.js +49 -53
  39. package/cjs/util.js.map +1 -1
  40. package/cjs/{version-78dfc3bd.js → version-9edb5540.js} +50 -159
  41. package/cjs/version-9edb5540.js.map +1 -0
  42. package/cjs/version-d3b5fbde.js +98 -0
  43. package/cjs/version-d3b5fbde.js.map +1 -0
  44. package/esm/{App-707730d3.js → App-2db3d689.js} +145 -427
  45. package/esm/App-2db3d689.js.map +1 -0
  46. package/esm/{login-57395c9c.js → ChangePassword.container-54b4011d.js} +287 -184
  47. package/esm/ChangePassword.container-54b4011d.js.map +1 -0
  48. package/esm/ContensisDeliveryApi-50b8fd7c.js +258 -0
  49. package/esm/ContensisDeliveryApi-50b8fd7c.js.map +1 -0
  50. package/esm/CookieConstants-3d3b6531.js +6 -0
  51. package/esm/CookieConstants-3d3b6531.js.map +1 -0
  52. package/esm/CookieHelper.class-4d6ee27b.js +49 -0
  53. package/esm/CookieHelper.class-4d6ee27b.js.map +1 -0
  54. package/esm/{RouteLoader-5171c63f.js → RouteLoader-3e77f6a4.js} +27 -37
  55. package/esm/RouteLoader-3e77f6a4.js.map +1 -0
  56. package/esm/{ToJs-4e02a04d.js → ToJs-e533a70a.js} +3 -4
  57. package/esm/ToJs-e533a70a.js.map +1 -0
  58. package/esm/client.js +21 -24
  59. package/esm/client.js.map +1 -1
  60. package/esm/contensis-react-base.js +140 -524
  61. package/esm/contensis-react-base.js.map +1 -1
  62. package/esm/forms.js +1490 -274
  63. package/esm/forms.js.map +1 -1
  64. package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-e2dacd63.js} +1 -4
  65. package/esm/{fromJSLeaveImmer-0114ffcf.js.map → fromJSLeaveImmer-e2dacd63.js.map} +1 -1
  66. package/esm/{reducers-8e5d6232.js → reducers-3d5c37d1.js} +14 -31
  67. package/esm/reducers-3d5c37d1.js.map +1 -0
  68. package/esm/redux.js +9 -8
  69. package/esm/redux.js.map +1 -1
  70. package/esm/routing.js +5 -4
  71. package/esm/routing.js.map +1 -1
  72. package/esm/{sagas-e576b6f6.js → sagas-933a8fc8.js} +177 -254
  73. package/esm/sagas-933a8fc8.js.map +1 -0
  74. package/esm/search.js +69 -95
  75. package/esm/search.js.map +1 -1
  76. package/esm/{selectors-a5e5835b.js → selectors-5061d7c8.js} +70 -8
  77. package/esm/selectors-5061d7c8.js.map +1 -0
  78. package/esm/urls-eac9a747.js.map +1 -1
  79. package/esm/user.js +23 -161
  80. package/esm/user.js.map +1 -1
  81. package/esm/util.js +44 -53
  82. package/esm/util.js.map +1 -1
  83. package/esm/{version-e3a5ec66.js → version-1ef42ad1.js} +37 -142
  84. package/esm/version-1ef42ad1.js.map +1 -0
  85. package/esm/version-7550d14d.js +87 -0
  86. package/esm/version-7550d14d.js.map +1 -0
  87. package/models/client/client.d.ts +1 -1
  88. package/models/config.d.ts +4 -4
  89. package/models/redux/appstate.d.ts +2 -1
  90. package/models/routing/redux/actions.d.ts +10 -6
  91. package/models/routing/redux/selectors.d.ts +5 -4
  92. package/models/routing/redux/types.d.ts +0 -1
  93. package/models/routing/routes.d.ts +20 -17
  94. package/models/search/models/Queries.d.ts +9 -10
  95. package/models/search/models/Search.d.ts +26 -24
  96. package/models/search/models/SearchActions.d.ts +36 -36
  97. package/models/search/models/SearchState.d.ts +11 -11
  98. package/models/search/models/SearchUtil.d.ts +1 -1
  99. package/models/search/models/WithSearch.d.ts +1 -1
  100. package/models/search/redux/actions.d.ts +7 -7
  101. package/models/search/redux/selectors.d.ts +27 -27
  102. package/models/search/redux/util.d.ts +2 -2
  103. package/models/search/search/expressions.d.ts +4 -4
  104. package/models/search/search/util.d.ts +2 -2
  105. package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
  106. package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
  107. package/models/server/features/linkdepth-api/search.d.ts +3 -3
  108. package/models/server/internalServer.d.ts +7 -5
  109. package/models/server/util/bundles.d.ts +2 -2
  110. package/models/server/util/handleExceptions.d.ts +1 -1
  111. package/models/testImmer/redux/reducer.d.ts +1 -1
  112. package/models/user/components/Login.d.ts +2 -3
  113. package/models/user/containers/ChangePassword.container.d.ts +2 -2
  114. package/models/user/containers/ForgotPassword.container.d.ts +2 -2
  115. package/models/user/containers/Login.container.d.ts +2 -2
  116. package/models/user/containers/Registration.container.d.ts +2 -2
  117. package/models/user/hocs/withLogin.d.ts +5 -11
  118. package/models/user/hocs/withRegistration.d.ts +2 -8
  119. package/models/user/redux/actions.d.ts +2 -2
  120. package/models/user/redux/sagas/login.d.ts +9 -8
  121. package/models/user/redux/selectors.d.ts +4 -4
  122. package/models/user/util/CookieConstants.d.ts +7 -0
  123. package/models/user/util/CookieHelper.class.d.ts +15 -3
  124. package/models/user/util/LoginHelper.class.d.ts +27 -23
  125. package/models/util/ContensisDeliveryApi.d.ts +26 -13
  126. package/models/util/ToJs.d.ts +1 -1
  127. package/models/util/index.d.ts +1 -0
  128. package/models/util/json-mapper.d.ts +1 -1
  129. package/package.json +9 -10
  130. package/cjs/App-5b34574e.js.map +0 -1
  131. package/cjs/RouteLoader-3aa6456e.js.map +0 -1
  132. package/cjs/ToJs-a9a8522b.js.map +0 -1
  133. package/cjs/actions-8dc9e8de.js +0 -87
  134. package/cjs/actions-8dc9e8de.js.map +0 -1
  135. package/cjs/login-840860bc.js.map +0 -1
  136. package/cjs/reducers-3a4f8971.js.map +0 -1
  137. package/cjs/sagas-8a20e424.js.map +0 -1
  138. package/cjs/selectors-656da4b7.js.map +0 -1
  139. package/cjs/version-78dfc3bd.js.map +0 -1
  140. package/cjs/version-eba6d09b.js +0 -20
  141. package/cjs/version-eba6d09b.js.map +0 -1
  142. package/esm/App-707730d3.js.map +0 -1
  143. package/esm/RouteLoader-5171c63f.js.map +0 -1
  144. package/esm/ToJs-4e02a04d.js.map +0 -1
  145. package/esm/actions-180948dd.js +0 -72
  146. package/esm/actions-180948dd.js.map +0 -1
  147. package/esm/login-57395c9c.js.map +0 -1
  148. package/esm/reducers-8e5d6232.js.map +0 -1
  149. package/esm/sagas-e576b6f6.js.map +0 -1
  150. package/esm/selectors-a5e5835b.js.map +0 -1
  151. package/esm/version-2485e2fb.js +0 -15
  152. package/esm/version-2485e2fb.js.map +0 -1
  153. package/esm/version-e3a5ec66.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ import { g as getImmutableOrJS, E as action } from './selectors-5061d7c8.js';
2
+ import { all } from '@redux-saga/core/effects';
3
+ import { r as reduxStore, b as SET_VERSION_STATUS, d as SET_VERSION } from './version-1ef42ad1.js';
4
+
5
+ const hasNavigationTree = state => getImmutableOrJS(state, ['navigation', 'isReady']);
6
+ const selectNavigationRoot = state => getImmutableOrJS(state, ['navigation', 'root']);
7
+ const selectNavigationChildren = state => getImmutableOrJS(state, ['navigation', 'root', 'children']);
8
+ const selectNavigationDepends = () => [];
9
+
10
+ var navigation = /*#__PURE__*/Object.freeze({
11
+ __proto__: null,
12
+ hasNavigationTree: hasNavigationTree,
13
+ selectNavigationRoot: selectNavigationRoot,
14
+ selectNavigationChildren: selectNavigationChildren,
15
+ selectNavigationDepends: selectNavigationDepends
16
+ });
17
+
18
+ const convertSagaArray = sagas => {
19
+ if (Array.isArray(sagas)) return function* rootSaga() {
20
+ yield all(sagas);
21
+ };
22
+ return sagas;
23
+ };
24
+ const injectReducer = ({
25
+ key,
26
+ reducer
27
+ }, store = reduxStore) => {
28
+ if (Reflect.has(store.injectedReducers, key) && store.injectedReducers[key] === reducer) return;
29
+ store.injectedReducers[key] = reducer;
30
+ store.replaceReducer(store.createReducer(store.injectedReducers));
31
+ };
32
+ const injectSaga = ({
33
+ key,
34
+ saga
35
+ }, store = reduxStore) => {
36
+ const rootSaga = convertSagaArray(saga);
37
+ let hasSaga = Reflect.has(store.injectedSagas, key);
38
+ if (process.env.NODE_ENV !== 'production') {
39
+ const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas
40
+
41
+ if (hasSaga && oldDescriptor.saga !== rootSaga) {
42
+ oldDescriptor.task.cancel();
43
+ hasSaga = false;
44
+ }
45
+ }
46
+ console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);
47
+ if (!hasSaga) {
48
+ store.injectedSagas[key] = {
49
+ key,
50
+ saga: rootSaga,
51
+ task: store.runSaga(rootSaga)
52
+ };
53
+ }
54
+ };
55
+ const injectRedux = ({
56
+ key,
57
+ reducer,
58
+ saga
59
+ }, store = reduxStore) => {
60
+ console.info('injectRedux, key: ', key);
61
+ if (reducer) injectReducer({
62
+ key,
63
+ reducer
64
+ }, store);
65
+ if (saga) injectSaga({
66
+ key,
67
+ saga
68
+ }, store);
69
+ };
70
+ const useInjectRedux = injectRedux;
71
+
72
+ const setVersion = (commitRef, buildNo) => action(SET_VERSION, {
73
+ commitRef,
74
+ buildNo
75
+ });
76
+ const setVersionStatus = status => action(SET_VERSION_STATUS, {
77
+ status
78
+ });
79
+
80
+ var version = /*#__PURE__*/Object.freeze({
81
+ __proto__: null,
82
+ setVersion: setVersion,
83
+ setVersionStatus: setVersionStatus
84
+ });
85
+
86
+ export { setVersion as a, injectReducer as b, convertSagaArray as c, injectSaga as d, hasNavigationTree as h, injectRedux as i, navigation as n, setVersionStatus as s, useInjectRedux as u, version as v };
87
+ //# sourceMappingURL=version-7550d14d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-7550d14d.js","sources":["../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationChildren = state =>\n getIn(state, ['navigation', 'root', 'children']);\n\nexport const selectNavigationDepends = () => [];\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["hasNavigationTree","state","getIn","selectNavigationRoot","selectNavigationChildren","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","store","DefaultStore","Reflect","has","injectedReducers","replaceReducer","createReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","runSaga","injectRedux","useInjectRedux","setVersion","commitRef","buildNo","action","SET_VERSION","setVersionStatus","status","SET_VERSION_STATUS"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import 'isomorphic-fetch';
2
2
  import React from 'react';
3
3
  import { AppConfig } from "../config";
4
- declare type ReactAppProps = {
4
+ type ReactAppProps = {
5
5
  routes: any;
6
6
  withEvents: any;
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { AppRoutes, WithEvents } from './routing/routes';
2
2
  import handleResponse from './server/features/response-handler';
3
- export declare type StateType = 'immutable' | 'js';
4
- export declare type AppConfig = {
3
+ export type StateType = 'immutable' | 'js';
4
+ export type AppConfig = {
5
5
  stateType?: StateType;
6
6
  routes: AppRoutes;
7
7
  withReducers: {
@@ -10,11 +10,11 @@ export declare type AppConfig = {
10
10
  withSagas: any[];
11
11
  withEvents: WithEvents;
12
12
  };
13
- export declare type ServerConfig = AppConfig & {
13
+ export type ServerConfig = AppConfig & {
14
14
  appRootPath?: string;
15
15
  disableSsrRedux?: boolean;
16
16
  handleResponses?: typeof handleResponse;
17
- handleExceptions?: boolean;
17
+ handleExceptions?: boolean | string[];
18
18
  reverseProxyPaths?: string[];
19
19
  packagejson: any;
20
20
  proxyDeliveryApi?: boolean;
@@ -3,13 +3,14 @@ import { Entry, Node } from 'contensis-delivery-api/lib/models';
3
3
  import { Group, User } from 'contensis-management-api/lib/models';
4
4
  import { MatchedRoute } from 'react-router-config';
5
5
  import { StaticRoute } from "../routing/routes";
6
- export declare type AppState = {
6
+ export type AppState = {
7
7
  navigation: {
8
8
  root: Node | null;
9
9
  isError: boolean;
10
10
  isReady: boolean;
11
11
  };
12
12
  routing: {
13
+ canonicalPath: string | null;
13
14
  currentHostname: null;
14
15
  currentPath: string;
15
16
  currentNode: Node & {
@@ -1,6 +1,10 @@
1
- export declare const setNotFound: (notFound: any) => any;
2
- export declare const setNavigationPath: (path: any, location: any, staticRoute: any, withEvents: any, statePath: any, routes: any) => any;
3
- export declare const setCurrentProject: (project: any, allowedGroups: any, hostname: any) => any;
4
- export declare const setRoute: (path: any, state: any) => any;
5
- export declare const setRouteEntry: (entry: any) => any;
6
- export declare const setSurrogateKeys: (keys: any, url: any) => any;
1
+ import { useLocation } from 'react-router-dom';
2
+ import { Entry } from 'contensis-delivery-api/lib/models';
3
+ import { MatchedRoute, RouteConfig } from 'react-router-config';
4
+ import { AppRoutes, WithEvents } from '../routes';
5
+ import { CookieHelper } from "../../user/util/CookieHelper.class";
6
+ export declare const setNavigationPath: (path: string, location: ReturnType<typeof useLocation>, staticRoute: MatchedRoute<any, RouteConfig> | undefined, withEvents: WithEvents, statePath: string, routes: AppRoutes, cookies: CookieHelper) => any;
7
+ export declare const setCurrentProject: (project: string, allowedGroups: any, hostname: string) => any;
8
+ export declare const setRoute: (path: string, state?: any) => any;
9
+ export declare const setRouteEntry: (entry: Entry) => any;
10
+ export declare const setSurrogateKeys: (keys: string, url: string) => any;
@@ -1,7 +1,7 @@
1
1
  import { StateType } from "../../config";
2
2
  import { AppState } from "../../redux/appstate";
3
- export declare const selectRouteEntry: (state: AppState, returnType?: StateType | undefined) => any;
4
- export declare const selectMappedEntry: (state: AppState, returnType?: StateType | undefined) => any;
3
+ export declare const selectRouteEntry: (state: AppState, returnType?: StateType) => any;
4
+ export declare const selectMappedEntry: (state: AppState, returnType?: StateType) => any;
5
5
  export declare const selectSurrogateKeys: (state: AppState) => any;
6
6
  export declare const selectCurrentHostname: (state: AppState) => any;
7
7
  export declare const selectCurrentTreeID: (state: AppState) => any;
@@ -10,6 +10,7 @@ export declare const selectRouteEntryContentTypeId: (state: AppState) => any;
10
10
  export declare const selectRouteEntryLanguage: (state: AppState) => any;
11
11
  export declare const selectRouteEntrySlug: (state: AppState) => any;
12
12
  export declare const selectRouteEntryID: (state: AppState) => any;
13
+ export declare const selectCanonicalPath: (state: AppState) => any;
13
14
  export declare const selectCurrentPath: (state: AppState) => any;
14
15
  export declare const selectCurrentLocation: (state: AppState) => any;
15
16
  export declare const selectCurrentSearch: (state: AppState) => any;
@@ -19,9 +20,9 @@ export declare const selectCurrentProject: (state: AppState) => any;
19
20
  export declare const selectIsNotFound: (state: AppState) => any;
20
21
  export declare const selectCurrentAncestors: (state: AppState) => any;
21
22
  export declare const selectCurrentSiblings: (state: AppState) => any;
22
- export declare const selectCurrentNode: (state: AppState, returnType?: StateType | undefined) => any;
23
+ export declare const selectCurrentNode: (state: AppState, returnType?: StateType) => any;
23
24
  export declare const selectCurrentChildren: (state: any) => any;
24
- export declare const selectBreadcrumb: (state: AppState) => any;
25
+ export declare const selectBreadcrumb: (state: AppState) => any[];
25
26
  export declare const selectRouteErrorMessage: (state: AppState) => any;
26
27
  export declare const selectRouteIsError: (state: AppState) => any;
27
28
  export declare const selectRouteLoading: (state: AppState) => any;
@@ -5,7 +5,6 @@ export declare const SET_ANCESTORS: string;
5
5
  export declare const SET_SIBLINGS: string;
6
6
  export declare const SET_ENTRY_ID: string;
7
7
  export declare const SET_SURROGATE_KEYS: string;
8
- export declare const SET_NAVIGATION_NOT_FOUND: string;
9
8
  export declare const SET_NAVIGATION_PATH: string;
10
9
  export declare const SET_TARGET_PROJECT: string;
11
10
  export declare const SET_ROUTE: string;
@@ -2,20 +2,21 @@ import { MatchedRoute, RouteConfig } from 'react-router-config';
2
2
  import { Entry, Node } from 'contensis-delivery-api/lib/models';
3
3
  import React from 'react';
4
4
  import { AppState } from "../redux/appstate";
5
- declare type RouteComponent<Props> = React.ComponentType<Props>;
6
- export declare type RouteNode = Node & {
5
+ import { CookieHelper } from "../user/util/CookieHelper.class";
6
+ type RouteComponent<Props> = React.ComponentType<Props>;
7
+ export type RouteNode = Node & {
7
8
  ancestors: Node[];
8
9
  children: Node[];
9
10
  };
10
- export declare type AppRoutes = {
11
+ export type AppRoutes = {
11
12
  ContentTypeMappings: ContentTypeMapping[];
12
13
  StaticRoutes: StaticRoute[];
13
14
  };
14
- export declare type AppRootProps = {
15
+ export type AppRootProps = {
15
16
  routes: AppRoutes;
16
17
  withEvents: WithEvents;
17
18
  };
18
- export declare type RouteComponentProps<P = any> = {
19
+ export type RouteComponentProps<P = any> = {
19
20
  [key: string]: any;
20
21
  projectId?: string;
21
22
  contentTypeId?: string;
@@ -23,23 +24,23 @@ export declare type RouteComponentProps<P = any> = {
23
24
  mappedEntry?: P;
24
25
  isLoggedIn?: boolean;
25
26
  };
26
- export declare type RouteLoaderProps = {
27
+ export type RouteLoaderProps = {
27
28
  loadingComponent?: React.ComponentType;
28
29
  notFoundComponent?: React.ComponentType;
29
30
  trailingSlashRedirectCode?: 301 | 302;
30
31
  };
31
- export declare type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
32
- export declare type ReduxInjector = () => Promise<{
32
+ export type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
33
+ export type ReduxInjector = () => Promise<{
33
34
  key: string;
34
35
  reducer: any;
35
36
  saga: any;
36
37
  }>;
37
- declare type UserGroupRequisite = {
38
+ type UserGroupRequisite = {
38
39
  id?: string;
39
40
  name?: string;
40
41
  };
41
- export declare type RequireLogin = boolean | UserGroupRequisite[];
42
- export declare type ContentTypeMapping = {
42
+ export type RequireLogin = boolean | UserGroupRequisite[];
43
+ export type ContentTypeMapping = {
43
44
  contentTypeID: string;
44
45
  component: RouteComponent<RouteComponentProps>;
45
46
  entryMapper?: EntryMapper;
@@ -59,7 +60,7 @@ export declare type ContentTypeMapping = {
59
60
  };
60
61
  requireLogin?: RequireLogin;
61
62
  };
62
- export declare type StaticRoute = Omit<RouteConfig, 'component'> & {
63
+ export type StaticRoute = Omit<RouteConfig, 'component'> & {
63
64
  component: RouteComponent<RouteComponentProps>;
64
65
  fetchNode?: boolean | {
65
66
  /**
@@ -79,7 +80,8 @@ export declare type StaticRoute = Omit<RouteConfig, 'component'> & {
79
80
  ssr?: boolean;
80
81
  ssrOnly?: boolean;
81
82
  };
82
- export declare type OnRouteLoadArgs = {
83
+ export type OnRouteLoadArgs = {
84
+ cookies: CookieHelper;
83
85
  location: {
84
86
  pathname: string;
85
87
  search: string;
@@ -90,7 +92,8 @@ export declare type OnRouteLoadArgs = {
90
92
  staticRoute: MatchedRoute<any, StaticRoute>;
91
93
  statePath: string;
92
94
  };
93
- export declare type OnRouteLoadedArgs = {
95
+ export type OnRouteLoadedArgs = {
96
+ cookies: CookieHelper;
94
97
  entry: Entry | any;
95
98
  location: {
96
99
  pathname: string;
@@ -101,7 +104,7 @@ export declare type OnRouteLoadedArgs = {
101
104
  path: string;
102
105
  staticRoute: MatchedRoute<any, StaticRoute>;
103
106
  };
104
- export declare type RouteLoadOptions = {
107
+ export type RouteLoadOptions = {
105
108
  customNavigation?: boolean | {
106
109
  ancestors: boolean | number;
107
110
  children: boolean | number;
@@ -114,10 +117,10 @@ export declare type RouteLoadOptions = {
114
117
  preventScrollTop?: boolean;
115
118
  refetchNode?: true;
116
119
  };
117
- export declare type RouteLoadedOptions = {
120
+ export type RouteLoadedOptions = {
118
121
  requireLogin?: RequireLogin;
119
122
  };
120
- export declare type WithEvents = {
123
+ export type WithEvents = {
121
124
  onRouteLoad: (args: OnRouteLoadArgs) => Generator<void | RouteLoadOptions>;
122
125
  onRouteLoaded: (args: OnRouteLoadedArgs) => Generator<void | RouteLoadedOptions>;
123
126
  };
@@ -1,16 +1,14 @@
1
- import { Query } from 'contensis-core-api';
2
- import { VersionStatus } from 'contensis-core-api/lib/models';
3
- import { Operators } from 'contensis-delivery-api/lib/entries/query';
1
+ import { Operators, Query, VersionStatus } from 'contensis-core-api';
4
2
  import { CustomWhereClause, FeaturedResults, WeightedSearchField } from './Search';
5
- export declare type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
6
- export declare type LogicOperators = 'and' | 'or' | 'not';
7
- export declare type FilterExpression = {
3
+ export type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
4
+ export type LogicOperators = 'and' | 'or' | 'not';
5
+ export type FilterExpression = {
8
6
  key: string;
9
7
  values: string[];
10
8
  fieldOperator: FieldOperators;
11
9
  logicOperator: LogicOperators;
12
10
  };
13
- export declare type SearchQueryOptions = {
11
+ export type SearchQueryOptions = {
14
12
  assetTypes: string[];
15
13
  contentTypeIds: string[];
16
14
  customWhere: any;
@@ -24,13 +22,14 @@ export declare type SearchQueryOptions = {
24
22
  languages: string[];
25
23
  pageSize: number;
26
24
  pageIndex: number;
25
+ omitDefaultSearchFields: string[];
27
26
  orderBy: string[];
28
27
  searchTerm: string;
29
28
  versionStatus: VersionStatus;
30
29
  webpageTemplates: string[];
31
30
  weightedSearchFields: WeightedSearchField[];
32
31
  };
33
- export declare type QueryParams = SearchQueryOptions & {
32
+ export type QueryParams = SearchQueryOptions & {
34
33
  env: string;
35
34
  internalPageIndex: number;
36
35
  internalPaging: boolean;
@@ -43,5 +42,5 @@ export declare type QueryParams = SearchQueryOptions & {
43
42
  [key: string]: string;
44
43
  };
45
44
  };
46
- export declare type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
47
- export declare type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
45
+ export type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, omitDefaultSearchFields, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
46
+ export type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
@@ -3,7 +3,7 @@ import MappingTemplate from 'jsonpath-mapper/dist/models/Template';
3
3
  import { Context } from './Enums';
4
4
  import { FieldOperators, LogicOperators } from './Queries';
5
5
  import { AppState } from './SearchState';
6
- export declare type Tab = {
6
+ export type Tab = {
7
7
  /** The facet to render as default */
8
8
  defaultFacet?: string;
9
9
  /** The zero-based incrementing id assigned to the tab */
@@ -13,11 +13,11 @@ export declare type Tab = {
13
13
  /** The facet to render the total results count as default */
14
14
  totalCount?: string;
15
15
  };
16
- export declare type CustomApi = {
16
+ export type CustomApi = {
17
17
  /** The uri of the REST API implementing a simple GET request */
18
18
  uri: string;
19
19
  };
20
- export declare type Listing = {
20
+ export type Listing = {
21
21
  /** Display title */
22
22
  title?: string;
23
23
  /** Experimental: use a custom API to retrieve search results */
@@ -34,7 +34,7 @@ export declare type Listing = {
34
34
  /** Display title */
35
35
  title?: string;
36
36
  };
37
- export declare type SearchFacet = {
37
+ export type SearchFacet = {
38
38
  /** The first facet to be shown if no facet is supplied via a route parameter [default false] */
39
39
  isDefault?: boolean;
40
40
  /** Set to true to temporarily disable the facet [default false] */
@@ -42,10 +42,10 @@ export declare type SearchFacet = {
42
42
  /** The id of the tab the facet applies to. Use 0 for default or the id assigned to the tab */
43
43
  tabId?: number;
44
44
  } & Listing;
45
- export declare type SearchFilters = {
45
+ export type SearchFilters = {
46
46
  [key: string]: SearchFilter;
47
47
  };
48
- export declare type SearchFilter = {
48
+ export type SearchFilter = {
49
49
  /** The content type id we will dynamically load entries from and load into state under the items[] */
50
50
  contentTypeId?: string | string[];
51
51
  /** An array of CustomWhereClause to include in the search query when dynamically loading entries via the contentTypeId key */
@@ -71,7 +71,7 @@ export declare type SearchFilter = {
71
71
  /** The title to render next to the filter */
72
72
  title: string;
73
73
  };
74
- export declare type FilterItem = {
74
+ export type FilterItem = {
75
75
  /** Whether the filter is in a selected state */
76
76
  isSelected?: boolean;
77
77
  /** This will usually be the entry id or the taxonomy key */
@@ -81,7 +81,7 @@ export declare type FilterItem = {
81
81
  /** The title to render next to the filter item */
82
82
  title: string;
83
83
  };
84
- export declare type FeaturedResults = {
84
+ export type FeaturedResults = {
85
85
  /** If the featured results are flagged with a certain field value, specify the fieldId containing the flagged value */
86
86
  fieldId?: string | string[];
87
87
  /** If the featured results are flagged with a certain field value, specify the value in the flagged fieldId */
@@ -91,7 +91,7 @@ export declare type FeaturedResults = {
91
91
  /** The number of featured results to retrieve */
92
92
  count?: number;
93
93
  };
94
- export declare type SearchQueryParams = {
94
+ export type SearchQueryParams = {
95
95
  /** An array of assetTypes to search over (sys.dataFormat == 'asset'); Prefix an entry with a "!" to exclude that asset type from the search */
96
96
  assetTypes?: string[];
97
97
  /** An array of contentTypeIds to search over (sys.dataFormat == 'entry'); Prefix an entry with a "!" to exclude that content type from the search */
@@ -112,6 +112,8 @@ export declare type SearchQueryParams = {
112
112
  linkDepth?: number;
113
113
  /** Alters the pagination style to retain previously loaded pages of results after loading next pages */
114
114
  loadMorePaging?: boolean;
115
+ /** A list of fields to omit from the default search fields that are added to weightedSearchFields */
116
+ omitDefaultSearchFields?: string[];
115
117
  /** An array of orderBy expressions to add to the search query */
116
118
  orderBy?: string[];
117
119
  /** The number of items returned per page in the search */
@@ -123,7 +125,7 @@ export declare type SearchQueryParams = {
123
125
  /** An array of WeightedSearchField to include in the search query */
124
126
  weightedSearchFields?: WeightedSearchField[];
125
127
  };
126
- export declare type WhereClause = {
128
+ export type WhereClause = {
127
129
  /** The field we wish to query */
128
130
  field: string;
129
131
  /** The value we want to evaluate with the chosen operator */
@@ -132,14 +134,14 @@ export declare type WhereClause = {
132
134
  /**
133
135
  * N.B. This shares syntax with adding where operators to a search query when using the Delivery API via HTTP, and should be used sparingly for exceptional cases where the standard query falls short
134
136
  */
135
- export declare type CustomWhereClause = (WhereClause | {
137
+ export type CustomWhereClause = (WhereClause | {
136
138
  not: WhereClause;
137
139
  } | {
138
140
  and: WhereClause[];
139
141
  } | {
140
142
  or: WhereClause[];
141
143
  })[];
142
- export declare type WeightedSearchField = {
144
+ export type WeightedSearchField = {
143
145
  /** The id of the field to query against */
144
146
  fieldId: string;
145
147
  /** The weighting applied to the field */
@@ -150,7 +152,7 @@ export declare type WeightedSearchField = {
150
152
  *
151
153
  * You need to provide a search configuration to the reducer so the initialState for your search can be set, this tells the package what you need your search to do, and where to get its data from.
152
154
  */
153
- export declare type SearchConfig = {
155
+ export type SearchConfig = {
154
156
  /** An object with a key for each facet that is required for the search */
155
157
  facets: {
156
158
  [key: string]: SearchFacet;
@@ -166,7 +168,7 @@ export declare type SearchConfig = {
166
168
  /** An Array of Tabs */
167
169
  tabs: Tab[];
168
170
  };
169
- export declare type ConfigTypes = {
171
+ export type ConfigTypes = {
170
172
  [key: string]: SearchFacet;
171
173
  } | {
172
174
  [key: string]: Listing;
@@ -174,15 +176,15 @@ export declare type ConfigTypes = {
174
176
  /**
175
177
  * Type your mapper for mapping API responses (entries) into usable props for your components to render
176
178
  */
177
- export declare type SearchResultsMapper<Target = any, Source = Entry> = (entries: Source[], facet?: string, context?: Context, state?: AppState) => Target[];
179
+ export type SearchResultsMapper<Target = any, Source = Entry> = (entries: Source[], facet?: string, context?: Context, state?: AppState) => Target[];
178
180
  /**
179
181
  * Type your custom filter item mapping function with this to ensure correctly typed FilterItems are returned to work with search functions
180
182
  */
181
- export declare type FilterItemsMapper<T = Entry> = (entries: T[]) => FilterItem[];
183
+ export type FilterItemsMapper<T = Entry> = (entries: T[]) => FilterItem[];
182
184
  /**
183
185
  * The uri object type we need to return from the Navigate mapper after any search action has been called
184
186
  */
185
- export declare type NavigateUri = {
187
+ export type NavigateUri = {
186
188
  path: string;
187
189
  search: string;
188
190
  hash: string;
@@ -190,11 +192,11 @@ export declare type NavigateUri = {
190
192
  /**
191
193
  * Type your jsonpath-mapper mapping template with this to map your next search uri to your custom uri structure after calling any search action
192
194
  */
193
- export declare type SearchUriMapping = MappingTemplate<SearchStateParams>;
195
+ export type SearchUriMapping = MappingTemplate<SearchStateParams>;
194
196
  /**
195
197
  * Type the argument passed to the Navigate mapper, this provides the relevant keys and data available to manipulate and return the next uri after any search action has been called
196
198
  */
197
- export declare type SearchStateParams = {
199
+ export type SearchStateParams = {
198
200
  state: AppState;
199
201
  facet?: string;
200
202
  orderBy?: string;
@@ -203,15 +205,15 @@ export declare type SearchStateParams = {
203
205
  term?: string;
204
206
  };
205
207
  /** Type your Navigate mapper with this, the Navigate mapper is called after any search action has been called and is required to return the next uri to be parsed by your project's route configuration and provide the right uri parameters to drive the next search query and resulting state */
206
- export declare type NavigateMapper = ({ state, facet, orderBy, pageIndex, pageSize, term, }: SearchStateParams) => NavigateUri;
208
+ export type NavigateMapper = ({ state, facet, orderBy, pageIndex, pageSize, term, }: SearchStateParams) => NavigateUri;
207
209
  /** Type your Results Info mapper with this, remember "resultsInfo" prop is a custom object you define yourself - you can provide any keys you wish, conveying detailed messaging or UX tweaks to cover all kinds of scenarios based on data in the search state at that time */
208
- export declare type ResultsInfoMapper<T = any> = (state: AppState) => T;
210
+ export type ResultsInfoMapper<T = any> = (state: AppState) => T;
209
211
  /** Experimental**: If you are trying to use the custom API feature you can add specific keys to the resultant querystring that for the custom API GET request */
210
- export declare type CustomApiParamsMapper = (queryParams: SearchQueryParams) => {
212
+ export type CustomApiParamsMapper = (queryParams: SearchQueryParams) => {
211
213
  [key: string]: string;
212
214
  };
213
215
  /** Type your Mappers object with this type to provide a accurate, type-safe "mapper" argument to your search implementation */
214
- export declare type Mappers = {
216
+ export type Mappers = {
215
217
  customApi?: CustomApiParamsMapper;
216
218
  results: SearchResultsMapper;
217
219
  filterItems?: FilterItemsMapper;
@@ -219,4 +221,4 @@ export declare type Mappers = {
219
221
  resultsInfo?: ResultsInfoMapper;
220
222
  };
221
223
  /** SearchTransformations is just an alias for Mappers object / argument */
222
- export declare type SearchTransformations = Mappers;
224
+ export type SearchTransformations = Mappers;