@mercurjs/core 2.2.0-canary.22 → 2.2.0-canary.24
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/.medusa/server/src/api/admin/collections/query-config.js +7 -7
- package/.medusa/server/src/api/admin/offers/query-config.js +2 -1
- package/.medusa/server/src/api/admin/product-attributes/validators.d.ts +4 -4
- package/.medusa/server/src/api/admin/product-categories/query-config.js +7 -7
- package/.medusa/server/src/api/store/middlewares.js +13 -11
- package/.medusa/server/src/api/store/offers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/store/offers/[id]/route.js +28 -0
- package/.medusa/server/src/api/store/offers/helpers.d.ts +43 -0
- package/.medusa/server/src/api/store/offers/helpers.js +191 -0
- package/.medusa/server/src/api/store/offers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/offers/middlewares.js +64 -0
- package/.medusa/server/src/api/store/offers/query-config.d.ts +12 -0
- package/.medusa/server/src/api/store/offers/query-config.js +50 -0
- package/.medusa/server/src/api/store/offers/route.d.ts +3 -0
- package/.medusa/server/src/api/store/offers/route.js +30 -0
- package/.medusa/server/src/api/store/offers/validators.d.ts +159 -0
- package/.medusa/server/src/api/store/offers/validators.js +29 -0
- package/.medusa/server/src/api/store/products/middlewares.js +22 -20
- package/.medusa/server/src/api/utils/sellers.d.ts +2 -0
- package/.medusa/server/src/api/utils/sellers.js +23 -0
- package/.medusa/server/src/api/vendor/collections/query-config.js +7 -7
- package/.medusa/server/src/api/vendor/offers/query-config.js +2 -1
- package/.medusa/server/src/api/vendor/product-attributes/validators.d.ts +4 -4
- package/.medusa/server/src/api/vendor/product-categories/query-config.js +7 -7
- package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +6 -6
- package/.medusa/server/src/links/media-product-category-link.d.ts +11 -3
- package/.medusa/server/src/links/media-product-category-link.js +16 -5
- package/.medusa/server/src/links/media-product-collection-link.d.ts +8 -1
- package/.medusa/server/src/links/media-product-collection-link.js +13 -3
- package/.medusa/server/src/links/offer-product-link.d.ts +2 -0
- package/.medusa/server/src/links/offer-product-link.js +15 -0
- package/.medusa/server/src/modules/media/index.d.ts +5 -5
- package/.medusa/server/src/modules/media/models/index.d.ts +1 -1
- package/.medusa/server/src/modules/media/models/index.js +4 -4
- package/.medusa/server/src/modules/media/models/{image.d.ts → media-image.d.ts} +9 -5
- package/.medusa/server/src/modules/media/models/media-image.js +41 -0
- package/.medusa/server/src/modules/media/service.d.ts +2 -2
- package/.medusa/server/src/modules/media/service.js +2 -2
- package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.d.ts +5 -0
- package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.js +16 -0
- package/.medusa/server/src/modules/offer/models/offer.d.ts +1 -0
- package/.medusa/server/src/modules/offer/models/offer.js +7 -1
- package/.medusa/server/src/modules/offer/service.d.ts +1 -0
- package/.medusa/server/src/workflows/media/steps/create-images.js +3 -3
- package/.medusa/server/src/workflows/media/steps/delete-images.js +3 -3
- package/.medusa/server/src/workflows/media/workflows/set-category-images.js +5 -5
- package/.medusa/server/src/workflows/media/workflows/set-collection-images.js +5 -5
- package/.medusa/server/src/workflows/offer/steps/create-offers.d.ts +1 -0
- package/.medusa/server/src/workflows/offer/steps/update-offers.d.ts +1 -0
- package/.medusa/server/src/workflows/offer/workflows/create-offers.js +3 -2
- package/package.json +1 -1
- package/.medusa/server/src/modules/media/models/image.js +0 -37
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type StoreGetOfferParamsType = z.infer<typeof StoreGetOfferParams>;
|
|
3
|
+
export declare const StoreGetOfferParams: z.ZodObject<{
|
|
4
|
+
fields: z.ZodOptional<z.ZodString>;
|
|
5
|
+
} & {
|
|
6
|
+
region_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
country_code: z.ZodOptional<z.ZodString>;
|
|
8
|
+
province: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cart_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
fields?: string | undefined;
|
|
12
|
+
country_code?: string | undefined;
|
|
13
|
+
province?: string | undefined;
|
|
14
|
+
cart_id?: string | undefined;
|
|
15
|
+
region_id?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
fields?: string | undefined;
|
|
18
|
+
country_code?: string | undefined;
|
|
19
|
+
province?: string | undefined;
|
|
20
|
+
cart_id?: string | undefined;
|
|
21
|
+
region_id?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type StoreGetOffersParamsType = z.infer<typeof StoreGetOffersParams>;
|
|
24
|
+
export declare const StoreGetOffersParams: z.ZodObject<{
|
|
25
|
+
fields: z.ZodOptional<z.ZodString>;
|
|
26
|
+
} & {
|
|
27
|
+
offset: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
|
|
28
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
|
|
29
|
+
order: z.ZodOptional<z.ZodString> | z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
30
|
+
with_deleted: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
31
|
+
} & {
|
|
32
|
+
region_id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
country_code: z.ZodOptional<z.ZodString>;
|
|
34
|
+
province: z.ZodOptional<z.ZodString>;
|
|
35
|
+
cart_id: z.ZodOptional<z.ZodString>;
|
|
36
|
+
} & {
|
|
37
|
+
q: z.ZodOptional<z.ZodString>;
|
|
38
|
+
id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
39
|
+
product_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
40
|
+
variant_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
41
|
+
seller_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
42
|
+
sku: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
43
|
+
created_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
|
|
44
|
+
$eq: any;
|
|
45
|
+
$ne: any;
|
|
46
|
+
$in: any;
|
|
47
|
+
$nin: any;
|
|
48
|
+
$like: any;
|
|
49
|
+
$ilike: any;
|
|
50
|
+
$re: any;
|
|
51
|
+
$contains: any;
|
|
52
|
+
$gt: any;
|
|
53
|
+
$gte: any;
|
|
54
|
+
$lt: any;
|
|
55
|
+
$lte: any;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
$eq?: any;
|
|
58
|
+
$ne?: any;
|
|
59
|
+
$in?: any;
|
|
60
|
+
$nin?: any;
|
|
61
|
+
$like?: any;
|
|
62
|
+
$ilike?: any;
|
|
63
|
+
$re?: any;
|
|
64
|
+
$contains?: any;
|
|
65
|
+
$gt?: any;
|
|
66
|
+
$gte?: any;
|
|
67
|
+
$lt?: any;
|
|
68
|
+
$lte?: any;
|
|
69
|
+
}, {
|
|
70
|
+
$eq?: any;
|
|
71
|
+
$ne?: any;
|
|
72
|
+
$in?: any;
|
|
73
|
+
$nin?: any;
|
|
74
|
+
$like?: any;
|
|
75
|
+
$ilike?: any;
|
|
76
|
+
$re?: any;
|
|
77
|
+
$contains?: any;
|
|
78
|
+
$gt?: any;
|
|
79
|
+
$gte?: any;
|
|
80
|
+
$lt?: any;
|
|
81
|
+
$lte?: any;
|
|
82
|
+
}>]>>;
|
|
83
|
+
updated_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
|
|
84
|
+
$eq: any;
|
|
85
|
+
$ne: any;
|
|
86
|
+
$in: any;
|
|
87
|
+
$nin: any;
|
|
88
|
+
$like: any;
|
|
89
|
+
$ilike: any;
|
|
90
|
+
$re: any;
|
|
91
|
+
$contains: any;
|
|
92
|
+
$gt: any;
|
|
93
|
+
$gte: any;
|
|
94
|
+
$lt: any;
|
|
95
|
+
$lte: any;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
$eq?: any;
|
|
98
|
+
$ne?: any;
|
|
99
|
+
$in?: any;
|
|
100
|
+
$nin?: any;
|
|
101
|
+
$like?: any;
|
|
102
|
+
$ilike?: any;
|
|
103
|
+
$re?: any;
|
|
104
|
+
$contains?: any;
|
|
105
|
+
$gt?: any;
|
|
106
|
+
$gte?: any;
|
|
107
|
+
$lt?: any;
|
|
108
|
+
$lte?: any;
|
|
109
|
+
}, {
|
|
110
|
+
$eq?: any;
|
|
111
|
+
$ne?: any;
|
|
112
|
+
$in?: any;
|
|
113
|
+
$nin?: any;
|
|
114
|
+
$like?: any;
|
|
115
|
+
$ilike?: any;
|
|
116
|
+
$re?: any;
|
|
117
|
+
$contains?: any;
|
|
118
|
+
$gt?: any;
|
|
119
|
+
$gte?: any;
|
|
120
|
+
$lt?: any;
|
|
121
|
+
$lte?: any;
|
|
122
|
+
}>]>>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
offset: number;
|
|
125
|
+
limit: number;
|
|
126
|
+
order?: string | undefined;
|
|
127
|
+
seller_id?: string | string[] | undefined;
|
|
128
|
+
id?: string | string[] | undefined;
|
|
129
|
+
created_at?: any;
|
|
130
|
+
updated_at?: any;
|
|
131
|
+
q?: string | undefined;
|
|
132
|
+
fields?: string | undefined;
|
|
133
|
+
with_deleted?: boolean | undefined;
|
|
134
|
+
variant_id?: string | string[] | undefined;
|
|
135
|
+
product_id?: string | string[] | undefined;
|
|
136
|
+
sku?: string | string[] | undefined;
|
|
137
|
+
country_code?: string | undefined;
|
|
138
|
+
province?: string | undefined;
|
|
139
|
+
cart_id?: string | undefined;
|
|
140
|
+
region_id?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
order?: string | undefined;
|
|
143
|
+
seller_id?: string | string[] | undefined;
|
|
144
|
+
id?: string | string[] | undefined;
|
|
145
|
+
created_at?: any;
|
|
146
|
+
updated_at?: any;
|
|
147
|
+
offset?: unknown;
|
|
148
|
+
limit?: unknown;
|
|
149
|
+
q?: string | undefined;
|
|
150
|
+
fields?: string | undefined;
|
|
151
|
+
with_deleted?: unknown;
|
|
152
|
+
variant_id?: string | string[] | undefined;
|
|
153
|
+
product_id?: string | string[] | undefined;
|
|
154
|
+
sku?: string | string[] | undefined;
|
|
155
|
+
country_code?: string | undefined;
|
|
156
|
+
province?: string | undefined;
|
|
157
|
+
cart_id?: string | undefined;
|
|
158
|
+
region_id?: string | undefined;
|
|
159
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StoreGetOffersParams = exports.StoreGetOfferParams = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const validators_1 = require("@medusajs/medusa/api/utils/validators");
|
|
6
|
+
const StoreOfferContextFields = zod_1.z.object({
|
|
7
|
+
region_id: zod_1.z.string().optional(),
|
|
8
|
+
country_code: zod_1.z.string().optional(),
|
|
9
|
+
province: zod_1.z.string().optional(),
|
|
10
|
+
cart_id: zod_1.z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
const StoreOfferFilterFields = zod_1.z.object({
|
|
13
|
+
q: zod_1.z.string().optional(),
|
|
14
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
15
|
+
product_id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
16
|
+
variant_id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
17
|
+
seller_id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
18
|
+
sku: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
19
|
+
created_at: (0, validators_1.createOperatorMap)().optional(),
|
|
20
|
+
updated_at: (0, validators_1.createOperatorMap)().optional(),
|
|
21
|
+
});
|
|
22
|
+
exports.StoreGetOfferParams = (0, validators_1.createSelectParams)().merge(StoreOfferContextFields);
|
|
23
|
+
exports.StoreGetOffersParams = (0, validators_1.createFindParams)({
|
|
24
|
+
offset: 0,
|
|
25
|
+
limit: 50,
|
|
26
|
+
})
|
|
27
|
+
.merge(StoreOfferContextFields)
|
|
28
|
+
.merge(StoreOfferFilterFields);
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvc3RvcmUvb2ZmZXJzL3ZhbGlkYXRvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkJBQXVCO0FBQ3ZCLHNFQUk4QztBQUU5QyxNQUFNLHVCQUF1QixHQUFHLE9BQUMsQ0FBQyxNQUFNLENBQUM7SUFDdkMsU0FBUyxFQUFFLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDaEMsWUFBWSxFQUFFLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDbkMsUUFBUSxFQUFFLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDL0IsT0FBTyxFQUFFLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxRQUFRLEVBQUU7Q0FDL0IsQ0FBQyxDQUFBO0FBRUYsTUFBTSxzQkFBc0IsR0FBRyxPQUFDLENBQUMsTUFBTSxDQUFDO0lBQ3RDLENBQUMsRUFBRSxPQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3hCLEVBQUUsRUFBRSxPQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxFQUFFLE9BQUMsQ0FBQyxLQUFLLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsRUFBRTtJQUN6RCxVQUFVLEVBQUUsT0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLE9BQUMsQ0FBQyxNQUFNLEVBQUUsRUFBRSxPQUFDLENBQUMsS0FBSyxDQUFDLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLEVBQUU7SUFDakUsVUFBVSxFQUFFLE9BQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxPQUFDLENBQUMsTUFBTSxFQUFFLEVBQUUsT0FBQyxDQUFDLEtBQUssQ0FBQyxPQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBUSxFQUFFO0lBQ2pFLFNBQVMsRUFBRSxPQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxFQUFFLE9BQUMsQ0FBQyxLQUFLLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsRUFBRTtJQUNoRSxHQUFHLEVBQUUsT0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLE9BQUMsQ0FBQyxNQUFNLEVBQUUsRUFBRSxPQUFDLENBQUMsS0FBSyxDQUFDLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLEVBQUU7SUFDMUQsVUFBVSxFQUFFLElBQUEsOEJBQWlCLEdBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDMUMsVUFBVSxFQUFFLElBQUEsOEJBQWlCLEdBQUUsQ0FBQyxRQUFRLEVBQUU7Q0FDM0MsQ0FBQyxDQUFBO0FBR1csUUFBQSxtQkFBbUIsR0FDOUIsSUFBQSwrQkFBa0IsR0FBRSxDQUFDLEtBQUssQ0FBQyx1QkFBdUIsQ0FBQyxDQUFBO0FBR3hDLFFBQUEsb0JBQW9CLEdBQUcsSUFBQSw2QkFBZ0IsRUFBQztJQUNuRCxNQUFNLEVBQUUsQ0FBQztJQUNULEtBQUssRUFBRSxFQUFFO0NBQ1YsQ0FBQztLQUNDLEtBQUssQ0FBQyx1QkFBdUIsQ0FBQztLQUM5QixLQUFLLENBQUMsc0JBQXNCLENBQUMsQ0FBQSJ9
|
|
@@ -7,11 +7,26 @@ const framework_1 = require("@medusajs/framework");
|
|
|
7
7
|
const query_config_1 = require("./query-config");
|
|
8
8
|
const validators_1 = require("./validators");
|
|
9
9
|
const types_1 = require("@mercurjs/types");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const sellers_1 = require("../../utils/sellers");
|
|
11
|
+
/**
|
|
12
|
+
* Apply the store-facing defaults that vanilla Medusa applies on its own
|
|
13
|
+
* `/store/products` route. Besides forcing the `published` status, this
|
|
14
|
+
* translates the Medusa-standard `category_id` query param into the
|
|
15
|
+
* `categories` relation filter. The `Product` entity has no `category_id`
|
|
16
|
+
* column, so passing it straight to `query.graph` raises
|
|
17
|
+
* `Trying to query by not existing property Product.category_id` (#974).
|
|
18
|
+
*/
|
|
19
|
+
const applyProductFilters = (0, http_1.applyDefaultFilters)({
|
|
20
|
+
status: types_1.ProductStatus.PUBLISHED,
|
|
21
|
+
categories: (filters) => {
|
|
22
|
+
const categoryIds = filters.category_id;
|
|
23
|
+
delete filters.category_id;
|
|
24
|
+
if (!(0, utils_1.isPresent)(categoryIds)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
return { id: categoryIds, is_internal: false, is_active: true };
|
|
28
|
+
},
|
|
29
|
+
});
|
|
15
30
|
/**
|
|
16
31
|
* Resolve sellers that are currently OPEN and not within an active
|
|
17
32
|
* closure window, then expose their IDs as `seller_id` so the link
|
|
@@ -19,21 +34,8 @@ const applyProductFilters = (req, _res, next) => {
|
|
|
19
34
|
* `product_seller` join entity.
|
|
20
35
|
*/
|
|
21
36
|
async function applyVisibleSellerIdsFilter(req, _res, next) {
|
|
22
|
-
const query = req.scope.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
23
|
-
const now = new Date();
|
|
24
|
-
const { data: visibleSellers } = await query.graph({
|
|
25
|
-
entity: "seller",
|
|
26
|
-
fields: ["id"],
|
|
27
|
-
filters: {
|
|
28
|
-
status: types_1.SellerStatus.OPEN,
|
|
29
|
-
$and: [
|
|
30
|
-
{ $or: [{ closed_from: null }, { closed_from: { $gt: now } }] },
|
|
31
|
-
{ $or: [{ closed_to: null }, { closed_to: { $lt: now } }] },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
37
|
req.filterableFields ??= {};
|
|
36
|
-
req.filterableFields.seller_id =
|
|
38
|
+
req.filterableFields.seller_id = await (0, sellers_1.resolveVisibleSellerIds)(req.scope);
|
|
37
39
|
next();
|
|
38
40
|
}
|
|
39
41
|
exports.storeProductsMiddlewares = [
|
|
@@ -66,4 +68,4 @@ exports.storeProductsMiddlewares = [
|
|
|
66
68
|
],
|
|
67
69
|
},
|
|
68
70
|
];
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3N0b3JlL3Byb2R1Y3RzL21pZGRsZXdhcmVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1EQU9pQztBQUNqQyxxREFBcUQ7QUFDckQsbURBQStEO0FBRS9ELGlEQUF3RDtBQUN4RCw2Q0FHcUI7QUFDckIsMkNBQStDO0FBQy9DLGlEQUE2RDtBQUU3RDs7Ozs7OztHQU9HO0FBQ0gsTUFBTSxtQkFBbUIsR0FBRyxJQUFBLDBCQUFtQixFQUFDO0lBQzlDLE1BQU0sRUFBRSxxQkFBYSxDQUFDLFNBQVM7SUFDL0IsVUFBVSxFQUFFLENBQUMsT0FBZ0MsRUFBRSxFQUFFO1FBQy9DLE1BQU0sV0FBVyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUE7UUFDdkMsT0FBTyxPQUFPLENBQUMsV0FBVyxDQUFBO1FBRTFCLElBQUksQ0FBQyxJQUFBLGlCQUFTLEVBQUMsV0FBVyxDQUFDLEVBQUUsQ0FBQztZQUM1QixPQUFNO1FBQ1IsQ0FBQztRQUVELE9BQU8sRUFBRSxFQUFFLEVBQUUsV0FBVyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxDQUFBO0lBQ2pFLENBQUM7Q0FDRixDQUFDLENBQUE7QUFFRjs7Ozs7R0FLRztBQUNILEtBQUssVUFBVSwyQkFBMkIsQ0FDeEMsR0FBa0IsRUFDbEIsSUFBb0IsRUFDcEIsSUFBd0I7SUFFeEIsR0FBRyxDQUFDLGdCQUFnQixLQUFLLEVBQUUsQ0FBQTtJQUMzQixHQUFHLENBQUMsZ0JBQWdCLENBQUMsU0FBUyxHQUFHLE1BQU0sSUFBQSxpQ0FBdUIsRUFBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFekUsSUFBSSxFQUFFLENBQUE7QUFDUixDQUFDO0FBRVksUUFBQSx3QkFBd0IsR0FBc0I7SUFDekQ7UUFDRSxNQUFNLEVBQUUsQ0FBQyxLQUFLLENBQUM7UUFDZixPQUFPLEVBQUUsaUJBQWlCO1FBQzFCLFdBQVcsRUFBRTtZQUNYLElBQUEscUNBQXlCLEVBQ3ZCLG1DQUFzQixFQUN0QixzQ0FBdUIsQ0FBQyxJQUFJLENBQzdCO1lBQ0QsbUJBQW1CO1lBQ25CLDJCQUEyQjtZQUMzQixJQUFBLDJCQUFvQixFQUFDO2dCQUNuQixVQUFVLEVBQUUsZ0JBQWdCO2dCQUM1QixVQUFVLEVBQUUsWUFBWTtnQkFDeEIsZUFBZSxFQUFFLFdBQVc7YUFDN0IsQ0FBQztTQUNIO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxDQUFDLEtBQUssQ0FBQztRQUNmLE9BQU8sRUFBRSxxQkFBcUI7UUFDOUIsV0FBVyxFQUFFO1lBQ1gsSUFBQSxxQ0FBeUIsRUFDdkIsa0NBQXFCLEVBQ3JCLHNDQUF1QixDQUFDLFFBQVEsQ0FDakM7WUFDRCxtQkFBbUI7WUFDbkIsMkJBQTJCO1lBQzNCLElBQUEsMkJBQW9CLEVBQUM7Z0JBQ25CLFVBQVUsRUFBRSxnQkFBZ0I7Z0JBQzVCLFVBQVUsRUFBRSxZQUFZO2dCQUN4QixlQUFlLEVBQUUsV0FBVzthQUM3QixDQUFDO1NBQ0g7S0FDRjtDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveVisibleSellerIds = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const types_1 = require("@mercurjs/types");
|
|
6
|
+
const resolveVisibleSellerIds = async (scope) => {
|
|
7
|
+
const query = scope.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
8
|
+
const now = new Date();
|
|
9
|
+
const { data: visibleSellers } = await query.graph({
|
|
10
|
+
entity: "seller",
|
|
11
|
+
fields: ["id"],
|
|
12
|
+
filters: {
|
|
13
|
+
status: types_1.SellerStatus.OPEN,
|
|
14
|
+
$and: [
|
|
15
|
+
{ $or: [{ closed_from: null }, { closed_from: { $gt: now } }] },
|
|
16
|
+
{ $or: [{ closed_to: null }, { closed_to: { $lt: now } }] },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return visibleSellers.map((s) => s.id);
|
|
21
|
+
};
|
|
22
|
+
exports.resolveVisibleSellerIds = resolveVisibleSellerIds;
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsbGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvdXRpbHMvc2VsbGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxREFBcUU7QUFFckUsMkNBQThDO0FBRXZDLE1BQU0sdUJBQXVCLEdBQUcsS0FBSyxFQUMxQyxLQUFzQixFQUNILEVBQUU7SUFDckIsTUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxpQ0FBeUIsQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUM1RCxNQUFNLEdBQUcsR0FBRyxJQUFJLElBQUksRUFBRSxDQUFBO0lBRXRCLE1BQU0sRUFBRSxJQUFJLEVBQUUsY0FBYyxFQUFFLEdBQUcsTUFBTSxLQUFLLENBQUMsS0FBSyxDQUFDO1FBQ2pELE1BQU0sRUFBRSxRQUFRO1FBQ2hCLE1BQU0sRUFBRSxDQUFDLElBQUksQ0FBQztRQUNkLE9BQU8sRUFBRTtZQUNQLE1BQU0sRUFBRSxvQkFBWSxDQUFDLElBQUk7WUFDekIsSUFBSSxFQUFFO2dCQUNKLEVBQUUsR0FBRyxFQUFFLENBQUMsRUFBRSxXQUFXLEVBQUUsSUFBSSxFQUFFLEVBQUUsRUFBRSxXQUFXLEVBQUUsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEVBQUUsQ0FBQyxFQUFFO2dCQUMvRCxFQUFFLEdBQUcsRUFBRSxDQUFDLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxFQUFFLEVBQUUsU0FBUyxFQUFFLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxFQUFFLENBQUMsRUFBRTthQUM1RDtTQUNGO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsT0FBTyxjQUFjLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBaUIsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFBO0FBQ3hELENBQUMsQ0FBQTtBQW5CWSxRQUFBLHVCQUF1QiwyQkFtQm5DIn0=
|
|
@@ -8,12 +8,12 @@ exports.defaultVendorCollectionFields = [
|
|
|
8
8
|
"created_at",
|
|
9
9
|
"updated_at",
|
|
10
10
|
"metadata",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
11
|
+
"media_images.id",
|
|
12
|
+
"media_images.url",
|
|
13
|
+
"media_images.type",
|
|
14
|
+
"media_images.is_thumbnail",
|
|
15
|
+
"media_images.is_banner",
|
|
16
|
+
"media_images.rank",
|
|
17
17
|
];
|
|
18
18
|
exports.retrieveTransformQueryConfig = {
|
|
19
19
|
defaults: exports.defaultVendorCollectionFields,
|
|
@@ -23,4 +23,4 @@ exports.listTransformQueryConfig = {
|
|
|
23
23
|
...exports.retrieveTransformQueryConfig,
|
|
24
24
|
isList: true,
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwaS92ZW5kb3IvY29sbGVjdGlvbnMvcXVlcnktY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFhLFFBQUEsNkJBQTZCLEdBQUc7SUFDM0MsSUFBSTtJQUNKLE9BQU87SUFDUCxRQUFRO0lBQ1IsWUFBWTtJQUNaLFlBQVk7SUFDWixVQUFVO0lBQ1YsaUJBQWlCO0lBQ2pCLGtCQUFrQjtJQUNsQixtQkFBbUI7SUFDbkIsMkJBQTJCO0lBQzNCLHdCQUF3QjtJQUN4QixtQkFBbUI7Q0FDcEIsQ0FBQTtBQUVZLFFBQUEsNEJBQTRCLEdBQUc7SUFDMUMsUUFBUSxFQUFFLHFDQUE2QjtJQUN2QyxNQUFNLEVBQUUsS0FBSztDQUNkLENBQUE7QUFFWSxRQUFBLHdCQUF3QixHQUFHO0lBQ3RDLEdBQUcsb0NBQTRCO0lBQy9CLE1BQU0sRUFBRSxJQUFJO0NBQ2IsQ0FBQSJ9
|
|
@@ -5,6 +5,7 @@ exports.defaultVendorOfferFields = [
|
|
|
5
5
|
"id",
|
|
6
6
|
"seller_id",
|
|
7
7
|
"variant_id",
|
|
8
|
+
"product_id",
|
|
8
9
|
"shipping_profile_id",
|
|
9
10
|
"sku",
|
|
10
11
|
"ean",
|
|
@@ -44,4 +45,4 @@ exports.vendorOfferQueryConfig = {
|
|
|
44
45
|
isList: false,
|
|
45
46
|
},
|
|
46
47
|
};
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwaS92ZW5kb3Ivb2ZmZXJzL3F1ZXJ5LWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBYSxRQUFBLHdCQUF3QixHQUFHO0lBQ3RDLElBQUk7SUFDSixXQUFXO0lBQ1gsWUFBWTtJQUNaLFlBQVk7SUFDWixxQkFBcUI7SUFDckIsS0FBSztJQUNMLEtBQUs7SUFDTCxLQUFLO0lBQ0wsWUFBWTtJQUNaLFVBQVU7SUFDVixZQUFZO0lBQ1osWUFBWTtJQUNaLFlBQVk7SUFDWixXQUFXO0lBQ1gsYUFBYTtJQUNiLGVBQWU7SUFDZixvQkFBb0I7SUFDcEIsdUJBQXVCO0lBQ3ZCLHFCQUFxQjtJQUNyQixxQkFBcUI7SUFDckIsdUJBQXVCO0lBQ3ZCLFdBQVc7SUFDWCxlQUFlO0lBQ2Ysc0JBQXNCO0lBQ3RCLHFCQUFxQjtJQUNyQixxQkFBcUI7SUFDckIsOEJBQThCO0lBQzlCLDBCQUEwQjtJQUMxQixtQ0FBbUM7SUFDbkMsbUNBQW1DO0lBQ25DLG9CQUFvQjtJQUNwQixxQkFBcUI7Q0FDdEIsQ0FBQTtBQUVZLFFBQUEsc0JBQXNCLEdBQUc7SUFDcEMsSUFBSSxFQUFFO1FBQ0osUUFBUSxFQUFFLGdDQUF3QjtRQUNsQyxNQUFNLEVBQUUsSUFBSTtLQUNiO0lBQ0QsUUFBUSxFQUFFO1FBQ1IsUUFBUSxFQUFFLGdDQUF3QjtRQUNsQyxNQUFNLEVBQUUsS0FBSztLQUNkO0NBQ0YsQ0FBQSJ9
|
|
@@ -109,11 +109,11 @@ export declare const VendorGetProductAttributesParams: z.ZodObject<{} & {
|
|
|
109
109
|
updated_at?: any;
|
|
110
110
|
type?: AttributeType | AttributeType[] | undefined;
|
|
111
111
|
q?: string | undefined;
|
|
112
|
+
product_id?: string | string[] | null | undefined;
|
|
112
113
|
handle?: string | string[] | undefined;
|
|
113
114
|
is_active?: boolean | undefined;
|
|
114
115
|
is_variant_axis?: boolean | undefined;
|
|
115
116
|
is_required?: boolean | undefined;
|
|
116
|
-
product_id?: string | string[] | null | undefined;
|
|
117
117
|
is_filterable?: boolean | undefined;
|
|
118
118
|
category_id?: string | string[] | undefined;
|
|
119
119
|
}, {
|
|
@@ -122,11 +122,11 @@ export declare const VendorGetProductAttributesParams: z.ZodObject<{} & {
|
|
|
122
122
|
updated_at?: any;
|
|
123
123
|
type?: AttributeType | AttributeType[] | undefined;
|
|
124
124
|
q?: string | undefined;
|
|
125
|
+
product_id?: string | string[] | null | undefined;
|
|
125
126
|
handle?: string | string[] | undefined;
|
|
126
127
|
is_active?: string | boolean | undefined;
|
|
127
128
|
is_variant_axis?: string | boolean | undefined;
|
|
128
129
|
is_required?: string | boolean | undefined;
|
|
129
|
-
product_id?: string | string[] | null | undefined;
|
|
130
130
|
is_filterable?: string | boolean | undefined;
|
|
131
131
|
category_id?: string | string[] | undefined;
|
|
132
132
|
}>, "many">>>;
|
|
@@ -227,11 +227,11 @@ export declare const VendorGetProductAttributesParams: z.ZodObject<{} & {
|
|
|
227
227
|
updated_at?: any;
|
|
228
228
|
type?: AttributeType | AttributeType[] | undefined;
|
|
229
229
|
q?: string | undefined;
|
|
230
|
+
product_id?: string | string[] | null | undefined;
|
|
230
231
|
handle?: string | string[] | undefined;
|
|
231
232
|
is_active?: boolean | undefined;
|
|
232
233
|
is_variant_axis?: boolean | undefined;
|
|
233
234
|
is_required?: boolean | undefined;
|
|
234
|
-
product_id?: string | string[] | null | undefined;
|
|
235
235
|
is_filterable?: boolean | undefined;
|
|
236
236
|
category_id?: string | string[] | undefined;
|
|
237
237
|
}, {
|
|
@@ -240,11 +240,11 @@ export declare const VendorGetProductAttributesParams: z.ZodObject<{} & {
|
|
|
240
240
|
updated_at?: any;
|
|
241
241
|
type?: AttributeType | AttributeType[] | undefined;
|
|
242
242
|
q?: string | undefined;
|
|
243
|
+
product_id?: string | string[] | null | undefined;
|
|
243
244
|
handle?: string | string[] | undefined;
|
|
244
245
|
is_active?: string | boolean | undefined;
|
|
245
246
|
is_variant_axis?: string | boolean | undefined;
|
|
246
247
|
is_required?: string | boolean | undefined;
|
|
247
|
-
product_id?: string | string[] | null | undefined;
|
|
248
248
|
is_filterable?: string | boolean | undefined;
|
|
249
249
|
category_id?: string | string[] | undefined;
|
|
250
250
|
}>, "many">>>;
|
|
@@ -16,12 +16,12 @@ exports.vendorProductCategoryFields = [
|
|
|
16
16
|
"metadata",
|
|
17
17
|
"*parent_category",
|
|
18
18
|
"*category_children",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
19
|
+
"media_images.id",
|
|
20
|
+
"media_images.url",
|
|
21
|
+
"media_images.type",
|
|
22
|
+
"media_images.is_thumbnail",
|
|
23
|
+
"media_images.is_banner",
|
|
24
|
+
"media_images.rank",
|
|
25
25
|
];
|
|
26
26
|
exports.vendorProductCategoryQueryConfig = {
|
|
27
27
|
list: {
|
|
@@ -34,4 +34,4 @@ exports.vendorProductCategoryQueryConfig = {
|
|
|
34
34
|
isList: false,
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwaS92ZW5kb3IvcHJvZHVjdC1jYXRlZ29yaWVzL3F1ZXJ5LWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBYSxRQUFBLDJCQUEyQixHQUFHO0lBQ3pDLElBQUk7SUFDSixNQUFNO0lBQ04sYUFBYTtJQUNiLFFBQVE7SUFDUixXQUFXO0lBQ1gsYUFBYTtJQUNiLGVBQWU7SUFDZixNQUFNO0lBQ04sb0JBQW9CO0lBQ3BCLFlBQVk7SUFDWixZQUFZO0lBQ1osVUFBVTtJQUNWLGtCQUFrQjtJQUNsQixvQkFBb0I7SUFDcEIsaUJBQWlCO0lBQ2pCLGtCQUFrQjtJQUNsQixtQkFBbUI7SUFDbkIsMkJBQTJCO0lBQzNCLHdCQUF3QjtJQUN4QixtQkFBbUI7Q0FDcEIsQ0FBQTtBQUVZLFFBQUEsZ0NBQWdDLEdBQUc7SUFDOUMsSUFBSSxFQUFFO1FBQ0osUUFBUSxFQUFFLG1DQUEyQjtRQUNyQyxZQUFZLEVBQUUsRUFBRTtRQUNoQixNQUFNLEVBQUUsSUFBSTtLQUNiO0lBQ0QsUUFBUSxFQUFFO1FBQ1IsUUFBUSxFQUFFLG1DQUEyQjtRQUNyQyxNQUFNLEVBQUUsS0FBSztLQUNkO0NBQ0YsQ0FBQSJ9
|
|
@@ -134,11 +134,11 @@ export declare const VendorGetProductVariantsParamsFields: z.ZodObject<{
|
|
|
134
134
|
created_at?: any;
|
|
135
135
|
updated_at?: any;
|
|
136
136
|
q?: string | undefined;
|
|
137
|
+
product_id?: string | string[] | undefined;
|
|
137
138
|
sku?: string | string[] | undefined;
|
|
138
139
|
ean?: string | string[] | undefined;
|
|
139
140
|
upc?: string | string[] | undefined;
|
|
140
141
|
deleted_at?: any;
|
|
141
|
-
product_id?: string | string[] | undefined;
|
|
142
142
|
barcode?: string | string[] | undefined;
|
|
143
143
|
manage_inventory?: boolean | undefined;
|
|
144
144
|
allow_backorder?: boolean | undefined;
|
|
@@ -147,11 +147,11 @@ export declare const VendorGetProductVariantsParamsFields: z.ZodObject<{
|
|
|
147
147
|
created_at?: any;
|
|
148
148
|
updated_at?: any;
|
|
149
149
|
q?: string | undefined;
|
|
150
|
+
product_id?: string | string[] | undefined;
|
|
150
151
|
sku?: string | string[] | undefined;
|
|
151
152
|
ean?: string | string[] | undefined;
|
|
152
153
|
upc?: string | string[] | undefined;
|
|
153
154
|
deleted_at?: any;
|
|
154
|
-
product_id?: string | string[] | undefined;
|
|
155
155
|
barcode?: string | string[] | undefined;
|
|
156
156
|
manage_inventory?: string | boolean | undefined;
|
|
157
157
|
allow_backorder?: string | boolean | undefined;
|
|
@@ -294,11 +294,11 @@ export declare const VendorGetProductVariantsParams: z.ZodObject<{} & {
|
|
|
294
294
|
created_at?: any;
|
|
295
295
|
updated_at?: any;
|
|
296
296
|
q?: string | undefined;
|
|
297
|
+
product_id?: string | string[] | undefined;
|
|
297
298
|
sku?: string | string[] | undefined;
|
|
298
299
|
ean?: string | string[] | undefined;
|
|
299
300
|
upc?: string | string[] | undefined;
|
|
300
301
|
deleted_at?: any;
|
|
301
|
-
product_id?: string | string[] | undefined;
|
|
302
302
|
barcode?: string | string[] | undefined;
|
|
303
303
|
manage_inventory?: boolean | undefined;
|
|
304
304
|
allow_backorder?: boolean | undefined;
|
|
@@ -307,11 +307,11 @@ export declare const VendorGetProductVariantsParams: z.ZodObject<{} & {
|
|
|
307
307
|
created_at?: any;
|
|
308
308
|
updated_at?: any;
|
|
309
309
|
q?: string | undefined;
|
|
310
|
+
product_id?: string | string[] | undefined;
|
|
310
311
|
sku?: string | string[] | undefined;
|
|
311
312
|
ean?: string | string[] | undefined;
|
|
312
313
|
upc?: string | string[] | undefined;
|
|
313
314
|
deleted_at?: any;
|
|
314
|
-
product_id?: string | string[] | undefined;
|
|
315
315
|
barcode?: string | string[] | undefined;
|
|
316
316
|
manage_inventory?: string | boolean | undefined;
|
|
317
317
|
allow_backorder?: string | boolean | undefined;
|
|
@@ -451,11 +451,11 @@ export declare const VendorGetProductVariantsParams: z.ZodObject<{} & {
|
|
|
451
451
|
created_at?: any;
|
|
452
452
|
updated_at?: any;
|
|
453
453
|
q?: string | undefined;
|
|
454
|
+
product_id?: string | string[] | undefined;
|
|
454
455
|
sku?: string | string[] | undefined;
|
|
455
456
|
ean?: string | string[] | undefined;
|
|
456
457
|
upc?: string | string[] | undefined;
|
|
457
458
|
deleted_at?: any;
|
|
458
|
-
product_id?: string | string[] | undefined;
|
|
459
459
|
barcode?: string | string[] | undefined;
|
|
460
460
|
manage_inventory?: boolean | undefined;
|
|
461
461
|
allow_backorder?: boolean | undefined;
|
|
@@ -464,11 +464,11 @@ export declare const VendorGetProductVariantsParams: z.ZodObject<{} & {
|
|
|
464
464
|
created_at?: any;
|
|
465
465
|
updated_at?: any;
|
|
466
466
|
q?: string | undefined;
|
|
467
|
+
product_id?: string | string[] | undefined;
|
|
467
468
|
sku?: string | string[] | undefined;
|
|
468
469
|
ean?: string | string[] | undefined;
|
|
469
470
|
upc?: string | string[] | undefined;
|
|
470
471
|
deleted_at?: any;
|
|
471
|
-
product_id?: string | string[] | undefined;
|
|
472
472
|
barcode?: string | string[] | undefined;
|
|
473
473
|
manage_inventory?: string | boolean | undefined;
|
|
474
474
|
allow_backorder?: string | boolean | undefined;
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Direction is category → media: the category owns its images, so
|
|
5
5
|
* `productCategory` is the parent linkable and `isList: true` sits on the
|
|
6
|
-
* image side. A category resolves its gallery + icon via
|
|
6
|
+
* image side. A category resolves its gallery + icon via
|
|
7
|
+
* `category.media_images`.
|
|
7
8
|
*
|
|
8
|
-
* The
|
|
9
|
-
*
|
|
9
|
+
* The reverse alias is `media_images`, NOT the bare `images`: ProductCategory
|
|
10
|
+
* lives in the Medusa product module, whose service config also owns the
|
|
11
|
+
* `Product.images` relation. Registering an `images` link alias on that shared
|
|
12
|
+
* service shadows the native relation and makes the joiner throw
|
|
13
|
+
* `Cannot resolve alias path "" that matches entity Product` on every product
|
|
14
|
+
* query. A distinct alias avoids the collision.
|
|
15
|
+
*
|
|
16
|
+
* The same `Image` model is reused for product collections via a second,
|
|
17
|
+
* analogous link — keep this entity-agnostic.
|
|
10
18
|
*/
|
|
11
19
|
declare const _default: import("@medusajs/framework/utils").DefineLinkExport;
|
|
12
20
|
export default _default;
|
|
@@ -11,13 +11,24 @@ const media_1 = __importDefault(require("../modules/media"));
|
|
|
11
11
|
*
|
|
12
12
|
* Direction is category → media: the category owns its images, so
|
|
13
13
|
* `productCategory` is the parent linkable and `isList: true` sits on the
|
|
14
|
-
* image side. A category resolves its gallery + icon via
|
|
14
|
+
* image side. A category resolves its gallery + icon via
|
|
15
|
+
* `category.media_images`.
|
|
15
16
|
*
|
|
16
|
-
* The
|
|
17
|
-
*
|
|
17
|
+
* The reverse alias is `media_images`, NOT the bare `images`: ProductCategory
|
|
18
|
+
* lives in the Medusa product module, whose service config also owns the
|
|
19
|
+
* `Product.images` relation. Registering an `images` link alias on that shared
|
|
20
|
+
* service shadows the native relation and makes the joiner throw
|
|
21
|
+
* `Cannot resolve alias path "" that matches entity Product` on every product
|
|
22
|
+
* query. A distinct alias avoids the collision.
|
|
23
|
+
*
|
|
24
|
+
* The same `Image` model is reused for product collections via a second,
|
|
25
|
+
* analogous link — keep this entity-agnostic.
|
|
18
26
|
*/
|
|
19
27
|
exports.default = (0, utils_1.defineLink)(product_1.default.linkable.productCategory, {
|
|
20
|
-
linkable:
|
|
28
|
+
linkable: {
|
|
29
|
+
...media_1.default.linkable.mediaImage,
|
|
30
|
+
alias: "media_images",
|
|
31
|
+
},
|
|
21
32
|
isList: true,
|
|
22
33
|
});
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVkaWEtcHJvZHVjdC1jYXRlZ29yeS1saW5rLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpbmtzL21lZGlhLXByb2R1Y3QtY2F0ZWdvcnktbGluay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHFEQUFzRDtBQUN0RCx1RUFBb0Q7QUFFcEQsNkRBQTBDO0FBRTFDOzs7Ozs7Ozs7Ozs7Ozs7OztHQWlCRztBQUNILGtCQUFlLElBQUEsa0JBQVUsRUFDdkIsaUJBQWEsQ0FBQyxRQUFRLENBQUMsZUFBZSxFQUN0QztJQUNFLFFBQVEsRUFBRTtRQUNSLEdBQUcsZUFBVyxDQUFDLFFBQVEsQ0FBQyxVQUFVO1FBQ2xDLEtBQUssRUFBRSxjQUFjO0tBQ3RCO0lBQ0QsTUFBTSxFQUFFLElBQUk7Q0FDYixDQUNGLENBQUEifQ==
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mirrors `media-product-category-link`: the collection owns its images, so
|
|
5
5
|
* `productCollection` is the parent linkable and `isList: true` sits on the
|
|
6
|
-
* image side. A collection resolves its gallery + icon via
|
|
6
|
+
* image side. A collection resolves its gallery + icon via
|
|
7
|
+
* `collection.media_images`.
|
|
8
|
+
*
|
|
9
|
+
* The reverse alias is `media_images`, NOT the bare `images`: ProductCollection
|
|
10
|
+
* lives in the Medusa product module, whose service config also owns the
|
|
11
|
+
* `Product.images` relation. An `images` link alias there shadows the native
|
|
12
|
+
* relation and breaks every product `query.graph` (see
|
|
13
|
+
* `media-product-category-link`).
|
|
7
14
|
*
|
|
8
15
|
* Reuses the same entity-agnostic `Image` model as categories.
|
|
9
16
|
*/
|
|
@@ -11,12 +11,22 @@ const media_1 = __importDefault(require("../modules/media"));
|
|
|
11
11
|
*
|
|
12
12
|
* Mirrors `media-product-category-link`: the collection owns its images, so
|
|
13
13
|
* `productCollection` is the parent linkable and `isList: true` sits on the
|
|
14
|
-
* image side. A collection resolves its gallery + icon via
|
|
14
|
+
* image side. A collection resolves its gallery + icon via
|
|
15
|
+
* `collection.media_images`.
|
|
16
|
+
*
|
|
17
|
+
* The reverse alias is `media_images`, NOT the bare `images`: ProductCollection
|
|
18
|
+
* lives in the Medusa product module, whose service config also owns the
|
|
19
|
+
* `Product.images` relation. An `images` link alias there shadows the native
|
|
20
|
+
* relation and breaks every product `query.graph` (see
|
|
21
|
+
* `media-product-category-link`).
|
|
15
22
|
*
|
|
16
23
|
* Reuses the same entity-agnostic `Image` model as categories.
|
|
17
24
|
*/
|
|
18
25
|
exports.default = (0, utils_1.defineLink)(product_1.default.linkable.productCollection, {
|
|
19
|
-
linkable:
|
|
26
|
+
linkable: {
|
|
27
|
+
...media_1.default.linkable.mediaImage,
|
|
28
|
+
alias: "media_images",
|
|
29
|
+
},
|
|
20
30
|
isList: true,
|
|
21
31
|
});
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVkaWEtcHJvZHVjdC1jb2xsZWN0aW9uLWxpbmsuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGlua3MvbWVkaWEtcHJvZHVjdC1jb2xsZWN0aW9uLWxpbmsudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxxREFBc0Q7QUFDdEQsdUVBQW9EO0FBRXBELDZEQUEwQztBQUUxQzs7Ozs7Ozs7Ozs7Ozs7O0dBZUc7QUFDSCxrQkFBZSxJQUFBLGtCQUFVLEVBQ3ZCLGlCQUFhLENBQUMsUUFBUSxDQUFDLGlCQUFpQixFQUN4QztJQUNFLFFBQVEsRUFBRTtRQUNSLEdBQUcsZUFBVyxDQUFDLFFBQVEsQ0FBQyxVQUFVO1FBQ2xDLEtBQUssRUFBRSxjQUFjO0tBQ3RCO0lBQ0QsTUFBTSxFQUFFLElBQUk7Q0FDYixDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
7
|
+
const product_1 = __importDefault(require("@medusajs/medusa/product"));
|
|
8
|
+
const offer_1 = __importDefault(require("../modules/offer"));
|
|
9
|
+
exports.default = (0, utils_1.defineLink)({
|
|
10
|
+
linkable: offer_1.default.linkable.offer,
|
|
11
|
+
field: "product_id",
|
|
12
|
+
}, product_1.default.linkable.product, {
|
|
13
|
+
readOnly: true,
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2ZmZXItcHJvZHVjdC1saW5rLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpbmtzL29mZmVyLXByb2R1Y3QtbGluay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHFEQUFzRDtBQUN0RCx1RUFBb0Q7QUFDcEQsNkRBQTBDO0FBRTFDLGtCQUFlLElBQUEsa0JBQVUsRUFDdkI7SUFDRSxRQUFRLEVBQUUsZUFBVyxDQUFDLFFBQVEsQ0FBQyxLQUFLO0lBQ3BDLEtBQUssRUFBRSxZQUFZO0NBQ3BCLEVBQ0QsaUJBQWEsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUM5QjtJQUNFLFFBQVEsRUFBRSxJQUFJO0NBQ2YsQ0FDRixDQUFBIn0=
|
|
@@ -2,17 +2,17 @@ import { MercurModules } from "@mercurjs/types";
|
|
|
2
2
|
import MediaModuleService from "./service";
|
|
3
3
|
declare const _default: import("@mercurjs/types").ModuleExports<typeof MediaModuleService> & {
|
|
4
4
|
linkable: {
|
|
5
|
-
readonly
|
|
5
|
+
readonly mediaImage: {
|
|
6
6
|
id: {
|
|
7
7
|
serviceName: MercurModules.MEDIA;
|
|
8
|
-
field: "
|
|
9
|
-
linkable: "
|
|
8
|
+
field: "mediaImage";
|
|
9
|
+
linkable: "media_image_id";
|
|
10
10
|
primaryKey: "id";
|
|
11
11
|
};
|
|
12
12
|
toJSON: () => {
|
|
13
13
|
serviceName: MercurModules.MEDIA;
|
|
14
|
-
field: "
|
|
15
|
-
linkable: "
|
|
14
|
+
field: "mediaImage";
|
|
15
|
+
linkable: "media_image_id";
|
|
16
16
|
primaryKey: "id";
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as MediaImage } from "./media-image";
|