@daffodil/search-product 0.88.1 → 0.90.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 (96) hide show
  1. package/driver/in-memory/index.d.ts +15 -1
  2. package/driver/index.d.ts +25 -1
  3. package/driver/magento/index.d.ts +102 -1
  4. package/driver/testing/index.d.ts +15 -1
  5. package/fesm2022/daffodil-search-product-driver-in-memory.mjs +7 -7
  6. package/fesm2022/daffodil-search-product-driver-in-memory.mjs.map +1 -1
  7. package/fesm2022/daffodil-search-product-driver-magento.mjs +15 -15
  8. package/fesm2022/daffodil-search-product-driver-magento.mjs.map +1 -1
  9. package/fesm2022/daffodil-search-product-driver-testing.mjs +4 -4
  10. package/fesm2022/daffodil-search-product-driver-testing.mjs.map +1 -1
  11. package/fesm2022/daffodil-search-product-routing.mjs +7 -7
  12. package/fesm2022/daffodil-search-product-routing.mjs.map +1 -1
  13. package/fesm2022/daffodil-search-product-state-testing.mjs +7 -7
  14. package/fesm2022/daffodil-search-product-state-testing.mjs.map +1 -1
  15. package/fesm2022/daffodil-search-product-state.mjs +24 -24
  16. package/fesm2022/daffodil-search-product-state.mjs.map +1 -1
  17. package/fesm2022/daffodil-search-product-testing.mjs +7 -7
  18. package/fesm2022/daffodil-search-product-testing.mjs.map +1 -1
  19. package/fesm2022/daffodil-search-product.mjs.map +1 -1
  20. package/index.d.ts +22 -1
  21. package/package.json +1 -1
  22. package/routing/index.d.ts +12 -1
  23. package/state/index.d.ts +249 -1
  24. package/state/testing/index.d.ts +31 -1
  25. package/testing/index.d.ts +26 -1
  26. package/constants/public_api.d.ts +0 -1
  27. package/constants/search-result-kind.d.ts +0 -5
  28. package/driver/in-memory/backend/search.service.d.ts +0 -36
  29. package/driver/in-memory/in-memory.module.d.ts +0 -12
  30. package/driver/in-memory/public_api.d.ts +0 -1
  31. package/driver/interfaces/options.interface.d.ts +0 -4
  32. package/driver/interfaces/public_api.d.ts +0 -3
  33. package/driver/interfaces/response.interface.d.ts +0 -6
  34. package/driver/interfaces/search-product-service.interface.d.ts +0 -16
  35. package/driver/magento/core.module.d.ts +0 -10
  36. package/driver/magento/driver.module.d.ts +0 -13
  37. package/driver/magento/errors/map.d.ts +0 -6
  38. package/driver/magento/errors/transform.d.ts +0 -13
  39. package/driver/magento/federated-driver.module.d.ts +0 -20
  40. package/driver/magento/models/incremental-response.interface.d.ts +0 -9
  41. package/driver/magento/models/public_api.d.ts +0 -2
  42. package/driver/magento/models/search-response.interface.d.ts +0 -13
  43. package/driver/magento/product-search.service.d.ts +0 -29
  44. package/driver/magento/public_api.d.ts +0 -6
  45. package/driver/magento/queries/fragments/product-result.d.ts +0 -1
  46. package/driver/magento/queries/fragments/public_api.d.ts +0 -1
  47. package/driver/magento/queries/product-incremental.d.ts +0 -3
  48. package/driver/magento/queries/product-search.d.ts +0 -3
  49. package/driver/magento/queries/public_api.d.ts +0 -3
  50. package/driver/public_api.d.ts +0 -1
  51. package/driver/testing/public_api.d.ts +0 -1
  52. package/driver/testing/testing.module.d.ts +0 -12
  53. package/models/product-search-result.type.d.ts +0 -9
  54. package/models/public_api.d.ts +0 -1
  55. package/public_api.d.ts +0 -3
  56. package/routing/effects/collection-route.effects.d.ts +0 -10
  57. package/routing/module.d.ts +0 -9
  58. package/routing/public_api.d.ts +0 -1
  59. package/state/actions/product-collection.actions.d.ts +0 -95
  60. package/state/core.module.d.ts +0 -9
  61. package/state/effects/collection.effects.d.ts +0 -29
  62. package/state/facades/collection/facade.d.ts +0 -9
  63. package/state/facades/public_api.d.ts +0 -5
  64. package/state/facades/search/incremental.facade.d.ts +0 -15
  65. package/state/facades/search/page.facade.d.ts +0 -15
  66. package/state/facades/search/search-facade.interface.d.ts +0 -13
  67. package/state/facades/search/search.facade.d.ts +0 -15
  68. package/state/page.module.d.ts +0 -9
  69. package/state/public_api.d.ts +0 -6
  70. package/state/reducers/collection/public_api.d.ts +0 -3
  71. package/state/reducers/collection/reducer.d.ts +0 -4
  72. package/state/reducers/collection/search-reducers.d.ts +0 -3
  73. package/state/reducers/collection/search.reducer.d.ts +0 -6
  74. package/state/reducers/product/entities.reducer.d.ts +0 -7
  75. package/state/reducers/product/public_api.d.ts +0 -2
  76. package/state/reducers/product/reducers.d.ts +0 -3
  77. package/state/reducers/public_api.d.ts +0 -5
  78. package/state/reducers/reducers.d.ts +0 -6
  79. package/state/reducers/reducers.interface.d.ts +0 -16
  80. package/state/reducers/store-feature-key.d.ts +0 -4
  81. package/state/selectors/collection/selectors.d.ts +0 -3
  82. package/state/selectors/incremental/selectors.d.ts +0 -2
  83. package/state/selectors/page/selectors.d.ts +0 -2
  84. package/state/selectors/public_api.d.ts +0 -5
  85. package/state/selectors/search-feature.selector.d.ts +0 -9
  86. package/state/selectors/search.selector.d.ts +0 -23
  87. package/state/state.module.d.ts +0 -7
  88. package/state/testing/mock-search-facade.d.ts +0 -19
  89. package/state/testing/public_api.d.ts +0 -2
  90. package/state/testing/testing.module.d.ts +0 -9
  91. package/testing/factories/product-search-result.factory.d.ts +0 -14
  92. package/testing/factories/public_api.d.ts +0 -1
  93. package/testing/public_api.d.ts +0 -2
  94. package/testing/testing.module.d.ts +0 -9
  95. package/transforms/products-to-result.d.ts +0 -6
  96. package/transforms/public_api.d.ts +0 -1
package/state/index.d.ts CHANGED
@@ -1 +1,249 @@
1
- export * from './public_api';
1
+ import * as i1 from '@ngrx/store';
2
+ import { ActionReducerMap, MemoizedSelector, Action, Store } from '@ngrx/store';
3
+ import { DaffCollectionMetadata, DaffFilterRequest, DaffFilterToggleRequest, DaffCollectionRequest } from '@daffodil/core';
4
+ import * as i2 from '@daffodil/product/state';
5
+ import { DaffProductStateRootSlice, DaffProductReducersState } from '@daffodil/product/state';
6
+ import * as _daffodil_search_state from '@daffodil/search/state';
7
+ import { DaffSearchStateRootSlice, DaffSearchReducerState, DaffSearchReducersState, DaffSearchActions, DaffSearchSelectors } from '@daffodil/search/state';
8
+ import * as _daffodil_search from '@daffodil/search';
9
+ import { DaffCollectionReplaceFilters, DaffCollectionApplyFilters, DaffCollectionRemoveFilters, DaffCollectionClearFilters, DaffCollectionToggleFilter, DaffCollectionChangePageSize, DaffCollectionChangeCurrentPage, DaffCollectionChangeSortingOption, DaffCollectionMemoizedSelectors, DaffStoreFacade, DaffCollectionFacade, DaffCollectionFacadeInterface } from '@daffodil/core/state';
10
+ import { EntityState, Dictionary } from '@ngrx/entity';
11
+ import { DaffSearchProductResult } from '@daffodil/search-product';
12
+ import { DaffProduct } from '@daffodil/product';
13
+ import { Observable } from 'rxjs';
14
+ import * as i0 from '@angular/core';
15
+ import * as i3 from '@ngrx/effects';
16
+
17
+ /**
18
+ * The key under which the search feature state will be stored.
19
+ */
20
+ declare const DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY = "daffSearchProduct";
21
+
22
+ /**
23
+ * The feature state for search.
24
+ */
25
+ interface DaffSearchProductReducersState {
26
+ productCollection: DaffCollectionMetadata;
27
+ }
28
+ /**
29
+ * The footprint of search feature state in the root application state.
30
+ */
31
+ interface DaffSearchProductStateRootSlice extends DaffSearchStateRootSlice, DaffProductStateRootSlice {
32
+ [DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY]: DaffSearchProductReducersState;
33
+ }
34
+
35
+ /**
36
+ * The reducers for the entire search feature state.
37
+ */
38
+ declare const daffSearchProductReducers: ActionReducerMap<DaffSearchProductReducersState>;
39
+
40
+ /**
41
+ * The search action types enum.
42
+ */
43
+ declare enum DaffSearchProductCollectionActionTypes {
44
+ SearchProductReplaceFiltersAction = "[@daffodil/search-product] Search Product Replace Filters Action",
45
+ SearchProductApplyFiltersAction = "[@daffodil/search-product] Search Product Apply Filters Action",
46
+ SearchProductRemoveFiltersAction = "[@daffodil/search-product] Search Product Remove Filters Action",
47
+ SearchProductClearFiltersAction = "[@daffodil/search-product] Search Product Clear Filters Action",
48
+ SearchProductToggleFiltersAction = "[@daffodil/search-product] Search Product Toggle Filters Action",
49
+ SearchProductChangePageSizeAction = "[@daffodil/search-product] Search Product Change Page Size Action",
50
+ SearchProductChangeCurrentPageAction = "[@daffodil/search-product] Search Product Change Current Page Action",
51
+ SearchProductChangeSortingOptionAction = "[@daffodil/search-product] Search Product Change Sorting Option Action"
52
+ }
53
+ /**
54
+ * @inheritdoc
55
+ * @role action
56
+ */
57
+ declare class DaffSearchProductCollectionReplaceFilters implements DaffCollectionReplaceFilters {
58
+ filters: DaffFilterRequest[];
59
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductReplaceFiltersAction;
60
+ constructor(filters: DaffFilterRequest[]);
61
+ }
62
+ /**
63
+ * @inheritdoc
64
+ * @role action
65
+ */
66
+ declare class DaffSearchProductCollectionApplyFilters implements DaffCollectionApplyFilters {
67
+ filters: DaffFilterRequest[];
68
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductApplyFiltersAction;
69
+ constructor(filters: DaffFilterRequest[]);
70
+ }
71
+ /**
72
+ * @inheritdoc
73
+ * @role action
74
+ */
75
+ declare class DaffSearchProductCollectionRemoveFilters implements DaffCollectionRemoveFilters {
76
+ filters: DaffFilterRequest[];
77
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductRemoveFiltersAction;
78
+ constructor(filters: DaffFilterRequest[]);
79
+ }
80
+ /**
81
+ * @inheritdoc
82
+ * @role action
83
+ */
84
+ declare class DaffSearchProductCollectionClearFilters implements DaffCollectionClearFilters {
85
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductClearFiltersAction;
86
+ }
87
+ /**
88
+ * @inheritdoc
89
+ * @role action
90
+ */
91
+ declare class DaffSearchProductCollectionToggleFilter implements DaffCollectionToggleFilter {
92
+ filter: DaffFilterToggleRequest;
93
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductToggleFiltersAction;
94
+ constructor(filter: DaffFilterToggleRequest);
95
+ }
96
+ /**
97
+ * @inheritdoc
98
+ * @role action
99
+ */
100
+ declare class DaffSearchProductCollectionChangePageSize implements DaffCollectionChangePageSize {
101
+ pageSize: number;
102
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangePageSizeAction;
103
+ constructor(pageSize: number);
104
+ }
105
+ /**
106
+ * @inheritdoc
107
+ * @role action
108
+ */
109
+ declare class DaffSearchProductCollectionChangeCurrentPage implements DaffCollectionChangeCurrentPage {
110
+ currentPage: number;
111
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeCurrentPageAction;
112
+ constructor(currentPage: number);
113
+ }
114
+ /**
115
+ * @inheritdoc
116
+ * @role action
117
+ */
118
+ declare class DaffSearchProductCollectionChangeSortingOption implements DaffCollectionChangeSortingOption {
119
+ sort: {
120
+ option: DaffCollectionRequest['appliedSortOption'];
121
+ direction: DaffCollectionRequest['appliedSortDirection'];
122
+ };
123
+ readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeSortingOptionAction;
124
+ constructor(sort: {
125
+ option: DaffCollectionRequest['appliedSortOption'];
126
+ direction: DaffCollectionRequest['appliedSortDirection'];
127
+ });
128
+ }
129
+ /**
130
+ * A union of the search product action types.
131
+ */
132
+ type DaffSearchProductCollectionActions = DaffSearchProductCollectionReplaceFilters | DaffSearchProductCollectionApplyFilters | DaffSearchProductCollectionRemoveFilters | DaffSearchProductCollectionClearFilters | DaffSearchProductCollectionToggleFilter | DaffSearchProductCollectionChangePageSize | DaffSearchProductCollectionChangeCurrentPage | DaffSearchProductCollectionChangeSortingOption;
133
+
134
+ /**
135
+ * The reducer for handling apply product filters actions in the main search state.
136
+ */
137
+ declare function daffSearchProductCollectionSearchReducer(state: DaffSearchReducerState<_daffodil_search.DaffSearchResult>, action: DaffSearchProductCollectionActions): DaffSearchReducerState;
138
+
139
+ declare const daffSearchProductCollectionSearchReducers: ActionReducerMap<DaffSearchReducersState>;
140
+
141
+ declare const daffSearchProductCollectionReducer: (state: DaffCollectionMetadata, action: DaffSearchActions | DaffSearchProductCollectionActions) => DaffCollectionMetadata;
142
+
143
+ /**
144
+ * Reducer function that catches actions and changes/overwrites search entities state.
145
+ */
146
+ declare function daffSearchProductEntitiesReducer<T extends DaffSearchProductResult = DaffSearchProductResult>(state: EntityState<T>, action: DaffSearchActions<T>): EntityState<T>;
147
+
148
+ declare const daffSearchProductProductReducers: ActionReducerMap<DaffProductReducersState>;
149
+
150
+ declare const getSearchProductCollectionSelectors: () => DaffCollectionMemoizedSelectors<DaffSearchProductStateRootSlice>;
151
+
152
+ /**
153
+ * Selectors for product results on a search page.
154
+ */
155
+ interface DaffSearchProductSelectors {
156
+ /**
157
+ * Select the product search result IDs from the main search state.
158
+ */
159
+ selectProductResultIds: MemoizedSelector<DaffSearchProductStateRootSlice, Array<DaffSearchProductResult['id']>>;
160
+ /**
161
+ * Select the product search results from the main product state.
162
+ */
163
+ selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, Array<DaffSearchProductResult>>;
164
+ }
165
+ declare const daffSearchProductCreateSelectors: (selectSearchResultIds: DaffSearchSelectors["selectSearchResultIds"]) => {
166
+ selectProductResultIds: MemoizedSelector<_daffodil_search_state.DaffSearchStateRootSlice<_daffodil_search.DaffSearchResult>, string[], (s1: Record<string, string[]>) => string[]>;
167
+ selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductResult[], (s_0: string[], s_1: Dictionary<DaffProduct>) => DaffSearchProductResult[]>;
168
+ };
169
+
170
+ declare const daffSearchProductGetPageSelectors: () => DaffSearchProductSelectors;
171
+
172
+ declare const daffSearchProductGetIncrementalSelectors: () => DaffSearchProductSelectors;
173
+
174
+ /**
175
+ * Selector for the search product feature state.
176
+ */
177
+ interface DaffSearchProductFeatureSelector {
178
+ selectSearchProductFeatureState: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductReducersState>;
179
+ }
180
+ declare const getDaffSearchProductReducersStateSelector: () => DaffSearchProductFeatureSelector;
181
+
182
+ /**
183
+ * Exposes the search state selectors.
184
+ */
185
+ interface DaffSearchProductFacadeInterface extends DaffStoreFacade<Action> {
186
+ /**
187
+ * The products returned in the most recent search.
188
+ */
189
+ productResults$: Observable<Array<DaffSearchProductResult>>;
190
+ }
191
+
192
+ /**
193
+ * @inheritdoc
194
+ */
195
+ declare abstract class DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
196
+ private store;
197
+ productResults$: Observable<Array<DaffSearchProductResult>>;
198
+ constructor(store: Store<DaffSearchProductStateRootSlice>, selectors: DaffSearchProductSelectors);
199
+ dispatch(action: Action): void;
200
+ }
201
+
202
+ /**
203
+ * @inheritdoc
204
+ *
205
+ * A facade for the normal search state.
206
+ */
207
+ declare class DaffSearchProductPageFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
208
+ constructor(store: Store<DaffSearchProductStateRootSlice>);
209
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageFacade, never>;
210
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductPageFacade>;
211
+ }
212
+
213
+ /**
214
+ * @inheritdoc
215
+ *
216
+ * A facade for the normal search state.
217
+ */
218
+ declare class DaffSearchProductIncrementalFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
219
+ constructor(store: Store<DaffSearchProductStateRootSlice>);
220
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductIncrementalFacade, never>;
221
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductIncrementalFacade>;
222
+ }
223
+
224
+ declare class DaffSearchProductCollectionFacade extends DaffCollectionFacade<DaffSearchProductStateRootSlice> implements DaffCollectionFacadeInterface {
225
+ constructor(store: Store<DaffSearchProductStateRootSlice>);
226
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductCollectionFacade, never>;
227
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductCollectionFacade>;
228
+ }
229
+
230
+ declare class DaffSearchProductStateCoreModule {
231
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateCoreModule, never>;
232
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateCoreModule, never, [typeof i1.StoreFeatureModule, typeof i2.DaffProductStateModule, typeof _daffodil_search_state.DaffSearchStateModule], never>;
233
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateCoreModule>;
234
+ }
235
+
236
+ declare class DaffSearchProductStateModule {
237
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateModule, never>;
238
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateModule, never, [typeof DaffSearchProductStateCoreModule], never>;
239
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateModule>;
240
+ }
241
+
242
+ declare class DaffSearchProductPageStateModule {
243
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageStateModule, never>;
244
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductPageStateModule, never, [typeof DaffSearchProductStateCoreModule, typeof _daffodil_search_state.DaffSearchPageStateModule, typeof i3.EffectsFeatureModule], never>;
245
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductPageStateModule>;
246
+ }
247
+
248
+ export { DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY, DaffSearchProductCollectionActionTypes, DaffSearchProductCollectionApplyFilters, DaffSearchProductCollectionChangeCurrentPage, DaffSearchProductCollectionChangePageSize, DaffSearchProductCollectionChangeSortingOption, DaffSearchProductCollectionClearFilters, DaffSearchProductCollectionFacade, DaffSearchProductCollectionRemoveFilters, DaffSearchProductCollectionReplaceFilters, DaffSearchProductCollectionToggleFilter, DaffSearchProductFacade, DaffSearchProductIncrementalFacade, DaffSearchProductPageFacade, DaffSearchProductPageStateModule, DaffSearchProductStateModule, daffSearchProductCollectionReducer, daffSearchProductCollectionSearchReducer, daffSearchProductCollectionSearchReducers, daffSearchProductCreateSelectors, daffSearchProductEntitiesReducer, daffSearchProductGetIncrementalSelectors, daffSearchProductGetPageSelectors, daffSearchProductProductReducers, daffSearchProductReducers, getDaffSearchProductReducersStateSelector, getSearchProductCollectionSelectors };
249
+ export type { DaffSearchProductCollectionActions, DaffSearchProductFacadeInterface, DaffSearchProductFeatureSelector, DaffSearchProductReducersState, DaffSearchProductSelectors, DaffSearchProductStateRootSlice };
@@ -1 +1,31 @@
1
- export * from './public_api';
1
+ import { Action } from '@ngrx/store';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { DaffFilters } from '@daffodil/core';
4
+ import { DaffSearchProductResult } from '@daffodil/search-product';
5
+ import { DaffSearchProductFacadeInterface } from '@daffodil/search-product/state';
6
+ import * as i0 from '@angular/core';
7
+
8
+ /**
9
+ * Mocks out facade fields and methods for testing purposes.
10
+ *
11
+ * @inheritdoc
12
+ */
13
+ declare class MockDaffSearchProductFacade implements DaffSearchProductFacadeInterface {
14
+ filters$: BehaviorSubject<DaffFilters>;
15
+ appliedFilters$: BehaviorSubject<DaffFilters>;
16
+ productResults$: BehaviorSubject<DaffSearchProductResult[]>;
17
+ dispatch(action: Action): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffSearchProductFacade, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffSearchProductFacade>;
20
+ }
21
+
22
+ /**
23
+ * Provides the {@link MockDaffSearchProductFacade} for {@link DaffSearchProductFacade}.
24
+ */
25
+ declare class DaffSearchProductStateTestingModule {
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateTestingModule, never>;
27
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateTestingModule, never, never, never>;
28
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateTestingModule>;
29
+ }
30
+
31
+ export { DaffSearchProductStateTestingModule, MockDaffSearchProductFacade };
@@ -1 +1,26 @@
1
- export * from './public_api';
1
+ import { DaffModelFactory } from '@daffodil/core/testing';
2
+ import { DaffProductKindFactory } from '@daffodil/product/testing';
3
+ import { DaffSearchProductResult } from '@daffodil/search-product';
4
+ import * as i0 from '@angular/core';
5
+
6
+ /**
7
+ * Factory for creating {@link DaffSearchProductResult}s.
8
+ */
9
+ declare class DaffSearchProductResultFactory extends DaffModelFactory<DaffSearchProductResult> {
10
+ private productKindFactory;
11
+ constructor(productKindFactory: DaffProductKindFactory);
12
+ create(partial?: {}): DaffSearchProductResult;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductResultFactory, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductResultFactory>;
15
+ }
16
+
17
+ /**
18
+ * Provides the default search result factory as a search result type factory.
19
+ */
20
+ declare class DaffSearchProductTestingModule {
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductTestingModule, never>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductTestingModule, never, never, never>;
23
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductTestingModule>;
24
+ }
25
+
26
+ export { DaffSearchProductResultFactory, DaffSearchProductTestingModule };
@@ -1 +0,0 @@
1
- export { DAFF_SEARCH_PRODUCT_RESULT_KIND } from './search-result-kind';
@@ -1,5 +0,0 @@
1
- import { DaffSearchResult } from '@daffodil/search';
2
- /**
3
- * The kind identifier for product search results.
4
- */
5
- export declare const DAFF_SEARCH_PRODUCT_RESULT_KIND: DaffSearchResult['kind'];
@@ -1,36 +0,0 @@
1
- import { InMemoryDbService, RequestInfoUtilities, ParsedRequestUrl, RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';
3
- import { DaffSearchInMemoryChildBackend } from '@daffodil/search/driver/in-memory';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * An in-memory service that stubs out the backend services for searching products.
7
- */
8
- export declare class DaffSearchProductInMemoryBackendService implements InMemoryDbService, DaffSearchInMemoryChildBackend {
9
- private productBackend;
10
- readonly kind: string;
11
- constructor(productBackend: DaffInMemoryBackendProductService);
12
- private matchProduct;
13
- /**
14
- * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
15
- *
16
- * @param url initial url
17
- * @param utils utility to parse url
18
- * @returns ParsedRequestUrl
19
- * @docs-private
20
- */
21
- parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
22
- /**
23
- * @docs-private
24
- */
25
- createDb(): any;
26
- /**
27
- * Searches the product in-memory backend with the query.
28
- * The search query is passed as the `query` URL query parameter.
29
- *
30
- * @param reqInfo request object
31
- * @returns An http response object
32
- */
33
- get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductInMemoryBackendService, never>;
35
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductInMemoryBackendService>;
36
- }
@@ -1,12 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- /**
5
- * Module for providing the {@link DaffSearchProductInMemoryBackendService} as a search in-memory child backend.
6
- */
7
- export declare class DaffSearchProductInMemoryDriverModule {
8
- static forRoot(): ModuleWithProviders<DaffSearchProductInMemoryDriverModule>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductInMemoryDriverModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductInMemoryDriverModule>;
12
- }
@@ -1 +0,0 @@
1
- export { DaffSearchProductInMemoryDriverModule } from './in-memory.module';
@@ -1,4 +0,0 @@
1
- import { DaffCollectionRequest } from '@daffodil/core';
2
- import { DaffSearchDriverOptions } from '@daffodil/search/driver';
3
- export interface DaffSearchProductDriverOptions extends DaffSearchDriverOptions, DaffCollectionRequest {
4
- }
@@ -1,3 +0,0 @@
1
- export { DaffSearchProductDriverInterface } from './search-product-service.interface';
2
- export { DaffSearchProductDriverResponse } from './response.interface';
3
- export { DaffSearchProductDriverOptions } from './options.interface';
@@ -1,6 +0,0 @@
1
- import { DaffCollectionMetadata } from '@daffodil/core';
2
- import { DaffSearchDriverResponse } from '@daffodil/search/driver';
3
- import { DaffSearchProductResult } from '@daffodil/search-product';
4
- export interface DaffSearchProductDriverResponse<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverResponse<T> {
5
- metadata: DaffCollectionMetadata;
6
- }
@@ -1,16 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffSearchResultCollection } from '@daffodil/search';
3
- import { DaffSearchDriverKindedInterface, DaffSearchDriverOptions } from '@daffodil/search/driver';
4
- import { DaffSearchProductResult, DAFF_SEARCH_PRODUCT_RESULT_KIND } from '@daffodil/search-product';
5
- import { DaffSearchProductDriverOptions } from './options.interface';
6
- import { DaffSearchProductDriverResponse } from './response.interface';
7
- /**
8
- * A driver interface for searching products.
9
- *
10
- * @inheritdoc
11
- */
12
- export interface DaffSearchProductDriverInterface<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverKindedInterface<T> {
13
- readonly kind: typeof DAFF_SEARCH_PRODUCT_RESULT_KIND;
14
- search(query: string, options?: DaffSearchProductDriverOptions): Observable<DaffSearchProductDriverResponse<T>>;
15
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection<T>>;
16
- }
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- /**
4
- * A module that provides product search query as a cacheable network operation.
5
- */
6
- export declare class DaffSearchProductMagentoCoreModule {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductMagentoCoreModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductMagentoCoreModule, never, [typeof i1.CommonModule], never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductMagentoCoreModule>;
10
- }
@@ -1,13 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- import * as i2 from "./core.module";
5
- export declare class DaffSearchProductMagentoDriverModule {
6
- /**
7
- * A module that provides the singleton of the product search Magento driver as the search driver.
8
- */
9
- static forRoot(): ModuleWithProviders<DaffSearchProductMagentoDriverModule>;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductMagentoDriverModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductMagentoDriverModule, never, [typeof i1.CommonModule, typeof i2.DaffSearchProductMagentoCoreModule], never>;
12
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductMagentoDriverModule>;
13
- }
@@ -1,6 +0,0 @@
1
- export declare const MagentoSearchProductErrorMap: {
2
- DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS: typeof import("@daffodil/core").DaffCollectionPageOutOfBoundsError;
3
- };
4
- export declare const MagentoSearchProductErrorMessageRegexMap: {
5
- DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS: RegExp;
6
- };
@@ -1,13 +0,0 @@
1
- import { GraphQLFormattedError } from 'graphql';
2
- import { DaffError } from '@daffodil/core';
3
- /**
4
- * Transforms a single GraphQL error.
5
- * Optionally accepts a request payload which can be used in certain cases
6
- * to add supplemental info to the error.
7
- */
8
- export declare function transformMagentoSearchProductGraphQlError(error: GraphQLFormattedError, requestPayload?: unknown): DaffError;
9
- /**
10
- * Transforms only the first GraphQL error with the cart magento error transformer,
11
- * otherwise falls back to a standard Magento error transform.
12
- */
13
- export declare function transformSearchProductMagentoError(error: any, requestPayload?: unknown): DaffError;
@@ -1,20 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- import * as i2 from "./core.module";
5
- /**
6
- * A module that provides product search query as a cacheable network operation.
7
- */
8
- export declare class DaffSearchProductMagentoFederatedDriverModule {
9
- /**
10
- * A module that provides the singleton of the product search Magento driver as a federated driver.
11
- */
12
- static forRoot(): ModuleWithProviders<DaffSearchProductMagentoFederatedDriverModule>;
13
- /**
14
- * A module that provides a new instance of the product search Magento driver as a federated driver.
15
- */
16
- static forFeature(): ModuleWithProviders<DaffSearchProductMagentoFederatedDriverModule>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductMagentoFederatedDriverModule, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductMagentoFederatedDriverModule, never, [typeof i1.CommonModule, typeof i2.DaffSearchProductMagentoCoreModule], never>;
19
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductMagentoFederatedDriverModule>;
20
- }
@@ -1,9 +0,0 @@
1
- import { MagentoProduct } from '@daffodil/product/driver/magento';
2
- export interface MagentoSearchProductIncrementalResponse {
3
- __typename?: string;
4
- products: {
5
- __typename?: string;
6
- items: MagentoProduct[];
7
- total_count: number;
8
- };
9
- }
@@ -1,2 +0,0 @@
1
- export { MagentoSearchForProductsResponse } from './search-response.interface';
2
- export { MagentoSearchProductIncrementalResponse } from './incremental-response.interface';
@@ -1,13 +0,0 @@
1
- import { MagentoSearchResultPageInfo } from '@daffodil/driver/magento';
2
- import { MagentoAggregation, MagentoProduct, MagentoProductSortFields } from '@daffodil/product/driver/magento';
3
- export interface MagentoSearchForProductsResponse {
4
- __typename?: string;
5
- products: {
6
- __typename?: string;
7
- items: MagentoProduct[];
8
- page_info: MagentoSearchResultPageInfo;
9
- aggregations: MagentoAggregation[];
10
- sort_fields: MagentoProductSortFields;
11
- total_count: number;
12
- };
13
- }
@@ -1,29 +0,0 @@
1
- import { Apollo } from 'apollo-angular';
2
- import { DocumentNode } from 'graphql';
3
- import { Observable } from 'rxjs';
4
- import { MagentoProductAppliedFiltersTransformService, DaffMagentoProductsTransformer, DaffProductMagentoDriverConfig, DaffMagentoProductTransform } from '@daffodil/product/driver/magento';
5
- import { DaffSearchResultCollection } from '@daffodil/search';
6
- import { DaffSearchProductResult } from '@daffodil/search-product';
7
- import { DaffSearchProductDriverInterface, DaffSearchProductDriverOptions, DaffSearchProductDriverResponse } from '@daffodil/search-product/driver';
8
- import * as i0 from "@angular/core";
9
- /**
10
- * A service for searching products in Magento.
11
- *
12
- * @inheritdoc
13
- */
14
- export declare class DaffSearchProductMagentoDriver implements DaffSearchProductDriverInterface {
15
- private apollo;
16
- private productFilterRequestsTransformer;
17
- private extraFragments;
18
- private extraPreviewFragments;
19
- private magentoProductsTransformers;
20
- private config;
21
- private magentoProductsTransform;
22
- constructor(apollo: Apollo, productFilterRequestsTransformer: MagentoProductAppliedFiltersTransformService, extraFragments: DocumentNode[], extraPreviewFragments: DocumentNode[], magentoProductsTransformers: DaffMagentoProductsTransformer, config: DaffProductMagentoDriverConfig, magentoProductsTransform: DaffMagentoProductTransform);
23
- readonly kind: string;
24
- private getVariables;
25
- search(query: string, options?: DaffSearchProductDriverOptions): Observable<DaffSearchProductDriverResponse>;
26
- incremental(query: string, options?: DaffSearchProductDriverOptions): Observable<DaffSearchResultCollection<DaffSearchProductResult>>;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductMagentoDriver, never>;
28
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductMagentoDriver>;
29
- }
@@ -1,6 +0,0 @@
1
- export { DaffSearchProductMagentoDriverModule } from './driver.module';
2
- export { DaffSearchProductMagentoFederatedDriverModule } from './federated-driver.module';
3
- export type { DaffSearchProductMagentoCoreModule } from './core.module';
4
- export * from './models/public_api';
5
- export * from './queries/public_api';
6
- export * from './product-search.service';
@@ -1 +0,0 @@
1
- export declare const magentoProductSearchResultFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1 +0,0 @@
1
- export * from './product-result';
@@ -1,3 +0,0 @@
1
- import { DocumentNode } from 'graphql';
2
- export declare const DAFF_SEARCH_PRODUCT_MAGENTO_INCREMENTAL_QUERY_NAME = "MagentoIncrementalSearchForProducts";
3
- export declare const daffSearchProductIncrementalQuery: (extraProductFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,3 +0,0 @@
1
- import { DocumentNode } from 'graphql';
2
- export declare const DAFF_MAGENTO_SEARCH_FOR_PRODUCTS_QUERY_NAME = "MagentoSearchForProducts";
3
- export declare const productSearch: (extraProductFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,3 +0,0 @@
1
- export * from './product-incremental';
2
- export * from './product-search';
3
- export * from './fragments/public_api';
@@ -1 +0,0 @@
1
- export * from './interfaces/public_api';
@@ -1 +0,0 @@
1
- export { DaffSearchProductTestingDriverModule } from './testing.module';
@@ -1,12 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- /**
5
- * Module for providing the product search result factory as a search result kind factory.
6
- */
7
- export declare class DaffSearchProductTestingDriverModule {
8
- static forRoot(): ModuleWithProviders<DaffSearchProductTestingDriverModule>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductTestingDriverModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductTestingDriverModule, never, [typeof i1.CommonModule], never>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductTestingDriverModule>;
12
- }
@@ -1,9 +0,0 @@
1
- import { DaffProduct } from '@daffodil/product';
2
- import { DaffSearchResult } from '@daffodil/search';
3
- import { DAFF_SEARCH_PRODUCT_RESULT_KIND } from '../constants/public_api';
4
- /**
5
- * An extension of a {@link DaffSearchResult} for products.
6
- */
7
- export type DaffSearchProductResult<T extends DaffProduct = DaffProduct> = DaffSearchResult & T & {
8
- kind: typeof DAFF_SEARCH_PRODUCT_RESULT_KIND;
9
- };
@@ -1 +0,0 @@
1
- export { DaffSearchProductResult } from './product-search-result.type';
package/public_api.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './models/public_api';
2
- export * from './constants/public_api';
3
- export * from './transforms/public_api';
@@ -1,10 +0,0 @@
1
- import { ActivatedRoute, Router } from '@angular/router';
2
- import { Actions } from '@ngrx/effects';
3
- import { DaffProductGetQueryParamsFromRequest, DaffProductRoutingCollectionEffects } from '@daffodil/product/routing';
4
- import { DaffSearchProductCollectionFacade } from '@daffodil/search-product/state';
5
- import * as i0 from "@angular/core";
6
- export declare class DaffSearchProductRoutingCollectionEffects extends DaffProductRoutingCollectionEffects {
7
- constructor(actions$: Actions, router: Router, collectionFacade: DaffSearchProductCollectionFacade, getQueryParams: DaffProductGetQueryParamsFromRequest, route: ActivatedRoute);
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductRoutingCollectionEffects, never>;
9
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductRoutingCollectionEffects>;
10
- }
@@ -1,9 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@daffodil/product/routing";
3
- import * as i2 from "@daffodil/search/routing";
4
- import * as i3 from "@ngrx/effects";
5
- export declare class DaffSearchProductRoutingModule {
6
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductRoutingModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductRoutingModule, never, [typeof i1.DaffProductRoutingModule, typeof i2.DaffSearchRoutingModule, typeof i3.EffectsFeatureModule], never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductRoutingModule>;
9
- }