@feedmepos/mf-connect 0.1.58-prod → 0.1.60-prod

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 (129) hide show
  1. package/dist/Analytic-CB0xAr9Q.js +427 -0
  2. package/dist/App-fp_3oll7.js +4630 -0
  3. package/dist/Bin-CPEbn14A.js +166 -0
  4. package/dist/Broadcast-jKp2iB8c.js +233 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
  6. package/dist/Card-BaPJkgd2.js +911 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-Bqsg-ON3.js +458 -0
  9. package/dist/Credit-C9zIva1h.js +228 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
  12. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
  13. package/dist/Experience-CCI_oesa.js +229 -0
  14. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  16. package/dist/Game-CRMVz1JP.js +284 -0
  17. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
  18. package/dist/Index-szNiSnjR.js +259 -0
  19. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  20. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  21. package/dist/MainLayout-B1aJoR95.js +41 -0
  22. package/dist/Marketing-AvEiNiD9.js +319 -0
  23. package/dist/Member-DIZwt6Hh.js +279 -0
  24. package/dist/MemberList-dxteIRWn.js +1607 -0
  25. package/dist/MemberOverview-wL_ailso.js +58 -0
  26. package/dist/MemberTransactions-Q3phmXfI.js +45 -0
  27. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
  28. package/dist/Mission-CZjySlcS.js +302 -0
  29. package/dist/Overview-BXbWEDy3.js +1079 -0
  30. package/dist/Point-CgjNc_Qn.js +232 -0
  31. package/dist/Promotion-COYo3qLi.js +289 -0
  32. package/dist/Queue-BLIStJth.js +260 -0
  33. package/dist/Record-BWoTvVEE.js +341 -0
  34. package/dist/Reward-Dq6GxHMP.js +442 -0
  35. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
  36. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
  37. package/dist/Segment-CUfn6k5R.js +882 -0
  38. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
  39. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
  40. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
  41. package/dist/Setting-CC5AiQSy.js +1928 -0
  42. package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
  43. package/dist/Store-CEgv5aOD.js +1842 -0
  44. package/dist/StoreRewards-Dtzk_YG2.js +423 -0
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
  47. package/dist/Tier-1xqQvWzc.js +895 -0
  48. package/dist/Title-Da-G8plz.js +566 -0
  49. package/dist/Transaction-B0vuVZFZ.js +39 -0
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
  51. package/dist/Voucher-DLFjkXLu.js +384 -0
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  56. package/dist/app-Do_C3F_N.js +7094 -0
  57. package/dist/app-o7Kvv5aK.js +57962 -0
  58. package/dist/app-wDQR6dpb.js +39 -0
  59. package/dist/app.js +6 -0
  60. package/dist/business-BDi-QTa5.js +82 -0
  61. package/dist/campaign-BHqizYy6.js +1810 -0
  62. package/dist/campaign-CpzFl8Vr.js +4 -0
  63. package/dist/campaign-DNXI3K9c.js +94 -0
  64. package/dist/campaign.enum-BXDwYoeA.js +20 -0
  65. package/dist/campaign.fn-Rws4mJa5.js +758 -0
  66. package/dist/collectible.enum-cMc4fL1T.js +19 -0
  67. package/dist/collection.fn-F8FZ7Dnr.js +26 -0
  68. package/dist/dto-CAtf1jq0.js +216 -0
  69. package/dist/effect-Dhg1ZIrL.js +78 -0
  70. package/dist/email-addresses-BZJZwglQ.js +705 -0
  71. package/dist/export-B6yvRuct.js +97 -0
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-VoErinsY.js +71 -0
  74. package/dist/index-B0Pzwzkd.js +31 -0
  75. package/dist/index-Bq6FwMwW.js +32 -0
  76. package/dist/index-BvE6Sbog.js +3 -0
  77. package/dist/index-BysJoGFD.js +146 -0
  78. package/dist/index-C8m_F_I4.js +121 -0
  79. package/dist/index-CQZinjc9.js +54 -0
  80. package/dist/index-Cq7s1Pk2.js +76 -0
  81. package/dist/index-CuvNtC_M.js +61 -0
  82. package/dist/index-DOGrOlB8.js +8859 -0
  83. package/dist/index-Di23nMJ7.js +38 -0
  84. package/dist/index-Dkyb4P6T.js +30076 -0
  85. package/dist/index-DvZiQOtl.js +3077 -0
  86. package/dist/index-Ved5V90A.js +2155 -0
  87. package/dist/index-d4A3r8kv.js +32269 -0
  88. package/dist/index-vh86FiIQ.js +10 -0
  89. package/dist/index-y7IqG-tl.js +44 -0
  90. package/dist/index.esm2017-CRTpUsW5.js +3069 -0
  91. package/dist/loading-CoUrS63J.js +71 -0
  92. package/dist/lodash-B5I3zXaY.js +3678 -0
  93. package/dist/membership-BiQwBHAA.js +235 -0
  94. package/dist/moment-D7p2TMB-.js +2583 -0
  95. package/dist/money-CA3gpWD3.js +15 -0
  96. package/dist/number-CgmVpwHm.js +12 -0
  97. package/dist/object-qECH92oz.js +26 -0
  98. package/dist/objectId-dwaoBfJX.js +7 -0
  99. package/dist/objectid-C80eoTvt.js +145 -0
  100. package/dist/plugins-BkWtR_R5.js +208 -0
  101. package/dist/reward-D7SKofYj.js +36 -0
  102. package/dist/rule-Cpxty5PH.js +1951 -0
  103. package/dist/rule-builder-d_TMgXEC.js +102 -0
  104. package/dist/style.css +4 -0
  105. package/dist/template-BB7bab5R.js +190 -0
  106. package/dist/tier-BJDhpH6X.js +4 -0
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-Dj3UaenF.js +1151 -0
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-ZVR5eR1H.js +144 -0
  122. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  123. package/dist/type_drinks-D6jnpvwV.js +4 -0
  124. package/dist/usePagination-Ds-cuHop.js +223 -0
  125. package/dist/user-DjRqnFsC.js +54 -0
  126. package/dist/vue-i18n-BlCNfIcP.js +2365 -0
  127. package/dist/xlsx-CtNr_GAa.js +15491 -0
  128. package/dist/zod-Bg2FbC-D.js +90 -0
  129. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ var g = Object.defineProperty;
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 d = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
+ import { u as a, w as f } from "./xlsx-CtNr_GAa.js";
5
+ import { u as h } from "./loading-CoUrS63J.js";
6
+ import { h as x } from "./moment-D7p2TMB-.js";
7
+ import { m as w } from "./index-BysJoGFD.js";
8
+ class y {
9
+ constructor() {
10
+ d(this, "records", []);
11
+ }
12
+ addRecord(e) {
13
+ this.records.push(e);
14
+ }
15
+ addRecords(e) {
16
+ this.records.push(...e);
17
+ }
18
+ buildExcel() {
19
+ const e = a.json_to_sheet(this.records), o = a.book_new();
20
+ return a.book_append_sheet(o, e, "Sheet1"), o;
21
+ }
22
+ }
23
+ class k extends y {
24
+ }
25
+ const r = {
26
+ sortBy: "_id",
27
+ descending: !1,
28
+ rowsPerPage: 1e3,
29
+ page: 1,
30
+ rowsNumber: 0
31
+ }, { minor: _ } = h;
32
+ async function S({
33
+ exporter: s,
34
+ readFunction: e,
35
+ transformRecord: o,
36
+ filename: t
37
+ }) {
38
+ const c = (await e({
39
+ limit: 1,
40
+ skip: 0,
41
+ sortBy: r.sortBy,
42
+ descending: r.descending
43
+ })).meta.totalResources ?? 0, n = r.rowsPerPage;
44
+ await _(
45
+ async () => {
46
+ for (let i = 0; i < c; i += n) {
47
+ const m = {
48
+ ...r,
49
+ limit: n,
50
+ skip: r.page - 1,
51
+ sortBy: r.sortBy,
52
+ descending: r.descending
53
+ }, p = await e(m);
54
+ for (const l of p.resources) {
55
+ const u = o(l);
56
+ s.addRecord(u);
57
+ }
58
+ r.page++;
59
+ }
60
+ await f(
61
+ s.buildExcel(),
62
+ `${t}-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
63
+ {
64
+ bookType: "xlsx",
65
+ bookSST: !1,
66
+ type: "array"
67
+ }
68
+ ), r.page = 1;
69
+ },
70
+ {
71
+ message: `Exporting ${t}...`,
72
+ successMessage: `${t} exported successfully`
73
+ }
74
+ );
75
+ }
76
+ async function E() {
77
+ return S({
78
+ exporter: new k(),
79
+ readFunction: w.readCards,
80
+ transformRecord: (s) => {
81
+ var e, o;
82
+ return {
83
+ CardNumber: s.serialNumber || "",
84
+ MemberId: ((e = s.pf_member) == null ? void 0 : e._id.toString()) || "",
85
+ Phone: ((o = s.pf_member) == null ? void 0 : o.phoneNumber) || "",
86
+ RedeemedAt: s.redeemedAt ? x(s.redeemedAt).format("DD/MM/YYYY") : ""
87
+ };
88
+ },
89
+ filename: "cards"
90
+ });
91
+ }
92
+ export {
93
+ y as B,
94
+ k as C,
95
+ E as a,
96
+ S as e
97
+ };
Binary file
@@ -0,0 +1,71 @@
1
+ import { o as i } from "./index-DOGrOlB8.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,31 @@
1
+ import { h as p } from "./index-DOGrOlB8.js";
2
+ function g(r) {
3
+ return r.toLowerCase();
4
+ }
5
+ var m = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], _ = /[^A-Z0-9]+/gi;
6
+ function A(r, e) {
7
+ e === void 0 && (e = {});
8
+ for (var t = e.splitRegexp, i = t === void 0 ? m : t, a = e.stripRegexp, o = a === void 0 ? _ : a, u = e.transform, d = u === void 0 ? g : u, f = e.delimiter, v = f === void 0 ? " " : f, n = l(l(r, i, "$1\0$2"), o, "\0"), s = 0, c = n.length; n.charAt(s) === "\0"; )
9
+ s++;
10
+ for (; n.charAt(c - 1) === "\0"; )
11
+ c--;
12
+ return n.slice(s, c).split("\0").map(d).join(v);
13
+ }
14
+ function l(r, e, t) {
15
+ return e instanceof RegExp ? r.replace(e, t) : e.reduce(function(i, a) {
16
+ return i.replace(a, t);
17
+ }, r);
18
+ }
19
+ function C(r) {
20
+ return r.charAt(0).toUpperCase() + r.substr(1);
21
+ }
22
+ function R(r, e) {
23
+ var t = r.toLowerCase();
24
+ return e === 0 ? C(t) : t;
25
+ }
26
+ function E(r, e) {
27
+ return e === void 0 && (e = {}), A(r, p({ delimiter: " ", transform: R }, e));
28
+ }
29
+ export {
30
+ E as s
31
+ };
@@ -0,0 +1,32 @@
1
+ import { g as s, S as o, b as i } from "./index-Dkyb4P6T.js";
2
+ const a = () => {
3
+ const r = o.getBusinessId();
4
+ if (!r) throw new Error("Invalid business ID");
5
+ return i(`businesses/${r}/referral`, {
6
+ noIdRequired: !0
7
+ });
8
+ }, u = {
9
+ async read() {
10
+ return s(await a().get(""));
11
+ },
12
+ async update(r) {
13
+ return s(await a().put("", r));
14
+ },
15
+ async readRecords(r) {
16
+ const e = s(
17
+ await a().get("records", { params: r })
18
+ ), t = e.resources.map((n) => ({
19
+ ...n
20
+ }));
21
+ return {
22
+ meta: e.meta,
23
+ resources: t
24
+ };
25
+ },
26
+ async updateCriteriaProgress(r, e) {
27
+ return s(await a().post(`/records/${r}/progress`, e));
28
+ }
29
+ };
30
+ export {
31
+ u as r
32
+ };
@@ -0,0 +1,3 @@
1
+ import "vue-router";
2
+ import { R as o } from "./app-Do_C3F_N.js";
3
+ o["$connect-DASHBOARD"];
@@ -0,0 +1,146 @@
1
+ import { g as t, s as u, S as c, b as i } from "./index-Dkyb4P6T.js";
2
+ const a = () => {
3
+ const e = c.getBusinessId();
4
+ if (!e) throw new Error("Invalid business ID");
5
+ return i(`businesses/${e}/membership`, {
6
+ noIdRequired: !0
7
+ });
8
+ }, o = {
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 sendBundle(e) {
49
+ return t(
50
+ await a().post("store/bundle/send", e)
51
+ );
52
+ },
53
+ async refundStoreTransaction(e) {
54
+ return t(
55
+ await a().post("store/refund", e)
56
+ );
57
+ },
58
+ async readRewards() {
59
+ return t(await a().get("rewards"));
60
+ },
61
+ async readRewardById(e) {
62
+ return t(await a().get(`rewards/${e}`));
63
+ },
64
+ async readCollectionsByRewardId(e, r) {
65
+ const s = t(
66
+ await a().get(`/${e}/collections`, {
67
+ params: r
68
+ })
69
+ );
70
+ return {
71
+ meta: s.meta,
72
+ resources: s.resources
73
+ };
74
+ },
75
+ async createReward(e) {
76
+ return t(await a().post("rewards", e));
77
+ },
78
+ async readCards(e) {
79
+ const r = t(
80
+ await a().get("/cards", {
81
+ params: e
82
+ })
83
+ );
84
+ return {
85
+ meta: r.meta,
86
+ resources: r.resources
87
+ };
88
+ },
89
+ async createCards(e) {
90
+ return t(
91
+ await a().post("/cards", e)
92
+ );
93
+ },
94
+ async updateCard(e) {
95
+ return t(await a().put("cards", e));
96
+ },
97
+ async deleteCard(e) {
98
+ return t(await a().delete(`cards/${e}`));
99
+ },
100
+ async updateReward(e, r) {
101
+ return t(
102
+ await a().put(`rewards/${e}`, r)
103
+ );
104
+ },
105
+ async deleteReward(e) {
106
+ return t(await a().delete(`rewards/${e}`));
107
+ },
108
+ async getEmailAddresses() {
109
+ return t(await a().get("email-addresses"));
110
+ },
111
+ async getWhatsappNumbers() {
112
+ return t(
113
+ await u(`whatsappList/${c.getBusinessId()}`).get(
114
+ ""
115
+ )
116
+ );
117
+ },
118
+ async readCollectionCountByMemberId(e, r) {
119
+ return t(
120
+ await a().get(`/collections/count/${e}`, {
121
+ params: { type: r }
122
+ })
123
+ );
124
+ },
125
+ async readCollectionsByMemberId(e, r, s) {
126
+ const n = t(
127
+ await a().get(`/collections/${e}`, {
128
+ params: { ...r, ...s }
129
+ })
130
+ );
131
+ return {
132
+ meta: n.meta,
133
+ resources: n.resources
134
+ };
135
+ },
136
+ async readMissionCountByMemberId(e) {
137
+ return t(
138
+ await a().get(
139
+ `/collections/mission/count/${e}`
140
+ )
141
+ );
142
+ }
143
+ };
144
+ export {
145
+ o as m
146
+ };
@@ -0,0 +1,121 @@
1
+ import { g as a, S as n, b as o } from "./index-Dkyb4P6T.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
+ };
119
+ export {
120
+ i as c
121
+ };
@@ -0,0 +1,54 @@
1
+ import { F as o, e as t, g as a } from "./index-DOGrOlB8.js";
2
+ import { z as e, F as i, m as d } from "./index-d4A3r8kv.js";
3
+ import { F as c } from "./collectible.enum-cMc4fL1T.js";
4
+ const l = e.enum(["VOUCHER", "LOYALTY"]), n = e.object({
5
+ type: e.literal(l.enum.VOUCHER),
6
+ collectible: i,
7
+ collectibleConfig: e.lazy(() => o._def.right.options[0]),
8
+ earningOption: e.lazy(() => t)
9
+ }), s = e.object({
10
+ type: e.literal(l.enum.LOYALTY),
11
+ collectibleType: c,
12
+ collectible: i,
13
+ earningOption: e.lazy(() => t),
14
+ validityOption: e.lazy(() => a)
15
+ }), r = e.discriminatedUnion("type", [
16
+ n,
17
+ s
18
+ ]), p = e.discriminatedUnion("type", [
19
+ n.extend({
20
+ collectible: i.nullish(),
21
+ business: i.nullish()
22
+ }),
23
+ s.extend({
24
+ collectible: i.nullish(),
25
+ collectibleConfig: o.nullish(),
26
+ business: i.nullish()
27
+ })
28
+ ]), m = {
29
+ collectionName: "RewardTemplates",
30
+ transform: {
31
+ _id: "oid",
32
+ business: "oid",
33
+ deletedAt: "date"
34
+ }
35
+ }, b = e.object({
36
+ _id: i,
37
+ business: i,
38
+ name: e.string(),
39
+ option: r,
40
+ deletedAt: e.date().optional(),
41
+ collectibleConfig: e.lazy(() => o.nullish())
42
+ }).describe(d.describe(m)), u = b.extend({
43
+ _id: i.nullish(),
44
+ business: i.nullish(),
45
+ option: p,
46
+ name: e.string().min(1, { message: "Name is required" })
47
+ });
48
+ u.extend({
49
+ updateCollection: e.boolean().optional()
50
+ });
51
+ export {
52
+ u as F,
53
+ b as a
54
+ };
@@ -0,0 +1,76 @@
1
+ import { g as t, S as I, u as C, b as w } from "./index-Dkyb4P6T.js";
2
+ const a = () => {
3
+ if (!I.getBusinessId()) throw new Error("Invalid business ID");
4
+ return C("users");
5
+ }, c = () => {
6
+ const e = I.getBusinessId();
7
+ if (!e) throw new Error("Invalid business ID");
8
+ return w(`businesses/${e}/membership`, {
9
+ noIdRequired: !0
10
+ });
11
+ }, y = {
12
+ async read(e) {
13
+ const s = t(
14
+ await a().get("", { params: e })
15
+ ), n = s.resources.map((r) => {
16
+ var i, o, d, l, p, u, m, b;
17
+ return {
18
+ ...r,
19
+ collection_TIER_0_balance: ((o = (i = r.collection.TIER) == null ? void 0 : i[0]) == null ? void 0 : o.balance) ?? 0,
20
+ collection_CREDIT_0_balance: ((l = (d = r.collection.CREDIT) == null ? void 0 : d[0]) == null ? void 0 : l.balance) ?? 0,
21
+ collection_COIN_0_balance: ((u = (p = r.collection.COIN) == null ? void 0 : p[0]) == null ? void 0 : u.balance) ?? 0,
22
+ collection_TITLE_0_title: ((b = (m = r.collection.TITLE) == null ? void 0 : m[0]) == null ? void 0 : b.title) ?? ""
23
+ };
24
+ });
25
+ return {
26
+ meta: s.meta,
27
+ resources: n
28
+ };
29
+ },
30
+ async readById(e) {
31
+ return t(await a().get(`${e}`));
32
+ },
33
+ async sendCredit(e, s) {
34
+ return t(
35
+ await c().post(
36
+ `members/${e}/send-credit`,
37
+ s
38
+ )
39
+ );
40
+ },
41
+ async deductCredit(e, s) {
42
+ return t(
43
+ await c().post(
44
+ `members/${e}/deduct-credit`,
45
+ s
46
+ )
47
+ );
48
+ },
49
+ async sendCoin(e, s) {
50
+ return t(
51
+ await c().post(
52
+ `members/${e}/send-coin`,
53
+ s
54
+ )
55
+ );
56
+ },
57
+ async deductCoin(e, s) {
58
+ return t(
59
+ await c().post(
60
+ `members/${e}/deduct-coin`,
61
+ s
62
+ )
63
+ );
64
+ },
65
+ async updateMember(e, s) {
66
+ return t(
67
+ await a().put(`${e}`, s)
68
+ );
69
+ },
70
+ async import(e) {
71
+ return await a().post("import", e);
72
+ }
73
+ };
74
+ export {
75
+ y as m
76
+ };
@@ -0,0 +1,61 @@
1
+ const E = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), x = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), P = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), _ = /[^\p{L}\d]+/giu, u = "$1\0$2", i = "";
2
+ function L(r) {
3
+ let e = r.trim();
4
+ e = e.replace(E, u).replace(x, u), e = e.replace(_, "\0");
5
+ let c = 0, t = e.length;
6
+ for (; e.charAt(c) === "\0"; )
7
+ c++;
8
+ if (c === t)
9
+ return [];
10
+ for (; e.charAt(t - 1) === "\0"; )
11
+ t--;
12
+ return e.slice(c, t).split(/\0/g);
13
+ }
14
+ function R(r) {
15
+ const e = L(r);
16
+ for (let c = 0; c < e.length; c++) {
17
+ const t = e[c], l = P.exec(t);
18
+ if (l) {
19
+ const s = l.index + (l[1] ?? l[2]).length;
20
+ e.splice(c, 1, t.slice(0, s), t.slice(s));
21
+ }
22
+ }
23
+ return e;
24
+ }
25
+ function p(r, e) {
26
+ const [c, t, l] = o(r, e), s = d(e == null ? void 0 : e.locale), a = C(e == null ? void 0 : e.locale), n = A(s, a);
27
+ return c + t.map((f, h) => h === 0 ? n(f) : s(f)).join((e == null ? void 0 : e.delimiter) ?? " ") + l;
28
+ }
29
+ function d(r) {
30
+ return r === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(r);
31
+ }
32
+ function C(r) {
33
+ return r === !1 ? (e) => e.toUpperCase() : (e) => e.toLocaleUpperCase(r);
34
+ }
35
+ function A(r, e) {
36
+ return (c) => `${e(c[0])}${r(c.slice(1))}`;
37
+ }
38
+ function o(r, e = {}) {
39
+ const c = e.split ?? (e.separateNumbers ? R : L), t = e.prefixCharacters ?? i, l = e.suffixCharacters ?? i;
40
+ let s = 0, a = r.length;
41
+ for (; s < r.length; ) {
42
+ const n = r.charAt(s);
43
+ if (!t.includes(n))
44
+ break;
45
+ s++;
46
+ }
47
+ for (; a > s; ) {
48
+ const n = a - 1, f = r.charAt(n);
49
+ if (!l.includes(f))
50
+ break;
51
+ a = n;
52
+ }
53
+ return [
54
+ r.slice(0, s),
55
+ c(r.slice(s, a)),
56
+ r.slice(a)
57
+ ];
58
+ }
59
+ export {
60
+ p as s
61
+ };