@mercurjs/admin 2.0.0-canary.47 → 2.0.0-canary.48

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 (34) hide show
  1. package/dist/{category-organize-DKUPCQNI.js → category-organize-P3SP5ORE.js} +2 -1
  2. package/dist/{chunk-PAQH5QQH.js → chunk-2NF6WEZX.js} +3 -3
  3. package/dist/{chunk-42Z5MXZ6.js → chunk-FSZTUENG.js} +1 -1
  4. package/dist/{chunk-2UN7CNBG.js → chunk-JIER2AQX.js} +3 -3
  5. package/dist/chunk-QEKAZOEP.js +8 -0
  6. package/dist/{chunk-6E3T6CGY.js → chunk-RSD4YTV4.js} +4 -1
  7. package/dist/{chunk-BLG726FI.js → chunk-XLFY6D6P.js} +6 -6
  8. package/dist/{chunk-FR3AHKZD.js → chunk-YOZMLU26.js} +1 -1
  9. package/dist/{chunk-4UTK7DZN.js → chunk-YPNZSNDC.js} +1 -2
  10. package/dist/{types-DUhfb5tH.d.ts → constants-RstItOZv.d.ts} +13 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +29 -23
  13. package/dist/{location-list-KMHS7UL6.js → location-list-QPFWN62R.js} +1 -1
  14. package/dist/{location-service-zone-shipping-option-create-EOYOHEKU.js → location-service-zone-shipping-option-create-KQ6W2X6N.js} +1 -1
  15. package/dist/{location-service-zone-shipping-option-edit-KPECMUYB.js → location-service-zone-shipping-option-edit-IYY5FGIR.js} +2 -2
  16. package/dist/{manage-locations-FJUXXPP4.js → manage-locations-SAEMVG2S.js} +1 -1
  17. package/dist/{marketplace-edit-GH2GQF3O.js → marketplace-edit-CF3M2T7V.js} +3 -3
  18. package/dist/{order-create-claim-OAJIQICB.js → order-create-claim-TYJTGC3H.js} +2 -2
  19. package/dist/{order-create-exchange-2WBTKG2K.js → order-create-exchange-7DIU4KDZ.js} +2 -2
  20. package/dist/{order-create-fulfillment-T2BUPHA3.js → order-create-fulfillment-XPPD5IMV.js} +1 -1
  21. package/dist/{order-request-transfer-3MRISJHE.js → order-request-transfer-632PSIIQ.js} +1 -1
  22. package/dist/pages/index.d.ts +2 -1
  23. package/dist/pages/index.js +13 -7
  24. package/dist/{product-create-H66AWLGK.js → product-create-UGQGBC4T.js} +1 -1
  25. package/dist/{product-create-variant-LWYI37SK.js → product-create-variant-FYKETHK6.js} +1 -1
  26. package/dist/{product-detail-4GRDLUHU.js → product-detail-ZILZCBHP.js} +7 -4
  27. package/dist/{product-organization-AFCELJ62.js → product-organization-EFXWECYB.js} +4 -1
  28. package/dist/{product-shipping-profile-J6PINV7C.js → product-shipping-profile-LOWLCB56.js} +1 -1
  29. package/dist/{product-variant-manage-inventory-items-C77QHYRT.js → product-variant-manage-inventory-items-UNXKKLIQ.js} +1 -1
  30. package/dist/{promotion-add-campaign-YSSFGMXG.js → promotion-add-campaign-IEI7OT72.js} +1 -1
  31. package/dist/{promotion-create-QGJU2BMP.js → promotion-create-7HQRXW62.js} +2 -2
  32. package/dist/{tax-region-create-REGKAEKJ.js → tax-region-create-YCEJUWW4.js} +1 -1
  33. package/dist/{tax-region-edit-4WZBJCYE.js → tax-region-edit-LSGZD7IY.js} +1 -1
  34. package/package.json +1 -1
@@ -43,7 +43,8 @@ var OrganizeCategoryForm = () => {
43
43
  mutationFn: async ({
44
44
  value
45
45
  }) => {
46
- await sdk.admin.productCategory.update(value.id, {
46
+ await sdk.admin.productCategories.$id.mutate({
47
+ $id: value.id,
47
48
  rank: value.rank ?? 0,
48
49
  parent_category_id: value.parent_category_id
49
50
  });
@@ -119,7 +119,7 @@ var Root = ({
119
119
  const direction = useDocumentDirection();
120
120
  const isPickup = type === "pickup" /* Pickup */;
121
121
  const shippingProfiles = useComboboxData({
122
- queryFn: (params) => sdk.admin.shippingProfile.list(params),
122
+ queryFn: (params) => sdk.admin.shippingProfiles.query(params),
123
123
  queryKey: ["shipping_profiles"],
124
124
  getOptions: (data) => data.shipping_profiles.map((profile) => ({
125
125
  label: profile.name,
@@ -127,7 +127,7 @@ var Root = ({
127
127
  }))
128
128
  });
129
129
  const shippingOptionTypes = useComboboxData({
130
- queryFn: (params) => sdk.admin.shippingOptionType.list(params),
130
+ queryFn: (params) => sdk.admin.shippingOptionTypes.query(params),
131
131
  queryKey: ["shipping_option_types"],
132
132
  getOptions: (data) => data.shipping_option_types.map((type2) => ({
133
133
  label: type2.label,
@@ -135,7 +135,7 @@ var Root = ({
135
135
  }))
136
136
  });
137
137
  const fulfillmentProviders = useComboboxData({
138
- queryFn: (params) => sdk.admin.fulfillmentProvider.list({
138
+ queryFn: (params) => sdk.admin.fulfillmentProviders.query({
139
139
  ...params,
140
140
  stock_location_id: locationId
141
141
  }),
@@ -120,7 +120,7 @@ var AddCampaignPromotionFields = ({
120
120
  name: "campaign_choice"
121
121
  });
122
122
  const campaignsCombobox = useComboboxData({
123
- queryFn: (params) => sdk.admin.campaign.list({
123
+ queryFn: (params) => sdk.admin.campaigns.query({
124
124
  ...params
125
125
  }),
126
126
  queryKey: ["campaigns"],
@@ -200,7 +200,7 @@ var useLocationListTableQuery = ({
200
200
 
201
201
  // src/pages/locations/location-list/location-list.tsx
202
202
  import { keepPreviousData } from "@tanstack/react-query";
203
- import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
203
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
204
204
  var PAGE_SIZE = 20;
205
205
  var PREFIX = "loc";
206
206
  var LocationListContent = () => {
@@ -308,10 +308,10 @@ var LinksSection = () => {
308
308
  ] });
309
309
  };
310
310
  var Root = ({ children }) => {
311
- return /* @__PURE__ */ jsx2(TwoColumnPage, { showJSON: true, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
311
+ return Children.count(children) > 0 ? /* @__PURE__ */ jsx2(TwoColumnPage, { showJSON: true, children }) : /* @__PURE__ */ jsxs(TwoColumnPage, { showJSON: true, children: [
312
312
  /* @__PURE__ */ jsx2(TwoColumnPage.Main, { children: /* @__PURE__ */ jsx2(LocationListContent, {}) }),
313
313
  /* @__PURE__ */ jsx2(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx2(LinksSection, {}) })
314
- ] }) });
314
+ ] });
315
315
  };
316
316
  var LocationListPage = Object.assign(Root, {
317
317
  Main: TwoColumnPage.Main,
@@ -0,0 +1,8 @@
1
+ // src/pages/products/constants.ts
2
+ var PRODUCT_DETAIL_FIELDS = "*seller,*categories";
3
+ var PRODUCT_DETAIL_QUERY = { fields: PRODUCT_DETAIL_FIELDS };
4
+
5
+ export {
6
+ PRODUCT_DETAIL_FIELDS,
7
+ PRODUCT_DETAIL_QUERY
8
+ };
@@ -13,6 +13,9 @@ import {
13
13
  import {
14
14
  SectionRow
15
15
  } from "./chunk-3XPXUIK3.js";
16
+ import {
17
+ PRODUCT_DETAIL_QUERY
18
+ } from "./chunk-QEKAZOEP.js";
16
19
  import {
17
20
  TwoColumnPage
18
21
  } from "./chunk-V5J73NPW.js";
@@ -1184,7 +1187,7 @@ var Root = ({ children }) => {
1184
1187
  const { id } = useParams();
1185
1188
  const { product: rawProduct, isLoading, isError, error } = useProduct(
1186
1189
  id,
1187
- {},
1190
+ PRODUCT_DETAIL_QUERY,
1188
1191
  {
1189
1192
  initialData
1190
1193
  }
@@ -1154,7 +1154,7 @@ function InventoryItemRow({
1154
1154
  queryKey: ["inventory_items"],
1155
1155
  defaultValueKey: "id",
1156
1156
  selectedValue: selectedInventoryItemId,
1157
- queryFn: (params) => sdk.admin.inventoryItem.list(params),
1157
+ queryFn: (params) => sdk.admin.inventoryItems.query(params),
1158
1158
  getOptions: (data) => data.inventory_items.map((item) => ({
1159
1159
  label: `${item.title} ${item.sku ? `(${item.sku})` : ""}`,
1160
1160
  value: item.id
@@ -1354,7 +1354,7 @@ var ProductCreateOrganizationSection = () => {
1354
1354
  const { t } = useTranslation6();
1355
1355
  const sellers = useComboboxData({
1356
1356
  queryKey: ["sellers"],
1357
- queryFn: (params) => sdk.admin.sellers.query(params),
1357
+ queryFn: (params) => sdk.admin.sellers.query({ fetchOptions: { method: "GET" }, ...params }),
1358
1358
  getOptions: (data) => data.sellers.map((seller) => ({
1359
1359
  label: seller.name,
1360
1360
  value: seller.id
@@ -1362,7 +1362,7 @@ var ProductCreateOrganizationSection = () => {
1362
1362
  });
1363
1363
  const collections = useComboboxData({
1364
1364
  queryKey: ["product_collections"],
1365
- queryFn: (params) => sdk.admin.productCollection.list(params),
1365
+ queryFn: (params) => sdk.admin.collections.query(params),
1366
1366
  getOptions: (data) => data.collections.map((collection) => ({
1367
1367
  label: collection.title,
1368
1368
  value: collection.id
@@ -1370,7 +1370,7 @@ var ProductCreateOrganizationSection = () => {
1370
1370
  });
1371
1371
  const types = useComboboxData({
1372
1372
  queryKey: ["product_types"],
1373
- queryFn: (params) => sdk.admin.productType.list(params),
1373
+ queryFn: (params) => sdk.admin.productTypes.query(params),
1374
1374
  getOptions: (data) => data.product_types.map((type) => ({
1375
1375
  label: type.value,
1376
1376
  value: type.id
@@ -1378,7 +1378,7 @@ var ProductCreateOrganizationSection = () => {
1378
1378
  });
1379
1379
  const tags = useComboboxData({
1380
1380
  queryKey: ["product_tags"],
1381
- queryFn: (params) => sdk.admin.productTag.list(params),
1381
+ queryFn: (params) => sdk.admin.productTags.query(params),
1382
1382
  getOptions: (data) => data.product_tags.map((tag) => ({
1383
1383
  label: tag.value,
1384
1384
  value: tag.id
@@ -1386,7 +1386,7 @@ var ProductCreateOrganizationSection = () => {
1386
1386
  });
1387
1387
  const shippingProfiles = useComboboxData({
1388
1388
  queryKey: ["shipping_profiles"],
1389
- queryFn: (params) => sdk.admin.shippingProfile.list(params),
1389
+ queryFn: (params) => sdk.admin.shippingProfiles.query(params),
1390
1390
  getOptions: (data) => data.shipping_profiles.map((shippingProfile) => ({
1391
1391
  label: shippingProfile.name,
1392
1392
  value: shippingProfile.id
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MAEP2UCK.js";
4
4
  import {
5
5
  AddCampaignPromotionFields
6
- } from "./chunk-42Z5MXZ6.js";
6
+ } from "./chunk-FSZTUENG.js";
7
7
  import {
8
8
  RulesFormField
9
9
  } from "./chunk-XT574CWR.js";
@@ -280,8 +280,7 @@ function InventoryKitTab() {
280
280
  const inventoryFormData = inventory.fields;
281
281
  const items = useComboboxData({
282
282
  queryKey: ["inventory_items"],
283
- // @ts-expect-error Mercur SDK extension
284
- queryFn: (params) => sdk.admin.inventoryItem.list(params),
283
+ queryFn: (params) => sdk.admin.inventoryItems.query(params),
285
284
  getOptions: (data) => {
286
285
  const items2 = data.inventory_items;
287
286
  return items2.map((item) => ({
@@ -27,4 +27,16 @@ interface TabDefinition<T extends FieldValues = FieldValues> {
27
27
  */
28
28
  declare const defineTabMeta: <T extends FieldValues = FieldValues>(meta: TabDefinition<T>) => TabDefinition<T>;
29
29
 
30
- export { type TabDefinition as T, defineTabMeta as d };
30
+ /**
31
+ * Fields appended to Medusa defaults for product detail queries.
32
+ * Uses `*` prefix to add relations without replacing Medusa's built-in defaults.
33
+ *
34
+ * Missing from Medusa defaults: *categories
35
+ * Mercur custom links: *seller
36
+ */
37
+ declare const PRODUCT_DETAIL_FIELDS = "*seller,*categories";
38
+ declare const PRODUCT_DETAIL_QUERY: {
39
+ readonly fields: "*seller,*categories";
40
+ };
41
+
42
+ export { PRODUCT_DETAIL_FIELDS as P, type TabDefinition as T, PRODUCT_DETAIL_QUERY as a, defineTabMeta as d };
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import react__default, { ReactNode, PropsWithChildren } from 'react';
4
4
  import * as react_hook_form from 'react-hook-form';
5
5
  import { FieldValues, UseFormReturn, FieldPath, ControllerProps } from 'react-hook-form';
6
- import { T as TabDefinition } from './types-DUhfb5tH.js';
7
- export { d as defineTabMeta } from './types-DUhfb5tH.js';
6
+ import { T as TabDefinition } from './constants-RstItOZv.js';
7
+ export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY, d as defineTabMeta } from './constants-RstItOZv.js';
8
8
  import { Label, Slot } from 'radix-ui';
9
9
  import * as _tanstack_react_table from '@tanstack/react-table';
10
10
  import { Table, ColumnDef, Row, RowSelectionState, OnChangeFn } from '@tanstack/react-table';
package/dist/index.js CHANGED
@@ -13,6 +13,10 @@ import {
13
13
  } from "./chunk-QSGR43JM.js";
14
14
  import "./chunk-FMFVTERD.js";
15
15
  import "./chunk-JRTZWK77.js";
16
+ import {
17
+ PRODUCT_DETAIL_FIELDS,
18
+ PRODUCT_DETAIL_QUERY
19
+ } from "./chunk-QEKAZOEP.js";
16
20
  import {
17
21
  Thumbnail
18
22
  } from "./chunk-WIYFXWRI.js";
@@ -3295,7 +3299,7 @@ function getRouteMap({
3295
3299
  children: [
3296
3300
  {
3297
3301
  path: "create",
3298
- lazy: () => import("./product-create-H66AWLGK.js")
3302
+ lazy: () => import("./product-create-UGQGBC4T.js")
3299
3303
  },
3300
3304
  {
3301
3305
  path: "import",
@@ -3311,7 +3315,7 @@ function getRouteMap({
3311
3315
  path: ":id",
3312
3316
  errorElement: /* @__PURE__ */ jsx15(ErrorBoundary, {}),
3313
3317
  lazy: async () => {
3314
- const { Breadcrumb, loader } = await import("./product-detail-4GRDLUHU.js");
3318
+ const { Breadcrumb, loader } = await import("./product-detail-ZILZCBHP.js");
3315
3319
  return {
3316
3320
  Component: Outlet4,
3317
3321
  loader,
@@ -3323,7 +3327,7 @@ function getRouteMap({
3323
3327
  children: [
3324
3328
  {
3325
3329
  path: "",
3326
- lazy: () => import("./product-detail-4GRDLUHU.js"),
3330
+ lazy: () => import("./product-detail-ZILZCBHP.js"),
3327
3331
  children: [
3328
3332
  {
3329
3333
  path: "edit",
@@ -3343,11 +3347,11 @@ function getRouteMap({
3343
3347
  },
3344
3348
  {
3345
3349
  path: "organization",
3346
- lazy: () => import("./product-organization-AFCELJ62.js")
3350
+ lazy: () => import("./product-organization-EFXWECYB.js")
3347
3351
  },
3348
3352
  {
3349
3353
  path: "shipping-profile",
3350
- lazy: () => import("./product-shipping-profile-J6PINV7C.js")
3354
+ lazy: () => import("./product-shipping-profile-LOWLCB56.js")
3351
3355
  },
3352
3356
  {
3353
3357
  path: "media",
@@ -3367,7 +3371,7 @@ function getRouteMap({
3367
3371
  },
3368
3372
  {
3369
3373
  path: "variants/create",
3370
- lazy: () => import("./product-create-variant-LWYI37SK.js")
3374
+ lazy: () => import("./product-create-variant-FYKETHK6.js")
3371
3375
  },
3372
3376
  {
3373
3377
  path: "stock",
@@ -3406,7 +3410,7 @@ function getRouteMap({
3406
3410
  },
3407
3411
  {
3408
3412
  path: "manage-items",
3409
- lazy: () => import("./product-variant-manage-inventory-items-C77QHYRT.js")
3413
+ lazy: () => import("./product-variant-manage-inventory-items-UNXKKLIQ.js")
3410
3414
  },
3411
3415
  {
3412
3416
  path: "metadata/edit",
@@ -3437,7 +3441,7 @@ function getRouteMap({
3437
3441
  },
3438
3442
  {
3439
3443
  path: "organize",
3440
- lazy: () => import("./category-organize-DKUPCQNI.js")
3444
+ lazy: () => import("./category-organize-P3SP5ORE.js")
3441
3445
  }
3442
3446
  ]
3443
3447
  },
@@ -3468,7 +3472,7 @@ function getRouteMap({
3468
3472
  },
3469
3473
  {
3470
3474
  path: "organize",
3471
- lazy: () => import("./category-organize-DKUPCQNI.js")
3475
+ lazy: () => import("./category-organize-P3SP5ORE.js")
3472
3476
  },
3473
3477
  {
3474
3478
  path: "metadata/edit",
@@ -3510,7 +3514,7 @@ function getRouteMap({
3510
3514
  children: [
3511
3515
  {
3512
3516
  path: "fulfillment",
3513
- lazy: () => import("./order-create-fulfillment-T2BUPHA3.js")
3517
+ lazy: () => import("./order-create-fulfillment-XPPD5IMV.js")
3514
3518
  },
3515
3519
  {
3516
3520
  path: "returns/:return_id/receive",
@@ -3530,11 +3534,11 @@ function getRouteMap({
3530
3534
  },
3531
3535
  {
3532
3536
  path: "claims",
3533
- lazy: () => import("./order-create-claim-OAJIQICB.js")
3537
+ lazy: () => import("./order-create-claim-TYJTGC3H.js")
3534
3538
  },
3535
3539
  {
3536
3540
  path: "exchanges",
3537
- lazy: () => import("./order-create-exchange-2WBTKG2K.js")
3541
+ lazy: () => import("./order-create-exchange-7DIU4KDZ.js")
3538
3542
  },
3539
3543
  {
3540
3544
  path: "edits",
@@ -3546,7 +3550,7 @@ function getRouteMap({
3546
3550
  },
3547
3551
  {
3548
3552
  path: "transfer",
3549
- lazy: () => import("./order-request-transfer-3MRISJHE.js")
3553
+ lazy: () => import("./order-request-transfer-632PSIIQ.js")
3550
3554
  },
3551
3555
  {
3552
3556
  path: "email",
@@ -3583,7 +3587,7 @@ function getRouteMap({
3583
3587
  },
3584
3588
  {
3585
3589
  path: "create",
3586
- lazy: () => import("./promotion-create-QGJU2BMP.js")
3590
+ lazy: () => import("./promotion-create-7HQRXW62.js")
3587
3591
  },
3588
3592
  {
3589
3593
  path: ":id",
@@ -3608,7 +3612,7 @@ function getRouteMap({
3608
3612
  },
3609
3613
  {
3610
3614
  path: "add-to-campaign",
3611
- lazy: () => import("./promotion-add-campaign-YSSFGMXG.js")
3615
+ lazy: () => import("./promotion-add-campaign-IEI7OT72.js")
3612
3616
  },
3613
3617
  {
3614
3618
  path: ":ruleType/edit",
@@ -3831,7 +3835,7 @@ function getRouteMap({
3831
3835
  },
3832
3836
  {
3833
3837
  path: ":order_id/transfer",
3834
- lazy: () => import("./order-request-transfer-3MRISJHE.js")
3838
+ lazy: () => import("./order-request-transfer-632PSIIQ.js")
3835
3839
  },
3836
3840
  {
3837
3841
  path: "metadata/edit",
@@ -4068,7 +4072,7 @@ function getRouteMap({
4068
4072
  },
4069
4073
  {
4070
4074
  path: "locations",
4071
- lazy: () => import("./manage-locations-FJUXXPP4.js")
4075
+ lazy: () => import("./manage-locations-SAEMVG2S.js")
4072
4076
  },
4073
4077
  {
4074
4078
  path: "locations/:location_id",
@@ -4190,7 +4194,7 @@ function getRouteMap({
4190
4194
  children: [
4191
4195
  {
4192
4196
  path: "edit",
4193
- lazy: () => import("./marketplace-edit-GH2GQF3O.js")
4197
+ lazy: () => import("./marketplace-edit-CF3M2T7V.js")
4194
4198
  },
4195
4199
  {
4196
4200
  path: "currencies",
@@ -4361,7 +4365,7 @@ function getRouteMap({
4361
4365
  children: [
4362
4366
  {
4363
4367
  path: "",
4364
- lazy: () => import("./location-list-KMHS7UL6.js")
4368
+ lazy: () => import("./location-list-QPFWN62R.js")
4365
4369
  },
4366
4370
  {
4367
4371
  path: "create",
@@ -4508,14 +4512,14 @@ function getRouteMap({
4508
4512
  children: [
4509
4513
  {
4510
4514
  path: "create",
4511
- lazy: () => import("./location-service-zone-shipping-option-create-EOYOHEKU.js")
4515
+ lazy: () => import("./location-service-zone-shipping-option-create-KQ6W2X6N.js")
4512
4516
  },
4513
4517
  {
4514
4518
  path: ":so_id",
4515
4519
  children: [
4516
4520
  {
4517
4521
  path: "edit",
4518
- lazy: () => import("./location-service-zone-shipping-option-edit-KPECMUYB.js")
4522
+ lazy: () => import("./location-service-zone-shipping-option-edit-IYY5FGIR.js")
4519
4523
  },
4520
4524
  {
4521
4525
  path: "pricing",
@@ -4750,7 +4754,7 @@ function getRouteMap({
4750
4754
  children: [
4751
4755
  {
4752
4756
  path: "create",
4753
- lazy: () => import("./tax-region-create-REGKAEKJ.js")
4757
+ lazy: () => import("./tax-region-create-YCEJUWW4.js")
4754
4758
  }
4755
4759
  ]
4756
4760
  },
@@ -4773,7 +4777,7 @@ function getRouteMap({
4773
4777
  children: [
4774
4778
  {
4775
4779
  path: "edit",
4776
- lazy: () => import("./tax-region-edit-4WZBJCYE.js")
4780
+ lazy: () => import("./tax-region-edit-LSGZD7IY.js")
4777
4781
  },
4778
4782
  {
4779
4783
  path: "provinces/create",
@@ -4963,6 +4967,8 @@ export {
4963
4967
  FileUpload,
4964
4968
  Form,
4965
4969
  Notifications,
4970
+ PRODUCT_DETAIL_FIELDS,
4971
+ PRODUCT_DETAIL_QUERY,
4966
4972
  SingleColumnPage,
4967
4973
  SwitchBox,
4968
4974
  TabbedForm,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocationListPage
3
- } from "./chunk-2UN7CNBG.js";
3
+ } from "./chunk-JIER2AQX.js";
4
4
  import "./chunk-4F5GP7J7.js";
5
5
  import "./chunk-LXSBG6LK.js";
6
6
  import "./chunk-4GPAS5GW.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LocationServiceZoneShippingOptionCreate
3
- } from "./chunk-PAQH5QQH.js";
3
+ } from "./chunk-2NF6WEZX.js";
4
4
  import "./chunk-ZZEAWVFX.js";
5
5
  import "./chunk-LXSBG6LK.js";
6
6
  import "./chunk-VW56KWO2.js";
@@ -73,7 +73,7 @@ var EditShippingOptionForm = ({
73
73
  const direction = useDocumentDirection();
74
74
  const isPickup = type === "pickup" /* Pickup */;
75
75
  const shippingProfiles = useComboboxData({
76
- queryFn: (params) => sdk.admin.shippingProfile.list(params),
76
+ queryFn: (params) => sdk.admin.shippingProfiles.query(params),
77
77
  queryKey: ["shipping_profiles"],
78
78
  getOptions: (data) => data.shipping_profiles.map((profile) => ({
79
79
  label: profile.name,
@@ -82,7 +82,7 @@ var EditShippingOptionForm = ({
82
82
  defaultValue: shippingOption.shipping_profile_id
83
83
  });
84
84
  const shippingOptionTypes = useComboboxData({
85
- queryFn: (params) => sdk.admin.shippingOptionType.list(params),
85
+ queryFn: (params) => sdk.admin.shippingOptionTypes.query(params),
86
86
  queryKey: ["shipping_option_types"],
87
87
  getOptions: (data) => data.shipping_option_types.map((type2) => ({
88
88
  label: type2.label,
@@ -196,7 +196,7 @@ var ManageLocationsForm = ({
196
196
  {
197
197
  queryKey: ["stock-locations", searchQuery],
198
198
  queryFn: async (params) => {
199
- const response = await sdk.admin.stockLocation.list({
199
+ const response = await sdk.admin.stockLocations.query({
200
200
  limit: params.limit,
201
201
  offset: params.offset,
202
202
  ...searchQuery && { q: searchQuery }
@@ -65,18 +65,18 @@ var EditMarketplaceForm = ({ store }) => {
65
65
  const { mutateAsync, isPending } = useUpdateStore(store.id);
66
66
  const regionsCombobox = useComboboxData({
67
67
  queryKey: ["regions", "default_region_id"],
68
- queryFn: (params) => sdk.admin.region.list({ ...params, fields: "id,name" }),
68
+ queryFn: (params) => sdk.admin.regions.query({ ...params, fields: "id,name" }),
69
69
  defaultValue: store.default_region_id || void 0,
70
70
  getOptions: (data) => data.regions.map((r) => ({ label: r.name, value: r.id }))
71
71
  });
72
72
  const salesChannelsCombobox = useComboboxData({
73
- queryFn: (params) => sdk.admin.salesChannel.list({ ...params, fields: "id,name" }),
73
+ queryFn: (params) => sdk.admin.salesChannels.query({ ...params, fields: "id,name" }),
74
74
  getOptions: (data) => data.sales_channels.map((sc) => ({ label: sc.name, value: sc.id })),
75
75
  queryKey: ["sales_channels", "default_sales_channel_id"],
76
76
  defaultValue: store.default_sales_channel_id || void 0
77
77
  });
78
78
  const locationsCombobox = useComboboxData({
79
- queryFn: (params) => sdk.admin.stockLocation.list({ ...params, fields: "id,name" }),
79
+ queryFn: (params) => sdk.admin.stockLocations.query({ ...params, fields: "id,name" }),
80
80
  getOptions: (data) => data.stock_locations.map((l) => ({ label: l.name, value: l.id })),
81
81
  queryKey: ["stock_locations", "default_location_id"],
82
82
  defaultValue: store.default_location_id || void 0
@@ -1175,7 +1175,7 @@ var ClaimOutboundSection = ({
1175
1175
  return ret;
1176
1176
  }
1177
1177
  const variantIds = outboundItems.map((item) => item?.variant_id).filter(Boolean);
1178
- const variants = (await sdk.admin.productVariant.list({
1178
+ const variants = (await sdk.admin.productVariants.query({
1179
1179
  id: variantIds,
1180
1180
  fields: "*inventory.location_levels"
1181
1181
  })).variants;
@@ -1641,7 +1641,7 @@ var ClaimCreateForm = ({
1641
1641
  return ret;
1642
1642
  }
1643
1643
  const variantIds = inboundItems.map((item) => item?.variant_id).filter(Boolean);
1644
- const variants = (await sdk.admin.productVariant.list({
1644
+ const variants = (await sdk.admin.productVariants.query({
1645
1645
  id: variantIds,
1646
1646
  fields: "*inventory.location_levels"
1647
1647
  })).variants;
@@ -847,7 +847,7 @@ var ExchangeInboundSection = ({
847
847
  return ret;
848
848
  }
849
849
  const variantIds = inboundItems.map((item) => item?.variant_id).filter(Boolean);
850
- const variants = (await sdk.admin.productVariant.list({
850
+ const variants = (await sdk.admin.productVariants.query({
851
851
  id: variantIds,
852
852
  fields: "*inventory.location_levels"
853
853
  })).variants;
@@ -1476,7 +1476,7 @@ var ExchangeOutboundSection = ({
1476
1476
  return ret;
1477
1477
  }
1478
1478
  const variantIds = outboundItems.map((item) => item?.variant_id).filter(Boolean);
1479
- const variants = (await sdk.admin.productVariant.list({
1479
+ const variants = (await sdk.admin.productVariants.query({
1480
1480
  id: variantIds,
1481
1481
  fields: "*inventory.location_levels"
1482
1482
  })).variants;
@@ -304,7 +304,7 @@ function OrderCreateFulfillmentForm({
304
304
  limit: getReservationsLimitCount(order)
305
305
  });
306
306
  const stockLocations = useComboboxData({
307
- queryFn: (params) => sdk.admin.stockLocation.list(params),
307
+ queryFn: (params) => sdk.admin.stockLocations.query(params),
308
308
  queryKey: ["stock_locations"],
309
309
  getOptions: (data) => data.stock_locations.map((location) => ({
310
310
  label: location.name,
@@ -464,7 +464,7 @@ function CreateOrderTransferForm({
464
464
  });
465
465
  const customers = useComboboxData({
466
466
  queryKey: ["customers"],
467
- queryFn: (params) => sdk.admin.customer.list({ ...params, has_account: true }),
467
+ queryFn: (params) => sdk.admin.customers.query({ ...params, has_account: true }),
468
468
  getOptions: (data) => data.customers.map((item) => ({
469
469
  label: `${item.first_name || ""} ${item.last_name || ""} (${item.email})`,
470
470
  value: item.id
@@ -5,7 +5,8 @@ import * as _medusajs_types from '@medusajs/types';
5
5
  import { HttpTypes } from '@medusajs/types';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { DeepPartial } from 'react-hook-form';
8
- import { T as TabDefinition } from '../types-DUhfb5tH.js';
8
+ import { T as TabDefinition } from '../constants-RstItOZv.js';
9
+ export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY } from '../constants-RstItOZv.js';
9
10
  import * as zod from 'zod';
10
11
  import { z } from 'zod';
11
12
  import * as _mercurjs_types from '@mercurjs/types';
@@ -34,7 +34,7 @@ import "../chunk-XFR5JLNF.js";
34
34
  import {
35
35
  CreateShippingOptionSchema,
36
36
  ShippingOptionCreatePage
37
- } from "../chunk-PAQH5QQH.js";
37
+ } from "../chunk-2NF6WEZX.js";
38
38
  import "../chunk-ZZEAWVFX.js";
39
39
  import {
40
40
  ProductTagListPage
@@ -67,7 +67,7 @@ import {
67
67
  } from "../chunk-MD56QRKC.js";
68
68
  import {
69
69
  LocationListPage
70
- } from "../chunk-2UN7CNBG.js";
70
+ } from "../chunk-JIER2AQX.js";
71
71
  import {
72
72
  CommissionRateListPage
73
73
  } from "../chunk-VOFAM7HJ.js";
@@ -182,14 +182,14 @@ import "../chunk-6OA7JZ5E.js";
182
182
  import {
183
183
  CreatePromotionSchema,
184
184
  PromotionCreatePage
185
- } from "../chunk-FR3AHKZD.js";
185
+ } from "../chunk-YOZMLU26.js";
186
186
  import {
187
187
  PromotionDetailPage
188
188
  } from "../chunk-2FZ47MSS.js";
189
189
  import "../chunk-RK5N3XIX.js";
190
190
  import "../chunk-BAV6Y7RC.js";
191
191
  import "../chunk-MAEP2UCK.js";
192
- import "../chunk-42Z5MXZ6.js";
192
+ import "../chunk-FSZTUENG.js";
193
193
  import "../chunk-XT574CWR.js";
194
194
  import {
195
195
  CampaignListPage
@@ -239,7 +239,7 @@ import "../chunk-Y456KVIN.js";
239
239
  import {
240
240
  CreateProductVariantSchema,
241
241
  ProductCreateVariantPage
242
- } from "../chunk-4UTK7DZN.js";
242
+ } from "../chunk-YPNZSNDC.js";
243
243
  import {
244
244
  ProductVariantDetailPage
245
245
  } from "../chunk-NXKCVD5F.js";
@@ -248,7 +248,7 @@ import "../chunk-7AV5EJJ5.js";
248
248
  import "../chunk-WCEMRNW4.js";
249
249
  import {
250
250
  ProductDetailPage
251
- } from "../chunk-6E3T6CGY.js";
251
+ } from "../chunk-RSD4YTV4.js";
252
252
  import "../chunk-4GPAS5GW.js";
253
253
  import "../chunk-U2EI2ZLM.js";
254
254
  import "../chunk-W6Y3PPU5.js";
@@ -261,6 +261,10 @@ import "../chunk-NXDFDEKP.js";
261
261
  import "../chunk-V74Y5NIV.js";
262
262
  import "../chunk-FMFVTERD.js";
263
263
  import "../chunk-JRTZWK77.js";
264
+ import {
265
+ PRODUCT_DETAIL_FIELDS,
266
+ PRODUCT_DETAIL_QUERY
267
+ } from "../chunk-QEKAZOEP.js";
264
268
  import {
265
269
  ProductListPage
266
270
  } from "../chunk-XHVYNMTA.js";
@@ -279,7 +283,7 @@ import "../chunk-3EF54XFY.js";
279
283
  import "../chunk-XIZLPYEE.js";
280
284
  import {
281
285
  ProductCreatePage
282
- } from "../chunk-BLG726FI.js";
286
+ } from "../chunk-XLFY6D6P.js";
283
287
  import "../chunk-IGTRIAUC.js";
284
288
  import "../chunk-TLE6YHGH.js";
285
289
  import "../chunk-U3OWJE7V.js";
@@ -396,6 +400,8 @@ export {
396
400
  MarketplaceDetailPage,
397
401
  OrderDetailPage,
398
402
  OrderListPage,
403
+ PRODUCT_DETAIL_FIELDS,
404
+ PRODUCT_DETAIL_QUERY,
399
405
  PayoutDetailPage,
400
406
  PayoutListPage,
401
407
  PriceListCreatePage,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductCreate
3
- } from "./chunk-BLG726FI.js";
3
+ } from "./chunk-XLFY6D6P.js";
4
4
  import "./chunk-IGTRIAUC.js";
5
5
  import "./chunk-TLE6YHGH.js";
6
6
  import "./chunk-U3OWJE7V.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductCreateVariant
3
- } from "./chunk-4UTK7DZN.js";
3
+ } from "./chunk-YPNZSNDC.js";
4
4
  import "./chunk-U3OWJE7V.js";
5
5
  import "./chunk-IQPN4PZJ.js";
6
6
  import "./chunk-AEFDAU3Y.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductDetailPage
3
- } from "./chunk-6E3T6CGY.js";
3
+ } from "./chunk-RSD4YTV4.js";
4
4
  import "./chunk-4GPAS5GW.js";
5
5
  import "./chunk-U2EI2ZLM.js";
6
6
  import "./chunk-W6Y3PPU5.js";
@@ -9,6 +9,9 @@ import "./chunk-VZEMURY7.js";
9
9
  import "./chunk-FI474ADU.js";
10
10
  import "./chunk-3XPXUIK3.js";
11
11
  import "./chunk-JRTZWK77.js";
12
+ import {
13
+ PRODUCT_DETAIL_QUERY
14
+ } from "./chunk-QEKAZOEP.js";
12
15
  import "./chunk-V5J73NPW.js";
13
16
  import "./chunk-XIZLPYEE.js";
14
17
  import "./chunk-54RTJBYO.js";
@@ -67,7 +70,7 @@ var ProductDetailBreadcrumb = (props) => {
67
70
  const { id } = props.params || {};
68
71
  const { product } = useProduct(
69
72
  id,
70
- {},
73
+ PRODUCT_DETAIL_QUERY,
71
74
  {
72
75
  initialData: props.data,
73
76
  enabled: Boolean(id)
@@ -81,8 +84,8 @@ var ProductDetailBreadcrumb = (props) => {
81
84
 
82
85
  // src/pages/products/product-detail/loader.ts
83
86
  var productDetailQuery = (id) => ({
84
- queryKey: productsQueryKeys.detail(id),
85
- queryFn: async () => sdk.admin.products.$id.query({ $id: id, fields: "*seller" })
87
+ queryKey: productsQueryKeys.detail(id, PRODUCT_DETAIL_QUERY),
88
+ queryFn: async () => sdk.admin.products.$id.query({ $id: id, ...PRODUCT_DETAIL_QUERY })
86
89
  });
87
90
  var productLoader = async ({ params }) => {
88
91
  const id = params.id;
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-QEKAZOEP.js";
1
4
  import {
2
5
  CategoryCombobox
3
6
  } from "./chunk-P7G4RY2J.js";
@@ -292,7 +295,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
292
295
  var ProductOrganization = () => {
293
296
  const { id } = useParams();
294
297
  const { t } = useTranslation2();
295
- const { product, isLoading, isError, error } = useProduct(id);
298
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
296
299
  if (isError) {
297
300
  throw error;
298
301
  }
@@ -49,7 +49,7 @@ var ProductShippingProfileForm = ({
49
49
  const { handleSuccess } = useRouteModal();
50
50
  const shippingProfiles = useComboboxData({
51
51
  queryKey: ["shipping_profiles"],
52
- queryFn: (params) => sdk.admin.shippingProfile.list(params),
52
+ queryFn: (params) => sdk.admin.shippingProfiles.query(params),
53
53
  getOptions: (data) => data.shipping_profiles.map((shippingProfile) => ({
54
54
  label: shippingProfile.name,
55
55
  value: shippingProfile.id
@@ -84,7 +84,7 @@ function VariantInventoryItemRow({
84
84
  defaultValueKey: "id",
85
85
  defaultValue: inventoryItem.inventory_item_id,
86
86
  selectedValue: selectedInventoryItemId,
87
- queryFn: (params) => sdk.admin.inventoryItem.list(params),
87
+ queryFn: (params) => sdk.admin.inventoryItems.query(params),
88
88
  getOptions: (data) => data.inventory_items.map((item) => ({
89
89
  label: `${item.title} ${item.sku ? `(${item.sku})` : ""}`,
90
90
  value: item.id
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AddCampaignPromotionForm
3
- } from "./chunk-42Z5MXZ6.js";
3
+ } from "./chunk-FSZTUENG.js";
4
4
  import "./chunk-OFCUTNGV.js";
5
5
  import "./chunk-IQPN4PZJ.js";
6
6
  import "./chunk-AEFDAU3Y.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  PromotionCreate
3
- } from "./chunk-FR3AHKZD.js";
3
+ } from "./chunk-YOZMLU26.js";
4
4
  import "./chunk-MAEP2UCK.js";
5
- import "./chunk-42Z5MXZ6.js";
5
+ import "./chunk-FSZTUENG.js";
6
6
  import "./chunk-XT574CWR.js";
7
7
  import "./chunk-25Z3ZNHL.js";
8
8
  import "./chunk-54TMLQH3.js";
@@ -106,7 +106,7 @@ var TaxRegionCreateForm = ({ parentId }) => {
106
106
  const { handleSuccess } = useRouteModal();
107
107
  const taxProviders = useComboboxData({
108
108
  queryKey: ["tax_providers"],
109
- queryFn: (params) => sdk.admin.taxProvider.list(params),
109
+ queryFn: (params) => sdk.admin.taxProviders.query(params),
110
110
  getOptions: (data) => data.tax_providers.map((provider) => ({
111
111
  label: formatProvider(provider.id),
112
112
  value: provider.id
@@ -77,7 +77,7 @@ var TaxRegionEditForm = ({ taxRegion }) => {
77
77
  const { handleSuccess } = useRouteModal();
78
78
  const taxProviders = useComboboxData({
79
79
  queryKey: ["tax_providers"],
80
- queryFn: (params) => sdk.admin.taxProvider.list(params),
80
+ queryFn: (params) => sdk.admin.taxProviders.query(params),
81
81
  getOptions: (data) => data.tax_providers.map((provider) => ({
82
82
  label: formatProvider(provider.id),
83
83
  value: provider.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/admin",
3
- "version": "2.0.0-canary.47",
3
+ "version": "2.0.0-canary.48",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",