@medusajs/draft-order 3.0.0-snapshot-20251106181920 → 3.0.0-snapshot-20251126221441
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/admin/index.js +37 -31
- package/.medusa/server/src/admin/index.mjs +37 -31
- package/package.json +16 -16
|
@@ -352,10 +352,14 @@ const DataTableAction = ({
|
|
|
352
352
|
}
|
|
353
353
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { ...buttonProps, onClick: props.onClick, children: label });
|
|
354
354
|
};
|
|
355
|
+
const backendUrl = __BACKEND_URL__ ?? "/";
|
|
356
|
+
const authType = __AUTH_TYPE__ ?? "session";
|
|
357
|
+
const jwtTokenStorageKey = __JWT_TOKEN_STORAGE_KEY__ || void 0;
|
|
355
358
|
const sdk = new Medusa__default.default({
|
|
356
|
-
baseUrl:
|
|
359
|
+
baseUrl: backendUrl,
|
|
357
360
|
auth: {
|
|
358
|
-
type:
|
|
361
|
+
type: authType,
|
|
362
|
+
jwtTokenStorageKey
|
|
359
363
|
}
|
|
360
364
|
});
|
|
361
365
|
const CUSTOMER_QUERY_KEY = "customers";
|
|
@@ -8725,7 +8729,7 @@ const Contact = ({ order }) => {
|
|
|
8725
8729
|
children: phone
|
|
8726
8730
|
}
|
|
8727
8731
|
),
|
|
8728
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Copy, { content:
|
|
8732
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Copy, { content: phone, className: "text-ui-fg-muted" }) })
|
|
8729
8733
|
] })
|
|
8730
8734
|
] })
|
|
8731
8735
|
] });
|
|
@@ -9568,6 +9572,27 @@ const ID = () => {
|
|
|
9568
9572
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
|
|
9569
9573
|
] });
|
|
9570
9574
|
};
|
|
9575
|
+
const CustomItems = () => {
|
|
9576
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9577
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9578
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9579
|
+
] });
|
|
9580
|
+
};
|
|
9581
|
+
const CustomItemsForm = () => {
|
|
9582
|
+
const form = reactHookForm.useForm({
|
|
9583
|
+
resolver: zod.zodResolver(schema$5)
|
|
9584
|
+
});
|
|
9585
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9586
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9587
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9588
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9589
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9590
|
+
] }) })
|
|
9591
|
+
] }) });
|
|
9592
|
+
};
|
|
9593
|
+
const schema$5 = objectType({
|
|
9594
|
+
email: stringType().email()
|
|
9595
|
+
});
|
|
9571
9596
|
const BillingAddress = () => {
|
|
9572
9597
|
const { id } = reactRouterDom.useParams();
|
|
9573
9598
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9600,7 +9625,7 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9600
9625
|
postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
9601
9626
|
phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
|
|
9602
9627
|
},
|
|
9603
|
-
resolver: zod.zodResolver(schema$
|
|
9628
|
+
resolver: zod.zodResolver(schema$4)
|
|
9604
9629
|
});
|
|
9605
9630
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9606
9631
|
const { handleSuccess } = useRouteModal();
|
|
@@ -9757,28 +9782,7 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9757
9782
|
}
|
|
9758
9783
|
) });
|
|
9759
9784
|
};
|
|
9760
|
-
const schema$
|
|
9761
|
-
const CustomItems = () => {
|
|
9762
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9763
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9764
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9765
|
-
] });
|
|
9766
|
-
};
|
|
9767
|
-
const CustomItemsForm = () => {
|
|
9768
|
-
const form = reactHookForm.useForm({
|
|
9769
|
-
resolver: zod.zodResolver(schema$4)
|
|
9770
|
-
});
|
|
9771
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9772
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9773
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9774
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9775
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9776
|
-
] }) })
|
|
9777
|
-
] }) });
|
|
9778
|
-
};
|
|
9779
|
-
const schema$4 = objectType({
|
|
9780
|
-
email: stringType().email()
|
|
9781
|
-
});
|
|
9785
|
+
const schema$4 = addressSchema;
|
|
9782
9786
|
const Email = () => {
|
|
9783
9787
|
const { id } = reactRouterDom.useParams();
|
|
9784
9788
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -13060,14 +13064,14 @@ const routeModule = {
|
|
|
13060
13064
|
handle,
|
|
13061
13065
|
loader,
|
|
13062
13066
|
children: [
|
|
13063
|
-
{
|
|
13064
|
-
Component: BillingAddress,
|
|
13065
|
-
path: "/draft-orders/:id/billing-address"
|
|
13066
|
-
},
|
|
13067
13067
|
{
|
|
13068
13068
|
Component: CustomItems,
|
|
13069
13069
|
path: "/draft-orders/:id/custom-items"
|
|
13070
13070
|
},
|
|
13071
|
+
{
|
|
13072
|
+
Component: BillingAddress,
|
|
13073
|
+
path: "/draft-orders/:id/billing-address"
|
|
13074
|
+
},
|
|
13071
13075
|
{
|
|
13072
13076
|
Component: Email,
|
|
13073
13077
|
path: "/draft-orders/:id/email"
|
|
@@ -13110,7 +13114,9 @@ const menuItemModule = {
|
|
|
13110
13114
|
label: config.label,
|
|
13111
13115
|
icon: void 0,
|
|
13112
13116
|
path: "/draft-orders",
|
|
13113
|
-
nested: "/orders"
|
|
13117
|
+
nested: "/orders",
|
|
13118
|
+
rank: void 0,
|
|
13119
|
+
translationNs: void 0
|
|
13114
13120
|
}
|
|
13115
13121
|
]
|
|
13116
13122
|
};
|
|
@@ -345,10 +345,14 @@ const DataTableAction = ({
|
|
|
345
345
|
}
|
|
346
346
|
return /* @__PURE__ */ jsx(Button, { ...buttonProps, onClick: props.onClick, children: label });
|
|
347
347
|
};
|
|
348
|
+
const backendUrl = __BACKEND_URL__ ?? "/";
|
|
349
|
+
const authType = __AUTH_TYPE__ ?? "session";
|
|
350
|
+
const jwtTokenStorageKey = __JWT_TOKEN_STORAGE_KEY__ || void 0;
|
|
348
351
|
const sdk = new Medusa({
|
|
349
|
-
baseUrl:
|
|
352
|
+
baseUrl: backendUrl,
|
|
350
353
|
auth: {
|
|
351
|
-
type:
|
|
354
|
+
type: authType,
|
|
355
|
+
jwtTokenStorageKey
|
|
352
356
|
}
|
|
353
357
|
});
|
|
354
358
|
const CUSTOMER_QUERY_KEY = "customers";
|
|
@@ -8718,7 +8722,7 @@ const Contact = ({ order }) => {
|
|
|
8718
8722
|
children: phone
|
|
8719
8723
|
}
|
|
8720
8724
|
),
|
|
8721
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Copy, { content:
|
|
8725
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Copy, { content: phone, className: "text-ui-fg-muted" }) })
|
|
8722
8726
|
] })
|
|
8723
8727
|
] })
|
|
8724
8728
|
] });
|
|
@@ -9561,6 +9565,27 @@ const ID = () => {
|
|
|
9561
9565
|
/* @__PURE__ */ jsx(Outlet, {})
|
|
9562
9566
|
] });
|
|
9563
9567
|
};
|
|
9568
|
+
const CustomItems = () => {
|
|
9569
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9570
|
+
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
9571
|
+
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
9572
|
+
] });
|
|
9573
|
+
};
|
|
9574
|
+
const CustomItemsForm = () => {
|
|
9575
|
+
const form = useForm({
|
|
9576
|
+
resolver: zodResolver(schema$5)
|
|
9577
|
+
});
|
|
9578
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9579
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
9580
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9581
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9582
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
9583
|
+
] }) })
|
|
9584
|
+
] }) });
|
|
9585
|
+
};
|
|
9586
|
+
const schema$5 = objectType({
|
|
9587
|
+
email: stringType().email()
|
|
9588
|
+
});
|
|
9564
9589
|
const BillingAddress = () => {
|
|
9565
9590
|
const { id } = useParams();
|
|
9566
9591
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9593,7 +9618,7 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9593
9618
|
postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
9594
9619
|
phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
|
|
9595
9620
|
},
|
|
9596
|
-
resolver: zodResolver(schema$
|
|
9621
|
+
resolver: zodResolver(schema$4)
|
|
9597
9622
|
});
|
|
9598
9623
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9599
9624
|
const { handleSuccess } = useRouteModal();
|
|
@@ -9750,28 +9775,7 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9750
9775
|
}
|
|
9751
9776
|
) });
|
|
9752
9777
|
};
|
|
9753
|
-
const schema$
|
|
9754
|
-
const CustomItems = () => {
|
|
9755
|
-
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9756
|
-
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
9757
|
-
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
9758
|
-
] });
|
|
9759
|
-
};
|
|
9760
|
-
const CustomItemsForm = () => {
|
|
9761
|
-
const form = useForm({
|
|
9762
|
-
resolver: zodResolver(schema$4)
|
|
9763
|
-
});
|
|
9764
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9765
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
9766
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9767
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9768
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
9769
|
-
] }) })
|
|
9770
|
-
] }) });
|
|
9771
|
-
};
|
|
9772
|
-
const schema$4 = objectType({
|
|
9773
|
-
email: stringType().email()
|
|
9774
|
-
});
|
|
9778
|
+
const schema$4 = addressSchema;
|
|
9775
9779
|
const Email = () => {
|
|
9776
9780
|
const { id } = useParams();
|
|
9777
9781
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -13053,14 +13057,14 @@ const routeModule = {
|
|
|
13053
13057
|
handle,
|
|
13054
13058
|
loader,
|
|
13055
13059
|
children: [
|
|
13056
|
-
{
|
|
13057
|
-
Component: BillingAddress,
|
|
13058
|
-
path: "/draft-orders/:id/billing-address"
|
|
13059
|
-
},
|
|
13060
13060
|
{
|
|
13061
13061
|
Component: CustomItems,
|
|
13062
13062
|
path: "/draft-orders/:id/custom-items"
|
|
13063
13063
|
},
|
|
13064
|
+
{
|
|
13065
|
+
Component: BillingAddress,
|
|
13066
|
+
path: "/draft-orders/:id/billing-address"
|
|
13067
|
+
},
|
|
13064
13068
|
{
|
|
13065
13069
|
Component: Email,
|
|
13066
13070
|
path: "/draft-orders/:id/email"
|
|
@@ -13103,7 +13107,9 @@ const menuItemModule = {
|
|
|
13103
13107
|
label: config.label,
|
|
13104
13108
|
icon: void 0,
|
|
13105
13109
|
path: "/draft-orders",
|
|
13106
|
-
nested: "/orders"
|
|
13110
|
+
nested: "/orders",
|
|
13111
|
+
rank: void 0,
|
|
13112
|
+
translationNs: void 0
|
|
13107
13113
|
}
|
|
13108
13114
|
]
|
|
13109
13115
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20251126221441",
|
|
4
4
|
"description": "A starter for Medusa plugins.",
|
|
5
5
|
"author": "Medusa (https://medusajs.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ariakit/react": "^0.4.15",
|
|
38
38
|
"@babel/runtime": "^7.26.10",
|
|
39
39
|
"@hookform/resolvers": "3.4.2",
|
|
40
|
-
"@medusajs/js-sdk": "3.0.0-snapshot-
|
|
40
|
+
"@medusajs/js-sdk": "3.0.0-snapshot-20251126221441",
|
|
41
41
|
"@tanstack/react-query": "5.64.2",
|
|
42
42
|
"@uiw/react-json-view": "^2.0.0-alpha.17",
|
|
43
43
|
"date-fns": "^3.6.0",
|
|
@@ -48,22 +48,22 @@
|
|
|
48
48
|
"react-hook-form": "7.49.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@medusajs/admin-sdk": "3.0.0-snapshot-
|
|
52
|
-
"@medusajs/cli": "3.0.0-snapshot-
|
|
53
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
54
|
-
"@medusajs/icons": "3.0.0-snapshot-
|
|
55
|
-
"@medusajs/test-utils": "3.0.0-snapshot-
|
|
56
|
-
"@medusajs/types": "3.0.0-snapshot-
|
|
57
|
-
"@medusajs/ui": "4.0.28-snapshot-
|
|
58
|
-
"@medusajs/ui-preset": "3.0.0-snapshot-
|
|
51
|
+
"@medusajs/admin-sdk": "3.0.0-snapshot-20251126221441",
|
|
52
|
+
"@medusajs/cli": "3.0.0-snapshot-20251126221441",
|
|
53
|
+
"@medusajs/framework": "3.0.0-snapshot-20251126221441",
|
|
54
|
+
"@medusajs/icons": "3.0.0-snapshot-20251126221441",
|
|
55
|
+
"@medusajs/test-utils": "3.0.0-snapshot-20251126221441",
|
|
56
|
+
"@medusajs/types": "3.0.0-snapshot-20251126221441",
|
|
57
|
+
"@medusajs/ui": "4.0.28-snapshot-20251126221441",
|
|
58
|
+
"@medusajs/ui-preset": "3.0.0-snapshot-20251126221441"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@medusajs/admin-sdk": "3.0.0-snapshot-
|
|
62
|
-
"@medusajs/cli": "3.0.0-snapshot-
|
|
63
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
64
|
-
"@medusajs/icons": "3.0.0-snapshot-
|
|
65
|
-
"@medusajs/test-utils": "3.0.0-snapshot-
|
|
66
|
-
"@medusajs/ui": "4.0.28-snapshot-
|
|
61
|
+
"@medusajs/admin-sdk": "3.0.0-snapshot-20251126221441",
|
|
62
|
+
"@medusajs/cli": "3.0.0-snapshot-20251126221441",
|
|
63
|
+
"@medusajs/framework": "3.0.0-snapshot-20251126221441",
|
|
64
|
+
"@medusajs/icons": "3.0.0-snapshot-20251126221441",
|
|
65
|
+
"@medusajs/test-utils": "3.0.0-snapshot-20251126221441",
|
|
66
|
+
"@medusajs/ui": "4.0.28-snapshot-20251126221441",
|
|
67
67
|
"react": "^18.3.1",
|
|
68
68
|
"react-dom": "^18.3.1",
|
|
69
69
|
"react-router-dom": "6.20.1"
|