@feedmepos/mf-connect 0.1.38-beta.76 → 0.1.38-beta.78

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 (115) hide show
  1. package/dist/{Analytic-BrBxRQue.js → Analytic-VCsXA7tN.js} +29 -30
  2. package/dist/{App-CE_19YJc.js → App-C3h7BzvW.js} +7 -7
  3. package/dist/{AuditLogs-CQtMmVIp.js → AuditLogs-DChTm0o7.js} +9 -9
  4. package/dist/{Bin-D9CHhiUb.js → Bin-Ctg5MEH1.js} +8 -8
  5. package/dist/{Broadcast-Dg6eBL_f.js → Broadcast-BC0Dn5KX.js} +22 -23
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DixbhtL0.js} +6 -6
  7. package/dist/{Card-BTkf67i1.js → Card-CPf78WVe.js} +18 -18
  8. package/dist/{Collections-Czq4nsdu.js → Collections-CFaHjMsW.js} +13 -14
  9. package/dist/{Credit-B3nX8aJA.js → Credit-CUfndg2i.js} +30 -31
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKv94j3F.js} +33 -33
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js → EffectSheet.vue_vue_type_style_index_0_lang-B3Hrhp0c.js} +6 -6
  12. package/dist/{Experience-B9Vn3NTH.js → Experience-BjkhGFFu.js} +11 -12
  13. package/dist/{FileSaver.min-CJaOkSQt.js → FileSaver.min-CwKsfqnU.js} +1 -1
  14. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  15. package/dist/{Game-DTx_EsM3.js → Game-fI2GMPAc.js} +12 -13
  16. package/dist/{Grab-B29W7rka.js → Grab-DK4Bs9T-.js} +31 -32
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js → ImageInput.vue_vue_type_script_setup_true_lang-CKVKss1k.js} +1 -1
  18. package/dist/{Index-Fk8EP5dG.js → Index-CCobdOFl.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js → LocationPicker.vue_vue_type_script_setup_true_lang-BNHNFP5D.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C1T1qoUS.js} +1 -1
  21. package/dist/{MainLayout-BFmqJkE_.js → MainLayout-C4qzV9tn.js} +1 -1
  22. package/dist/Marketing-6qXWCcNA.js +157 -0
  23. package/dist/MarketingMaterialEdit-C74xVj4y.js +857 -0
  24. package/dist/{Member-DwPJNAo9.js → Member-B85PlRE2.js} +11 -11
  25. package/dist/{MemberList-mS1W0qHY.js → MemberList-DPmz3Opy.js} +26 -26
  26. package/dist/{MemberTransactions-BV3xvFYS.js → MemberTransactions-Dsa9w9W-.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js → MessageInput.vue_vue_type_script_setup_true_lang-CNaz513g.js} +9 -9
  28. package/dist/{Mission-QmoURSu4.js → Mission-C4SBvbNg.js} +22 -23
  29. package/dist/{Overview-CaTMLlq-.js → Overview-ClDQbGY4.js} +18 -18
  30. package/dist/{Point-CjG77Sma.js → Point-BVKIWsY3.js} +11 -12
  31. package/dist/{Promotion-C5I-1qPN.js → Promotion-BF9d5lk2.js} +12 -13
  32. package/dist/{Queue-BaIBCCaX.js → Queue-qahb5fft.js} +10 -10
  33. package/dist/{Record-DqpGwZIU.js → Record-BUV8ZdU3.js} +9 -9
  34. package/dist/{Review-Bq-edSOO.js → Review-CA23dkxd.js} +4 -4
  35. package/dist/{ReviewFacebookCallback-yaC4rLki.js → ReviewFacebookCallback-DeMiZX62.js} +4 -4
  36. package/dist/{ReviewGoogleCallback-uxrrCQdu.js → ReviewGoogleCallback-BvJSLV9F.js} +4 -4
  37. package/dist/{Reward-DGP65n5t.js → Reward-CvBYF099.js} +16 -16
  38. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js → RewardGroup.vue_vue_type_script_setup_true_lang-D_eHt5fI.js} +11 -11
  39. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js → RuleGroup.vue_vue_type_script_setup_true_lang-6RN-20vi.js} +14 -14
  40. package/dist/{Segment-CNz0sR3c.js → Segment-BFbGGvOI.js} +24 -24
  41. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js → SelectItems.vue_vue_type_script_setup_true_lang-BHG6QOaW.js} +2 -2
  42. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-JZ5VuHF1.js} +12 -12
  43. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Dgyofqk8.js +226 -0
  44. package/dist/{Setting-BKDSGYBR.js → Setting-D6Yt2Hyr.js} +14 -14
  45. package/dist/{SettingAdvertisements-B2GMFfN9.js → SettingAdvertisements-Y6ODltcR.js} +12 -12
  46. package/dist/{Store-C6uLl_Ue.js → Store-Mhkl6zhg.js} +21 -21
  47. package/dist/{StoreRewards-D4728UDf.js → StoreRewards-Bv-zwdt_.js} +15 -15
  48. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BQO12vA9.js} +21 -21
  49. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BTfT4QAC.js} +2 -2
  50. package/dist/{Tier-BNzTa1_w.js → Tier-BYXIBg8s.js} +25 -26
  51. package/dist/{Title-DY5knovF.js → Title-kpCJmPvQ.js} +29 -30
  52. package/dist/{Transaction-Ct4yAJ9n.js → Transaction-DQy-t6tK.js} +2 -2
  53. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DiW7jXt6.js} +6 -6
  54. package/dist/{Voucher-DFTMRPT0.js → Voucher-BA_9PgA2.js} +15 -16
  55. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-OoPMbbWd.js} +12 -12
  56. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js → ZodTextField.vue_vue_type_script_setup_true_lang-Dq2TlOIT.js} +2 -2
  57. package/dist/{app-6lG4w5PT.js → app-DJxUak8Q.js} +328 -419
  58. package/dist/app.js +1 -1
  59. package/dist/{business-CrfQ56D0.js → business-Dx3tPdK2.js} +1 -1
  60. package/dist/campaign-7Eu0LkpH.js +219 -0
  61. package/dist/{campaign-B_iIaTKz.js → campaign-D2xK0tWG.js} +8 -8
  62. package/dist/{campaign.enum-BAHf0dSv.js → campaign.enum-IZBI1M64.js} +1 -1
  63. package/dist/{campaign.fn-DDEgBzH2.js → campaign.fn-DG6v0D4_.js} +128 -128
  64. package/dist/{collectible.enum-9os2zr5a.js → collectible.enum-Bz9l4gWn.js} +1 -1
  65. package/dist/{collection.fn-7qP_m2MW.js → collection.fn-DAcLdA9r.js} +2 -2
  66. package/dist/{dto-C2hLQKuu.js → dto-CTdVFjCy.js} +4 -4
  67. package/dist/{duplicateCampaign-C6RXfeWE.js → duplicateCampaign-DmuOz8P8.js} +2 -2
  68. package/dist/{effect-DGVfWyIc.js → effect-BHqMMiuI.js} +1 -1
  69. package/dist/{email-addresses-BHa_qQBd.js → email-addresses-DO9FPEJG.js} +2 -2
  70. package/dist/{export-CRPfo4hq.js → export-Dq1ecGOS.js} +3 -3
  71. package/dist/{helper-0_zrz4kj.js → helper-C4R3niUO.js} +1 -1
  72. package/dist/{index-DeaGdUSH.js → index-B5R3rD12.js} +3 -3
  73. package/dist/{index-C8L2jQ_6.js → index-Bqp0JS4s.js} +5 -3
  74. package/dist/{index-CO5kQMIK.js → index-C5O0JUok.js} +1 -1
  75. package/dist/{index-QUvYZydO.js → index-C8YsAeR2.js} +1 -1
  76. package/dist/{index-lwxV5iX0.js → index-CDYkEmcE.js} +4 -4
  77. package/dist/{index-Dp1J9Fxa.js → index-CGKANfLZ.js} +1 -1
  78. package/dist/{index-By2wenzb.js → index-CSzWCoI-.js} +1 -1
  79. package/dist/{index-DbJGJ2fB.js → index-Cvoa_YhV.js} +1 -1
  80. package/dist/{index-BpdSswT6.js → index-DZr2PzPy.js} +1 -1
  81. package/dist/{index-4bX0ewBJ.js → index-Dd8Hbv6_.js} +1 -1
  82. package/dist/{index-CW_ub4cF.js → index-QqOuFoKd.js} +3 -3
  83. package/dist/{index-4Vl1VXum.js → index-imR50hIb.js} +6 -6
  84. package/dist/{index-D6Te1BQZ.js → index-mVFLfIAw.js} +3 -3
  85. package/dist/{index.esm2017-ofRmIpjY.js → index.esm2017-Ee5QhYIY.js} +1 -1
  86. package/dist/{loading-8_73fcXo.js → loading-C5QxXpCJ.js} +1 -1
  87. package/dist/{lodash-Bz_vrY3P.js → lodash-BauupBJE.js} +1 -1
  88. package/dist/{membership-CpB39vNW.js → membership-C3FS3V4K.js} +3 -3
  89. package/dist/{money-DALHjzjF.js → money-C_h2PBKm.js} +1 -1
  90. package/dist/{number-D_GJahxw.js → number-CEyqGZhi.js} +1 -1
  91. package/dist/{objectid-BZSH63yc.js → objectid-sT4x06Nd.js} +7 -7
  92. package/dist/{plugins-A4jDcmfS.js → plugins-Cr4fq1-c.js} +3 -3
  93. package/dist/remy-r12bZ_gw.js +46 -0
  94. package/dist/{reward-BqFB2Yn2.js → reward-ZRg3PKdQ.js} +1 -1
  95. package/dist/{rule-DNylZfIG.js → rule-DtQ_9tIs.js} +3 -3
  96. package/dist/{rule-builder-2iT04EOj.js → rule-builder-xRhvszfI.js} +1 -1
  97. package/dist/style.css +1 -1
  98. package/dist/{template-D7rpG7FN.js → template-CviIoV5v.js} +6 -6
  99. package/dist/{timezone-BW17tvi2.js → timezone-Cn4t-gUq.js} +5 -3
  100. package/dist/{trigger-CbVrS2i6.js → trigger-cMNYhqNs.js} +5 -5
  101. package/dist/usePagination-Bb-4w-Ty.js +220 -0
  102. package/dist/{user-Ck-m3cB3.js → user-h4SJx-05.js} +1 -1
  103. package/dist/{vue-i18n-BvqmcBWZ.js → vue-i18n-BVlH2-Q3.js} +326 -326
  104. package/dist/{xlsx-CkqDfUNs.js → xlsx-BfvWsPoE.js} +440 -440
  105. package/dist/{zod-B0YxCfoE.js → zod-C_G8JfBL.js} +1 -1
  106. package/package.json +1 -1
  107. package/dist/GenerateMaterial-C3J9_YHw.js +0 -589
  108. package/dist/Marketing-BRHQHAWD.js +0 -145
  109. package/dist/MarketingMaterialEdit-7s3WEDyJ.js +0 -746
  110. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +0 -147
  111. package/dist/campaign-B9fR7RwT.js +0 -100
  112. package/dist/index-Bj0TV_D5.js +0 -36
  113. package/dist/index-Cp8wkBus.js +0 -124
  114. package/dist/remy-D_Deb3ue.js +0 -13
  115. package/dist/usePagination-dXSoqxfG.js +0 -266
@@ -1,147 +0,0 @@
1
- import { defineComponent as L, ref as c, watch as S, onMounted as R, resolveComponent as f, openBlock as j, createBlock as B, unref as t, isRef as _, withCtx as V, createElementVNode as v, createVNode as m, toDisplayString as N } from "vue";
2
- import { J as A } from "./JsonViewer-v8_C7l5N.js";
3
- import { u as E } from "./loading-8_73fcXo.js";
4
- import { u as P } from "./app-wDQR6dpb.js";
5
- import { l as U } from "./lodash-Bz_vrY3P.js";
6
- import { m as D } from "./index-CO5kQMIK.js";
7
- import { c as J } from "./index-Cp8wkBus.js";
8
- const O = { class: "space-y-16" }, T = { class: "fm-typo-en-body-md-600" }, $ = { class: "flex items-center justify-end" }, q = { class: "flex items-center gap-8" }, ee = /* @__PURE__ */ L({
9
- __name: "SendVoucherSheet",
10
- emits: ["success"],
11
- setup(G, { expose: w, emit: y }) {
12
- const { minor: x } = E, h = c(""), l = c({}), C = y, r = c(!1), s = c([]);
13
- function F(a) {
14
- r.value = !0, h.value = a.campaignId, s.value = [];
15
- }
16
- function b() {
17
- r.value = !1;
18
- }
19
- const I = [
20
- {
21
- header: "Name",
22
- accessorFn: (a) => a.name || "No Profile"
23
- },
24
- {
25
- header: "Phone",
26
- accessorFn: (a) => a.phoneNumber || "-"
27
- }
28
- ], o = c({
29
- searchValue: "",
30
- pageSize: 10,
31
- pageCount: 0,
32
- pageIndex: 0,
33
- totalRows: 0,
34
- isLoading: !1
35
- }), n = c([]), g = async (a) => {
36
- o.value.isLoading = !0, n.value = [];
37
- const e = await D.read({
38
- limit: a.pageSize,
39
- skip: a.pageIndex,
40
- sortBy: "_id",
41
- search: o.value.searchValue,
42
- descending: !1
43
- });
44
- n.value = e.resources, o.value.totalRows = e.meta.totalResources ?? 0, o.value.pageCount = e.meta.totalPages ?? 0, o.value.isLoading = !1, l.value = {}, s.value.forEach((i) => {
45
- const d = n.value.findIndex((p) => p._id == i);
46
- d > -1 && (console.log(d, "fetch member index"), l.value[d] = !0);
47
- });
48
- };
49
- function z() {
50
- n.value.length > 0 && (s.value = s.value.filter(
51
- (a) => !n.value.some((e) => e._id === a) || // Keep if not in current page
52
- Object.entries(l.value).some(
53
- ([e, i]) => i && n.value[e]._id === a
54
- // Keep if selected in current page
55
- )
56
- ));
57
- for (const [a, e] of Object.entries(l.value))
58
- if (e) {
59
- const i = n.value[a]._id;
60
- s.value.includes(i) || s.value.push(i);
61
- }
62
- }
63
- async function M(a) {
64
- s.value.length < 1 || await x(
65
- async () => {
66
- await J.sendCollection(h.value, {
67
- memberId: s.value
68
- }), await C("success"), b();
69
- },
70
- {
71
- message: "Sending claim(s)",
72
- successMessage: "Claim(s) created"
73
- }
74
- );
75
- }
76
- return S(l, z, { deep: !0 }), S(
77
- () => o.value.searchValue,
78
- U.debounce(async () => {
79
- await g({ pageSize: 10, pageIndex: 0 });
80
- }, 500)
81
- ), w({
82
- showSheet: F,
83
- hideSheet: b
84
- }), R(async () => {
85
- await g(o.value);
86
- }), (a, e) => {
87
- const i = f("FmSearch"), d = f("FmTable"), p = f("FmButton"), k = f("FmSideSheet");
88
- return j(), B(k, {
89
- "max-width": 560,
90
- "dismiss-away": !0,
91
- header: "Send voucher to",
92
- modelValue: t(r),
93
- "onUpdate:modelValue": [
94
- e[3] || (e[3] = (u) => _(r) ? r.value = u : null),
95
- e[4] || (e[4] = (u) => r.value = u)
96
- ]
97
- }, {
98
- "side-sheet-footer": V(() => [
99
- v("div", q, [
100
- m(p, {
101
- label: "Send",
102
- loading: t(P)().isLoading,
103
- onClick: M
104
- }, null, 8, ["loading"]),
105
- m(p, {
106
- label: "Cancel",
107
- type: "button",
108
- variant: "tertiary",
109
- onClick: e[2] || (e[2] = (u) => r.value = !1)
110
- })
111
- ])
112
- ]),
113
- default: V(() => [
114
- m(A, { json: t(s) }, null, 8, ["json"]),
115
- v("div", O, [
116
- v("div", T, N(t(s).length) + " members selected ", 1),
117
- v("div", $, [
118
- m(i, {
119
- class: "mt-4",
120
- modelValue: t(o).searchValue,
121
- "onUpdate:modelValue": e[0] || (e[0] = (u) => t(o).searchValue = u),
122
- placeholder: "Search Member",
123
- collapsible: ""
124
- }, null, 8, ["modelValue"])
125
- ]),
126
- m(d, {
127
- modelValue: t(l),
128
- "onUpdate:modelValue": e[1] || (e[1] = (u) => _(l) ? l.value = u : null),
129
- selection: "multiple",
130
- loading: t(o).isLoading,
131
- "row-data": t(n),
132
- "column-defs": I,
133
- "page-size": t(o).pageSize,
134
- "page-count": t(o).pageCount,
135
- "hide-footer": t(o).totalRows <= t(o).pageSize,
136
- "fetch-fn": g
137
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
138
- ])
139
- ]),
140
- _: 1
141
- }, 8, ["modelValue"]);
142
- };
143
- }
144
- });
145
- export {
146
- ee as _
147
- };
@@ -1,100 +0,0 @@
1
- import { defineStore as d } from "pinia";
2
- import { reactive as b, onMounted as f, ref as s } from "vue";
3
- import { c } from "./index-Cp8wkBus.js";
4
- import { g as i, S as g, b as h } from "./index-C8L2jQ_6.js";
5
- const p = () => {
6
- const e = g.getBusinessId();
7
- if (!e) throw new Error("Invalid business ID");
8
- return h(`businesses/${e}/campaigns`, {
9
- noIdRequired: !0
10
- });
11
- }, I = {
12
- async readAll() {
13
- return i(await p().get("templates"));
14
- },
15
- async readById(e) {
16
- return i(
17
- await p().get(`templates/${e}`)
18
- );
19
- }
20
- }, A = d("mf-connect-campaign", () => {
21
- const e = b({
22
- promotion: [],
23
- voucher: [],
24
- broadcast: [],
25
- experience: [],
26
- point: [],
27
- credit: [],
28
- token: [],
29
- mission: [],
30
- grab: [],
31
- all: []
32
- });
33
- f(() => {
34
- console.log("🔧 CampaignStore Installed");
35
- });
36
- const t = s([]), r = s([]), n = s([]);
37
- async function u(k) {
38
- const o = await c.readAll({
39
- limit: 1e3,
40
- skip: 0,
41
- sortBy: "_id",
42
- descending: !0
43
- });
44
- Object.keys(e).forEach((a) => {
45
- e[a] = [];
46
- }), e.all = o.resources.filter(
47
- (a) => a.type !== "MEMBERSHIP"
48
- );
49
- for (const a of o.resources)
50
- switch (a.type) {
51
- case "PROMOTION":
52
- e.promotion.push(a);
53
- break;
54
- case "VOUCHER":
55
- e.voucher.push(a), n.value.push(a);
56
- break;
57
- case "BROADCAST":
58
- ["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
59
- break;
60
- case "POINT":
61
- e.experience.push(a);
62
- break;
63
- case "COIN":
64
- e.point.push(a);
65
- break;
66
- case "CREDIT":
67
- e.credit.push(a);
68
- break;
69
- case "GAME":
70
- e.token.push(a);
71
- break;
72
- case "MISSION":
73
- e.mission.push(a);
74
- break;
75
- case "GRAB":
76
- e.grab.push(a);
77
- break;
78
- }
79
- }
80
- async function l() {
81
- r.value = await c.readGroups();
82
- }
83
- async function m() {
84
- t.value = await I.readAll();
85
- }
86
- return {
87
- // State
88
- campaigns: e,
89
- templates: t,
90
- groups: r,
91
- voucher: n,
92
- // Actions
93
- read: u,
94
- readGroups: l,
95
- readTemplates: m
96
- };
97
- });
98
- export {
99
- A as u
100
- };
@@ -1,36 +0,0 @@
1
- import { S as a, g as n, b as r } from "./index-C8L2jQ_6.js";
2
- const i = (s) => r(`businesses/${s}/marketing-materials`), u = {
3
- async createMarketingMaterial(s) {
4
- const e = a.getBusinessId();
5
- if (!e) throw new Error("Invalid business ID");
6
- return n(
7
- await i(e).post("", s)
8
- );
9
- },
10
- async getMarketingMaterial(s) {
11
- const e = a.getBusinessId();
12
- if (!e) throw new Error("Invalid business ID");
13
- return n(
14
- await i(e).get(`/${s}`)
15
- );
16
- },
17
- async listMarketingMaterials(s = null, e = 20) {
18
- const t = a.getBusinessId();
19
- if (!t) throw new Error("Invalid business ID");
20
- return n(
21
- await i(t).get("", {
22
- params: { ...s ? { cursor: s } : {}, limit: e }
23
- })
24
- );
25
- },
26
- async updateMarketingMaterial(s, e) {
27
- const t = a.getBusinessId();
28
- if (!t) throw new Error("Invalid business ID");
29
- return n(
30
- await i(t).patch(`/${s}`, e)
31
- );
32
- }
33
- };
34
- export {
35
- u as m
36
- };
@@ -1,124 +0,0 @@
1
- import { g as a, S as n, b as o } from "./index-C8L2jQ_6.js";
2
- const t = () => {
3
- const e = n.getBusinessId();
4
- if (!e) throw new Error("Invalid business ID");
5
- return o(`businesses/${e}/campaigns`, {
6
- // url: 'http://localhost:3000/portal/',
7
- });
8
- }, i = {
9
- async readAllGrouped(e) {
10
- const s = a(
11
- await t().get("grouped", { params: e })
12
- );
13
- return {
14
- meta: s.meta,
15
- resources: s.resources
16
- };
17
- },
18
- async readAll(e, s) {
19
- const r = a(
20
- await t().get("", {
21
- params: { ...e, ...s }
22
- })
23
- );
24
- return {
25
- meta: r.meta,
26
- resources: r.resources
27
- };
28
- },
29
- async readById(e) {
30
- return a(await t().get(`/${e}`));
31
- },
32
- async create(e) {
33
- return a(await t().post("", e));
34
- },
35
- async update(e, s) {
36
- return a(await t().put(e, s));
37
- },
38
- async delete(e) {
39
- return a(await t().delete(e));
40
- },
41
- async readCollectionsByCampaignId(e, s) {
42
- const r = a(
43
- await t().get(`/${e}/collections`, {
44
- params: s
45
- })
46
- );
47
- return {
48
- meta: r.meta,
49
- resources: r.resources
50
- };
51
- },
52
- async readTransactions(e) {
53
- return a(
54
- await t().get(
55
- `/${e}/collections/transactions`
56
- )
57
- );
58
- },
59
- async createCollectionByCampaignId(e, s) {
60
- return a(
61
- await t().post(`/${e}/collections`, s)
62
- );
63
- },
64
- async readGroups() {
65
- return a(await t().get("/groups")) ?? [];
66
- },
67
- async readStats(e) {
68
- return a(
69
- await t().get("/stats", { params: e })
70
- );
71
- },
72
- async createGroup(e) {
73
- return a(await t().post("/groups", e));
74
- },
75
- async updateGroup(e, s) {
76
- return a(
77
- await t().put(`/groups/${e}`, s)
78
- );
79
- },
80
- async deleteGroup(e) {
81
- return a(await t().delete(`/groups/${e}`));
82
- },
83
- async sendCollection(e, s) {
84
- return a(
85
- await t().post(
86
- `/${e}/collections/send`,
87
- s
88
- )
89
- );
90
- },
91
- async sendStamp(e, s) {
92
- return a(
93
- await t().post(
94
- `/${e}/collections/send-stamp`,
95
- s
96
- )
97
- );
98
- },
99
- async syncAllPromotion() {
100
- return a(await t().post("/promotion/sync"));
101
- },
102
- async readAllDeleted(e, s) {
103
- const r = a(
104
- await t().get("/bin", {
105
- params: { ...e, ...s }
106
- })
107
- );
108
- return {
109
- meta: r.meta,
110
- resources: r.resources
111
- };
112
- },
113
- async restore(e) {
114
- return a(
115
- await t().post(`/${e}/restore`)
116
- );
117
- },
118
- async getPromotionQueue() {
119
- return a(await t().get("/promotion/queue"));
120
- }
121
- };
122
- export {
123
- i as c
124
- };
@@ -1,13 +0,0 @@
1
- import { useAppStore as n, initializeRemyChat as o } from "@feedmepos/mf-remy-panel";
2
- import { ref as r, onMounted as a } from "vue";
3
- const e = r(!1);
4
- function f() {
5
- const t = n();
6
- async function i() {
7
- e.value || (await o(), e.value = !0);
8
- }
9
- return a(i), Object.assign(t);
10
- }
11
- export {
12
- f as u
13
- };
@@ -1,266 +0,0 @@
1
- import { defineComponent as N, ref as S, resolveComponent as z, openBlock as u, createBlock as M, withCtx as $, createVNode as d, createElementVNode as s, normalizeStyle as E, createElementBlock as f, Fragment as L, renderList as R, computed as C, onMounted as U, watch as A, unref as i, createCommentVNode as D, toDisplayString as k } from "vue";
2
- import { l as O } from "./lodash-Bz_vrY3P.js";
3
- const T = ["id"], I = /* @__PURE__ */ N({
4
- __name: "FmTableSelection",
5
- props: {
6
- value: {},
7
- items: {}
8
- },
9
- emits: ["update:modelValue"],
10
- setup(e, { emit: y }) {
11
- const a = y, l = e, c = S(!1);
12
- return (x, m) => {
13
- const b = z("FmButton"), h = z("FmMenuItem"), n = z("FmMenu");
14
- return u(), M(n, {
15
- "max-height": 264,
16
- shift: "",
17
- onMenuChanged: m[0] || (m[0] = (o) => c.value = o)
18
- }, {
19
- "menu-button": $(() => {
20
- var o;
21
- return [
22
- d(b, {
23
- icon: c.value ? "expand_less" : "expand_more",
24
- label: (o = e.items.find((g) => g.value === l.value)) == null ? void 0 : o.label,
25
- "icon-position": "append",
26
- size: "md",
27
- variant: "tertiary"
28
- }, null, 8, ["icon", "label"])
29
- ];
30
- }),
31
- "menu-wrapper": $(({ maxHeight: o }) => [
32
- s("div", {
33
- id: `menu-wrapper-${o}`,
34
- style: E({ maxHeight: `${o}px` }),
35
- class: "bg-fm-color-neutral-white flex flex-col overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"
36
- }, [
37
- (u(!0), f(L, null, R(e.items, (g) => (u(), M(h, {
38
- key: g.value,
39
- label: g.label,
40
- value: g.value,
41
- "model-value": g.value === l.value,
42
- "onUpdate:modelValue": (p) => a("update:modelValue", g.value)
43
- }, null, 8, ["label", "value", "model-value", "onUpdate:modelValue"]))), 128))
44
- ], 12, T)
45
- ]),
46
- _: 1
47
- });
48
- };
49
- }
50
- }), j = { class: "" }, W = {
51
- key: 0,
52
- class: "w-full flex flex-col gap-16 items-center py-16"
53
- }, q = {
54
- key: 1,
55
- class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
56
- }, G = {
57
- key: 0,
58
- class: "flex gap-24 items-center justify-between xs:hidden xs:invisible"
59
- }, H = { class: "flex gap-8 items-center" }, J = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, K = {
60
- key: 1,
61
- class: "flex gap-24 items-center justify-between xs:hidden xs:invisible"
62
- }, Q = { class: "flex gap-8 items-center" }, X = {
63
- key: 2,
64
- class: "flex gap-8 items-center"
65
- }, Y = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, Z = { class: "flex gap-8" }, _ = {
66
- key: 3,
67
- class: "flex gap-8 items-center"
68
- }, ee = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, ae = { class: "flex gap-8" }, oe = /* @__PURE__ */ N({
69
- __name: "BaseTable",
70
- props: {
71
- rowData: {},
72
- columnDefs: {},
73
- loading: { type: Boolean, default: !1 },
74
- rowCount: { default: 0 },
75
- shrinkAt: { type: [Number, Boolean], default: !1 },
76
- pageCount: { default: 0 },
77
- pageIndex: {},
78
- hideFooter: { type: Boolean, default: !1 },
79
- pageSize: {},
80
- pageSizeOptions: { default: () => [
81
- { label: "10", value: 10 },
82
- { label: "20", value: 20 },
83
- { label: "50", value: 50 }
84
- ] },
85
- paginationMode: { default: "offset" },
86
- hasNext: { type: Boolean, default: !1 }
87
- },
88
- emits: ["sortChange", "rowClick", "pageChange"],
89
- setup(e, { emit: y }) {
90
- const a = e, l = y, c = C(() => a.pageIndex + 1), x = C(() => a.pageIndex * a.pageSize), m = C(
91
- () => Math.min(x.value + a.pageSize, a.rowCount || 0)
92
- ), b = C(() => a.paginationMode === "cursor"), h = C(() => a.pageIndex > 0), n = C(
93
- () => b.value ? a.hasNext : a.pageIndex < a.pageCount - 1
94
- ), o = (r) => {
95
- l("sortChange", r);
96
- }, g = (r) => {
97
- l("rowClick", r);
98
- }, p = (r) => {
99
- l("pageChange", { pageIndex: r, pageSize: a.pageSize });
100
- }, B = (r) => {
101
- l("pageChange", { pageIndex: 0, pageSize: r });
102
- }, F = S(!1);
103
- return U(() => {
104
- A(
105
- () => a.loading,
106
- (r, t) => {
107
- t === !0 && r === !1 && (F.value = !0);
108
- }
109
- );
110
- }), (r, t) => {
111
- const P = z("FmTable"), w = z("FmButton");
112
- return u(), f("div", j, [
113
- d(P, {
114
- loading: e.loading,
115
- "row-data": e.rowData,
116
- "row-count": e.rowCount,
117
- "column-defs": e.columnDefs,
118
- "shrink-at": e.shrinkAt,
119
- "page-count": e.pageCount,
120
- "page-size": e.pageSize,
121
- "fetch-fn": void 0,
122
- "hide-footer": "",
123
- onSortChange: o,
124
- onRowClick: g
125
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "shrink-at", "page-count", "page-size"]),
126
- e.rowData.length == 0 && e.loading == !1 && i(F) ? (u(), f("div", W, [...t[7] || (t[7] = [
127
- s("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
128
- s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
129
- ])])) : D("", !0),
130
- e.hideFooter ? D("", !0) : (u(), f("div", q, [
131
- i(b) ? (u(), f("div", K, [
132
- s("div", Q, [
133
- t[9] || (t[9] = s("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
134
- d(I, {
135
- items: e.pageSizeOptions,
136
- value: e.pageSize,
137
- "onUpdate:modelValue": B
138
- }, null, 8, ["items", "value"])
139
- ])
140
- ])) : (u(), f("div", G, [
141
- s("div", H, [
142
- t[8] || (t[8] = s("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
143
- d(I, {
144
- items: e.pageSizeOptions,
145
- value: e.pageSize,
146
- "onUpdate:modelValue": B
147
- }, null, 8, ["items", "value"])
148
- ]),
149
- s("span", J, k(i(x) + 1) + " - " + k(i(m)) + " of " + k(e.rowCount) + " items ", 1)
150
- ])),
151
- i(b) ? (u(), f("div", _, [
152
- s("span", ee, " Page " + k(i(c)), 1),
153
- s("div", ae, [
154
- d(w, {
155
- disabled: !i(h),
156
- icon: "chevron_left",
157
- "icon-color": "neutral-black",
158
- variant: "tertiary",
159
- onClick: t[5] || (t[5] = (v) => p(e.pageIndex - 1))
160
- }, null, 8, ["disabled"]),
161
- d(w, {
162
- disabled: !i(n),
163
- icon: "chevron_right",
164
- "icon-color": "neutral-black",
165
- variant: "tertiary",
166
- onClick: t[6] || (t[6] = (v) => p(e.pageIndex + 1))
167
- }, null, 8, ["disabled"])
168
- ])
169
- ])) : (u(), f("div", X, [
170
- d(I, {
171
- items: Array.from(Array(e.pageCount), (v, V) => ({
172
- label: (V + 1).toString(),
173
- value: V + 1
174
- })),
175
- value: i(c),
176
- "onUpdate:modelValue": t[0] || (t[0] = (v) => p(v - 1))
177
- }, null, 8, ["items", "value"]),
178
- s("span", Y, " of " + k(e.pageCount) + " pages ", 1),
179
- s("div", Z, [
180
- d(w, {
181
- disabled: !i(h),
182
- icon: "first_page",
183
- "icon-color": "neutral-black",
184
- variant: "tertiary",
185
- onClick: t[1] || (t[1] = (v) => p(0))
186
- }, null, 8, ["disabled"]),
187
- d(w, {
188
- disabled: !i(h),
189
- icon: "chevron_left",
190
- "icon-color": "neutral-black",
191
- variant: "tertiary",
192
- onClick: t[2] || (t[2] = (v) => p(e.pageIndex - 1))
193
- }, null, 8, ["disabled"]),
194
- d(w, {
195
- disabled: !i(n),
196
- icon: "chevron_right",
197
- "icon-color": "neutral-black",
198
- variant: "tertiary",
199
- onClick: t[3] || (t[3] = (v) => p(e.pageIndex + 1))
200
- }, null, 8, ["disabled"]),
201
- d(w, {
202
- disabled: !i(n),
203
- icon: "last_page",
204
- "icon-color": "neutral-black",
205
- variant: "tertiary",
206
- onClick: t[4] || (t[4] = (v) => p(e.pageCount - 1))
207
- }, null, 8, ["disabled"])
208
- ])
209
- ]))
210
- ]))
211
- ]);
212
- };
213
- }
214
- });
215
- function le(e, y = { key: "_id", descending: !0 }) {
216
- const a = S({
217
- pageCount: 0,
218
- searchValue: "",
219
- pageIndex: 0,
220
- totalRows: 0,
221
- isLoading: !1,
222
- pageSize: 10
223
- }), l = S(y), c = S([]), x = async (n) => {
224
- a.value.isLoading = !0, c.value = [];
225
- try {
226
- const o = await e({
227
- limit: n.pageSize || a.value.pageSize,
228
- skip: n.pageIndex ?? 0,
229
- sortBy: l.value.key,
230
- descending: l.value.descending,
231
- search: a.value.searchValue
232
- });
233
- c.value = o.resources, a.value.totalRows = o.meta.totalResources ?? 0, a.value.pageCount = o.meta.totalPages ?? 0, a.value.pageIndex = o.meta.skip ?? 0;
234
- } catch (o) {
235
- console.error("Error fetching data:", o);
236
- } finally {
237
- a.value.isLoading = !1;
238
- }
239
- }, m = O.debounce(async (n) => {
240
- a.value.pageSize = (n == null ? void 0 : n.pageSize) || a.value.pageSize, await x({
241
- pageSize: a.value.pageSize,
242
- pageIndex: (n == null ? void 0 : n.pageIndex) || 0
243
- });
244
- }, 200);
245
- return {
246
- tableMeta: a,
247
- rowData: c,
248
- sortBy: l,
249
- fetchData: x,
250
- debouncedFetchData: m,
251
- onSort: async (n) => {
252
- var o;
253
- console.log("sortState", (o = n[0]) == null ? void 0 : o.id), n.length ? (l.value = {
254
- key: n[0].id.startsWith("_") ? n[0].id : n[0].id.replace(new RegExp("_", "g"), "."),
255
- descending: n[0].desc
256
- }, console.log("sortBy", l.value)) : l.value = y, await m();
257
- },
258
- onSearch: () => {
259
- m({ pageIndex: 0, pageSize: a.value.pageSize });
260
- }
261
- };
262
- }
263
- export {
264
- oe as _,
265
- le as u
266
- };