@shopgate/pwa-common-commerce 7.34.0-beta.1 → 7.34.0-beta.2

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 (106) hide show
  1. package/filter/actions/helpers/buildRequestFilters.d.ts +9 -0
  2. package/filter/actions/helpers/buildRequestFilters.d.ts.map +1 -0
  3. package/filter/constants/Pipelines.d.ts +2 -0
  4. package/filter/constants/Pipelines.d.ts.map +1 -0
  5. package/filter/selectors/index.d.ts +42 -0
  6. package/filter/selectors/index.d.ts.map +1 -0
  7. package/package.json +3 -3
  8. package/product/constants/Pipelines.d.ts +13 -0
  9. package/product/constants/Pipelines.d.ts.map +1 -0
  10. package/product/constants/index.d.ts +67 -0
  11. package/product/constants/index.d.ts.map +1 -0
  12. package/product/helpers/index.d.ts +5 -0
  13. package/product/helpers/index.d.ts.map +1 -0
  14. package/product/selectors/product.d.ts +513 -0
  15. package/product/selectors/product.d.ts.map +1 -0
  16. package/reviews/action-creators/errorProductReviews.d.ts +19 -0
  17. package/reviews/action-creators/errorProductReviews.d.ts.map +1 -0
  18. package/reviews/action-creators/errorProductReviews.js +5 -4
  19. package/reviews/action-creators/errorReviews.d.ts +19 -0
  20. package/reviews/action-creators/errorReviews.d.ts.map +1 -0
  21. package/reviews/action-creators/errorReviews.js +5 -4
  22. package/reviews/action-creators/receiveProductReviews.d.ts +25 -0
  23. package/reviews/action-creators/receiveProductReviews.d.ts.map +1 -0
  24. package/reviews/action-creators/receiveProductReviews.js +10 -7
  25. package/reviews/action-creators/receiveReviewVote.d.ts +18 -0
  26. package/reviews/action-creators/receiveReviewVote.d.ts.map +1 -0
  27. package/reviews/action-creators/receiveReviewVote.js +15 -0
  28. package/reviews/action-creators/receiveReviews.d.ts +29 -0
  29. package/reviews/action-creators/receiveReviews.d.ts.map +1 -0
  30. package/reviews/action-creators/receiveReviews.js +13 -8
  31. package/reviews/action-creators/requestProductReviews.d.ts +21 -0
  32. package/reviews/action-creators/requestProductReviews.d.ts.map +1 -0
  33. package/reviews/action-creators/requestProductReviews.js +6 -5
  34. package/reviews/action-creators/requestReviews.d.ts +19 -0
  35. package/reviews/action-creators/requestReviews.d.ts.map +1 -0
  36. package/reviews/action-creators/requestReviews.js +5 -4
  37. package/reviews/action-creators/reviewSettings.d.ts +31 -0
  38. package/reviews/action-creators/reviewSettings.d.ts.map +1 -0
  39. package/reviews/action-creators/reviewSettings.js +28 -0
  40. package/reviews/actions/fetchProductReviewSettings.d.ts +5 -0
  41. package/reviews/actions/fetchProductReviewSettings.d.ts.map +1 -0
  42. package/reviews/actions/fetchProductReviewSettings.js +25 -0
  43. package/reviews/actions/fetchProductReviews.d.ts +17 -0
  44. package/reviews/actions/fetchProductReviews.d.ts.map +1 -0
  45. package/reviews/actions/fetchProductReviews.js +17 -9
  46. package/reviews/actions/fetchReviews.d.ts +22 -0
  47. package/reviews/actions/fetchReviews.d.ts.map +1 -0
  48. package/reviews/actions/fetchReviews.js +48 -14
  49. package/reviews/actions/submitReviewVote.d.ts +15 -0
  50. package/reviews/actions/submitReviewVote.d.ts.map +1 -0
  51. package/reviews/actions/submitReviewVote.js +46 -0
  52. package/reviews/constants/Pipelines.d.ts +7 -0
  53. package/reviews/constants/Pipelines.d.ts.map +1 -0
  54. package/reviews/constants/Pipelines.js +3 -1
  55. package/reviews/constants/index.d.ts +47 -0
  56. package/reviews/constants/index.d.ts.map +1 -0
  57. package/reviews/constants/index.js +43 -1
  58. package/reviews/helpers/filters.d.ts +16 -0
  59. package/reviews/helpers/filters.d.ts.map +1 -0
  60. package/reviews/helpers/filters.js +36 -0
  61. package/reviews/helpers/summary.d.ts +8 -0
  62. package/reviews/helpers/summary.d.ts.map +1 -0
  63. package/reviews/helpers/summary.js +55 -0
  64. package/reviews/index.js +1 -0
  65. package/reviews/reducers/index.js +5 -1
  66. package/reviews/reducers/ownReviewVotes.d.ts +13 -0
  67. package/reviews/reducers/ownReviewVotes.d.ts.map +1 -0
  68. package/reviews/reducers/ownReviewVotes.js +23 -0
  69. package/reviews/reducers/reviewSettings.d.ts +13 -0
  70. package/reviews/reducers/reviewSettings.d.ts.map +1 -0
  71. package/reviews/reducers/reviewSettings.js +33 -0
  72. package/reviews/reducers/reviewSummariesByProductId.d.ts +18 -0
  73. package/reviews/reducers/reviewSummariesByProductId.d.ts.map +1 -0
  74. package/reviews/reducers/reviewSummariesByProductId.js +27 -0
  75. package/reviews/reducers/reviewsByHash.d.ts +25 -0
  76. package/reviews/reducers/reviewsByHash.d.ts.map +1 -0
  77. package/reviews/reducers/reviewsByHash.js +70 -27
  78. package/reviews/reducers/reviewsById.d.ts +20 -0
  79. package/reviews/reducers/reviewsById.d.ts.map +1 -0
  80. package/reviews/reducers/reviewsById.js +23 -7
  81. package/reviews/reducers/reviewsByProductId.d.ts +23 -0
  82. package/reviews/reducers/reviewsByProductId.d.ts.map +1 -0
  83. package/reviews/reducers/reviewsByProductId.js +38 -23
  84. package/reviews/selectors/index.d.ts +278 -0
  85. package/reviews/selectors/index.d.ts.map +1 -0
  86. package/reviews/selectors/index.js +167 -56
  87. package/reviews/selectors/ownReviewVotes.d.ts +9 -0
  88. package/reviews/selectors/ownReviewVotes.d.ts.map +1 -0
  89. package/reviews/selectors/ownReviewVotes.js +7 -0
  90. package/reviews/selectors/reviewSettings.d.ts +63 -0
  91. package/reviews/selectors/reviewSettings.d.ts.map +1 -0
  92. package/reviews/selectors/reviewSettings.js +40 -0
  93. package/reviews/selectors/reviewSummary.d.ts +18 -0
  94. package/reviews/selectors/reviewSummary.d.ts.map +1 -0
  95. package/reviews/selectors/reviewSummary.js +45 -0
  96. package/reviews/streams/index.js +19 -1
  97. package/reviews/subscriptions/index.js +14 -1
  98. package/reviews/types/reviewSettings.d.ts +31 -0
  99. package/reviews/types/reviewSettings.d.ts.map +1 -0
  100. package/reviews/types/reviewSettings.js +1 -0
  101. package/reviews/types/reviewSummary.d.ts +16 -0
  102. package/reviews/types/reviewSummary.d.ts.map +1 -0
  103. package/reviews/types/reviewSummary.js +1 -0
  104. package/reviews/types/reviews.d.ts +190 -0
  105. package/reviews/types/reviews.d.ts.map +1 -0
  106. package/reviews/types/reviews.js +1 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,190 @@
1
+ import type { ReviewSettingsSliceState } from './reviewSettings';
2
+ import type { ReviewSummary } from './reviewSummary';
3
+ export type ReviewId = string | number;
4
+ /**
5
+ * A reply of the merchant to a product review.
6
+ */
7
+ export interface ReviewMerchantReply {
8
+ author?: string;
9
+ date?: string;
10
+ /** Plain text; never rendered as HTML. */
11
+ reply?: string;
12
+ }
13
+ /**
14
+ * A provider-defined label/value pair attached to a product review.
15
+ */
16
+ export interface ReviewCustomField {
17
+ label: string;
18
+ value: string;
19
+ }
20
+ /**
21
+ * An image or video attached to a product review.
22
+ */
23
+ export interface ReviewMediaItem {
24
+ type: 'image' | 'video';
25
+ url: string;
26
+ }
27
+ /**
28
+ * The helpfulness votes of a product review.
29
+ */
30
+ export interface ReviewVoteCounts {
31
+ up?: number;
32
+ down?: number;
33
+ }
34
+ export type ReviewVote = 'up' | 'down';
35
+ /**
36
+ * A product review as stored in the reviews slice.
37
+ */
38
+ export interface Review {
39
+ id: ReviewId;
40
+ author?: string;
41
+ date?: string;
42
+ rate: number;
43
+ title?: string;
44
+ review?: string;
45
+ /** Only set on reviews that were submitted from the write form. */
46
+ productId?: string;
47
+ /** A missing value is unknown, which differs from an explicit `false`. */
48
+ isVerified?: boolean;
49
+ merchantReply?: ReviewMerchantReply;
50
+ customFields?: ReviewCustomField[];
51
+ media?: ReviewMediaItem[];
52
+ /** Missing counts are unknown, which differs from an explicit zero. */
53
+ reviewVotes?: ReviewVoteCounts;
54
+ }
55
+ /**
56
+ * The active filters of a review list by request parameter; inactive filters are left out.
57
+ */
58
+ export interface ReviewListFilters {
59
+ filterMedia?: true;
60
+ filterVerified?: true;
61
+ /** Number of stars from 1 to 5. */
62
+ filterRate?: number;
63
+ }
64
+ /**
65
+ * Filter values as callers pass them; they are reduced to `ReviewListFilters` before use.
66
+ */
67
+ export type ReviewListFilterInput = Partial<Record<keyof ReviewListFilters, boolean | number | null>>;
68
+ /**
69
+ * A list filter the provider supports: its request parameter and the label of its control.
70
+ */
71
+ export interface ReviewFilterOption {
72
+ param: keyof ReviewListFilters;
73
+ type: 'toggle' | 'rate';
74
+ label: string;
75
+ }
76
+ /**
77
+ * Request bookkeeping that ties a review list response to the request that caused it.
78
+ */
79
+ export interface ReviewsRequestMeta {
80
+ requestId?: number;
81
+ offset?: number;
82
+ /** Opaque sort value; extensions may pass their own format. */
83
+ sort?: string;
84
+ /** The active list filters; missing when the list is unfiltered. */
85
+ filters?: ReviewListFilters;
86
+ }
87
+ /**
88
+ * A full review list stored under its request hash.
89
+ */
90
+ export interface ReviewsCollection {
91
+ reviews?: ReviewId[];
92
+ totalReviewCount?: number | null;
93
+ sort?: string;
94
+ isFetching?: boolean;
95
+ expires?: number;
96
+ requestId?: number;
97
+ requestOffset?: number;
98
+ requestSort?: string;
99
+ requestFilters?: ReviewListFilters;
100
+ /** The filters the stored reviews were loaded with. */
101
+ filters?: ReviewListFilters;
102
+ /** Cursor for the next page; null when the provider returned none. */
103
+ after?: string | null;
104
+ }
105
+ /**
106
+ * The review preview of a product stored under its product id.
107
+ */
108
+ export interface ProductReviewsCollection {
109
+ reviews?: ReviewId[];
110
+ totalReviewCount?: number | null;
111
+ sort?: string;
112
+ isFetching?: boolean;
113
+ expires?: number;
114
+ requestId?: number;
115
+ }
116
+ /**
117
+ * The own review reference of the logged-in user for a product.
118
+ */
119
+ export interface UserReviewReference {
120
+ review?: ReviewId;
121
+ isFetching?: boolean;
122
+ expires?: number;
123
+ }
124
+ export type ReviewsById = Record<string, Review>;
125
+ export type ReviewsByHash = Record<string, ReviewsCollection>;
126
+ export type ReviewsByProductId = Record<string, ProductReviewsCollection>;
127
+ export type UserReviewsByProductId = Record<string, UserReviewReference>;
128
+ /**
129
+ * The review list parts of the reviews redux slice.
130
+ */
131
+ export interface ReviewsSliceState {
132
+ reviewsById: ReviewsById;
133
+ reviewsByHash: ReviewsByHash;
134
+ reviewsByProductId: ReviewsByProductId;
135
+ userReviewsByProductId: UserReviewsByProductId;
136
+ reviewSettings?: ReviewSettingsSliceState;
137
+ /** Provider summaries by the product id the reviews were requested for. */
138
+ reviewSummariesByProductId?: Record<string, ReviewSummary>;
139
+ }
140
+ /**
141
+ * Minimal application state shape the review list selectors read from.
142
+ */
143
+ export interface ReviewsState {
144
+ reviews: ReviewsSliceState;
145
+ }
146
+ /**
147
+ * Application state shape for review selectors that also resolve the base product.
148
+ */
149
+ export type ReviewsProductState = ReviewsState & {
150
+ product: unknown;
151
+ };
152
+ /**
153
+ * Selector props that identify a product and optionally one of its variants.
154
+ */
155
+ export interface ReviewsProductProps {
156
+ productId?: string | null;
157
+ variantId?: string | null;
158
+ }
159
+ /**
160
+ * The review switches of the app config.
161
+ */
162
+ export interface ReviewsConfig {
163
+ hasReviews?: boolean;
164
+ showWriteReview?: boolean;
165
+ }
166
+ /**
167
+ * The votes the user of this device gave, stored by review id outside the reviews slice so
168
+ * that an app reset keeps them.
169
+ */
170
+ export type OwnReviewVotes = Record<string, ReviewVote>;
171
+ /**
172
+ * Minimal application state shape the review vote selectors read from.
173
+ */
174
+ export interface OwnReviewVotesState {
175
+ ownReviewVotes?: OwnReviewVotes;
176
+ }
177
+ /**
178
+ * The pipeline response of shopgate.catalog.getProductReviews.v1.
179
+ */
180
+ export interface ProductReviewsResponse {
181
+ reviews: Review[];
182
+ totalReviewCount?: number | null;
183
+ /** Unfiltered rating summary of the product; providers send it with a first page. */
184
+ ratingSummary?: unknown;
185
+ /** Only sent by providers with cursor pagination; no `after` means the last page. */
186
+ cursors?: {
187
+ after?: string | null;
188
+ };
189
+ }
190
+ //# sourceMappingURL=reviews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../reviews/types/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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