@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12

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 (85) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
  3. package/dist/Broadcast-dVPgK5QV.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
  5. package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-Fkb_zzqZ.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
  24. package/dist/Promotion-DEo-lxpX.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
  35. package/dist/Voucher-BZ8PKgO5.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-CnKzqAcN.js +53428 -0
  40. package/dist/app-FfENBuoE.js +5381 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-CXyP9G7A.js +78 -0
  44. package/dist/campaign-0aM2KYOy.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-FicQhH1t.js +26 -0
  47. package/dist/dto-BiYLkVdL.js +1169 -0
  48. package/dist/effect-Cg-eNEjg.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
  50. package/dist/helper-DvD-D7c7.js +71 -0
  51. package/dist/index-B1Q0GAWp.js +95 -0
  52. package/dist/index-B4UZgSB-.js +28058 -0
  53. package/dist/index-B6c-fUij.js +203 -0
  54. package/dist/index-BP_5cfKa.js +38 -0
  55. package/dist/index-BRXg5Si1.js +2071 -0
  56. package/dist/index-BuDwICBJ.js +761 -0
  57. package/dist/index-CDMC-8iO.js +94 -0
  58. package/dist/index-CcZt3OrE.js +73 -0
  59. package/dist/index-CuvNtC_M.js +61 -0
  60. package/dist/index-DA-fzkRR.js +1737 -0
  61. package/dist/index-Dbd4WA4r.js +61 -0
  62. package/dist/index-Dkeb_9ER.js +8832 -0
  63. package/dist/index-DmdKoKk_.js +298 -0
  64. package/dist/index-G-88ujCM.js +3 -0
  65. package/dist/loading-uCNeZibp.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-DFRO9TyM.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-OtkT4Pzp.js +15 -0
  70. package/dist/number-Cg3NCouc.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-Ch2HRiGw.js +1973 -0
  74. package/dist/rule-builder-B_M9yvEe.js +89 -0
  75. package/dist/template-1o0LbOoJ.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-AtGIa4qH.js +2365 -0
  78. package/dist/xlsx-pChq0adn.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +3 -3
  81. package/dist/Collections-CFCZ9YIG.js +0 -4
  82. package/dist/MainLayout-JbHzENFy.js +0 -4
  83. package/dist/app-BpzzygYP.js +0 -87765
  84. package/dist/money-DKGIIplY.js +0 -15
  85. package/dist/number-tPodRxTN.js +0 -12
@@ -0,0 +1,61 @@
1
+ import { c as o } from "./index-B4UZgSB-.js";
2
+ function c(e) {
3
+ if (!e)
4
+ return null;
5
+ const n = o.Config.getCountry().currency.symbol;
6
+ function s(t) {
7
+ const r = o.Dinero.fromFdoDecimal({ decimal: t.adjustment.amount });
8
+ switch (t.adjustment.type) {
9
+ case "BY_PERCENTAGE":
10
+ return `${r.toObject().amount}% discount`;
11
+ case "BY_AMOUNT":
12
+ return `${n}${r.toUnit()} discount`;
13
+ case "TO_AMOUNT":
14
+ return `to ${n}${r.toUnit()}`;
15
+ }
16
+ }
17
+ function i(t) {
18
+ switch (t.options.target) {
19
+ case "BILL":
20
+ return "Bill Discount";
21
+ case "ITEM":
22
+ if (t.options.strategy.type === "SIMPLE")
23
+ return "Item Discount";
24
+ if (t.options.strategy.type === "BUY_X_GET_Y")
25
+ return "Buy X Get Y (same product set)";
26
+ if (t.options.strategy.type === "BUY_X_GET_Y_V2")
27
+ return "Buy X Get Y (mixed product set)";
28
+ if (t.options.strategy.type === "BUY_X_ITEM_A_GET_Y_ITEM_B")
29
+ return "Buy X Get Y (different product set)";
30
+ if (t.options.strategy.type === "COMBO")
31
+ return "Combo";
32
+ break;
33
+ case "PAYMENT":
34
+ return "Payment";
35
+ default:
36
+ throw new Error("Invalid effect target");
37
+ }
38
+ }
39
+ function u(t) {
40
+ if (t.options.target === "BILL" || t.options.target === "PAYMENT") {
41
+ const r = o.Dinero.fromFdoDecimal({
42
+ decimal: t.options.minPurchase
43
+ });
44
+ return r.toUnit() > 0 ? `min spend ${n}${r.toUnit()}` : "no min spend";
45
+ }
46
+ return "no min spend";
47
+ }
48
+ return {
49
+ type: i(e),
50
+ adjustment: s(e),
51
+ requirements: u(e)
52
+ };
53
+ }
54
+ function m(e) {
55
+ const n = c(e);
56
+ return !e || !n ? null : Object.values(n).filter(Boolean).join(" | ");
57
+ }
58
+ export {
59
+ m as e,
60
+ c as s
61
+ };
@@ -1,10 +1,13 @@
1
1
  var g = Object.defineProperty;
2
2
  var b = (s, e, o) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
- var i = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
- import { Q as a, a4 as x, t as h, U as w, e as y } from "./app-BpzzygYP.js";
5
- class f {
3
+ var d = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
+ import { u as a, w as f } from "./xlsx-pChq0adn.js";
5
+ import { u as h } from "./loading-uCNeZibp.js";
6
+ import { h as x } from "./moment-BWErdI6_.js";
7
+ import { m as w } from "./index-B1Q0GAWp.js";
8
+ class y {
6
9
  constructor() {
7
- i(this, "records", []);
10
+ d(this, "records", []);
8
11
  }
9
12
  addRecord(e) {
10
13
  this.records.push(e);
@@ -17,7 +20,7 @@ class f {
17
20
  return a.book_append_sheet(o, e, "Sheet1"), o;
18
21
  }
19
22
  }
20
- class k extends f {
23
+ class k extends y {
21
24
  }
22
25
  const r = {
23
26
  sortBy: "_id",
@@ -25,7 +28,7 @@ const r = {
25
28
  rowsPerPage: 1e3,
26
29
  page: 1,
27
30
  rowsNumber: 0
28
- }, { minor: _ } = y;
31
+ }, { minor: _ } = h;
29
32
  async function S({
30
33
  exporter: s,
31
34
  readFunction: e,
@@ -40,21 +43,21 @@ async function S({
40
43
  })).meta.totalResources ?? 0, n = r.rowsPerPage;
41
44
  await _(
42
45
  async () => {
43
- for (let d = 0; d < c; d += n) {
44
- const p = {
46
+ for (let i = 0; i < c; i += n) {
47
+ const m = {
45
48
  ...r,
46
49
  limit: n,
47
50
  skip: r.page - 1,
48
51
  sortBy: r.sortBy,
49
52
  descending: r.descending
50
- }, m = await e(p);
51
- for (const l of m.resources) {
53
+ }, p = await e(m);
54
+ for (const l of p.resources) {
52
55
  const u = o(l);
53
56
  s.addRecord(u);
54
57
  }
55
58
  r.page++;
56
59
  }
57
- await x(
60
+ await f(
58
61
  s.buildExcel(),
59
62
  `${t}-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
60
63
  {
@@ -70,25 +73,25 @@ async function S({
70
73
  }
71
74
  );
72
75
  }
73
- async function R() {
76
+ async function E() {
74
77
  return S({
75
78
  exporter: new k(),
76
- readFunction: h.readCards,
79
+ readFunction: w.readCards,
77
80
  transformRecord: (s) => {
78
81
  var e, o;
79
82
  return {
80
83
  CardNumber: s.serialNumber || "",
81
84
  MemberId: ((e = s.pf_member) == null ? void 0 : e._id.toString()) || "",
82
85
  Phone: ((o = s.pf_member) == null ? void 0 : o.phoneNumber) || "",
83
- RedeemedAt: s.redeemedAt ? w(s.redeemedAt).format("DD/MM/YYYY") : ""
86
+ RedeemedAt: s.redeemedAt ? x(s.redeemedAt).format("DD/MM/YYYY") : ""
84
87
  };
85
88
  },
86
89
  filename: "cards"
87
90
  });
88
91
  }
89
92
  export {
90
- f as B,
93
+ y as B,
91
94
  k as C,
92
95
  S as a,
93
- R as e
96
+ E as e
94
97
  };
@@ -0,0 +1,71 @@
1
+ import { i } from "./index-Dkeb_9ER.js";
2
+ function o(t, e) {
3
+ switch (t) {
4
+ case "COIN":
5
+ case "CREDIT":
6
+ case "POINT":
7
+ case "TIER":
8
+ case "TITLE":
9
+ return {
10
+ business: e.business,
11
+ name: e.name || "",
12
+ stackable: !0,
13
+ type: t,
14
+ options: {}
15
+ };
16
+ case "GAME":
17
+ return {
18
+ business: e.business,
19
+ name: e.name || "",
20
+ stackable: !1,
21
+ type: t,
22
+ options: {},
23
+ extras: {
24
+ gameType: "FORTUNE_WHEEL"
25
+ }
26
+ };
27
+ case "VOUCHER":
28
+ return {
29
+ business: e.business,
30
+ name: e.name || "",
31
+ stackable: !1,
32
+ type: "VOUCHER",
33
+ options: {
34
+ enableTransfer: !1,
35
+ maxPerUser: null,
36
+ maxReceive: null,
37
+ maxUse: 1,
38
+ cooldown: 0,
39
+ validityOption: {}
40
+ },
41
+ extras: {
42
+ effect: null,
43
+ targetLocation: null
44
+ },
45
+ noCampaign: e.noCampaign === !0
46
+ };
47
+ case "STAMP":
48
+ return {
49
+ business: e.business,
50
+ name: e.name || "STAMP",
51
+ stackable: !0,
52
+ type: "STAMP",
53
+ options: {
54
+ maxPerUser: 1,
55
+ validityOption: {
56
+ followFirstReceive: !0
57
+ }
58
+ }
59
+ };
60
+ default:
61
+ throw new Error("Invalid collectible type");
62
+ }
63
+ }
64
+ function u(t) {
65
+ const { validAfter: e, validBefore: a } = t, { validForDay: s } = t, n = i(e).toDate(), r = i(a).toDate();
66
+ return e && a ? `${n.toLocaleDateString()} - ${r.toLocaleDateString()}` : e ? `Starts from ${n.toLocaleDateString()}` : a ? `Ends at ${r.toLocaleDateString()}` : s != null ? `Expires in ${s || "the same"} day${s > 1 ? "s" : ""} after claim` : "Always valid";
67
+ }
68
+ export {
69
+ o as i,
70
+ u as t
71
+ };
@@ -0,0 +1,95 @@
1
+ import { g as t, S as n, b as u } from "./index-B4UZgSB-.js";
2
+ const a = () => {
3
+ const e = n.getBusinessId();
4
+ if (!e) throw new Error("Invalid business ID");
5
+ return u(`businesses/${e}/membership`, {
6
+ noIdRequired: !0
7
+ });
8
+ }, c = {
9
+ async read() {
10
+ return t(await a().get(""));
11
+ },
12
+ async update(e) {
13
+ return t(await a().put("", e));
14
+ },
15
+ async createTier(e) {
16
+ return t(await a().post("tier", e));
17
+ },
18
+ async updateTiers(e) {
19
+ return t(await a().put("tiers", e));
20
+ },
21
+ async createTitle(e) {
22
+ return t(await a().post("titles", e));
23
+ },
24
+ async updateTitle(e, r) {
25
+ return t(
26
+ await a().put(`titles/${e}`, r)
27
+ );
28
+ },
29
+ async deleteTitle(e) {
30
+ return t(await a().delete(`titles/${e}`));
31
+ },
32
+ async readStore() {
33
+ return t(await a().get("store"));
34
+ },
35
+ async readPayoutAccount() {
36
+ return t(
37
+ await a().get("store/payout-account")
38
+ );
39
+ },
40
+ async updateStore(e) {
41
+ return t(await a().put("store", e));
42
+ },
43
+ async updateStoreBundle(e) {
44
+ return t(
45
+ await a().put("store/bundle", e)
46
+ );
47
+ },
48
+ async readRewards() {
49
+ return t(await a().get("rewards"));
50
+ },
51
+ async readRewardById(e) {
52
+ return t(await a().get(`rewards/${e}`));
53
+ },
54
+ async readCollectionsByRewardId(e, r) {
55
+ const s = t(
56
+ await a().get(`/${e}/collections`, {
57
+ params: r
58
+ })
59
+ );
60
+ return {
61
+ meta: s.meta,
62
+ resources: s.resources
63
+ };
64
+ },
65
+ async createReward(e) {
66
+ return t(await a().post("rewards", e));
67
+ },
68
+ async readCards(e) {
69
+ const r = t(
70
+ await a().get("/cards", {
71
+ params: e
72
+ })
73
+ );
74
+ return {
75
+ meta: r.meta,
76
+ resources: r.resources
77
+ };
78
+ },
79
+ async createCards(e) {
80
+ return t(
81
+ await a().post("/cards", e)
82
+ );
83
+ },
84
+ async updateReward(e, r) {
85
+ return t(
86
+ await a().put(`rewards/${e}`, r)
87
+ );
88
+ },
89
+ async deleteReward(e) {
90
+ return t(await a().delete(`rewards/${e}`));
91
+ }
92
+ };
93
+ export {
94
+ c as m
95
+ };