@mercurjs/b2c-core 1.5.0 → 1.5.1

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 (72) hide show
  1. package/.medusa/server/src/api/admin/inventory-items/[id]/location-levels/[location_id]/route.d.ts +3 -0
  2. package/.medusa/server/src/api/admin/inventory-items/[id]/location-levels/[location_id]/route.js +36 -0
  3. package/.medusa/server/src/api/admin/notifications/route.js +8 -8
  4. package/.medusa/server/src/api/admin/sellers/validators.d.ts +2 -2
  5. package/.medusa/server/src/api/admin/sellers/validators.js +9 -7
  6. package/.medusa/server/src/api/store/carts/[id]/promotions/route.js +3 -4
  7. package/.medusa/server/src/api/store/middlewares.js +11 -9
  8. package/.medusa/server/src/api/store/products/middlewares.d.ts +2 -0
  9. package/.medusa/server/src/api/store/products/middlewares.js +13 -0
  10. package/.medusa/server/src/api/store/products/search/route.d.ts +81 -0
  11. package/.medusa/server/src/api/store/products/search/route.js +170 -0
  12. package/.medusa/server/src/api/store/products/validators.d.ts +36 -0
  13. package/.medusa/server/src/api/store/products/validators.js +17 -0
  14. package/.medusa/server/src/api/store/wishlist/middlewares.d.ts +1 -1
  15. package/.medusa/server/src/api/store/wishlist/middlewares.js +47 -25
  16. package/.medusa/server/src/api/store/wishlist/{[id]/product → product}/[reference_id]/route.d.ts +3 -9
  17. package/.medusa/server/src/api/store/wishlist/product/[reference_id]/route.js +65 -0
  18. package/.medusa/server/src/api/store/wishlist/route.d.ts +789 -28
  19. package/.medusa/server/src/api/store/wishlist/route.js +817 -37
  20. package/.medusa/server/src/api/vendor/campaigns/validators.js +4 -4
  21. package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/[location_id]/route.js +2 -5
  22. package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/batch/route.js +2 -2
  23. package/.medusa/server/src/api/vendor/orders/validators.d.ts +4 -4
  24. package/.medusa/server/src/api/vendor/payout-account/route.js +3 -2
  25. package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.d.ts +2 -2
  26. package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.js +2 -2
  27. package/.medusa/server/src/api/vendor/price-lists/route.d.ts +1 -1
  28. package/.medusa/server/src/api/vendor/price-lists/route.js +27 -8
  29. package/.medusa/server/src/api/vendor/product-collections/middlewares.js +2 -2
  30. package/.medusa/server/src/api/vendor/product-collections/route.d.ts +18 -0
  31. package/.medusa/server/src/api/vendor/product-collections/route.js +19 -1
  32. package/.medusa/server/src/api/vendor/product-collections/validators.d.ts +404 -15
  33. package/.medusa/server/src/api/vendor/product-collections/validators.js +18 -3
  34. package/.medusa/server/src/api/vendor/product-tags/route.d.ts +4 -1
  35. package/.medusa/server/src/api/vendor/product-tags/route.js +8 -8
  36. package/.medusa/server/src/api/vendor/products/route.d.ts +8 -2
  37. package/.medusa/server/src/api/vendor/products/route.js +28 -20
  38. package/.medusa/server/src/api/vendor/products/utils.d.ts +20 -1
  39. package/.medusa/server/src/api/vendor/products/utils.js +81 -5
  40. package/.medusa/server/src/api/vendor/products/validators.d.ts +60 -0
  41. package/.medusa/server/src/api/vendor/products/validators.js +8 -2
  42. package/.medusa/server/src/api/vendor/promotions/route.d.ts +86 -2
  43. package/.medusa/server/src/api/vendor/promotions/route.js +116 -7
  44. package/.medusa/server/src/api/vendor/promotions/validators.d.ts +237 -38
  45. package/.medusa/server/src/api/vendor/promotions/validators.js +23 -5
  46. package/.medusa/server/src/api/vendor/shipping-profiles/route.d.ts +31 -2
  47. package/.medusa/server/src/api/vendor/shipping-profiles/route.js +61 -10
  48. package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +92 -3
  49. package/.medusa/server/src/api/vendor/shipping-profiles/validators.js +10 -2
  50. package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +10 -10
  51. package/.medusa/server/src/links/wishlist-product.js +3 -3
  52. package/.medusa/server/src/modules/seller/utils.d.ts +1 -1
  53. package/.medusa/server/src/modules/seller/utils.js +37 -10
  54. package/.medusa/server/src/shared/infra/http/utils/products.js +8 -2
  55. package/.medusa/server/src/workflows/attribute/steps/validate-attribute-value.js +7 -3
  56. package/.medusa/server/src/workflows/attribute/utils/products-updated-handler.d.ts +3 -3
  57. package/.medusa/server/src/workflows/attribute/utils/products-updated-handler.js +17 -15
  58. package/.medusa/server/src/workflows/hooks/fetch-shipping-option-pricing-context.d.ts +1 -0
  59. package/.medusa/server/src/workflows/hooks/fetch-shipping-option-pricing-context.js +97 -0
  60. package/.medusa/server/src/workflows/promotions/steps/index.d.ts +2 -0
  61. package/.medusa/server/src/workflows/promotions/steps/index.js +3 -1
  62. package/.medusa/server/src/workflows/promotions/steps/inject-seller-product-rule.d.ts +6 -0
  63. package/.medusa/server/src/workflows/promotions/steps/inject-seller-product-rule.js +40 -0
  64. package/.medusa/server/src/workflows/promotions/steps/verify-seller-product-rule-deletion.d.ts +9 -0
  65. package/.medusa/server/src/workflows/promotions/steps/verify-seller-product-rule-deletion.js +27 -0
  66. package/.medusa/server/src/workflows/promotions/steps/verify-vendor-target-promotion-rules.d.ts +5 -0
  67. package/.medusa/server/src/workflows/promotions/steps/verify-vendor-target-promotion-rules.js +27 -11
  68. package/.medusa/server/src/workflows/promotions/workflows/batch-vendor-promotion-rules.js +5 -1
  69. package/.medusa/server/src/workflows/promotions/workflows/create-vendor-promotion.js +4 -3
  70. package/.medusa/server/src/workflows/seller/steps/validate-products-to-import.d.ts +5 -0
  71. package/package.json +1 -1
  72. package/.medusa/server/src/api/store/wishlist/[id]/product/[reference_id]/route.js +0 -61
@@ -1,21 +1,15 @@
1
1
  import { AuthenticatedMedusaRequest, MedusaResponse } from '@medusajs/framework';
2
2
  /**
3
- * @oas [delete] /store/wishlist/{id}/product/{reference_id}
3
+ * @oas [delete] /store/wishlist/product/{reference_id}
4
4
  * operationId: "StoreDeleteWishlist"
5
5
  * summary: "Delete a wishlist entry"
6
- * description: "Deletes a wishlist entry by its ID for the authenticated user."
6
+ * description: "Removes an item from the wishlist of the currently authenticated user. The wishlist is resolved from the logged-in customer."
7
7
  * x-authenticated: true
8
8
  * parameters:
9
- * - name: id
10
- * in: path
11
- * required: true
12
- * description: The ID of the wishlist entry to delete.
13
- * schema:
14
- * type: string
15
9
  * - name: reference_id
16
10
  * in: path
17
11
  * required: true
18
- * description: The ID of the wishlist entry to delete.
12
+ * description: ID of the product (wishlist entry) to remove.
19
13
  * schema:
20
14
  * type: string
21
15
  * responses:
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DELETE = void 0;
4
+ const workflows_1 = require("../../../../../workflows/wishlist/workflows");
5
+ const utils_1 = require("../../../../../modules/wishlist/utils");
6
+ const utils_2 = require("@medusajs/framework/utils");
7
+ /**
8
+ * @oas [delete] /store/wishlist/product/{reference_id}
9
+ * operationId: "StoreDeleteWishlist"
10
+ * summary: "Delete a wishlist entry"
11
+ * description: "Removes an item from the wishlist of the currently authenticated user. The wishlist is resolved from the logged-in customer."
12
+ * x-authenticated: true
13
+ * parameters:
14
+ * - name: reference_id
15
+ * in: path
16
+ * required: true
17
+ * description: ID of the product (wishlist entry) to remove.
18
+ * schema:
19
+ * type: string
20
+ * responses:
21
+ * "200":
22
+ * description: OK
23
+ * content:
24
+ * application/json:
25
+ * schema:
26
+ * type: object
27
+ * properties:
28
+ * id:
29
+ * type: string
30
+ * description: Id of the wishlsit nad reference id.
31
+ * reference_id:
32
+ * type: string
33
+ * object:
34
+ * type: string
35
+ * description: The type of resource
36
+ * deleted:
37
+ * type: boolean
38
+ * description: Indicates if the wishlist entry was deleted.
39
+ * tags:
40
+ * - Store Wishlist
41
+ * security:
42
+ * - api_token: []
43
+ * - cookie_auth: []
44
+ */
45
+ const DELETE = async (req, res) => {
46
+ const wishlist = await (0, utils_1.getWishlistFromCustomerId)(req.scope, req.auth_context.actor_id);
47
+ if (!wishlist) {
48
+ throw new utils_2.MedusaError(utils_2.MedusaError.Types.NOT_FOUND, 'Wishlist not found for current customer');
49
+ }
50
+ await workflows_1.deleteWishlistEntryWorkflow.run({
51
+ container: req.scope,
52
+ input: {
53
+ id: wishlist.id,
54
+ reference_id: req.params.reference_id
55
+ }
56
+ });
57
+ res.json({
58
+ id: wishlist.id,
59
+ reference_id: req.params.reference_id,
60
+ object: 'wishlist',
61
+ deleted: true
62
+ });
63
+ };
64
+ exports.DELETE = DELETE;
65
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3N0b3JlL3dpc2hsaXN0L3Byb2R1Y3QvW3JlZmVyZW5jZV9pZF0vcm91dGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsMkVBQXlGO0FBQ3pGLGlFQUFpRjtBQUNqRixxREFBdUQ7QUFFdkQ7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FxQ0c7QUFFSSxNQUFNLE1BQU0sR0FBRyxLQUFLLEVBQ3pCLEdBQStCLEVBQy9CLEdBQW1CLEVBQ25CLEVBQUU7SUFDRixNQUFNLFFBQVEsR0FBRyxNQUFNLElBQUEsaUNBQXlCLEVBQzlDLEdBQUcsQ0FBQyxLQUFLLEVBQ1QsR0FBRyxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQzFCLENBQUE7SUFFRCxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7UUFDZCxNQUFNLElBQUksbUJBQVcsQ0FBQyxtQkFBVyxDQUFDLEtBQUssQ0FBQyxTQUFTLEVBQUUseUNBQXlDLENBQUMsQ0FBQTtJQUMvRixDQUFDO0lBRUQsTUFBTSx1Q0FBMkIsQ0FBQyxHQUFHLENBQUM7UUFDcEMsU0FBUyxFQUFFLEdBQUcsQ0FBQyxLQUFLO1FBQ3BCLEtBQUssRUFBRTtZQUNMLEVBQUUsRUFBRSxRQUFRLENBQUMsRUFBRTtZQUNmLFlBQVksRUFBRSxHQUFHLENBQUMsTUFBTSxDQUFDLFlBQVk7U0FDdEM7S0FDRixDQUFDLENBQUE7SUFFRixHQUFHLENBQUMsSUFBSSxDQUFDO1FBQ1AsRUFBRSxFQUFFLFFBQVEsQ0FBQyxFQUFFO1FBQ2YsWUFBWSxFQUFFLEdBQUcsQ0FBQyxNQUFNLENBQUMsWUFBWTtRQUNyQyxNQUFNLEVBQUUsVUFBVTtRQUNsQixPQUFPLEVBQUUsSUFBSTtLQUNkLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQTNCWSxRQUFBLE1BQU0sVUEyQmxCIn0=