@deenruv/reviews-plugin 1.0.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 (88) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +58 -0
  3. package/dist/plugin-server/api/admin-api.resolver.d.ts +67 -0
  4. package/dist/plugin-server/api/admin-api.resolver.js +127 -0
  5. package/dist/plugin-server/api/review-asset.resolver.d.ts +11 -0
  6. package/dist/plugin-server/api/review-asset.resolver.js +37 -0
  7. package/dist/plugin-server/api/review-customer.resolver.d.ts +15 -0
  8. package/dist/plugin-server/api/review-customer.resolver.js +52 -0
  9. package/dist/plugin-server/api/review-order.resolver.d.ts +8 -0
  10. package/dist/plugin-server/api/review-order.resolver.js +47 -0
  11. package/dist/plugin-server/api/review-product.resolver.d.ts +15 -0
  12. package/dist/plugin-server/api/review-product.resolver.js +50 -0
  13. package/dist/plugin-server/api/shop-api.resolver.d.ts +28 -0
  14. package/dist/plugin-server/api/shop-api.resolver.js +57 -0
  15. package/dist/plugin-server/constants.d.ts +6 -0
  16. package/dist/plugin-server/constants.js +7 -0
  17. package/dist/plugin-server/entities/review-translation.entity.d.ts +9 -0
  18. package/dist/plugin-server/entities/review-translation.entity.js +37 -0
  19. package/dist/plugin-server/entities/review.entity.d.ts +24 -0
  20. package/dist/plugin-server/entities/review.entity.js +89 -0
  21. package/dist/plugin-server/events.d.ts +10 -0
  22. package/dist/plugin-server/events.js +11 -0
  23. package/dist/plugin-server/extensions/admin-api.extension.d.ts +2 -0
  24. package/dist/plugin-server/extensions/admin-api.extension.js +70 -0
  25. package/dist/plugin-server/extensions/shared.extension.d.ts +2 -0
  26. package/dist/plugin-server/extensions/shared.extension.js +87 -0
  27. package/dist/plugin-server/extensions/shop-api.extension.d.ts +2 -0
  28. package/dist/plugin-server/extensions/shop-api.extension.js +60 -0
  29. package/dist/plugin-server/index.d.ts +15 -0
  30. package/dist/plugin-server/index.js +86 -0
  31. package/dist/plugin-server/services/reviews.service.d.ts +85 -0
  32. package/dist/plugin-server/services/reviews.service.js +366 -0
  33. package/dist/plugin-server/state/reviews.state.d.ts +16 -0
  34. package/dist/plugin-server/state/reviews.state.js +63 -0
  35. package/dist/plugin-server/types.d.ts +33 -0
  36. package/dist/plugin-server/types.js +1 -0
  37. package/dist/plugin-server/zeus/const.d.ts +6 -0
  38. package/dist/plugin-server/zeus/const.js +4027 -0
  39. package/dist/plugin-server/zeus/index.d.ts +20410 -0
  40. package/dist/plugin-server/zeus/index.js +443 -0
  41. package/dist/plugin-ui/components/OrderInfo.d.ts +5 -0
  42. package/dist/plugin-ui/components/OrderInfo.js +42 -0
  43. package/dist/plugin-ui/components/ProductInfo.d.ts +5 -0
  44. package/dist/plugin-ui/components/ProductInfo.js +36 -0
  45. package/dist/plugin-ui/components/ReviewCustomer.d.ts +2 -0
  46. package/dist/plugin-ui/components/ReviewCustomer.js +166 -0
  47. package/dist/plugin-ui/components/ReviewOrder.d.ts +2 -0
  48. package/dist/plugin-ui/components/ReviewOrder.js +57 -0
  49. package/dist/plugin-ui/components/ReviewProductSidebar.d.ts +2 -0
  50. package/dist/plugin-ui/components/ReviewProductSidebar.js +29 -0
  51. package/dist/plugin-ui/components/ReviewStateChange.d.ts +5 -0
  52. package/dist/plugin-ui/components/ReviewStateChange.js +35 -0
  53. package/dist/plugin-ui/components/UniversalSelectDialog.d.ts +16 -0
  54. package/dist/plugin-ui/components/UniversalSelectDialog.js +35 -0
  55. package/dist/plugin-ui/components/index.d.ts +2 -0
  56. package/dist/plugin-ui/components/index.js +2 -0
  57. package/dist/plugin-ui/constants.d.ts +1 -0
  58. package/dist/plugin-ui/constants.js +1 -0
  59. package/dist/plugin-ui/graphql/index.d.ts +3 -0
  60. package/dist/plugin-ui/graphql/index.js +3 -0
  61. package/dist/plugin-ui/graphql/mutations.d.ts +35 -0
  62. package/dist/plugin-ui/graphql/mutations.js +28 -0
  63. package/dist/plugin-ui/graphql/queries.d.ts +293 -0
  64. package/dist/plugin-ui/graphql/queries.js +34 -0
  65. package/dist/plugin-ui/graphql/scalars.d.ts +16 -0
  66. package/dist/plugin-ui/graphql/scalars.js +14 -0
  67. package/dist/plugin-ui/graphql/selectors.d.ts +58 -0
  68. package/dist/plugin-ui/graphql/selectors.js +39 -0
  69. package/dist/plugin-ui/index.d.ts +7 -0
  70. package/dist/plugin-ui/index.js +69 -0
  71. package/dist/plugin-ui/locales/en/index.d.ts +108 -0
  72. package/dist/plugin-ui/locales/en/index.js +2 -0
  73. package/dist/plugin-ui/locales/en/reviews.json +107 -0
  74. package/dist/plugin-ui/locales/pl/index.d.ts +108 -0
  75. package/dist/plugin-ui/locales/pl/index.js +2 -0
  76. package/dist/plugin-ui/locales/pl/reviews.json +107 -0
  77. package/dist/plugin-ui/pages/Review.d.ts +2 -0
  78. package/dist/plugin-ui/pages/Review.js +263 -0
  79. package/dist/plugin-ui/pages/Reviews.d.ts +2 -0
  80. package/dist/plugin-ui/pages/Reviews.js +174 -0
  81. package/dist/plugin-ui/tsconfig.json +18 -0
  82. package/dist/plugin-ui/zeus/const.d.ts +6 -0
  83. package/dist/plugin-ui/zeus/const.js +4027 -0
  84. package/dist/plugin-ui/zeus/index.d.ts +20410 -0
  85. package/dist/plugin-ui/zeus/index.js +459 -0
  86. package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
  87. package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
  88. package/package.json +61 -0
@@ -0,0 +1,293 @@
1
+ export declare const ListReviewQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
2
+ listReviews: {
3
+ items: {
4
+ id: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ state: import("../zeus/index.js").ReviewState;
8
+ product?: {
9
+ id: string;
10
+ name: string;
11
+ } | undefined;
12
+ order?: {
13
+ id: string;
14
+ } | undefined;
15
+ responseCreatedAt?: string | undefined;
16
+ rating: number;
17
+ }[];
18
+ totalItems: number;
19
+ };
20
+ }, {} & {
21
+ options: {
22
+ skip?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
23
+ take?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
24
+ sort?: {
25
+ id?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
26
+ createdAt?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
27
+ updatedAt?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
28
+ response?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
29
+ responseCreatedAt?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
30
+ rating?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
31
+ authorName?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
32
+ authorLocation?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
33
+ authorEmailAddress?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
34
+ body?: import("../zeus/index.js").SortOrder | import("../zeus/index.js").Variable<any, string> | null | undefined;
35
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
36
+ filter?: {
37
+ id?: {
38
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
39
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
40
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
41
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
42
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
43
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
44
+ createdAt?: {
45
+ eq?: unknown;
46
+ before?: unknown;
47
+ after?: unknown;
48
+ between?: {
49
+ start: unknown;
50
+ end: unknown;
51
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
52
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
53
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
54
+ updatedAt?: {
55
+ eq?: unknown;
56
+ before?: unknown;
57
+ after?: unknown;
58
+ between?: {
59
+ start: unknown;
60
+ end: unknown;
61
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
62
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
63
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
64
+ state?: {
65
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
66
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
67
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
68
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
69
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
70
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
71
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
72
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
73
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
74
+ response?: {
75
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
76
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
77
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
78
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
79
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
80
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
81
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
82
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
83
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
84
+ responseCreatedAt?: {
85
+ eq?: unknown;
86
+ before?: unknown;
87
+ after?: unknown;
88
+ between?: {
89
+ start: unknown;
90
+ end: unknown;
91
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
92
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
93
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
94
+ rating?: {
95
+ eq?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
96
+ lt?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
97
+ lte?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
98
+ gt?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
99
+ gte?: number | import("../zeus/index.js").Variable<any, string> | null | undefined;
100
+ between?: {
101
+ start: number | import("../zeus/index.js").Variable<any, string>;
102
+ end: number | import("../zeus/index.js").Variable<any, string>;
103
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
104
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
105
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
106
+ authorName?: {
107
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
108
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
109
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
110
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
111
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
112
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
113
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
114
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
115
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
116
+ authorLocation?: {
117
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
118
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
119
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
120
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
121
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
122
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
123
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
124
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
125
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
126
+ authorEmailAddress?: {
127
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
128
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
129
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
130
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
131
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
132
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
133
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
134
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
135
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
136
+ body?: {
137
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
138
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
139
+ contains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
140
+ notContains?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
141
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
142
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
143
+ regex?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
144
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
145
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
146
+ productId?: {
147
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
148
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
149
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
150
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
151
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
152
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
153
+ orderId?: {
154
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
155
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
156
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
157
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
158
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
159
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
160
+ customerId?: {
161
+ eq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
162
+ notEq?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
163
+ in?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
164
+ notIn?: string[] | import("../zeus/index.js").Variable<any, string> | null | undefined;
165
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
166
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
167
+ _and?: import("../zeus/index.js").Variable<any, string> | any[] | null | undefined;
168
+ _or?: import("../zeus/index.js").Variable<any, string> | any[] | null | undefined;
169
+ keepAnonymous?: {
170
+ eq?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
171
+ isNull?: boolean | import("../zeus/index.js").Variable<any, string> | null | undefined;
172
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
173
+ } | import("../zeus/index.js").Variable<any, string> | null | undefined;
174
+ filterOperator?: import("../zeus/index.js").LogicalOperator | import("../zeus/index.js").Variable<any, string> | null | undefined;
175
+ };
176
+ }>;
177
+ export declare const GetReviewQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
178
+ getReview?: {
179
+ response?: string | undefined;
180
+ id: string;
181
+ createdAt: string;
182
+ updatedAt: string;
183
+ productVariant?: {
184
+ id: string;
185
+ name: string;
186
+ product: {
187
+ id: string;
188
+ name: string;
189
+ slug: string;
190
+ };
191
+ } | undefined;
192
+ assets: {
193
+ key: string;
194
+ url: string;
195
+ }[];
196
+ translations: {
197
+ id: string;
198
+ languageCode: string;
199
+ body?: string | undefined;
200
+ }[];
201
+ state: import("../zeus/index.js").ReviewState;
202
+ order?: {
203
+ id: string;
204
+ code: string;
205
+ totalQuantity: number;
206
+ currencyCode: import("../zeus/index.js").CurrencyCode;
207
+ totalWithTax: number;
208
+ } | undefined;
209
+ responseCreatedAt?: string | undefined;
210
+ rating: number;
211
+ authorName: string;
212
+ authorLocation?: string | undefined;
213
+ authorEmailAddress: string;
214
+ body?: string | undefined;
215
+ author?: {
216
+ id: string;
217
+ } | undefined;
218
+ } | undefined;
219
+ }, {} & {
220
+ id: {};
221
+ }>;
222
+ export declare const GetReviewsConfigQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
223
+ getReviewsConfig: {
224
+ reviewsLanguages: import("../zeus/index.js").LanguageCode[];
225
+ canTranslate: boolean;
226
+ };
227
+ }, {} & {}>;
228
+ export declare const TranslateReviewsQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
229
+ translateReviews: {
230
+ languageCode: import("../zeus/index.js").LanguageCode;
231
+ summary: unknown;
232
+ body: string;
233
+ }[];
234
+ }, {} & {
235
+ input: {
236
+ id: string | import("../zeus/index.js").Variable<any, string>;
237
+ languages: import("../zeus/index.js").Variable<any, string> | import("../zeus/index.js").LanguageCode[];
238
+ };
239
+ }>;
240
+ export declare const GetReviewInfoForProductQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
241
+ getReviewInfoForProduct?: {
242
+ averageRating: number;
243
+ totalReviews: number;
244
+ totalRatings: number;
245
+ } | undefined;
246
+ }, {} & {
247
+ productId: {};
248
+ }>;
249
+ export declare const GetReviewForOrderQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
250
+ getReviewForOrder?: {
251
+ response?: string | undefined;
252
+ id: string;
253
+ createdAt: string;
254
+ updatedAt: string;
255
+ productVariant?: {
256
+ id: string;
257
+ name: string;
258
+ product: {
259
+ id: string;
260
+ name: string;
261
+ slug: string;
262
+ };
263
+ } | undefined;
264
+ assets: {
265
+ key: string;
266
+ url: string;
267
+ }[];
268
+ translations: {
269
+ id: string;
270
+ languageCode: string;
271
+ body?: string | undefined;
272
+ }[];
273
+ state: import("../zeus/index.js").ReviewState;
274
+ order?: {
275
+ id: string;
276
+ code: string;
277
+ totalQuantity: number;
278
+ currencyCode: import("../zeus/index.js").CurrencyCode;
279
+ totalWithTax: number;
280
+ } | undefined;
281
+ responseCreatedAt?: string | undefined;
282
+ rating: number;
283
+ authorName: string;
284
+ authorLocation?: string | undefined;
285
+ authorEmailAddress: string;
286
+ body?: string | undefined;
287
+ author?: {
288
+ id: string;
289
+ } | undefined;
290
+ } | undefined;
291
+ }, {} & {
292
+ orderId: {};
293
+ }>;
@@ -0,0 +1,34 @@
1
+ import { typedGql } from "../zeus/typedDocumentNode.js";
2
+ import { ReviewDetailSelector, ReviewListSelector } from "./selectors.js";
3
+ import { $ } from "../zeus/index.js";
4
+ import { scalars } from "./scalars.js";
5
+ export const ListReviewQuery = typedGql("query", { scalars })({
6
+ listReviews: [
7
+ { options: $("options", "ReviewListOptions!") },
8
+ { items: ReviewListSelector, totalItems: true },
9
+ ],
10
+ });
11
+ export const GetReviewQuery = typedGql("query", { scalars })({
12
+ getReview: [{ id: $("id", "ID!") }, ReviewDetailSelector],
13
+ });
14
+ export const GetReviewsConfigQuery = typedGql("query", { scalars })({
15
+ getReviewsConfig: {
16
+ reviewsLanguages: true,
17
+ canTranslate: true,
18
+ },
19
+ });
20
+ export const TranslateReviewsQuery = typedGql("query", { scalars })({
21
+ translateReviews: [
22
+ { input: $("input", "TranslateReviewsInput!") },
23
+ { body: true, languageCode: true, summary: true },
24
+ ],
25
+ });
26
+ export const GetReviewInfoForProductQuery = typedGql("query", { scalars })({
27
+ getReviewInfoForProduct: [
28
+ { productId: $("productId", "ID!") },
29
+ { averageRating: true, totalReviews: true, totalRatings: true },
30
+ ],
31
+ });
32
+ export const GetReviewForOrderQuery = typedGql("query", { scalars })({
33
+ getReviewForOrder: [{ orderId: $("orderId", "ID!") }, ReviewDetailSelector],
34
+ });
@@ -0,0 +1,16 @@
1
+ import { FromSelector, GraphQLTypes } from "../zeus/index.js";
2
+ export declare const scalars: {
3
+ Money: {
4
+ decode: (e: unknown) => number;
5
+ };
6
+ JSON: {
7
+ encode: (e: unknown) => string;
8
+ decode: (e: unknown) => any;
9
+ };
10
+ DateTime: {
11
+ decode: (e: unknown) => string;
12
+ encode: (e: unknown) => string;
13
+ };
14
+ };
15
+ export type ScalarsType = typeof scalars;
16
+ export type FromSelectorWithScalars<SELECTOR, NAME extends keyof GraphQLTypes> = FromSelector<SELECTOR, NAME, ScalarsType>;
@@ -0,0 +1,14 @@
1
+ import { ZeusScalars } from "../zeus/index.js";
2
+ export const scalars = ZeusScalars({
3
+ Money: {
4
+ decode: (e) => e,
5
+ },
6
+ JSON: {
7
+ encode: (e) => JSON.stringify(JSON.stringify(e)),
8
+ decode: (e) => JSON.parse(e),
9
+ },
10
+ DateTime: {
11
+ decode: (e) => new Date(e).toISOString(),
12
+ encode: (e) => e.toISOString(),
13
+ },
14
+ });
@@ -0,0 +1,58 @@
1
+ import { FromSelectorWithScalars } from "./scalars.js";
2
+ export declare const ReviewListSelector: {
3
+ id: true;
4
+ createdAt: true;
5
+ updatedAt: true;
6
+ responseCreatedAt: true;
7
+ rating: true;
8
+ state: true;
9
+ product: {
10
+ id: true;
11
+ name: true;
12
+ };
13
+ order: {
14
+ id: true;
15
+ };
16
+ };
17
+ export declare const ReviewDetailSelector: {
18
+ id: true;
19
+ state: true;
20
+ createdAt: true;
21
+ updatedAt: true;
22
+ authorLocation: true;
23
+ authorEmailAddress: true;
24
+ authorName: true;
25
+ body: true;
26
+ rating: true;
27
+ response: true;
28
+ responseCreatedAt: true;
29
+ assets: {
30
+ url: true;
31
+ key: true;
32
+ };
33
+ translations: {
34
+ id: true;
35
+ body: true;
36
+ languageCode: true;
37
+ };
38
+ author: {
39
+ id: true;
40
+ };
41
+ order: {
42
+ id: true;
43
+ code: true;
44
+ totalWithTax: true;
45
+ totalQuantity: true;
46
+ currencyCode: true;
47
+ };
48
+ productVariant: {
49
+ id: true;
50
+ name: true;
51
+ product: {
52
+ id: true;
53
+ name: true;
54
+ slug: true;
55
+ };
56
+ };
57
+ };
58
+ export type ReviewDetail = FromSelectorWithScalars<typeof ReviewDetailSelector, "Review">;
@@ -0,0 +1,39 @@
1
+ import { Selector } from "../zeus/index.js";
2
+ export const ReviewListSelector = Selector("Review")({
3
+ id: true,
4
+ createdAt: true,
5
+ updatedAt: true,
6
+ responseCreatedAt: true,
7
+ rating: true,
8
+ state: true,
9
+ product: { id: true, name: true },
10
+ order: { id: true },
11
+ });
12
+ export const ReviewDetailSelector = Selector("Review")({
13
+ id: true,
14
+ state: true,
15
+ createdAt: true,
16
+ updatedAt: true,
17
+ authorLocation: true,
18
+ authorEmailAddress: true,
19
+ authorName: true,
20
+ body: true,
21
+ rating: true,
22
+ response: true,
23
+ responseCreatedAt: true,
24
+ assets: { url: true, key: true },
25
+ translations: { id: true, body: true, languageCode: true },
26
+ author: { id: true },
27
+ order: {
28
+ id: true,
29
+ code: true,
30
+ totalWithTax: true,
31
+ totalQuantity: true,
32
+ currencyCode: true,
33
+ },
34
+ productVariant: {
35
+ id: true,
36
+ name: true,
37
+ product: { id: true, name: true, slug: true },
38
+ },
39
+ });
@@ -0,0 +1,7 @@
1
+ export declare const REVIEWS_ROUTES: {
2
+ route: string;
3
+ new: string;
4
+ list: string;
5
+ to: (id: string) => string;
6
+ };
7
+ export declare const ReviewsUIPlugin: import("@deenruv/react-ui-devkit").DeenruvUIPlugin<Record<string, any>>;
@@ -0,0 +1,69 @@
1
+ import React from "react";
2
+ import { createDeenruvUIPlugin } from "@deenruv/react-ui-devkit";
3
+ import { Reviews } from "./pages/Reviews";
4
+ import { ListIcon } from "lucide-react";
5
+ import { Review } from "./pages/Review";
6
+ import { ReviewProductSidebar } from "./components/ReviewProductSidebar";
7
+ import { TRANSLATION_NAMESPACE } from "./constants";
8
+ import pl from "./locales/pl";
9
+ import en from "./locales/en";
10
+ import { ReviewOrder } from "./components/ReviewOrder";
11
+ import { ReviewCustomer } from "./components/ReviewCustomer";
12
+ const PLUGIN_NAME = "reviews-plugin-ui";
13
+ export const REVIEWS_ROUTES = {
14
+ route: ["/admin-ui", "extensions", PLUGIN_NAME, ":id"].join("/"),
15
+ new: ["/admin-ui", "extensions", PLUGIN_NAME, "new"].join("/"),
16
+ list: ["/admin-ui", "extensions", PLUGIN_NAME].join("/"),
17
+ to: (id) => ["/admin-ui", "extensions", PLUGIN_NAME, id].join("/"),
18
+ };
19
+ export const ReviewsUIPlugin = createDeenruvUIPlugin({
20
+ version: "1.0.0",
21
+ name: PLUGIN_NAME.split("-")
22
+ .map((s) => s.charAt(0).toUpperCase() + s.slice(1))
23
+ .join(" "),
24
+ pages: [
25
+ { element: React.createElement(Reviews, null), path: "" },
26
+ { element: React.createElement(Review, null), path: ":id" },
27
+ ],
28
+ translations: {
29
+ ns: TRANSLATION_NAMESPACE,
30
+ data: { en, pl },
31
+ },
32
+ components: [
33
+ {
34
+ id: "products-detail-view-sidebar",
35
+ tab: "product",
36
+ component: ReviewProductSidebar,
37
+ },
38
+ {
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ id: "order-detail-view",
41
+ component: ReviewOrder,
42
+ },
43
+ ],
44
+ tabs: [
45
+ {
46
+ id: "customers-detail-view",
47
+ name: "reviews",
48
+ label: "Reviews",
49
+ component: React.createElement(ReviewCustomer, null),
50
+ hideSidebar: true,
51
+ },
52
+ ],
53
+ navMenuGroups: [
54
+ {
55
+ id: "reviews",
56
+ labelId: "nav.reviews",
57
+ placement: { groupId: "assortment-group" },
58
+ },
59
+ ],
60
+ navMenuLinks: [
61
+ {
62
+ groupId: "reviews",
63
+ id: "reviews-list",
64
+ labelId: "nav.reviewsList",
65
+ href: "",
66
+ icon: ListIcon,
67
+ },
68
+ ],
69
+ });
@@ -0,0 +1,108 @@
1
+ declare const _default: {
2
+ dialog: {
3
+ bulkStateChangeTitle: string;
4
+ bulkStateChangeDescription: string;
5
+ bulkStateChangeSelectLabel: string;
6
+ bulkStateChangeSelectPlaceholder: string;
7
+ bulkStateChangeSuccess: string;
8
+ bulkStateChangeError: string;
9
+ bulkStateChangeCancelled: string;
10
+ bulkStateChangeNoSelection: string;
11
+ singleStateChangeTitle: string;
12
+ singleStateChangeDescription: string;
13
+ singleStateChangeSelectLabel: string;
14
+ singleStateChangeSelectPlaceholder: string;
15
+ singleStateChangeSuccess: string;
16
+ singleStateChangeError: string;
17
+ singleStateChangeCancelled: string;
18
+ singleStateChangeNoSelection: string;
19
+ cancel: string;
20
+ submit: string;
21
+ selectError: string;
22
+ };
23
+ state: {
24
+ pending: string;
25
+ accepted: string;
26
+ declined: string;
27
+ };
28
+ detail: {
29
+ viewCustomer: string;
30
+ id: string;
31
+ changeState: string;
32
+ changeStateSuccess: string;
33
+ changeStateError: string;
34
+ cancel: string;
35
+ confirm: string;
36
+ selectState: string;
37
+ businessResponsePlaceholder: string;
38
+ businessResponse: string;
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ noFound: string;
42
+ reviewTranslations: string;
43
+ reviewContent: string;
44
+ generateAllMissingTranslations: string;
45
+ generateAllMissingTranslationsSuccess: string;
46
+ generateAllMissingTranslationsError: string;
47
+ updateReview: string;
48
+ noTranslation: string;
49
+ generateTranslation: string;
50
+ manualTranslation: string;
51
+ reviewBody: string;
52
+ review: string;
53
+ stateRequired: string;
54
+ rating: string;
55
+ assets: string;
56
+ manualTranslationPlaceholder: string;
57
+ generatedTranslationBody: string;
58
+ };
59
+ productInfo: {
60
+ productReview: string;
61
+ viewProduct: string;
62
+ productId: string;
63
+ productName: string;
64
+ variantName: string;
65
+ };
66
+ orderInfo: {
67
+ orderReview: string;
68
+ viewOrder: string;
69
+ orderId: string;
70
+ orderCode: string;
71
+ orderTotal: string;
72
+ totalItems: string;
73
+ };
74
+ reviewOrder: {
75
+ title: string;
76
+ titleWithId: string;
77
+ };
78
+ productReviewSidebar: {
79
+ averageRating: string;
80
+ noAverageRating: string;
81
+ totalReviews: string;
82
+ noTotalReviews: string;
83
+ totalReviewsForProduct: string;
84
+ noTotalReviewsForProduct: string;
85
+ viewAllReviews: string;
86
+ };
87
+ nav: {
88
+ reviews: string;
89
+ reviewsList: string;
90
+ };
91
+ list: {
92
+ bulkStateChange: string;
93
+ stateChange: string;
94
+ productId: string;
95
+ orderId: string;
96
+ customerId: string;
97
+ reviewFor: string;
98
+ shopReview: string;
99
+ orderReview: string;
100
+ responseDate: string;
101
+ state: string;
102
+ rating: string;
103
+ noResponse: string;
104
+ responseCreatedAt: string;
105
+ responseCreatedAtValue: string;
106
+ };
107
+ }[];
108
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import reviews from "./reviews.json";
2
+ export default [reviews];