@mercurjs/framework 1.4.4 → 1.5.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.
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/links/index.ts","../src/links/link-entrypoints.ts","../src/links/linkables.ts","../src/modules/index.ts","../src/types/index.ts","../src/types/algolia/algolia-entity.ts","../src/types/algolia/algolia-product.ts","../src/types/algolia/algolia-review.ts","../src/types/algolia/events.ts","../src/types/algolia/index-types.ts","../src/types/algolia/index.ts","../src/types/attribute/common.ts","../src/types/attribute/index.ts","../src/types/attribute/mutations.ts","../src/types/brand/index.ts","../src/types/brand/mutations.ts","../src/types/commission/common.ts","../src/types/commission/index.ts","../src/types/commission/mutations.ts","../src/types/configuration/common.ts","../src/types/configuration/index.ts","../src/types/configuration/mutations.ts","../src/types/marketplace/common.ts","../src/types/marketplace/events.ts","../src/types/marketplace/index.ts","../src/types/marketplace/mutations.ts","../src/types/order-return-request/common.ts","../src/types/order-return-request/index.ts","../src/types/order-return-request/mutations.ts","../src/types/payment-stripe-connect/index.ts","../src/types/payout/common.ts","../src/types/payout/events.ts","../src/types/payout/index.ts","../src/types/payout/mutations.ts","../src/types/payout/provider.ts","../src/types/requests/common.ts","../src/types/requests/events.ts","../src/types/requests/humanize_types.ts","../src/types/requests/index.ts","../src/types/requests/mutations.ts","../src/types/reviews/common.ts","../src/types/reviews/index.ts","../src/types/reviews/mutatations.ts","../src/types/seller/common.ts","../src/types/seller/events.ts","../src/types/seller/index.ts","../src/types/seller/mutations.ts","../src/types/split-order-payment/common.ts","../src/types/split-order-payment/index.ts","../src/types/split-order-payment/mutations.ts","../src/types/wishlist/common.ts","../src/types/wishlist/index.ts","../src/types/wishlist/mutations.ts","../src/utils/admin.ts","../src/utils/configuration.ts","../src/utils/hosts.ts","../src/utils/index.ts","../src/utils/money.ts","../src/utils/seller.ts","../src/utils/middlewares/apply-reference-filter.ts","../src/utils/middlewares/check-customer-ownership.ts","../src/utils/middlewares/check-ownership.ts","../src/utils/middlewares/filter-by-seller-id.ts","../src/utils/middlewares/index.ts","../src/workflows/emit-multiple-events-step.ts","../src/workflows/index.ts","../src/workflows/update-product-status.ts"],"version":"5.8.2"}
1
+ {"root":["../src/index.ts","../src/links/index.ts","../src/links/link-entrypoints.ts","../src/links/linkables.ts","../src/modules/index.ts","../src/types/index.ts","../src/types/algolia/algolia-entity.ts","../src/types/algolia/algolia-product.ts","../src/types/algolia/algolia-review.ts","../src/types/algolia/events.ts","../src/types/algolia/index-types.ts","../src/types/algolia/index.ts","../src/types/attribute/common.ts","../src/types/attribute/index.ts","../src/types/attribute/mutations.ts","../src/types/brand/index.ts","../src/types/brand/mutations.ts","../src/types/commission/common.ts","../src/types/commission/index.ts","../src/types/commission/mutations.ts","../src/types/configuration/common.ts","../src/types/configuration/index.ts","../src/types/configuration/mutations.ts","../src/types/marketplace/common.ts","../src/types/marketplace/events.ts","../src/types/marketplace/index.ts","../src/types/marketplace/mutations.ts","../src/types/order-return-request/common.ts","../src/types/order-return-request/index.ts","../src/types/order-return-request/mutations.ts","../src/types/payment-stripe-connect/index.ts","../src/types/payout/common.ts","../src/types/payout/events.ts","../src/types/payout/index.ts","../src/types/payout/mutations.ts","../src/types/payout/provider.ts","../src/types/requests/common.ts","../src/types/requests/events.ts","../src/types/requests/humanize_types.ts","../src/types/requests/index.ts","../src/types/requests/mutations.ts","../src/types/reviews/common.ts","../src/types/reviews/index.ts","../src/types/reviews/mutatations.ts","../src/types/seller/common.ts","../src/types/seller/events.ts","../src/types/seller/index.ts","../src/types/seller/mutations.ts","../src/types/split-order-payment/common.ts","../src/types/split-order-payment/index.ts","../src/types/split-order-payment/mutations.ts","../src/types/wishlist/common.ts","../src/types/wishlist/index.ts","../src/types/wishlist/mutations.ts","../src/utils/admin.ts","../src/utils/configuration.ts","../src/utils/hosts.ts","../src/utils/index.ts","../src/utils/money.ts","../src/utils/seller.ts","../src/utils/store.ts","../src/utils/middlewares/apply-reference-filter.ts","../src/utils/middlewares/check-customer-ownership.ts","../src/utils/middlewares/check-ownership.ts","../src/utils/middlewares/filter-by-seller-id.ts","../src/utils/middlewares/index.ts","../src/workflows/emit-multiple-events-step.ts","../src/workflows/index.ts","../src/workflows/update-product-status.ts"],"version":"5.9.3"}
@@ -90,12 +90,12 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
90
90
  store_status: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof StoreStatus>>>;
91
91
  }, "strip", z.ZodTypeAny, {
92
92
  id: string;
93
- handle?: string | null | undefined;
94
93
  store_status?: StoreStatus | null | undefined;
94
+ handle?: string | null | undefined;
95
95
  }, {
96
96
  id: string;
97
- handle?: string | null | undefined;
98
97
  store_status?: StoreStatus | null | undefined;
98
+ handle?: string | null | undefined;
99
99
  }>>;
100
100
  }, "strip", z.ZodTypeAny, {
101
101
  id: string;
@@ -103,8 +103,8 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
103
103
  handle: string;
104
104
  seller: {
105
105
  id: string;
106
- handle?: string | null | undefined;
107
106
  store_status?: StoreStatus | null | undefined;
107
+ handle?: string | null | undefined;
108
108
  } | null;
109
109
  title: string;
110
110
  subtitle: string | null;
@@ -112,6 +112,10 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
112
112
  average_rating: number | null;
113
113
  options: Record<string, string>[] | null;
114
114
  supported_countries: string[] | null;
115
+ length?: number | null | undefined;
116
+ type?: {
117
+ value: string;
118
+ } | null | undefined;
115
119
  images?: {
116
120
  id: string;
117
121
  rank: number;
@@ -120,9 +124,6 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
120
124
  collection?: {
121
125
  title: string;
122
126
  } | null | undefined;
123
- type?: {
124
- value: string;
125
- } | null | undefined;
126
127
  tags?: {
127
128
  value: string;
128
129
  }[] | undefined;
@@ -144,7 +145,6 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
144
145
  hs_code?: string | null | undefined;
145
146
  mid_code?: string | null | undefined;
146
147
  weight?: number | null | undefined;
147
- length?: number | null | undefined;
148
148
  height?: number | null | undefined;
149
149
  width?: number | null | undefined;
150
150
  origin_country?: string | null | undefined;
@@ -155,15 +155,19 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
155
155
  handle: string;
156
156
  seller: {
157
157
  id: string;
158
- handle?: string | null | undefined;
159
158
  store_status?: StoreStatus | null | undefined;
159
+ handle?: string | null | undefined;
160
160
  } | null;
161
161
  title: string;
162
162
  subtitle: string | null;
163
163
  thumbnail: string | null;
164
164
  average_rating?: number | null | undefined;
165
- supported_countries?: string[] | null | undefined;
165
+ length?: number | null | undefined;
166
166
  options?: Record<string, string>[] | null | undefined;
167
+ type?: {
168
+ value: string;
169
+ } | null | undefined;
170
+ supported_countries?: string[] | null | undefined;
167
171
  images?: {
168
172
  id: string;
169
173
  rank: number;
@@ -172,9 +176,6 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
172
176
  collection?: {
173
177
  title: string;
174
178
  } | null | undefined;
175
- type?: {
176
- value: string;
177
- } | null | undefined;
178
179
  tags?: {
179
180
  value: string;
180
181
  }[] | undefined;
@@ -196,7 +197,6 @@ export declare const AlgoliaProductValidator: z.ZodObject<{
196
197
  hs_code?: string | null | undefined;
197
198
  mid_code?: string | null | undefined;
198
199
  weight?: number | null | undefined;
199
- length?: number | null | undefined;
200
200
  height?: number | null | undefined;
201
201
  width?: number | null | undefined;
202
202
  origin_country?: string | null | undefined;
@@ -295,17 +295,17 @@ export declare const AlgoliaVariantValidator: z.ZodObject<{
295
295
  max_quantity?: number | null | undefined;
296
296
  }[];
297
297
  title?: string | null | undefined;
298
+ length?: number | null | undefined;
298
299
  sku?: string | null | undefined;
299
- barcode?: string | null | undefined;
300
300
  ean?: string | null | undefined;
301
- ups?: string | null | undefined;
301
+ barcode?: string | null | undefined;
302
302
  hs_code?: string | null | undefined;
303
- origin_country?: string | null | undefined;
304
303
  mid_code?: string | null | undefined;
305
- material?: string | null | undefined;
306
304
  weight?: number | null | undefined;
307
- length?: number | null | undefined;
308
305
  height?: number | null | undefined;
306
+ origin_country?: string | null | undefined;
307
+ material?: string | null | undefined;
308
+ ups?: string | null | undefined;
309
309
  wifth?: number | null | undefined;
310
310
  variant_rank?: number | null | undefined;
311
311
  }, {
@@ -330,17 +330,17 @@ export declare const AlgoliaVariantValidator: z.ZodObject<{
330
330
  max_quantity?: number | null | undefined;
331
331
  }[];
332
332
  title?: string | null | undefined;
333
+ length?: number | null | undefined;
333
334
  sku?: string | null | undefined;
334
- barcode?: string | null | undefined;
335
335
  ean?: string | null | undefined;
336
- ups?: string | null | undefined;
336
+ barcode?: string | null | undefined;
337
337
  hs_code?: string | null | undefined;
338
- origin_country?: string | null | undefined;
339
338
  mid_code?: string | null | undefined;
340
- material?: string | null | undefined;
341
339
  weight?: number | null | undefined;
342
- length?: number | null | undefined;
343
340
  height?: number | null | undefined;
341
+ origin_country?: string | null | undefined;
342
+ material?: string | null | undefined;
343
+ ups?: string | null | undefined;
344
344
  wifth?: number | null | undefined;
345
345
  variant_rank?: number | null | undefined;
346
346
  }>;
@@ -4,4 +4,5 @@ export * from "./middlewares";
4
4
  export * from "./admin";
5
5
  export * from "./hosts";
6
6
  export * from "./configuration";
7
+ export * from "./store";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -20,4 +20,5 @@ __exportStar(require("./middlewares"), exports);
20
20
  __exportStar(require("./admin"), exports);
21
21
  __exportStar(require("./hosts"), exports);
22
22
  __exportStar(require("./configuration"), exports);
23
+ __exportStar(require("./store"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC;AAChC,0CAAwB"}
@@ -0,0 +1,7 @@
1
+ import { MedusaContainer } from "@medusajs/framework/types";
2
+ export interface StoreData {
3
+ store_name: string;
4
+ storefront_url: string;
5
+ }
6
+ export declare function fetchStoreData(container: MedusaContainer): Promise<StoreData>;
7
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,SAAS,CAAC,CAcpB"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchStoreData = fetchStoreData;
4
+ const utils_1 = require("@medusajs/framework/utils");
5
+ async function fetchStoreData(container) {
6
+ const storeModuleService = container.resolve(utils_1.Modules.STORE);
7
+ const stores = await storeModuleService.listStores();
8
+ const store = stores[0];
9
+ const storeName = store?.name || "Mercur";
10
+ const storefrontUrl = process.env.STOREFRONT_URL || "https://mercurjs.com";
11
+ return {
12
+ store_name: storeName,
13
+ storefront_url: storefrontUrl,
14
+ };
15
+ }
16
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":";;AAQA,wCAgBC;AAvBD,qDAAoD;AAO7C,KAAK,UAAU,cAAc,CAClC,SAA0B;IAE1B,MAAM,kBAAkB,GAAG,SAAS,CAAC,OAAO,CAAC,eAAO,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,UAAU,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAExB,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,IAAI,QAAQ,CAAC;IAC1C,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,sBAAsB,CAAC;IAEvD,OAAO;QACL,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "medusajs",
12
12
  "mercurjs"
13
13
  ],
14
- "version": "1.4.4",
14
+ "version": "1.5.0",
15
15
  "main": "dist/index.js",
16
16
  "types": "dist/index.d.ts",
17
17
  "files": [