@medusajs/draft-order 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.medusa/server/src/admin/components/common/action-menu.js +77 -0
- package/.medusa/server/src/admin/components/common/conditional-tooltip.js +15 -0
- package/.medusa/server/src/admin/components/common/data-table.js +249 -0
- package/.medusa/server/src/admin/components/common/form.js +151 -0
- package/.medusa/server/src/admin/components/common/inline-tip.js +42 -0
- package/.medusa/server/src/admin/components/common/keybound-form.js +32 -0
- package/.medusa/server/src/admin/components/common/page-skeleton.js +51 -0
- package/.medusa/server/src/admin/components/common/thumbnail.js +15 -0
- package/.medusa/server/src/admin/components/draft-orders/activity-section.js +205 -0
- package/.medusa/server/src/admin/components/draft-orders/customer-section.js +165 -0
- package/.medusa/server/src/admin/components/draft-orders/general-section.js +36 -0
- package/.medusa/server/src/admin/components/draft-orders/json-view-section.js +140 -0
- package/.medusa/server/src/admin/components/draft-orders/metadata-section.js +28 -0
- package/.medusa/server/src/admin/components/draft-orders/shipping-section.js +211 -0
- package/.medusa/server/src/admin/components/draft-orders/summary-section.js +148 -0
- package/.medusa/server/src/admin/components/inputs/combobox.js +311 -0
- package/.medusa/server/src/admin/components/inputs/country-select.js +59 -0
- package/.medusa/server/src/admin/components/inputs/number-input.js +100 -0
- package/.medusa/server/src/admin/components/inputs/switch-block.js +30 -0
- package/.medusa/server/src/admin/components/modals/index.js +19 -0
- package/.medusa/server/src/admin/components/modals/route-drawer/index.js +4 -0
- package/.medusa/server/src/admin/components/modals/route-drawer/route-drawer.js +57 -0
- package/.medusa/server/src/admin/components/modals/route-focus-modal/index.js +4 -0
- package/.medusa/server/src/admin/components/modals/route-focus-modal/route-focus-modal.js +71 -0
- package/.medusa/server/src/admin/components/modals/route-modal-form/index.js +4 -0
- package/.medusa/server/src/admin/components/modals/route-modal-form/route-modal-form.js +60 -0
- package/.medusa/server/src/admin/components/modals/route-modal-provider/index.js +6 -0
- package/.medusa/server/src/admin/components/modals/route-modal-provider/route-modal-context.js +5 -0
- package/.medusa/server/src/admin/components/modals/route-modal-provider/route-provider.js +30 -0
- package/.medusa/server/src/admin/components/modals/route-modal-provider/use-route-modal.js +12 -0
- package/.medusa/server/src/admin/components/modals/stacked-drawer/index.js +5 -0
- package/.medusa/server/src/admin/components/modals/stacked-drawer/stacked-drawer.js +55 -0
- package/.medusa/server/src/admin/components/modals/stacked-focus-modal/index.js +5 -0
- package/.medusa/server/src/admin/components/modals/stacked-focus-modal/stacked-focus-modal.js +63 -0
- package/.medusa/server/src/admin/components/modals/stacked-modal-provider/index.js +6 -0
- package/.medusa/server/src/admin/components/modals/stacked-modal-provider/stacked-modal-context.js +5 -0
- package/.medusa/server/src/admin/components/modals/stacked-modal-provider/stacked-modal-provider.js +47 -0
- package/.medusa/server/src/admin/components/modals/stacked-modal-provider/use-stacked-modal.js +14 -0
- package/.medusa/server/src/admin/components/utilities/generic-forward-ref.js +7 -0
- package/.medusa/server/src/admin/hooks/api/customers.js +53 -0
- package/.medusa/server/src/admin/hooks/api/draft-orders.js +161 -0
- package/.medusa/server/src/admin/hooks/api/orders.js +274 -0
- package/.medusa/server/src/admin/hooks/api/product-variants.js +21 -0
- package/.medusa/server/src/admin/hooks/api/regions.js +35 -0
- package/.medusa/server/src/admin/hooks/api/sales-channels.js +35 -0
- package/.medusa/server/src/admin/hooks/api/shipping-options.js +35 -0
- package/.medusa/server/src/admin/hooks/api/users.js +26 -0
- package/.medusa/server/src/admin/hooks/common/use-combobox-data.js +61 -0
- package/.medusa/server/src/admin/hooks/common/use-data-table-date-filters.js +89 -0
- package/.medusa/server/src/admin/hooks/common/use-debounced-search.js +22 -0
- package/.medusa/server/src/admin/hooks/common/use-query-params.js +14 -0
- package/.medusa/server/src/admin/hooks/order-edits/use-cancel-order-edit.js +25 -0
- package/.medusa/server/src/admin/hooks/order-edits/use-initiate-order-edit.js +39 -0
- package/.medusa/server/src/admin/lib/data/countries.js +1762 -0
- package/.medusa/server/src/admin/lib/data/currencies.js +36 -0
- package/.medusa/server/src/admin/lib/queries/draft-order-details.js +1 -0
- package/.medusa/server/src/admin/lib/queries/sdk.js +10 -0
- package/.medusa/server/src/admin/lib/schemas/address.js +16 -0
- package/.medusa/server/src/admin/lib/utils/address-utils.js +57 -0
- package/.medusa/server/src/admin/lib/utils/date-utils.js +27 -0
- package/.medusa/server/src/admin/lib/utils/order-utils.js +13 -0
- package/.medusa/server/src/admin/routes/draft-orders/@create/page.js +659 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@billing-address/page.js +228 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@custom-items/page.js +38 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@email/page.js +89 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@items/page.js +576 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@metadata/page.js +338 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@promotions/page.js +70 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@sales-channel/page.js +113 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@shipping/page.js +465 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/@shipping-address/page.js +241 -0
- package/.medusa/server/src/admin/routes/draft-orders/_id_/page.js +70 -0
- package/.medusa/server/src/admin/routes/draft-orders/page.js +148 -0
- package/.medusa/server/src/api/admin/draft-orders/[id]/convert/route.js +18 -0
- package/.medusa/server/src/types/http/draft-orders/payloads.js +3 -0
- package/.medusa/server/src/types/http/draft-orders/responses.js +3 -0
- package/.medusa/server/src/types/http/orders/entity.js +3 -0
- package/.medusa/server/src/types/http/orders/requests.js +3 -0
- package/.medusa/server/src/workflows/draft-orders/convert-draft-order-workflow.js +54 -0
- package/.medusa/server/tailwind.config.js +12 -0
- package/README.md +64 -0
- package/package.json +104 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from "/Users/oliverjuhl/Desktop/medusa/draft-order-plugin/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
|
|
3
|
+
import { Heading, toast, Input, Button } from "@medusajs/ui";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { useParams } from "react-router-dom";
|
|
6
|
+
import { z } from "/Users/oliverjuhl/Desktop/medusa/draft-order-plugin/node_modules/zod/lib/index.mjs";
|
|
7
|
+
import { Form } from "../../../../components/common/form.js";
|
|
8
|
+
import { KeyboundForm } from "../../../../components/common/keybound-form.js";
|
|
9
|
+
import { CountrySelect } from "../../../../components/inputs/country-select.js";
|
|
10
|
+
import { SwitchBlock } from "../../../../components/inputs/switch-block.js";
|
|
11
|
+
import { RouteDrawer } from "../../../../components/modals/route-drawer/route-drawer.js";
|
|
12
|
+
import "../../../../components/modals/route-focus-modal/route-focus-modal.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "../../../../components/modals/route-modal-provider/route-modal-context.js";
|
|
15
|
+
import { useRouteModal } from "../../../../components/modals/route-modal-provider/use-route-modal.js";
|
|
16
|
+
import "../../../../components/modals/stacked-drawer/stacked-drawer.js";
|
|
17
|
+
import "../../../../components/modals/stacked-focus-modal/stacked-focus-modal.js";
|
|
18
|
+
import "../../../../components/modals/stacked-modal-provider/stacked-modal-context.js";
|
|
19
|
+
import { useUpdateDraftOrder } from "../../../../hooks/api/draft-orders.js";
|
|
20
|
+
import { useOrder } from "../../../../hooks/api/orders.js";
|
|
21
|
+
import { addressSchema } from "../../../../lib/schemas/address.js";
|
|
22
|
+
const ShippingAddress = () => {
|
|
23
|
+
const { id } = useParams();
|
|
24
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
25
|
+
fields: "+shipping_address"
|
|
26
|
+
});
|
|
27
|
+
if (isError) {
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
const isReady = !isPending && !!order;
|
|
31
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
32
|
+
/* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
|
|
34
|
+
/* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
|
|
35
|
+
] }),
|
|
36
|
+
isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
const ShippingAddressForm = ({ order }) => {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
41
|
+
const form = useForm({
|
|
42
|
+
defaultValues: {
|
|
43
|
+
first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
|
|
44
|
+
last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
|
|
45
|
+
company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
|
|
46
|
+
address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
|
|
47
|
+
address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
|
|
48
|
+
city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
|
|
49
|
+
province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
|
|
50
|
+
country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
|
|
51
|
+
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
52
|
+
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? "",
|
|
53
|
+
notify: false
|
|
54
|
+
},
|
|
55
|
+
resolver: zodResolver(schema)
|
|
56
|
+
});
|
|
57
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
58
|
+
const { handleSuccess } = useRouteModal();
|
|
59
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
60
|
+
await mutateAsync(
|
|
61
|
+
{
|
|
62
|
+
shipping_address: {
|
|
63
|
+
first_name: data.first_name,
|
|
64
|
+
last_name: data.last_name,
|
|
65
|
+
company: data.company,
|
|
66
|
+
address_1: data.address_1,
|
|
67
|
+
address_2: data.address_2,
|
|
68
|
+
city: data.city,
|
|
69
|
+
province: data.province,
|
|
70
|
+
country_code: data.country_code,
|
|
71
|
+
postal_code: data.postal_code,
|
|
72
|
+
phone: data.phone
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
onSuccess: () => {
|
|
77
|
+
handleSuccess();
|
|
78
|
+
},
|
|
79
|
+
onError: (error) => {
|
|
80
|
+
toast.error(error.message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
86
|
+
KeyboundForm,
|
|
87
|
+
{
|
|
88
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
89
|
+
onSubmit,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsxs(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
Form.Field,
|
|
95
|
+
{
|
|
96
|
+
control: form.control,
|
|
97
|
+
name: "country_code",
|
|
98
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "Country" }),
|
|
100
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
|
|
101
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
102
|
+
] })
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
Form.Field,
|
|
108
|
+
{
|
|
109
|
+
control: form.control,
|
|
110
|
+
name: "first_name",
|
|
111
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "First name" }),
|
|
113
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
114
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
115
|
+
] })
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
Form.Field,
|
|
120
|
+
{
|
|
121
|
+
control: form.control,
|
|
122
|
+
name: "last_name",
|
|
123
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
124
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "Last name" }),
|
|
125
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
126
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
127
|
+
] })
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
Form.Field,
|
|
133
|
+
{
|
|
134
|
+
control: form.control,
|
|
135
|
+
name: "company",
|
|
136
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
137
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: "Company" }),
|
|
138
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
139
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Form.Field,
|
|
145
|
+
{
|
|
146
|
+
control: form.control,
|
|
147
|
+
name: "address_1",
|
|
148
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
149
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "Address" }),
|
|
150
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
151
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
152
|
+
] })
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
Form.Field,
|
|
157
|
+
{
|
|
158
|
+
control: form.control,
|
|
159
|
+
name: "address_2",
|
|
160
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
161
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: "Apartment, suite, etc." }),
|
|
162
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
163
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
164
|
+
] })
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
Form.Field,
|
|
170
|
+
{
|
|
171
|
+
control: form.control,
|
|
172
|
+
name: "postal_code",
|
|
173
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
174
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "Postal code" }),
|
|
175
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
176
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
177
|
+
] })
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
Form.Field,
|
|
182
|
+
{
|
|
183
|
+
control: form.control,
|
|
184
|
+
name: "city",
|
|
185
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
186
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "City" }),
|
|
187
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
188
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
189
|
+
] })
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
Form.Field,
|
|
195
|
+
{
|
|
196
|
+
control: form.control,
|
|
197
|
+
name: "province",
|
|
198
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
199
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: "Province / State" }),
|
|
200
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
201
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
202
|
+
] })
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsx(
|
|
206
|
+
Form.Field,
|
|
207
|
+
{
|
|
208
|
+
control: form.control,
|
|
209
|
+
name: "phone",
|
|
210
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: "Phone" }),
|
|
212
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
213
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
214
|
+
] })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
SwitchBlock,
|
|
220
|
+
{
|
|
221
|
+
control: form.control,
|
|
222
|
+
name: "notify",
|
|
223
|
+
label: "Notify customer",
|
|
224
|
+
description: "Notify the customer of the new shipping address."
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] }),
|
|
228
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
229
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
230
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
231
|
+
] }) })
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
) });
|
|
235
|
+
};
|
|
236
|
+
const schema = addressSchema.extend({
|
|
237
|
+
notify: z.boolean().optional()
|
|
238
|
+
});
|
|
239
|
+
export {
|
|
240
|
+
ShippingAddress as default
|
|
241
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { useParams, Outlet } from "react-router-dom";
|
|
4
|
+
import { PageSkeleton } from "../../../components/common/page-skeleton.js";
|
|
5
|
+
import { ActivitySection } from "../../../components/draft-orders/activity-section.js";
|
|
6
|
+
import { CustomerSection } from "../../../components/draft-orders/customer-section.js";
|
|
7
|
+
import { GeneralSection } from "../../../components/draft-orders/general-section.js";
|
|
8
|
+
import { JsonViewSection } from "../../../components/draft-orders/json-view-section.js";
|
|
9
|
+
import { MetadataSection } from "../../../components/draft-orders/metadata-section.js";
|
|
10
|
+
import { ShippingSection } from "../../../components/draft-orders/shipping-section.js";
|
|
11
|
+
import { SummarySection } from "../../../components/draft-orders/summary-section.js";
|
|
12
|
+
import { useOrder, useOrderChanges } from "../../../hooks/api/orders.js";
|
|
13
|
+
const ID = () => {
|
|
14
|
+
const { id } = useParams();
|
|
15
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
16
|
+
fields: "+customer.*,+sales_channel.*,+region.*,+email,+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+items.variant.options.*,+currency_code"
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
order_changes,
|
|
20
|
+
isPending: isOrderChangesPending,
|
|
21
|
+
isError: isOrderChangesError,
|
|
22
|
+
error: orderChangesError
|
|
23
|
+
} = useOrderChanges(id, {
|
|
24
|
+
change_type: ["edit", "transfer", "update_order"]
|
|
25
|
+
});
|
|
26
|
+
if (isError) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
if (isOrderChangesError) {
|
|
30
|
+
throw orderChangesError;
|
|
31
|
+
}
|
|
32
|
+
const isReady = !isPending && !isOrderChangesPending && !!order && !!order_changes;
|
|
33
|
+
if (!isReady) {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
PageSkeleton,
|
|
36
|
+
{
|
|
37
|
+
mainSections: 3,
|
|
38
|
+
sidebarSections: 2,
|
|
39
|
+
showJSON: true,
|
|
40
|
+
showMetadata: true
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const orderHasItems = order.items.length > 0;
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-y-3", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-start gap-x-4 gap-y-3 xl:grid xl:grid-cols-[minmax(0,_1fr)_440px]", children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full min-w-0 flex-col gap-y-3", children: [
|
|
48
|
+
/* @__PURE__ */ jsx(GeneralSection, { order }),
|
|
49
|
+
/* @__PURE__ */ jsx(SummarySection, { order }),
|
|
50
|
+
orderHasItems && /* @__PURE__ */ jsx(ShippingSection, { order }),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden flex-col gap-y-3 xl:flex", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(MetadataSection, { order }),
|
|
53
|
+
/* @__PURE__ */ jsx(JsonViewSection, { data: order })
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-y-3 xl:mt-0", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(CustomerSection, { order }),
|
|
58
|
+
/* @__PURE__ */ jsx(ActivitySection, { order, changes: order_changes }),
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-3 xl:hidden", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(MetadataSection, { order }),
|
|
61
|
+
/* @__PURE__ */ jsx(JsonViewSection, { data: order })
|
|
62
|
+
] })
|
|
63
|
+
] })
|
|
64
|
+
] }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(Outlet, {})
|
|
66
|
+
] });
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
ID as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineRouteConfig } from "@medusajs/admin-sdk";
|
|
3
|
+
import { createDataTableColumnHelper, Container, Tooltip } from "@medusajs/ui";
|
|
4
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
5
|
+
import { Fragment, useMemo } from "react";
|
|
6
|
+
import { Outlet } from "react-router-dom";
|
|
7
|
+
import { DataTable } from "../../components/common/data-table.js";
|
|
8
|
+
import { useDraftOrders } from "../../hooks/api/draft-orders.js";
|
|
9
|
+
import { useDataTableDateFilters } from "../../hooks/common/use-data-table-date-filters.js";
|
|
10
|
+
import { useQueryParams } from "../../hooks/common/use-query-params.js";
|
|
11
|
+
import { getFullDate } from "../../lib/utils/date-utils.js";
|
|
12
|
+
const PAGE_SIZE = 20;
|
|
13
|
+
const List = () => {
|
|
14
|
+
const queryParams = useDraftOrderTableQuery({
|
|
15
|
+
pageSize: PAGE_SIZE
|
|
16
|
+
});
|
|
17
|
+
const { draft_orders, count, isPending, isError, error } = useDraftOrders(
|
|
18
|
+
{
|
|
19
|
+
...queryParams,
|
|
20
|
+
order: queryParams.order ?? "-created_at",
|
|
21
|
+
fields: "+customer.*,+sales_channel.*,+email,+display_id,+total,+currency_code,+shipping_total,+tax_total,+discount_total,+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+items.variant.options.*"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
placeholderData: keepPreviousData
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const columns = useColumns();
|
|
28
|
+
const filters = useFilters();
|
|
29
|
+
if (isError) {
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Container, { className: "p-0", children: /* @__PURE__ */ jsx(
|
|
34
|
+
DataTable,
|
|
35
|
+
{
|
|
36
|
+
data: draft_orders,
|
|
37
|
+
getRowId: (row) => row.id,
|
|
38
|
+
columns,
|
|
39
|
+
filters,
|
|
40
|
+
isLoading: isPending,
|
|
41
|
+
pageSize: PAGE_SIZE,
|
|
42
|
+
rowCount: count,
|
|
43
|
+
heading: "Draft Orders",
|
|
44
|
+
action: {
|
|
45
|
+
label: "Create",
|
|
46
|
+
to: "create"
|
|
47
|
+
},
|
|
48
|
+
rowHref: (row) => `${row.id}`,
|
|
49
|
+
emptyState: {
|
|
50
|
+
empty: {
|
|
51
|
+
heading: "No draft orders found",
|
|
52
|
+
description: "Create a new draft order to get started."
|
|
53
|
+
},
|
|
54
|
+
filtered: {
|
|
55
|
+
heading: "No results found",
|
|
56
|
+
description: "No draft orders match your filter criteria."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
/* @__PURE__ */ jsx(Outlet, {})
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
64
|
+
const config = defineRouteConfig({
|
|
65
|
+
label: "Drafts",
|
|
66
|
+
nested: "/orders"
|
|
67
|
+
});
|
|
68
|
+
const columnHelper = createDataTableColumnHelper();
|
|
69
|
+
const useColumns = () => {
|
|
70
|
+
return useMemo(
|
|
71
|
+
() => [
|
|
72
|
+
columnHelper.accessor("display_id", {
|
|
73
|
+
header: "Display ID",
|
|
74
|
+
cell: ({ getValue }) => {
|
|
75
|
+
return `#${getValue()}`;
|
|
76
|
+
},
|
|
77
|
+
enableSorting: true
|
|
78
|
+
}),
|
|
79
|
+
columnHelper.accessor("created_at", {
|
|
80
|
+
header: "Date",
|
|
81
|
+
cell: ({ getValue }) => {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
Tooltip,
|
|
84
|
+
{
|
|
85
|
+
content: getFullDate({ date: getValue(), includeTime: true }),
|
|
86
|
+
children: /* @__PURE__ */ jsx("span", { children: getFullDate({ date: getValue() }) })
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
enableSorting: true
|
|
91
|
+
}),
|
|
92
|
+
columnHelper.accessor("customer", {
|
|
93
|
+
header: "Customer",
|
|
94
|
+
cell: ({ getValue }) => {
|
|
95
|
+
var _a;
|
|
96
|
+
return (_a = getValue()) == null ? void 0 : _a.email;
|
|
97
|
+
},
|
|
98
|
+
enableSorting: true
|
|
99
|
+
}),
|
|
100
|
+
columnHelper.accessor("sales_channel.name", {
|
|
101
|
+
header: "Sales Channel",
|
|
102
|
+
cell: ({ getValue }) => {
|
|
103
|
+
return getValue() || "-";
|
|
104
|
+
},
|
|
105
|
+
enableSorting: true
|
|
106
|
+
})
|
|
107
|
+
],
|
|
108
|
+
[]
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
const useFilters = () => {
|
|
112
|
+
const dateFilterOptions = useDataTableDateFilters();
|
|
113
|
+
return useMemo(() => {
|
|
114
|
+
return dateFilterOptions;
|
|
115
|
+
}, [dateFilterOptions]);
|
|
116
|
+
};
|
|
117
|
+
const useDraftOrderTableQuery = ({
|
|
118
|
+
prefix,
|
|
119
|
+
pageSize = 20
|
|
120
|
+
}) => {
|
|
121
|
+
const queryObject = useQueryParams(
|
|
122
|
+
[
|
|
123
|
+
"offset",
|
|
124
|
+
"q",
|
|
125
|
+
"order",
|
|
126
|
+
"status",
|
|
127
|
+
"customer_id",
|
|
128
|
+
"created_at",
|
|
129
|
+
"updated_at"
|
|
130
|
+
],
|
|
131
|
+
prefix
|
|
132
|
+
);
|
|
133
|
+
const { offset, created_at, updated_at, status, ...rest } = queryObject;
|
|
134
|
+
const searchParams = {
|
|
135
|
+
limit: pageSize,
|
|
136
|
+
offset: offset ? Number(offset) : 0,
|
|
137
|
+
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
138
|
+
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
139
|
+
status: status ? JSON.parse(status) : void 0,
|
|
140
|
+
...rest
|
|
141
|
+
};
|
|
142
|
+
return searchParams;
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
config,
|
|
146
|
+
List as default,
|
|
147
|
+
useDraftOrderTableQuery
|
|
148
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POST = void 0;
|
|
4
|
+
const convert_draft_order_workflow_1 = require("../../../../../workflows/draft-orders/convert-draft-order-workflow");
|
|
5
|
+
const POST = async (req, res) => {
|
|
6
|
+
const { id } = req.params;
|
|
7
|
+
const workflow = (0, convert_draft_order_workflow_1.convertDraftOrderWorkflow)(req.scope);
|
|
8
|
+
const response = await workflow.run({
|
|
9
|
+
input: {
|
|
10
|
+
id,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
return res.json({
|
|
14
|
+
order: response.result,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.POST = POST;
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL2FkbWluL2RyYWZ0LW9yZGVycy9baWRdL2NvbnZlcnQvcm91dGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUhBQThHO0FBRXZHLE1BQU0sSUFBSSxHQUFHLEtBQUssRUFBRSxHQUFrQixFQUFFLEdBQW1CLEVBQUUsRUFBRTtJQUNwRSxNQUFNLEVBQUUsRUFBRSxFQUFFLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQTtJQUV6QixNQUFNLFFBQVEsR0FBRyxJQUFBLHdEQUF5QixFQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUVyRCxNQUFNLFFBQVEsR0FBRyxNQUFNLFFBQVEsQ0FBQyxHQUFHLENBQUM7UUFDbEMsS0FBSyxFQUFFO1lBQ0wsRUFBRTtTQUNIO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDO1FBQ2QsS0FBSyxFQUFFLFFBQVEsQ0FBQyxNQUFNO0tBQ3ZCLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQWRZLFFBQUEsSUFBSSxRQWNoQiJ9
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF5bG9hZHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvdHlwZXMvaHR0cC9kcmFmdC1vcmRlcnMvcGF5bG9hZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzcG9uc2VzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3R5cGVzL2h0dHAvZHJhZnQtb3JkZXJzL3Jlc3BvbnNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3R5cGVzL2h0dHAvb3JkZXJzL2VudGl0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvdHlwZXMvaHR0cC9vcmRlcnMvcmVxdWVzdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertDraftOrderWorkflow = void 0;
|
|
4
|
+
const core_flows_1 = require("@medusajs/core-flows");
|
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
6
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
7
|
+
const convertDraftOrderWorkflowId = "convert-draft-order";
|
|
8
|
+
const validateDraftOrderStep = (0, workflows_sdk_1.createStep)("validate-draft-order", async function ({ order }) {
|
|
9
|
+
// @ts-expect-error
|
|
10
|
+
if (order.status !== "draft" && !order.is_draft_order) {
|
|
11
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Order is not in draft status");
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const convertDraftOrderStep = (0, workflows_sdk_1.createStep)("convert-draft-order", async function ({ id }, { container }) {
|
|
15
|
+
const service = container.resolve(utils_1.Modules.ORDER);
|
|
16
|
+
const response = await service.updateOrders([
|
|
17
|
+
{
|
|
18
|
+
id,
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
status: utils_1.OrderStatus.PENDING,
|
|
21
|
+
is_draft_order: false,
|
|
22
|
+
},
|
|
23
|
+
]);
|
|
24
|
+
const order = response[0];
|
|
25
|
+
return new workflows_sdk_1.StepResponse(order, {
|
|
26
|
+
id,
|
|
27
|
+
});
|
|
28
|
+
}, async function (prevData, { container }) {
|
|
29
|
+
if (!prevData) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const service = container.resolve(utils_1.Modules.ORDER);
|
|
33
|
+
await service.updateOrders([
|
|
34
|
+
{
|
|
35
|
+
id: prevData.id,
|
|
36
|
+
// @ts-expect-error
|
|
37
|
+
status: utils_1.OrderStatus.DRAFT,
|
|
38
|
+
is_draft_order: true,
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
});
|
|
42
|
+
exports.convertDraftOrderWorkflow = (0, workflows_sdk_1.createWorkflow)(convertDraftOrderWorkflowId, function (input) {
|
|
43
|
+
const orderQuery = (0, core_flows_1.useQueryGraphStep)({
|
|
44
|
+
entity: "order",
|
|
45
|
+
fields: ["id", "status", "is_draft_order"],
|
|
46
|
+
filters: { id: input.id },
|
|
47
|
+
options: { throwIfKeyNotFound: true },
|
|
48
|
+
}).config({ name: "order-query" });
|
|
49
|
+
const order = (0, workflows_sdk_1.transform)({ orderQuery }, ({ orderQuery }) => orderQuery.data[0]);
|
|
50
|
+
validateDraftOrderStep({ order });
|
|
51
|
+
const updatedOrder = convertDraftOrderStep({ id: input.id });
|
|
52
|
+
return new workflows_sdk_1.WorkflowResponse(updatedOrder);
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydC1kcmFmdC1vcmRlci13b3JrZmxvdy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3MvZHJhZnQtb3JkZXJzL2NvbnZlcnQtZHJhZnQtb3JkZXItd29ya2Zsb3cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscURBQXdEO0FBQ3hELHFEQUE2RTtBQUM3RSxxRUFPMEM7QUFHMUMsTUFBTSwyQkFBMkIsR0FBRyxxQkFBcUIsQ0FBQTtBQVV6RCxNQUFNLHNCQUFzQixHQUFHLElBQUEsMEJBQVUsRUFDdkMsc0JBQXNCLEVBQ3RCLEtBQUssV0FBVyxFQUFFLEtBQUssRUFBK0I7SUFDcEQsbUJBQW1CO0lBQ25CLElBQUksS0FBSyxDQUFDLE1BQU0sS0FBSyxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsY0FBYyxFQUFFLENBQUM7UUFDdEQsTUFBTSxJQUFJLG1CQUFXLENBQ25CLG1CQUFXLENBQUMsS0FBSyxDQUFDLFlBQVksRUFDOUIsOEJBQThCLENBQy9CLENBQUE7SUFDSCxDQUFDO0FBQ0gsQ0FBQyxDQUNGLENBQUE7QUFNRCxNQUFNLHFCQUFxQixHQUFHLElBQUEsMEJBQVUsRUFDdEMscUJBQXFCLEVBQ3JCLEtBQUssV0FBVyxFQUFFLEVBQUUsRUFBOEIsRUFBRSxFQUFFLFNBQVMsRUFBRTtJQUMvRCxNQUFNLE9BQU8sR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFzQixlQUFPLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFckUsTUFBTSxRQUFRLEdBQUcsTUFBTSxPQUFPLENBQUMsWUFBWSxDQUFDO1FBQzFDO1lBQ0UsRUFBRTtZQUNGLG1CQUFtQjtZQUNuQixNQUFNLEVBQUUsbUJBQVcsQ0FBQyxPQUFPO1lBQzNCLGNBQWMsRUFBRSxLQUFLO1NBQ3RCO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsTUFBTSxLQUFLLEdBQUcsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFBO0lBRXpCLE9BQU8sSUFBSSw0QkFBWSxDQUFDLEtBQUssRUFBRTtRQUM3QixFQUFFO0tBQ0gsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxFQUNELEtBQUssV0FBVyxRQUFRLEVBQUUsRUFBRSxTQUFTLEVBQUU7SUFDckMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQ2QsT0FBTTtJQUNSLENBQUM7SUFFRCxNQUFNLE9BQU8sR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFzQixlQUFPLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFckUsTUFBTSxPQUFPLENBQUMsWUFBWSxDQUFDO1FBQ3pCO1lBQ0UsRUFBRSxFQUFFLFFBQVEsQ0FBQyxFQUFFO1lBQ2YsbUJBQW1CO1lBQ25CLE1BQU0sRUFBRSxtQkFBVyxDQUFDLEtBQUs7WUFDekIsY0FBYyxFQUFFLElBQUk7U0FDckI7S0FDRixDQUFDLENBQUE7QUFDSixDQUFDLENBQ0YsQ0FBQTtBQUVZLFFBQUEseUJBQXlCLEdBQUcsSUFBQSw4QkFBYyxFQUNyRCwyQkFBMkIsRUFDM0IsVUFDRSxLQUFtRDtJQUVuRCxNQUFNLFVBQVUsR0FBRyxJQUFBLDhCQUFpQixFQUFDO1FBQ25DLE1BQU0sRUFBRSxPQUFPO1FBQ2YsTUFBTSxFQUFFLENBQUMsSUFBSSxFQUFFLFFBQVEsRUFBRSxnQkFBZ0IsQ0FBQztRQUMxQyxPQUFPLEVBQUUsRUFBRSxFQUFFLEVBQUUsS0FBSyxDQUFDLEVBQUUsRUFBRTtRQUN6QixPQUFPLEVBQUUsRUFBRSxrQkFBa0IsRUFBRSxJQUFJLEVBQUU7S0FDdEMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxFQUFFLElBQUksRUFBRSxhQUFhLEVBQUUsQ0FBQyxDQUFBO0lBRWxDLE1BQU0sS0FBSyxHQUFHLElBQUEseUJBQVMsRUFDckIsRUFBRSxVQUFVLEVBQUUsRUFDZCxDQUFDLEVBQUUsVUFBVSxFQUFFLEVBQUUsRUFBRSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQ3ZDLENBQUE7SUFFRCxzQkFBc0IsQ0FBQyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUE7SUFFakMsTUFBTSxZQUFZLEdBQUcscUJBQXFCLENBQUMsRUFBRSxFQUFFLEVBQUUsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUE7SUFFNUQsT0FBTyxJQUFJLGdDQUFnQixDQUFDLFlBQVksQ0FBQyxDQUFBO0FBQzNDLENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -0,0 +1,12 @@
|
|
|
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 ui_preset_1 = __importDefault(require("@medusajs/ui-preset"));
|
|
7
|
+
const config = {
|
|
8
|
+
content: ["./src/admin/**/*.{ts,tsx}"],
|
|
9
|
+
presets: [ui_preset_1.default],
|
|
10
|
+
};
|
|
11
|
+
exports.default = config;
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpbHdpbmQuY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdGFpbHdpbmQuY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsb0VBQXlDO0FBR3pDLE1BQU0sTUFBTSxHQUFXO0lBQ3JCLE9BQU8sRUFBRSxDQUFDLDJCQUEyQixDQUFDO0lBQ3RDLE9BQU8sRUFBRSxDQUFDLG1CQUFNLENBQUM7Q0FDbEIsQ0FBQztBQUVGLGtCQUFlLE1BQU0sQ0FBQyJ9
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.medusajs.com">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/59018053/229103275-b5e482bb-4601-46e6-8142-244f531cebdb.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
|
|
6
|
+
<img alt="Medusa logo" src="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
<h1 align="center">
|
|
11
|
+
Medusa Plugin Starter
|
|
12
|
+
</h1>
|
|
13
|
+
|
|
14
|
+
<h4 align="center">
|
|
15
|
+
<a href="https://docs.medusajs.com">Documentation</a> |
|
|
16
|
+
<a href="https://www.medusajs.com">Website</a>
|
|
17
|
+
</h4>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
Building blocks for digital commerce
|
|
21
|
+
</p>
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md">
|
|
24
|
+
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://www.producthunt.com/posts/medusa"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Day-%23DA552E" alt="Product Hunt"></a>
|
|
27
|
+
<a href="https://discord.gg/xpCwq3Kfn8">
|
|
28
|
+
<img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://twitter.com/intent/follow?screen_name=medusajs">
|
|
31
|
+
<img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
|
|
32
|
+
</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## Compatibility
|
|
36
|
+
|
|
37
|
+
This starter is compatible with versions >= 2.4.0 of `@medusajs/medusa`.
|
|
38
|
+
|
|
39
|
+
## Getting Started
|
|
40
|
+
|
|
41
|
+
Visit the [Quickstart Guide](https://docs.medusajs.com/learn/installation) to set up a server.
|
|
42
|
+
|
|
43
|
+
Visit the [Plugins documentation](https://docs.medusajs.com/learn/fundamentals/plugins) to learn more about plugins and how to create them.
|
|
44
|
+
|
|
45
|
+
Visit the [Docs](https://docs.medusajs.com/learn/installation#get-started) to learn more about our system requirements.
|
|
46
|
+
|
|
47
|
+
## What is Medusa
|
|
48
|
+
|
|
49
|
+
Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.
|
|
50
|
+
|
|
51
|
+
Learn more about [Medusa’s architecture](https://docs.medusajs.com/learn/introduction/architecture) and [commerce modules](https://docs.medusajs.com/learn/fundamentals/modules/commerce-modules) in the Docs.
|
|
52
|
+
|
|
53
|
+
## Community & Contributions
|
|
54
|
+
|
|
55
|
+
The community and core team are available in [GitHub Discussions](https://github.com/medusajs/medusa/discussions), where you can ask for support, discuss roadmap, and share ideas.
|
|
56
|
+
|
|
57
|
+
Join our [Discord server](https://discord.com/invite/medusajs) to meet other community members.
|
|
58
|
+
|
|
59
|
+
## Other channels
|
|
60
|
+
|
|
61
|
+
- [GitHub Issues](https://github.com/medusajs/medusa/issues)
|
|
62
|
+
- [Twitter](https://twitter.com/medusajs)
|
|
63
|
+
- [LinkedIn](https://www.linkedin.com/company/medusajs)
|
|
64
|
+
- [Medusa Blog](https://medusajs.com/blog/)
|