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

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 (86) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-Gq7PoNer.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-Cikl5jnp.js} +33 -27
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +18 -11
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-B1SC1rr7.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-BgwI8DR3.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-C2Q-zqV6.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-DU2pZDGk.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-DWiTQp9I.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-BEXKBFry.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-DzMdajIf.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-KzwRlaA5.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-CSKvZXHc.js} +67 -58
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-2Q0PonBb.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-Df5vVRt4.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-C0WXCKs6.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-eSSIO0nk.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier-v-1FkRU-.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-CQ2JWqBW.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-0OouN_6s.js} +2 -2
  35. package/dist/Voucher-CL0cgogx.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-Bd19eW7X.js +5381 -0
  40. package/dist/app-CfS25Z66.js +34797 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-dQh3AEot.js +78 -0
  44. package/dist/campaign-BOl8AgKA.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-B_YsXmrP.js +26 -0
  47. package/dist/dto-B8NfyVPG.js +1169 -0
  48. package/dist/effect-C2jCStXO.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-BtZc3Yzh.js} +19 -16
  50. package/dist/helper-8oGsrM56.js +71 -0
  51. package/dist/index-6FkKY3q0.js +73 -0
  52. package/dist/index-C7oeXRUl.js +95 -0
  53. package/dist/index-CZKYIefW.js +203 -0
  54. package/dist/index-C_0IFnwi.js +2071 -0
  55. package/dist/index-CuvNtC_M.js +61 -0
  56. package/dist/index-DCixRRvz.js +761 -0
  57. package/dist/index-DFgt4-VW.js +38 -0
  58. package/dist/index-DYDhH9bi.js +8832 -0
  59. package/dist/index-Dbd4WA4r.js +61 -0
  60. package/dist/index-Di-kWSmf.js +1737 -0
  61. package/dist/index-Dn0jdj0o.js +28058 -0
  62. package/dist/index-DwKqFNF6.js +3 -0
  63. package/dist/index-HoacsZDk.js +291 -0
  64. package/dist/index-UTQHDUdW.js +94 -0
  65. package/dist/loading-D_AN6p24.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-Ccrx9R6r.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-waD-f-Zz.js +15 -0
  70. package/dist/number-CwTGGsh9.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-DJ07h3Gh.js +1973 -0
  74. package/dist/rule-builder-DJ-acvVD.js +89 -0
  75. package/dist/template-clxvNnbF.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  78. package/dist/xlsx-BB366cdN.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +2 -2
  81. package/dist/Card-B5in1RMa.js +0 -805
  82. package/dist/Collections-CFCZ9YIG.js +0 -4
  83. package/dist/MainLayout-JbHzENFy.js +0 -4
  84. package/dist/app-BpzzygYP.js +0 -87765
  85. package/dist/money-DKGIIplY.js +0 -15
  86. package/dist/number-tPodRxTN.js +0 -12
@@ -0,0 +1,3 @@
1
+ import "vue-router";
2
+ import { R as o } from "./app-Bd19eW7X.js";
3
+ o["$connect-DASHBOARD"];
@@ -0,0 +1,291 @@
1
+ import { z as e, F as t, g as f, e as s, d as r, m as a } from "./loading-D_AN6p24.js";
2
+ import { e as d } from "./index-DYDhH9bi.js";
3
+ import "vue";
4
+ const I = e.object({
5
+ icon: e.string(),
6
+ label: e.string(),
7
+ value: e.string()
8
+ }), E = e.object({
9
+ gatewayKey: e.enum([
10
+ "REVENUE_MONSTER",
11
+ "FEEDME",
12
+ "FEEDME_MEMBER_CREDIT",
13
+ "RAZER_MERCHANT_SERVICE"
14
+ ]),
15
+ checkoutUrl: e.string().optional(),
16
+ checkoutId: e.string().optional(),
17
+ callbackUrl: e.string().optional(),
18
+ vcode: e.string().optional(),
19
+ merchantId: e.string().optional(),
20
+ amount: e.string().optional(),
21
+ currency: e.string().optional(),
22
+ returnUrl: e.string().optional(),
23
+ notifyUrl: e.string().optional(),
24
+ channels: e.array(I).optional(),
25
+ transactionId: e.string().optional()
26
+ });
27
+ e.object({
28
+ trx: e.lazy(() => M),
29
+ onlineTrx: E.optional(),
30
+ url: e.string().optional()
31
+ });
32
+ const l = e.enum(["POS", "APP"]), u = e.enum(["topupCount"]), F = e.object({
33
+ line1: e.string(),
34
+ line2: e.string().optional(),
35
+ state: e.string(),
36
+ city: e.string(),
37
+ postcode: e.string(),
38
+ country: e.string()
39
+ }), m = e.object({
40
+ name: e.string(),
41
+ regNo: e.string(),
42
+ address: F,
43
+ phoneNo: e.string(),
44
+ sstRegNo: e.string().optional()
45
+ }), p = e.object({
46
+ systemCode: e.string(),
47
+ inclusive: e.boolean()
48
+ }), P = e.object({
49
+ id: t,
50
+ dayToExpire: e.number()
51
+ }), j = e.object({
52
+ normal: e.coerce.number(),
53
+ free: e.object({
54
+ day: e.coerce.number(),
55
+ amount: e.coerce.number(),
56
+ remark: e.string().nullish()
57
+ }).nullish()
58
+ }), T = e.object({
59
+ systemCode: e.string(),
60
+ taxCode: e.string()
61
+ }), _ = e.object({
62
+ name: e.string(),
63
+ systemCode: e.string(),
64
+ taxCode: e.string(),
65
+ rate: f,
66
+ total: s
67
+ });
68
+ e.object({
69
+ canPurchase: e.boolean(),
70
+ reason: e.string()
71
+ });
72
+ e.object({
73
+ type: u
74
+ });
75
+ e.object({
76
+ type: u,
77
+ min: e.number().nullish(),
78
+ max: e.number().nullish()
79
+ });
80
+ const N = e.object({
81
+ options: e.object({
82
+ maxReceive: e.number().min(0).nullish(),
83
+ maxPerUser: e.number().min(0).nullish()
84
+ }),
85
+ rule: d.nullish()
86
+ }), C = (o, i) => {
87
+ const n = o;
88
+ n.isFeedvibe && r.Dinero.fromFdoDinero(n.price).toUnit() < 0.1 && i.addIssue({
89
+ code: "custom",
90
+ path: ["price"],
91
+ message: "Price must be at least RM10"
92
+ });
93
+ }, b = e.object({
94
+ _id: e.string(),
95
+ isFeedvibe: e.boolean().nullish(),
96
+ // conditions: z.array(FdoTopupCountCondition),
97
+ image: e.string().nullish(),
98
+ rule: d.nullish(),
99
+ name: e.string(),
100
+ price: s,
101
+ originalPrice: s.nullish(),
102
+ // new field to indicate coinPrice
103
+ coinPrice: e.number().nullish(),
104
+ titles: e.array(P),
105
+ credit: j,
106
+ taxes: e.array(T),
107
+ taxTotals: e.array(_),
108
+ priceWithTaxes: s.nullish(),
109
+ vouchers: e.array(t),
110
+ _inclusiveTaxes: e.array(p).nullish(),
111
+ _taxSystem: e.array(e.string()).nullish(),
112
+ stripePriceId: e.string().nullish(),
113
+ subscriptionValidity: e.number().min(1, "Must be at least 1 day").max(365, "Maximum is 365").nullish(),
114
+ redeemWithCode: e.boolean().nullish(),
115
+ internal: e.boolean().optional(),
116
+ hideInPos: e.boolean().optional(),
117
+ config: N.optional(),
118
+ pf_titles: e.array(e.any()).optional(),
119
+ pf_vouchers: e.array(e.any()).optional(),
120
+ pf_credit: e.number().optional()
121
+ }).superRefine((o, i) => {
122
+ var n, c;
123
+ o.stripePriceId && !o.subscriptionValidity && i.addIssue({
124
+ code: "custom",
125
+ message: "Validity is required when stripePriceId is provided",
126
+ path: ["subscriptionValidity"]
127
+ }), o.originalPrice && o.originalPrice.amount && o.originalPrice.amount < o.price.amount && i.addIssue({
128
+ code: "custom",
129
+ message: "Original price must be greater than price",
130
+ path: ["originalPrice"]
131
+ }), o.price.amount < 0 && i.addIssue({
132
+ code: "custom",
133
+ path: ["price"],
134
+ message: "Price cannot be less than 0"
135
+ }), o.coinPrice && o.coinPrice < 0 && i.addIssue({
136
+ code: "custom",
137
+ path: ["coinPrice"],
138
+ message: "Point price cannot be less than 0"
139
+ }), o.credit.normal < 0 && i.addIssue({
140
+ code: "custom",
141
+ path: ["credit", "normal"],
142
+ message: "Normal credit cannot be less than 0"
143
+ }), o.credit.free && (o.credit.free.amount < 0 && i.addIssue({
144
+ code: "custom",
145
+ path: ["credit", "free", "amount"],
146
+ message: "Free credit cannot be less than 0"
147
+ }), o.credit.free.amount && o.credit.free.day < 0 && i.addIssue({
148
+ code: "custom",
149
+ path: ["credit", "free", "day"],
150
+ message: "Expiry must be at least 0 (expire same day)"
151
+ })), o.credit.normal && o.coinPrice && i.addIssue({
152
+ code: "custom",
153
+ message: "Bundle redeem with point cannot set normal credit.",
154
+ path: ["credit", "normal"]
155
+ }), o.credit.normal > r.Dinero.fromFdoDinero(o.price).toUnit() && i.addIssue({
156
+ code: "custom",
157
+ message: `Normal credit cannot be more than price. Max: ${r.Dinero.fromFdoDinero(
158
+ o.price
159
+ ).toUnit()}`,
160
+ path: ["credit", "normal"]
161
+ }), o.titles.length > 0 && o.titles.some((h) => h.dayToExpire < 0) && i.addIssue({
162
+ code: "custom",
163
+ path: ["titles"],
164
+ message: "Title expiry must be at least 0 day (expire same day)"
165
+ }), (((c = (n = o.config) == null ? void 0 : n.options) == null ? void 0 : c.maxPerUser) || 0) < 0 && i.addIssue({
166
+ code: "custom",
167
+ path: ["config.options.maxPerUser"],
168
+ message: "Max purchase per user cannot be negative"
169
+ });
170
+ }).superRefine(C), g = e.object({
171
+ name: e.string(),
172
+ bundles: e.array(b)
173
+ });
174
+ e.object({
175
+ _id: e.string(),
176
+ name: e.string(),
177
+ expiredAt: e.string()
178
+ });
179
+ const R = e.object({
180
+ apiKey: e.string(),
181
+ webhookSecret: e.string()
182
+ }), S = e.object({
183
+ company: m.nullish(),
184
+ inclusiveTaxes: e.array(p).nullish(),
185
+ stripe: R.optional()
186
+ }), x = {
187
+ collectionName: "Stores",
188
+ transform: {
189
+ _id: "oid",
190
+ business: "oid"
191
+ }
192
+ };
193
+ S.extend({
194
+ _id: t,
195
+ business: t,
196
+ categories: e.array(g)
197
+ }).describe(a.describe(x));
198
+ const D = e.object({
199
+ refundedAt: e.coerce.date(),
200
+ reason: e.string(),
201
+ transactions: e.array(t)
202
+ }), y = e.object({
203
+ type: e.enum(["ONLINE", "OFFLINE", "COIN", "STRIPE", "CARD", "FEEDVIBE"]),
204
+ extra: e.string().nullish()
205
+ }), M = e.object({
206
+ _id: t,
207
+ source: l,
208
+ // can be memberStorePurchase
209
+ ref: e.string(),
210
+ business: t,
211
+ company: m,
212
+ location: t.optional(),
213
+ member: t,
214
+ // createdAt: z.coerce.date(),
215
+ bundle: b,
216
+ transactions: e.array(t),
217
+ // array of transaction id (voucher, credit, title)
218
+ status: e.enum([
219
+ "PENDING_PAYMENT",
220
+ "PENDING_TRANSACTION",
221
+ "COMPLETED",
222
+ "REFUNDED"
223
+ ]),
224
+ refund: D.nullish(),
225
+ paymentType: y.nullish(),
226
+ paymentRef: e.string().nullish(),
227
+ pf_transactions: e.array(e.any()).optional(),
228
+ pf_member: e.any().optional(),
229
+ pf_location: e.any().optional(),
230
+ pf_ref: e.any().optional()
231
+ }).describe(
232
+ a.describe({
233
+ collectionName: "StoreTransactions",
234
+ transform: {
235
+ _id: "oid",
236
+ business: "oid",
237
+ location: "oid",
238
+ member: "oid",
239
+ transaction: "oid"
240
+ }
241
+ })
242
+ );
243
+ e.object({
244
+ bundle: t,
245
+ member: e.string(),
246
+ ref: e.string(),
247
+ paymentType: y.nullish(),
248
+ withCoin: e.boolean().optional(),
249
+ card: e.string().optional(),
250
+ location: t.optional(),
251
+ source: l
252
+ });
253
+ e.object({
254
+ categories: e.array(g)
255
+ });
256
+ e.object({
257
+ id: t,
258
+ reason: e.string(),
259
+ location: t.optional()
260
+ });
261
+ e.object({
262
+ _id: t,
263
+ business: t,
264
+ user: t,
265
+ bundleId: e.string(),
266
+ transaction: e.array(t),
267
+ subscriptionId: e.string(),
268
+ expiredAt: e.coerce.date()
269
+ }).describe(
270
+ a.describe({
271
+ collectionName: "StoreSubscriptions",
272
+ transform: {
273
+ _id: "oid",
274
+ business: "oid",
275
+ user: "oid",
276
+ transaction: "oid",
277
+ expiredAt: "date"
278
+ }
279
+ })
280
+ );
281
+ e.object({
282
+ member: e.string(),
283
+ subscriptionId: e.string()
284
+ });
285
+ export {
286
+ S as F,
287
+ m as a,
288
+ F as b,
289
+ b as c,
290
+ M as d
291
+ };
@@ -0,0 +1,94 @@
1
+ import { g as e, S as n, b as c } from "./index-Dn0jdj0o.js";
2
+ const t = () => {
3
+ const a = n.getBusinessId();
4
+ if (!a) throw new Error("Invalid business ID");
5
+ return c(`businesses/${a}/campaigns`, {
6
+ // url: 'http://localhost:3000/portal/',
7
+ });
8
+ }, i = {
9
+ async readAllGrouped(a) {
10
+ const s = e(
11
+ await t().get("grouped", { params: a })
12
+ );
13
+ return {
14
+ meta: s.meta,
15
+ resources: s.resources
16
+ };
17
+ },
18
+ async readAll(a, s) {
19
+ const r = e(
20
+ await t().get("", {
21
+ params: { ...a, ...s }
22
+ })
23
+ );
24
+ return {
25
+ meta: r.meta,
26
+ resources: r.resources
27
+ };
28
+ },
29
+ async readById(a) {
30
+ return e(await t().get(`/${a}`));
31
+ },
32
+ async create(a) {
33
+ return e(await t().post("", a));
34
+ },
35
+ async update(a, s) {
36
+ return e(await t().put(a, s));
37
+ },
38
+ async delete(a) {
39
+ return e(await t().delete(a));
40
+ },
41
+ async readCollectionsByCampaignId(a, s) {
42
+ const r = e(
43
+ await t().get(`/${a}/collections`, {
44
+ params: s
45
+ })
46
+ );
47
+ return {
48
+ meta: r.meta,
49
+ resources: r.resources
50
+ };
51
+ },
52
+ async readTransactions(a) {
53
+ return e(
54
+ await t().get(
55
+ `/${a}/collections/transactions`
56
+ )
57
+ );
58
+ },
59
+ async createCollectionByCampaignId(a, s) {
60
+ return e(
61
+ await t().post(`/${a}/collections`, s)
62
+ );
63
+ },
64
+ async readGroups() {
65
+ return e(await t().get("/groups")) ?? [];
66
+ },
67
+ async readStats(a) {
68
+ return e(
69
+ await t().get("/stats", { params: a })
70
+ );
71
+ },
72
+ async createGroup(a) {
73
+ return e(await t().post("/groups", a));
74
+ },
75
+ async updateGroup(a, s) {
76
+ return e(
77
+ await t().put(`/groups/${a}`, s)
78
+ );
79
+ },
80
+ async deleteGroup(a) {
81
+ return e(await t().delete(`/groups/${a}`));
82
+ },
83
+ async sendCollection(a, s) {
84
+ return e(
85
+ await t().post(
86
+ `/${a}/collections/send`,
87
+ s
88
+ )
89
+ );
90
+ }
91
+ };
92
+ export {
93
+ i as c
94
+ };