@q2devel/q2-core 1.0.69 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,103 +1,103 @@
1
- # Q2 Core
2
-
3
- ## Getting started
4
-
5
- To make it easy for you to get started with GitLab, here's a list of recommended next steps.
6
-
7
- Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
8
-
9
- ## Add your files
10
-
11
- - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
12
- - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
13
-
14
- ```
15
- cd existing_repo
16
- git remote add origin https://gitlab.pegasus.q2.cz/q2-extensions/q2-core.git
17
- git branch -M main
18
- git push -uf origin main
19
- ```
20
-
21
- ## Integrate with your tools
22
-
23
- - [ ] [Set up project integrations](http://gitlab.q2cz.local/q2-extensions/q2-core/-/settings/integrations)
24
-
25
- ## Collaborate with your team
26
-
27
- - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
28
- - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
29
- - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
30
- - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
31
- - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
32
-
33
- ## Test and Deploy
34
-
35
- Use the built-in continuous integration in GitLab.
36
-
37
- - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
38
- - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
39
- - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
40
- - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
41
- - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
42
-
43
- ---
44
-
45
- # Editing this README
46
-
47
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
48
-
49
- ## Suggestions for a good README
50
-
51
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
52
-
53
- ## Name
54
-
55
- Choose a self-explaining name for your project.
56
-
57
- ## Description
58
-
59
- Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
-
61
- ## Badges
62
-
63
- On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
64
-
65
- ## Visuals
66
-
67
- Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
68
-
69
- ## Installation
70
-
71
- Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
72
-
73
- ## Usage
74
-
75
- Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
76
-
77
- ## Support
78
-
79
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
80
-
81
- ## Roadmap
82
-
83
- If you have ideas for releases in the future, it is a good idea to list them in the README.
84
-
85
- ## Contributing
86
-
87
- State if you are open to contributions and what your requirements are for accepting them.
88
-
89
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
90
-
91
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
92
-
93
- ## Authors and acknowledgment
94
-
95
- Show your appreciation to those who have contributed to the project.
96
-
97
- ## License
98
-
99
- For open source projects, say how it is licensed.
100
-
101
- ## Project status
102
-
103
- If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
1
+ # Q2 Core
2
+
3
+ ## Getting started
4
+
5
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
6
+
7
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
8
+
9
+ ## Add your files
10
+
11
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
12
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
13
+
14
+ ```
15
+ cd existing_repo
16
+ git remote add origin https://gitlab.pegasus.q2.cz/q2-extensions/q2-core.git
17
+ git branch -M main
18
+ git push -uf origin main
19
+ ```
20
+
21
+ ## Integrate with your tools
22
+
23
+ - [ ] [Set up project integrations](http://gitlab.q2cz.local/q2-extensions/q2-core/-/settings/integrations)
24
+
25
+ ## Collaborate with your team
26
+
27
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
28
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
29
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
30
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
31
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
32
+
33
+ ## Test and Deploy
34
+
35
+ Use the built-in continuous integration in GitLab.
36
+
37
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
38
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
39
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
40
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
41
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
42
+
43
+ ---
44
+
45
+ # Editing this README
46
+
47
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
48
+
49
+ ## Suggestions for a good README
50
+
51
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
52
+
53
+ ## Name
54
+
55
+ Choose a self-explaining name for your project.
56
+
57
+ ## Description
58
+
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+
63
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
64
+
65
+ ## Visuals
66
+
67
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
68
+
69
+ ## Installation
70
+
71
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
72
+
73
+ ## Usage
74
+
75
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
76
+
77
+ ## Support
78
+
79
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
80
+
81
+ ## Roadmap
82
+
83
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
84
+
85
+ ## Contributing
86
+
87
+ State if you are open to contributions and what your requirements are for accepting them.
88
+
89
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
90
+
91
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
92
+
93
+ ## Authors and acknowledgment
94
+
95
+ Show your appreciation to those who have contributed to the project.
96
+
97
+ ## License
98
+
99
+ For open source projects, say how it is licensed.
100
+
101
+ ## Project status
102
+
103
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -1 +1 @@
1
- {"version":3,"file":"Cart.service.d.ts","sourceRoot":"","sources":["../../../api/cart/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AQ,kBAAuB,KAChC,OAAO,CAAC,IAAI,CAMd,CAAA;AAED,eAAO,MAAM,SAAS,GAClB,KAAK,WAAW,EAChB,QAAQ,MAAM,EACd,SAAQ,kBAAuB,KAChC,OAAO,CAAC,IAAI,CAKd,CAAA;AAED,eAAO,MAAM,WAAW,GACpB,KAAK,WAAW,EAChB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,SAAQ,kBAAuB,KAChC,OAAO,CAAC,IAAI,CAYd,CAAA;AAED,eAAO,MAAM,YAAY,GACrB,KAAK,WAAW,EAChB,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,SAAQ,kBAAuB,KAChC,OAAO,CAAC,IAAI,CAQd,CAAA;AAED,eAAO,MAAM,YAAY,GACrB,KAAK,WAAW,EAChB,SAAQ,kBAAuB,KAChC,OAAO,CAAC,MAAM,CAQhB,CAAA;AAED,eAAO,MAAM,eAAe,GACxB,KAAK,WAAW,EAChB,SAAQ,kBAAuB,KAChC,OAAO,CAAC,oBAAoB,CAmE9B,CAAA"}
@@ -190,16 +190,25 @@ export const getOrderHistory = async (ctx, config = {}) => {
190
190
  ? resolvedOrders
191
191
  : [resolvedOrders];
192
192
  const processedOrders = orders.map((orderData) => {
193
- const cartItems = (orderData.order_items || []).map((item) => ({
194
- id: item.purchased_entity.product_id.drupal_internal__product_id,
195
- uuid: item.id,
196
- drupalOrderItemId: item.drupal_internal__order_item_id || 0,
197
- type: item.type,
198
- name: item.title || '',
199
- price: parseFloat(item.unit_price?.number || '0'),
200
- quantity: parseFloat(item.quantity || '0'),
201
- variationId: item.purchased_entity?.id || '',
202
- }));
193
+ const cartItems = (orderData.order_items || [])
194
+ .map((item) => {
195
+ const defaultProduct = item.purchased_entity?.product_id;
196
+ const variationProduct = item.purchased_entity;
197
+ const variations = defaultProduct?.variations ?? [];
198
+ if (!defaultProduct || !variationProduct) {
199
+ console.warn('Invalid order item structure', item);
200
+ return null;
201
+ }
202
+ const baseProduct = mapProduct(defaultProduct, variationProduct, ctx);
203
+ return {
204
+ ...baseProduct,
205
+ quantity: parseFloat(item.quantity || '0'),
206
+ price: parseFloat(item.unit_price?.number || '0'), // override price from order item
207
+ drupalOrderItemId: item.drupal_internal__order_item_id || 0,
208
+ order_item_id: item.id || '',
209
+ };
210
+ })
211
+ .filter(Boolean);
203
212
  return {
204
213
  id: orderData.id || '',
205
214
  drupalOrderId: orderData.drupal_internal__order_id || 0,
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=getUserCart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserCart.d.ts","sourceRoot":"","sources":["../../../api/user/getUserCart.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,8 @@
1
+ import { CoreContext } from '../../context';
2
+ import { ResetPasswordResponse } from '../../types/user/ResetPassword';
3
+ type ResetPasswordParams = {
4
+ email: string;
5
+ };
6
+ export declare const resetPassword: (ctx: CoreContext, { email }: ResetPasswordParams) => Promise<ResetPasswordResponse>;
7
+ export {};
8
+ //# sourceMappingURL=resetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../api/user/resetPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,KAAK,WAAW,EAChB,WAAW,mBAAmB,KAC7B,OAAO,CAAC,qBAAqB,CAG/B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const resetPassword = async (ctx, { email }) => {
2
+ const { data } = await ctx.axios.get(`/api/user/reset/${email}`);
3
+ return data;
4
+ };
@@ -3,9 +3,7 @@ export type CreateWishlistRequest = {
3
3
  note: string;
4
4
  };
5
5
  export type CreateWishlistResponse = {
6
- data: {
7
- id: string;
8
- };
6
+ wishlist_id: string;
9
7
  };
10
8
  export type WishlistItem = {
11
9
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"WishlistService.types.d.ts","sourceRoot":"","sources":["../../../api/wishlist/WishlistService.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE;QACF,EAAE,EAAE,MAAM,CAAA;KACb,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;QACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;QACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;QACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;QACzB,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;KACf,GAAG,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,QAAQ,EAAE,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,YAAY,EAAE,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE;QACF,EAAE,EAAE,MAAM,CAAA;KACb,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA"}
1
+ {"version":3,"file":"WishlistService.types.d.ts","sourceRoot":"","sources":["../../../api/wishlist/WishlistService.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG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AAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,YAAY,EAAE,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE;QACF,EAAE,EAAE,MAAM,CAAA;KACb,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA"}
@@ -1,7 +1,7 @@
1
- import { Product } from '../../types/products/Product';
2
1
  import { Wishlist } from '../../api/wishlist/WishlistService.types';
3
- import { ProductCardWishlist } from '../../types/wishlist/Wishlist';
4
2
  import { CoreContext } from '../../context';
3
+ import { Product } from '../../types/products/Product';
4
+ import { ProductCardWishlist } from '../../types/wishlist/Wishlist';
5
5
  export declare const useWishlist: (ctx: CoreContext) => {
6
6
  isLogged: boolean;
7
7
  isWishlistPending: boolean;
@@ -18,5 +18,6 @@ export declare const useWishlist: (ctx: CoreContext) => {
18
18
  handleDeleteWishlist: (wishlistId: string) => void;
19
19
  favoritesWishlist: Wishlist | undefined;
20
20
  wishlistItems: import("../../api/wishlist/WishlistService.types").WishlistItem[];
21
+ isFavoritesNameReserved: (name: string) => boolean;
21
22
  };
22
23
  //# sourceMappingURL=useWishlist.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWishlist.d.ts","sourceRoot":"","sources":["../../../hooks/wishlist/useWishlist.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAOnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAI3C,eAAO,MAAM,WAAW,GAAI,KAAK,WAAW;;;wCA6CtB,MAAM;gCAuCV,OAAO;;;uCAxBH,MAAM;yCAmLN,MAAM,KAAG,MAAM,EAAE;oCAzGrB,OAAO;mCAyDP,OAAO,cAAc,MAAM;iCAW9B,MAAM,WAAW,OAAO;wCAiDrB,OAAO,cAAc,MAAM;uCAkBxB,MAAM;;;CAyB1B,CAAA"}
1
+ {"version":3,"file":"useWishlist.d.ts","sourceRoot":"","sources":["../../../hooks/wishlist/useWishlist.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAQnE,eAAO,MAAM,WAAW,GAAI,KAAK,WAAW;;;wCA2DtB,MAAM;gCA2CV,OAAO;;;uCA3BH,MAAM;yCAgMN,MAAM,KAAG,MAAM,EAAE;oCAjHrB,OAAO;mCAyDP,OAAO,cAAc,MAAM;iCAW9B,MAAM,WAAW,OAAO;wCAyDrB,OAAO,cAAc,MAAM;uCAkBxB,MAAM;;;oCA7PZ,MAAM;CAuRpB,CAAA"}
@@ -6,7 +6,6 @@ import { useDeleteWishlist } from './api/useDeleteWishlist';
6
6
  import { useDeleteWishlistItem } from './api/useDeleteWishlistItem';
7
7
  import { useGetWishlistItems } from './api/useGetWishlistItems';
8
8
  import { useGetWishlistList } from './api/useGetWishlistList';
9
- const FAVORITES_WISHLIST_ID = '1';
10
9
  export const useWishlist = (ctx) => {
11
10
  // const t = useTranslations('wishlist')
12
11
  // const FAVORITES_WISHLIST_NAME = t('default-wishlist')
@@ -22,19 +21,34 @@ export const useWishlist = (ctx) => {
22
21
  isDeletingFromWishlist ||
23
22
  isDeletingWishlist;
24
23
  const wishlists = useMemo(() => wishlistsData?.wishlist_ids || [], [wishlistsData]);
25
- const favoritesWishlist = useMemo(() => wishlists.find((wishlist) => wishlist.wishlist_id === FAVORITES_WISHLIST_ID), [wishlists]);
24
+ // Najdi favorites wishlist podle názvu
25
+ // Pokud by byly duplicity (což by nemělo být možné), použij ten s nejvíce položkami
26
+ const favoritesWishlist = useMemo(() => {
27
+ const matchingWishlists = wishlists.filter((wishlist) => wishlist.name === FAVORITES_WISHLIST_NAME);
28
+ if (matchingWishlists.length === 0)
29
+ return undefined;
30
+ if (matchingWishlists.length === 1)
31
+ return matchingWishlists[0];
32
+ // Pokud jsou duplicity, použij ten s nejvíce položkami (pravděpodobně správný favorites)
33
+ return matchingWishlists.reduce((prev, current) => current.items_count > prev.items_count ? current : prev);
34
+ }, [wishlists, FAVORITES_WISHLIST_NAME]);
35
+ // Helper pro kontrolu, zda je název rezervovaný pro favorites
36
+ const isFavoritesNameReserved = useCallback((name) => {
37
+ return name.trim() === FAVORITES_WISHLIST_NAME;
38
+ }, [FAVORITES_WISHLIST_NAME]);
26
39
  const wishlistIds = useMemo(() => wishlists.map((wishlist) => wishlist.wishlist_id), [wishlists]);
27
40
  const { data: wishlistItemsData } = useGetWishlistItems(ctx, wishlistIds);
28
41
  const wishlistItems = wishlistItemsData?.data || [];
29
42
  const isProductInFavorites = useCallback((productUuid) => {
30
- if (!wishlistItems.length)
43
+ if (!wishlistItems.length || !favoritesWishlist)
31
44
  return false;
32
45
  return wishlistItems.some((item) => {
33
46
  return (item.variation_id?.id === productUuid &&
34
- item.wishlist_id?.drupal_internal__id?.toString() ===
35
- FAVORITES_WISHLIST_ID);
47
+ (item.wishlist_id?.id === favoritesWishlist.wishlist_id ||
48
+ item.wishlist_id?.drupal_internal__id?.toString() ===
49
+ favoritesWishlist.wishlist_id));
36
50
  });
37
- }, [wishlistItems]);
51
+ }, [wishlistItems, favoritesWishlist]);
38
52
  const isProductInWishlist = useCallback((productUuid) => {
39
53
  if (!wishlistItems.length)
40
54
  return false;
@@ -43,12 +57,15 @@ export const useWishlist = (ctx) => {
43
57
  });
44
58
  }, [wishlistItems]);
45
59
  const findFavoritesItemForProduct = useCallback((productUuid) => {
60
+ if (!favoritesWishlist)
61
+ return undefined;
46
62
  return wishlistItems.find((item) => {
47
63
  return (item.variation_id?.id === productUuid &&
48
- item.wishlist_id?.drupal_internal__id?.toString() ===
49
- FAVORITES_WISHLIST_ID);
64
+ (item.wishlist_id?.id === favoritesWishlist.wishlist_id ||
65
+ item.wishlist_id?.drupal_internal__id?.toString() ===
66
+ favoritesWishlist.wishlist_id));
50
67
  });
51
- }, [wishlistItems]);
68
+ }, [wishlistItems, favoritesWishlist]);
52
69
  const handleLikeToggle = useCallback((product) => {
53
70
  const isInFavorites = isProductInFavorites(product.variation_uuid);
54
71
  if (isInFavorites) {
@@ -62,7 +79,7 @@ export const useWishlist = (ctx) => {
62
79
  else {
63
80
  if (favoritesWishlist) {
64
81
  addToWishlist({
65
- wishlist_id: FAVORITES_WISHLIST_ID,
82
+ wishlist_id: favoritesWishlist.wishlist_id,
66
83
  variation_id: product.variation_id,
67
84
  quantity: 1,
68
85
  });
@@ -73,11 +90,13 @@ export const useWishlist = (ctx) => {
73
90
  note: '',
74
91
  }, {
75
92
  onSuccess: (data) => {
76
- addToWishlist({
77
- wishlist_id: FAVORITES_WISHLIST_ID,
78
- variation_id: product.variation_id,
79
- quantity: 1,
80
- });
93
+ if (data && data.wishlist_id) {
94
+ addToWishlist({
95
+ wishlist_id: data.wishlist_id,
96
+ variation_id: product.variation_id,
97
+ quantity: 1,
98
+ });
99
+ }
81
100
  },
82
101
  });
83
102
  }
@@ -101,7 +120,7 @@ export const useWishlist = (ctx) => {
101
120
  }
102
121
  }
103
122
  else {
104
- const nonFavoritesWishlists = wishlists.filter((w) => w.wishlist_id !== FAVORITES_WISHLIST_ID);
123
+ const nonFavoritesWishlists = wishlists.filter((w) => w.name !== FAVORITES_WISHLIST_NAME);
105
124
  if (nonFavoritesWishlists.length > 0) {
106
125
  addToWishlist({
107
126
  wishlist_id: nonFavoritesWishlists[0].wishlist_id,
@@ -115,9 +134,9 @@ export const useWishlist = (ctx) => {
115
134
  note: '',
116
135
  }, {
117
136
  onSuccess: (data) => {
118
- if (data.data && data.data.id) {
137
+ if (data && data.wishlist_id) {
119
138
  addToWishlist({
120
- wishlist_id: data.data.id,
139
+ wishlist_id: data.wishlist_id,
121
140
  variation_id: product.variation_id,
122
141
  quantity: 1,
123
142
  });
@@ -142,23 +161,28 @@ export const useWishlist = (ctx) => {
142
161
  });
143
162
  }, [addToWishlist]);
144
163
  const handleCreateWishlist = useCallback((name, product) => {
164
+ // Validace: zabránit vytvoření wishlistu se stejným názvem jako favorites
165
+ if (isFavoritesNameReserved(name)) {
166
+ console.warn(`Cannot create wishlist with reserved name: "${name}". This name is reserved for favorites.`);
167
+ return;
168
+ }
145
169
  createWishlist({
146
170
  name,
147
171
  note: '',
148
172
  }, {
149
173
  onSuccess: (data) => {
150
- if (data.data && data.data.id) {
174
+ if (data && data.wishlist_id) {
151
175
  addToWishlist({
152
- wishlist_id: data.data.id,
176
+ wishlist_id: data.wishlist_id,
153
177
  variation_id: product.variation_id,
154
178
  quantity: 1,
155
179
  });
156
180
  }
157
181
  },
158
182
  });
159
- }, [createWishlist, addToWishlist]);
183
+ }, [createWishlist, addToWishlist, isFavoritesNameReserved]);
160
184
  const wishlistsForDropdown = wishlists
161
- .filter((wishlist) => wishlist.wishlist_id !== FAVORITES_WISHLIST_ID)
185
+ .filter((wishlist) => wishlist.name !== FAVORITES_WISHLIST_NAME)
162
186
  .map((wishlist) => ({
163
187
  id: wishlist.wishlist_id,
164
188
  name: wishlist.name,
@@ -204,5 +228,6 @@ export const useWishlist = (ctx) => {
204
228
  handleDeleteWishlist,
205
229
  favoritesWishlist,
206
230
  wishlistItems,
231
+ isFavoritesNameReserved,
207
232
  };
208
233
  };
@@ -0,0 +1,8 @@
1
+ export type ResetPasswordResponse = {
2
+ data: {
3
+ id: string;
4
+ email: string;
5
+ };
6
+ status: number;
7
+ };
8
+ //# sourceMappingURL=ResetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.d.ts","sourceRoot":"","sources":["../../types/ResetPassword.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type ResetPasswordResponse = {
2
+ data: {
3
+ id: string;
4
+ email: string;
5
+ };
6
+ status: number;
7
+ };
8
+ //# sourceMappingURL=ResetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.d.ts","sourceRoot":"","sources":["../../../types/content/ResetPassword.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type ResetPasswordResponse = {
2
+ data: {
3
+ id: string;
4
+ email: string;
5
+ };
6
+ status: number;
7
+ };
8
+ //# sourceMappingURL=ResetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.d.ts","sourceRoot":"","sources":["../../../types/user/ResetPassword.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"mapProducts.d.ts","sourceRoot":"","sources":["../../utils/mapProducts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAuB,MAAM,2BAA2B,CAAA;AAgLxE,wBAAgB,UAAU,CACtB,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,EACrB,GAAG,EAAE,GAAG,GACT,OAAO,CAeT;AAED,wBAAgB,cAAc,CAC1B,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,EACrB,GAAG,EAAE,GAAG,GACT,GAAG,CAKL"}
1
+ {"version":3,"file":"mapProducts.d.ts","sourceRoot":"","sources":["../../utils/mapProducts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAuB,MAAM,2BAA2B,CAAA;AAkLxE,wBAAgB,UAAU,CACtB,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,EACrB,GAAG,EAAE,GAAG,GACT,OAAO,CAeT;AAED,wBAAgB,cAAc,CAC1B,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,EACrB,GAAG,EAAE,GAAG,GACT,GAAG,CAKL"}
@@ -64,6 +64,7 @@ function mapProductBase(defaultProduct, variationProduct, ctx) {
64
64
  .flat();
65
65
  const discountPercent = getDiscountPercent(variationProduct.price, variationProduct.list_price);
66
66
  const badges = [
67
+ ...(defaultProduct.field_configurable ? [{ text: 'Možno konfigurovat', color: 'bg-[#364153] text-white' }] : []),
67
68
  ...(variationProduct.field_news
68
69
  ? [{ text: 'Novinka', color: 'bg-green-100 text-green-800' }]
69
70
  : []),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q2devel/q2-core",
3
- "version": "1.0.69",
3
+ "version": "1.0.72",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {