@medusajs/loyalty-plugin 0.0.7-snapshot.3 → 0.0.8-preview.2.11.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.
@@ -23690,6 +23690,73 @@ const KeyboundForm = React__namespace.default.forwardRef(({ onSubmit, onKeyDown,
23690
23690
  );
23691
23691
  });
23692
23692
  KeyboundForm.displayName = "KeyboundForm";
23693
+ const Note$1 = () => {
23694
+ const { id } = reactRouterDom.useParams();
23695
+ const {
23696
+ gift_card: giftCard,
23697
+ isPending,
23698
+ isError,
23699
+ error
23700
+ } = useGiftCard(id, {});
23701
+ if (isError) {
23702
+ throw error;
23703
+ }
23704
+ const isReady = !isPending && !!giftCard;
23705
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
23706
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
23707
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
23708
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
23709
+ ] }),
23710
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
23711
+ ] });
23712
+ };
23713
+ const GiftCardNoteForm = ({ giftCard }) => {
23714
+ const form = useForm({
23715
+ defaultValues: {
23716
+ note: giftCard.note ?? ""
23717
+ },
23718
+ resolver: t(schema$2)
23719
+ });
23720
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23721
+ const { handleSuccess } = useRouteModal();
23722
+ const onSubmit = form.handleSubmit(async (data) => {
23723
+ await mutateAsync(
23724
+ { note: data.note },
23725
+ {
23726
+ onSuccess: () => handleSuccess(),
23727
+ onError: (error) => ui.toast.error(error.message)
23728
+ }
23729
+ );
23730
+ });
23731
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
23732
+ KeyboundForm,
23733
+ {
23734
+ className: "flex flex-1 flex-col overflow-hidden",
23735
+ onSubmit,
23736
+ children: [
23737
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
23738
+ Form$2.Field,
23739
+ {
23740
+ control: form.control,
23741
+ name: "note",
23742
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
23743
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
23744
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
23745
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
23746
+ ] })
23747
+ }
23748
+ ) }),
23749
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
23750
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
23751
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
23752
+ ] }) })
23753
+ ]
23754
+ }
23755
+ ) });
23756
+ };
23757
+ const schema$2 = objectType({
23758
+ note: stringType().optional()
23759
+ });
23693
23760
  const GiftCardExpiration = () => {
23694
23761
  const { id } = reactRouterDom.useParams();
23695
23762
  const {
@@ -23715,7 +23782,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
23715
23782
  defaultValues: {
23716
23783
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
23717
23784
  },
23718
- resolver: t(schema$2)
23785
+ resolver: t(schema$1)
23719
23786
  });
23720
23787
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23721
23788
  const { handleSuccess } = useRouteModal();
@@ -23804,75 +23871,8 @@ const GiftCardExpirationForm = ({ giftCard }) => {
23804
23871
  }
23805
23872
  ) });
23806
23873
  };
23807
- const schema$2 = objectType({
23808
- expires_at: dateType().nullish()
23809
- });
23810
- const Note$1 = () => {
23811
- const { id } = reactRouterDom.useParams();
23812
- const {
23813
- gift_card: giftCard,
23814
- isPending,
23815
- isError,
23816
- error
23817
- } = useGiftCard(id, {});
23818
- if (isError) {
23819
- throw error;
23820
- }
23821
- const isReady = !isPending && !!giftCard;
23822
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
23823
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
23824
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
23825
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
23826
- ] }),
23827
- isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
23828
- ] });
23829
- };
23830
- const GiftCardNoteForm = ({ giftCard }) => {
23831
- const form = useForm({
23832
- defaultValues: {
23833
- note: giftCard.note ?? ""
23834
- },
23835
- resolver: t(schema$1)
23836
- });
23837
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23838
- const { handleSuccess } = useRouteModal();
23839
- const onSubmit = form.handleSubmit(async (data) => {
23840
- await mutateAsync(
23841
- { note: data.note },
23842
- {
23843
- onSuccess: () => handleSuccess(),
23844
- onError: (error) => ui.toast.error(error.message)
23845
- }
23846
- );
23847
- });
23848
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
23849
- KeyboundForm,
23850
- {
23851
- className: "flex flex-1 flex-col overflow-hidden",
23852
- onSubmit,
23853
- children: [
23854
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
23855
- Form$2.Field,
23856
- {
23857
- control: form.control,
23858
- name: "note",
23859
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
23860
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
23861
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
23862
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
23863
- ] })
23864
- }
23865
- ) }),
23866
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
23867
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
23868
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
23869
- ] }) })
23870
- ]
23871
- }
23872
- ) });
23873
- };
23874
23874
  const schema$1 = objectType({
23875
- note: stringType().optional()
23875
+ expires_at: dateType().nullish()
23876
23876
  });
23877
23877
  const columnHelper$7 = createColumnHelper();
23878
23878
  const useGiftCardProductsTableColumns = () => {
@@ -38657,13 +38657,13 @@ const routeModule = {
38657
38657
  Component: GiftCardDetailsPage,
38658
38658
  path: "/gift-cards/:id",
38659
38659
  children: [
38660
- {
38661
- Component: GiftCardExpiration,
38662
- path: "/gift-cards/:id/expiration"
38663
- },
38664
38660
  {
38665
38661
  Component: Note$1,
38666
38662
  path: "/gift-cards/:id/note"
38663
+ },
38664
+ {
38665
+ Component: GiftCardExpiration,
38666
+ path: "/gift-cards/:id/expiration"
38667
38667
  }
38668
38668
  ]
38669
38669
  },
@@ -38717,18 +38717,18 @@ const routeModule = {
38717
38717
  };
38718
38718
  const menuItemModule = {
38719
38719
  menuItems: [
38720
- {
38721
- label: config$1.label,
38722
- icon: config$1.icon,
38723
- path: "/store-credit-accounts",
38724
- nested: void 0
38725
- },
38726
38720
  {
38727
38721
  label: config$2.label,
38728
38722
  icon: config$2.icon,
38729
38723
  path: "/gift-cards",
38730
38724
  nested: void 0
38731
38725
  },
38726
+ {
38727
+ label: config$1.label,
38728
+ icon: config$1.icon,
38729
+ path: "/store-credit-accounts",
38730
+ nested: void 0
38731
+ },
38732
38732
  {
38733
38733
  label: config.label,
38734
38734
  icon: void 0,
@@ -23667,6 +23667,73 @@ const KeyboundForm = React__default.forwardRef(({ onSubmit, onKeyDown, ...rest }
23667
23667
  );
23668
23668
  });
23669
23669
  KeyboundForm.displayName = "KeyboundForm";
23670
+ const Note$1 = () => {
23671
+ const { id } = useParams();
23672
+ const {
23673
+ gift_card: giftCard,
23674
+ isPending,
23675
+ isError,
23676
+ error
23677
+ } = useGiftCard(id, {});
23678
+ if (isError) {
23679
+ throw error;
23680
+ }
23681
+ const isReady = !isPending && !!giftCard;
23682
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
23683
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
23684
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
23685
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
23686
+ ] }),
23687
+ isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
23688
+ ] });
23689
+ };
23690
+ const GiftCardNoteForm = ({ giftCard }) => {
23691
+ const form = useForm({
23692
+ defaultValues: {
23693
+ note: giftCard.note ?? ""
23694
+ },
23695
+ resolver: t(schema$2)
23696
+ });
23697
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23698
+ const { handleSuccess } = useRouteModal();
23699
+ const onSubmit = form.handleSubmit(async (data) => {
23700
+ await mutateAsync(
23701
+ { note: data.note },
23702
+ {
23703
+ onSuccess: () => handleSuccess(),
23704
+ onError: (error) => toast.error(error.message)
23705
+ }
23706
+ );
23707
+ });
23708
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
23709
+ KeyboundForm,
23710
+ {
23711
+ className: "flex flex-1 flex-col overflow-hidden",
23712
+ onSubmit,
23713
+ children: [
23714
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
23715
+ Form$2.Field,
23716
+ {
23717
+ control: form.control,
23718
+ name: "note",
23719
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
23720
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
23721
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
23722
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
23723
+ ] })
23724
+ }
23725
+ ) }),
23726
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
23727
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
23728
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
23729
+ ] }) })
23730
+ ]
23731
+ }
23732
+ ) });
23733
+ };
23734
+ const schema$2 = objectType({
23735
+ note: stringType().optional()
23736
+ });
23670
23737
  const GiftCardExpiration = () => {
23671
23738
  const { id } = useParams();
23672
23739
  const {
@@ -23692,7 +23759,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
23692
23759
  defaultValues: {
23693
23760
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
23694
23761
  },
23695
- resolver: t(schema$2)
23762
+ resolver: t(schema$1)
23696
23763
  });
23697
23764
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23698
23765
  const { handleSuccess } = useRouteModal();
@@ -23781,75 +23848,8 @@ const GiftCardExpirationForm = ({ giftCard }) => {
23781
23848
  }
23782
23849
  ) });
23783
23850
  };
23784
- const schema$2 = objectType({
23785
- expires_at: dateType().nullish()
23786
- });
23787
- const Note$1 = () => {
23788
- const { id } = useParams();
23789
- const {
23790
- gift_card: giftCard,
23791
- isPending,
23792
- isError,
23793
- error
23794
- } = useGiftCard(id, {});
23795
- if (isError) {
23796
- throw error;
23797
- }
23798
- const isReady = !isPending && !!giftCard;
23799
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
23800
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
23801
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
23802
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
23803
- ] }),
23804
- isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
23805
- ] });
23806
- };
23807
- const GiftCardNoteForm = ({ giftCard }) => {
23808
- const form = useForm({
23809
- defaultValues: {
23810
- note: giftCard.note ?? ""
23811
- },
23812
- resolver: t(schema$1)
23813
- });
23814
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
23815
- const { handleSuccess } = useRouteModal();
23816
- const onSubmit = form.handleSubmit(async (data) => {
23817
- await mutateAsync(
23818
- { note: data.note },
23819
- {
23820
- onSuccess: () => handleSuccess(),
23821
- onError: (error) => toast.error(error.message)
23822
- }
23823
- );
23824
- });
23825
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
23826
- KeyboundForm,
23827
- {
23828
- className: "flex flex-1 flex-col overflow-hidden",
23829
- onSubmit,
23830
- children: [
23831
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
23832
- Form$2.Field,
23833
- {
23834
- control: form.control,
23835
- name: "note",
23836
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
23837
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
23838
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
23839
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
23840
- ] })
23841
- }
23842
- ) }),
23843
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
23844
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
23845
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
23846
- ] }) })
23847
- ]
23848
- }
23849
- ) });
23850
- };
23851
23851
  const schema$1 = objectType({
23852
- note: stringType().optional()
23852
+ expires_at: dateType().nullish()
23853
23853
  });
23854
23854
  const columnHelper$7 = createColumnHelper();
23855
23855
  const useGiftCardProductsTableColumns = () => {
@@ -38634,13 +38634,13 @@ const routeModule = {
38634
38634
  Component: GiftCardDetailsPage,
38635
38635
  path: "/gift-cards/:id",
38636
38636
  children: [
38637
- {
38638
- Component: GiftCardExpiration,
38639
- path: "/gift-cards/:id/expiration"
38640
- },
38641
38637
  {
38642
38638
  Component: Note$1,
38643
38639
  path: "/gift-cards/:id/note"
38640
+ },
38641
+ {
38642
+ Component: GiftCardExpiration,
38643
+ path: "/gift-cards/:id/expiration"
38644
38644
  }
38645
38645
  ]
38646
38646
  },
@@ -38694,18 +38694,18 @@ const routeModule = {
38694
38694
  };
38695
38695
  const menuItemModule = {
38696
38696
  menuItems: [
38697
- {
38698
- label: config$1.label,
38699
- icon: config$1.icon,
38700
- path: "/store-credit-accounts",
38701
- nested: void 0
38702
- },
38703
38697
  {
38704
38698
  label: config$2.label,
38705
38699
  icon: config$2.icon,
38706
38700
  path: "/gift-cards",
38707
38701
  nested: void 0
38708
38702
  },
38703
+ {
38704
+ label: config$1.label,
38705
+ icon: config$1.icon,
38706
+ path: "/store-credit-accounts",
38707
+ nested: void 0
38708
+ },
38709
38709
  {
38710
38710
  label: config.label,
38711
38711
  icon: void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/loyalty-plugin",
3
- "version": "0.0.7-snapshot.3",
3
+ "version": "0.0.8-preview.2.11.0",
4
4
  "description": "Medusa Plugin: Loyalty - Gift Cards",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -15,11 +15,13 @@
15
15
  "./.medusa/server/src/*": "./.medusa/server/src/**/*.js",
16
16
  "./workflows": {
17
17
  "import": "./.medusa/server/src/workflows/index.js",
18
- "types": "./.medusa/server/src/workflows/index.d.ts"
18
+ "types": "./.medusa/server/src/workflows/index.d.ts",
19
+ "require": "./.medusa/server/src/workflows/index.js"
19
20
  },
20
21
  "./types": {
21
22
  "import": "./.medusa/server/src/types/index.js",
22
- "types": "./.medusa/server/src/types/index.d.ts"
23
+ "types": "./.medusa/server/src/types/index.d.ts",
24
+ "require": "./.medusa/server/src/types/index.js"
23
25
  },
24
26
  "./admin": {
25
27
  "import": "./.medusa/server/src/admin/index.mjs",
@@ -43,19 +45,14 @@
43
45
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit --silent"
44
46
  },
45
47
  "devDependencies": {
46
- "@medusajs/admin-sdk": "2.8.8",
47
- "@medusajs/cli": "2.8.8",
48
- "@medusajs/framework": "2.8.8",
49
- "@medusajs/icons": "2.8.8",
50
- "@medusajs/js-sdk": "2.8.8",
51
- "@medusajs/medusa": "2.8.8",
52
- "@medusajs/test-utils": "2.8.8",
48
+ "@medusajs/admin-sdk": "2.11.0",
49
+ "@medusajs/cli": "2.11.0",
50
+ "@medusajs/framework": "2.11.0",
51
+ "@medusajs/icons": "2.11.0",
52
+ "@medusajs/js-sdk": "2.11.0",
53
+ "@medusajs/medusa": "2.11.0",
54
+ "@medusajs/test-utils": "2.11.0",
53
55
  "@medusajs/ui": "latest",
54
- "@mikro-orm/cli": "6.4.3",
55
- "@mikro-orm/core": "6.4.3",
56
- "@mikro-orm/knex": "6.4.3",
57
- "@mikro-orm/migrations": "6.4.3",
58
- "@mikro-orm/postgresql": "6.4.3",
59
56
  "@swc/core": "1.5.7",
60
57
  "@swc/jest": "^0.2.37",
61
58
  "@types/jest": "^29.5.14",
@@ -87,15 +84,8 @@
87
84
  "@medusajs/medusa": "*",
88
85
  "@medusajs/test-utils": "*",
89
86
  "@medusajs/ui": "*",
90
- "@mikro-orm/cli": "6.4.3",
91
- "@mikro-orm/core": "6.4.3",
92
- "@mikro-orm/knex": "6.4.3",
93
- "@mikro-orm/migrations": "6.4.3",
94
- "@mikro-orm/postgresql": "6.4.3",
95
- "awilix": "^8.0.1",
96
87
  "date-fns": "^3.6.0",
97
88
  "lodash": "^4.17.21",
98
- "pg": "^8.13.0",
99
89
  "react-router-dom": "6.20.1"
100
90
  },
101
91
  "engines": {