@feedmepos/mf-connect 0.1.119-prod → 0.1.121-dev

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 (146) hide show
  1. package/dist/{App-BN2LKM3u.js → App-DwtaLO6F.js} +147 -135
  2. package/dist/AuditLogs-s572aHLw.js +2016 -0
  3. package/dist/{Bin-DpQ1atb7.js → Bin-BBaVggZI.js} +8 -8
  4. package/dist/{Broadcast-c1ZyYClI.js → Broadcast-CqAQ3EmE.js} +22 -21
  5. package/dist/{CampaignAnalytic-w1hIlc2r.js → CampaignAnalytic-34bfP8iY.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D7U6evm1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BvAAxE3a.js} +8 -9
  7. package/dist/{Card-De53Xgbe.js → Card-8hlnKnhk.js} +22 -22
  8. package/dist/{Collections-BL2RD3FU.js → Collections-BJ0-UjKf.js} +197 -185
  9. package/dist/{Credit-2KvFFcwR.js → Credit-DJNc__yp.js} +21 -20
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CKSs2nYE.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BvilcyyB.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSjOHBhA.js +4439 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Jy7HkK5Z.js → EffectSheet.vue_vue_type_style_index_0_lang-DFzVuuEy.js} +30 -30
  13. package/dist/{Experience-Cb0jHtVo.js → Experience-D-cUhjWc.js} +32 -31
  14. package/dist/{FileSaver.min-UDgZF_Cv.js → FileSaver.min-DKYYse6A.js} +1 -1
  15. package/dist/{Game-BnysxSMs.js → Game-DdFV90Kp.js} +19 -18
  16. package/dist/{GiftCardSetup-s1OR6xQq.js → GiftCardSetup-Dz0AN159.js} +31 -31
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-D108r20x.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-GCp3IFaC.js} +7 -7
  18. package/dist/{Goals-BAieLPzR.js → Goals-Dg_kAezl.js} +4 -4
  19. package/dist/Grab-BSQt4deB.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B9Jgq5Bp.js → ImageInput.vue_vue_type_script_setup_true_lang-B_H1Bgy1.js} +1 -1
  21. package/dist/{Index-DnX16GAE.js → Index-ZSup3I7J.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DeM-WG6m.js → LocationPicker.vue_vue_type_script_setup_true_lang-DisF-jcd.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BAN69FOS.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BHhjZOYi.js} +1 -1
  24. package/dist/{LoyaltyDashboard-D8g6OSbC.js → LoyaltyDashboard-D8BhHsaw.js} +15 -15
  25. package/dist/{MainLayout-DWABjpQn.js → MainLayout-BBnhRxyR.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-COp7iulq.js → MainLayout.vue_vue_type_script_setup_true_lang-DFrPlj5u.js} +16 -16
  27. package/dist/{Marketing-Dagatr0y.js → Marketing-5F9LLn91.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-DYVzNDpM.js → MarketingMaterialEdit-C7dD4Bzw.js} +214 -211
  29. package/dist/{Member-DAxdEF_Z.js → Member-Dk4JeGru.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-nBg7Hckj.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-ISolD_Qg.js} +39 -47
  31. package/dist/{MemberImportHistory-2gx6FnLh.js → MemberImportHistory-C0Ep8L2q.js} +7 -7
  32. package/dist/{MemberList-By_gGl-J.js → MemberList-BsuPfBgk.js} +103 -105
  33. package/dist/{MemberTransactions-BEF-4ZNp.js → MemberTransactions-mZ3fHw5O.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Bs8wKx9B.js → MessageInput.vue_vue_type_script_setup_true_lang-1weyRM8c.js} +12 -12
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DN3mWfKj.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-caED3JRW.js} +1 -1
  36. package/dist/{Mission-jg15lBxo.js → Mission-C7DqUOJz.js} +22 -21
  37. package/dist/{Overview-C7WfdzfV.js → Overview-U201nBVO.js} +20 -20
  38. package/dist/{Overview-BFKLTAk1.js → Overview-VABLg36G.js} +145 -144
  39. package/dist/{Point-dv9WgWTQ.js → Point-DU6Ndv35.js} +22 -21
  40. package/dist/{Promotion-mFPF_8jO.js → Promotion-9UhZXNPb.js} +137 -131
  41. package/dist/{Queue-BQoR_M5H.js → Queue-CUxMedbd.js} +45 -45
  42. package/dist/{Record-1JZ1N5iX.js → Record-BIftCQzV.js} +9 -9
  43. package/dist/{Review-B52AxCeT.js → Review-lyVgTfsP.js} +2 -2
  44. package/dist/ReviewFacebookCallback-Da5G19bE.js +225 -0
  45. package/dist/{ReviewGoogleCallback-DO6SVFIC.js → ReviewGoogleCallback-B41PXfsj.js} +5 -5
  46. package/dist/{Reward-Cp4jPAB0.js → Reward-BMun_Rs4.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DLD6X13Z.js → RewardGroup.vue_vue_type_script_setup_true_lang-3TONrUQu.js} +13 -13
  48. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DHzFgr4h.js +1923 -0
  49. package/dist/{Segment-DaKw0YXF.js → Segment-1VS7ycXi.js} +303 -306
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bj3OQ_JJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C5iJSlxi.js} +14 -14
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-B1Otak97.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CXY9Wyk9.js} +4 -4
  52. package/dist/{Setting-DveUrt8J.js → Setting-BdtzvKjt.js} +159 -148
  53. package/dist/{SettingAdvertisements-QRXOMNnM.js → SettingAdvertisements-BO2l3HBT.js} +12 -12
  54. package/dist/Settings-CvYawDU5.js +286 -0
  55. package/dist/{Store-DjdXRw3V.js → Store-DWQz-MgY.js} +28 -28
  56. package/dist/{StoreRewards-CjlGrc9E.js → StoreRewards-Bfwuqxf-.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CBwmDKAw.js +1319 -0
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CHzFjo24.js +7007 -0
  59. package/dist/{Tier-D74Oh2np.js → Tier-CKn-l-wY.js} +2575 -687
  60. package/dist/{Title-CeeviOW8.js → Title-BXDk69uL.js} +95 -94
  61. package/dist/{Transaction-CWdw0ITl.js → Transaction-D4HQO4i9.js} +2 -2
  62. package/dist/Upselling-CikWzKq7.js +1032 -0
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B9nf-9s0.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-um124o4t.js} +26 -26
  64. package/dist/{Voucher-C0nNXMtv.js → Voucher-BGIyw4jq.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DxZLsQq9.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BKyZj5SP.js} +12 -12
  66. package/dist/{WhatsappAccount-CoLSjCQ2.js → WhatsappAccount-Cd82g_xj.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DkHPlGgT.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DWy8kS66.js} +1 -1
  68. package/dist/{WhatsappBot-kLb3kUav.js → WhatsappBot-auQhO8zk.js} +6 -6
  69. package/dist/{WhatsappBotLogs-jcYaHs0t.js → WhatsappBotLogs-CWuJzK9W.js} +6 -6
  70. package/dist/{WhatsappBotSettings-B6jJD61h.js → WhatsappBotSettings-B8KXMpIF.js} +4 -4
  71. package/dist/{WhatsappLayout-C24bIjI2.js → WhatsappLayout-DxooAkkL.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-9a_grP76.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CYHmgQ2v.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-i8Wc2mCr.js → ZodTextField.vue_vue_type_script_setup_true_lang-DilxQM_z.js} +2 -2
  74. package/dist/{app-C06bAZj3.js → app-BG-zK89d.js} +4181 -3401
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-CgNRhKu8.js → base.export-BcMuREGH.js} +2 -2
  77. package/dist/{business-D23Dt1x4.js → business-9_NOI2V9.js} +1 -1
  78. package/dist/{campaign-FVcbXtrP.js → campaign-8y_9SvKP.js} +34 -28
  79. package/dist/{campaign-DfEvGigm.js → campaign-DjBTRZyA.js} +121 -94
  80. package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-Dx-Zo68Q.js} +2 -1
  81. package/dist/campaign.fn-COkPH1QE.js +776 -0
  82. package/dist/{collection.fn-DC1AMI9o.js → collection.fn-yXurU9iv.js} +2 -2
  83. package/dist/{currency-Bra2RJK4.js → currency-YzyBFtDU.js} +1 -1
  84. package/dist/duplicateCampaign-dRWioann.js +51 -0
  85. package/dist/{effect-EL4V3pAu.js → effect-bMGarJZ6.js} +1 -1
  86. package/dist/{email-addresses-Ddtf1x_y.js → email-addresses-Ciu83j_3.js} +2 -2
  87. package/dist/{feature-flag-umACX47C.js → feature-flag-H5D1Cob5.js} +70 -70
  88. package/dist/google-BQK68wbe.js +5 -0
  89. package/dist/{helper-DqDOnLCf.js → helper-BH9HMikb.js} +1 -1
  90. package/dist/{index-CEh6ryp2.js → index-B7-Uvnfn.js} +19 -6
  91. package/dist/{index-DuCJtx1m.js → index-BHO82_Ix.js} +1 -1
  92. package/dist/{index-B_BmgKrh.js → index-BaTnDV-T.js} +2699 -2613
  93. package/dist/{index-C3hAzzS2.js → index-BvKJM3M2.js} +29 -15
  94. package/dist/{index-rcfcslIC.js → index-BxwJfT08.js} +197 -197
  95. package/dist/{index-C6p9Lsvf.js → index-CH-KHkm5.js} +1 -1
  96. package/dist/{index-B2lqC_hH.js → index-CIOidYvo.js} +1 -1
  97. package/dist/{index-BzwwXWpZ.js → index-CJAFz9Nn.js} +1 -1
  98. package/dist/{index-ByVPdKdB.js → index-CooParq-.js} +682 -581
  99. package/dist/{index-pfmx-Gor.js → index-Cyf05z_2.js} +2 -2
  100. package/dist/{index-Bvk61_w_.js → index-DYu7ZdQt.js} +1 -1
  101. package/dist/{index-B3U3KZl0.js → index-DbxiG50D.js} +2 -2
  102. package/dist/{index-BkKu2G2c.js → index-DkMy7WpU.js} +2 -2
  103. package/dist/{index-LjoAs_nX.js → index-DpkoCl4z.js} +10 -10
  104. package/dist/{index-C3lk4GHF.js → index-MWNnMT2T.js} +4 -4
  105. package/dist/{index-DK9zxpDu.js → index-RvJ5cq__.js} +3 -3
  106. package/dist/{index-iVbjwKxc.js → index-Ye3qFt34.js} +10 -10
  107. package/dist/{index-BTjhdlN_.js → index-_giqGuYM.js} +1 -1
  108. package/dist/{index-TDCPGtW3.js → index-pnM5q4c_.js} +389 -232
  109. package/dist/{index-BroF2fC8.js → index-taPHgOqE.js} +608 -251
  110. package/dist/{index.esm2017-DCuQPCX2.js → index.esm2017-CLxZor1Y.js} +111 -111
  111. package/dist/{loading-CQm1DKWE.js → loading-CsOSUWBd.js} +1 -1
  112. package/dist/{lodash-C2wVbAap.js → lodash-CshibTzh.js} +1 -1
  113. package/dist/{member-import-BLEmTRso.js → member-import-BdaGAjjt.js} +1 -1
  114. package/dist/{membership-XycnxPEW.js → membership-C5JWO1FM.js} +2 -2
  115. package/dist/{money-DY_QGzd1.js → money-Blt5EM43.js} +1 -1
  116. package/dist/{number-BHthf4qF.js → number-COm3MiH8.js} +1 -1
  117. package/dist/objectid-DQTx3-ee.js +145 -0
  118. package/dist/{onboarding-BOJw54Fn.js → onboarding-BbQDJOOS.js} +36 -36
  119. package/dist/{onboardingSetup-Cf2u1tXu.js → onboardingSetup-BLISY52M.js} +2 -2
  120. package/dist/{plugins-DKQeoL_e.js → plugins-De_chCYU.js} +3 -3
  121. package/dist/{reward-D4RIYSpl.js → reward-Dl8Zoxe_.js} +1 -1
  122. package/dist/{rule-Ba-s0L_w.js → rule-D6_iss3O.js} +572 -492
  123. package/dist/style.css +1 -1
  124. package/dist/template-Cw6j1cLX.js +224 -0
  125. package/dist/{timezone-CAc8xi1h.js → timezone-CA5FwOyy.js} +1 -1
  126. package/dist/{transaction.fn-Cp2hnhyU.js → transaction.fn-DI_NeGQb.js} +2 -2
  127. package/dist/{trigger-3ebhNBX7.js → trigger-CuymoMM-.js} +9 -9
  128. package/dist/{useMarketingMaterialActions-6URv8neP.js → useMarketingMaterialActions-Bz0Kgvgd.js} +4 -4
  129. package/dist/{usePagination-C-fyMmiy.js → usePagination-yb1rupwa.js} +1 -1
  130. package/dist/{user-T-iXTrYV.js → user-QSKyFaMI.js} +1 -1
  131. package/dist/vue-i18n-B_qtODCw.js +2365 -0
  132. package/dist/{xlsx-B8OqaJfb.js → xlsx--RjkGa9A.js} +224 -224
  133. package/dist/{zod-DZkNj425.js → zod-CmPMd-h0.js} +1 -1
  134. package/package.json +8 -3
  135. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BXb7v7wc.js +0 -3493
  136. package/dist/ReviewFacebookCallback-ihTdiI8V.js +0 -238
  137. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-pdHRjCt8.js +0 -1884
  138. package/dist/Settings-D9D-mkBa.js +0 -179
  139. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DnwMpqzf.js +0 -1265
  140. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-I5-5BV4h.js +0 -142
  141. package/dist/campaign.fn-0MNUj1fZ.js +0 -776
  142. package/dist/google-C3S8u0mT.js +0 -4
  143. package/dist/objectid-CPCAqIiC.js +0 -145
  144. package/dist/rule-builder-D0B0DPao.js +0 -102
  145. package/dist/template-B40I16Yg.js +0 -236
  146. package/dist/vue-i18n-DzsxJorb.js +0 -2365
@@ -1,13 +1,187 @@
1
+ import { F as n, m, b as A } from "./index-RvJ5cq__.js";
1
2
  import { z as e } from "./index-C_H8jFYf.js";
2
- import { F as a, m as i, b as O } from "./index-DK9zxpDu.js";
3
- import { d as I } from "./index-B_BmgKrh.js";
4
- import { R as t } from "./rule-builder-D0B0DPao.js";
5
- import { i as o } from "./helper-DqDOnLCf.js";
6
- import { e as u, b as H, f as r } from "./index-rcfcslIC.js";
7
- import { k as R, l as L, j as c } from "./index-ByVPdKdB.js";
8
- import { d as x } from "./index-TDCPGtW3.js";
9
- import { F as _ } from "./index-B3U3KZl0.js";
10
- const Me = {
3
+ import { l as M, m as F, n as G, o as g } from "./index-CooParq-.js";
4
+ import { _ as k, l as v, f as B } from "./index-BaTnDV-T.js";
5
+ import { i as p } from "./helper-BH9HMikb.js";
6
+ import { d as z, b as U, e as d } from "./index-BxwJfT08.js";
7
+ import { c as V } from "./index-pnM5q4c_.js";
8
+ import { F as T } from "./index-DbxiG50D.js";
9
+ function b(o, a) {
10
+ let i = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
11
+ const l = r.length;
12
+ for (let c = 0; c < o; c++)
13
+ i += r.charAt(Math.floor(Math.random() * l));
14
+ return i;
15
+ }
16
+ function H(o) {
17
+ return !o.property && "rules" in o;
18
+ }
19
+ function W(o) {
20
+ return "property" in o && !!o.property;
21
+ }
22
+ const Y = "g_schedule";
23
+ function K(o) {
24
+ return o.split(/\r?\n/).filter((a) => !a.trim().toUpperCase().startsWith("DTSTART")).join(`
25
+ `).trim();
26
+ }
27
+ function q(o, a = !1) {
28
+ const i = k.cloneDeep(o);
29
+ if (W(i)) {
30
+ const r = i.conditions;
31
+ return !a && r && typeof r._rrule == "string" && (r._rrule = K(
32
+ r._rrule
33
+ )), i;
34
+ }
35
+ if (H(i))
36
+ for (const r in i.rules) {
37
+ const l = i.rules[r], c = a || H(l) && l.name === Y;
38
+ i.rules[r] = q(
39
+ l,
40
+ c
41
+ );
42
+ }
43
+ return i;
44
+ }
45
+ class t {
46
+ static scaffoldGroup(a) {
47
+ return {
48
+ name: a ?? `g_${b(4)}`,
49
+ rules: {},
50
+ logic: ""
51
+ };
52
+ }
53
+ static scaffoldEntry(a) {
54
+ return {
55
+ name: `r_${b(4)}`,
56
+ property: a ?? "",
57
+ conditions: {},
58
+ negated: !1
59
+ };
60
+ }
61
+ static constructEntry(a, i, r, l) {
62
+ return {
63
+ name: l ?? `e_${b(4)}`,
64
+ property: a,
65
+ conditions: {
66
+ [i]: r
67
+ },
68
+ negated: !1
69
+ };
70
+ }
71
+ static getLogic(a) {
72
+ return (a.logic ?? "").includes("||") ? "||" : "&&";
73
+ }
74
+ static constructLogic(a, i) {
75
+ const r = i ?? t.getLogic(a);
76
+ return Object.entries(a.rules).map(([l, c]) => H(c) ? l : `${c.negated ? "!" : ""}${l}`).join(` ${r} `);
77
+ }
78
+ static setRuleToGroup(a, i, r) {
79
+ let l = v.cloneDeep(a);
80
+ return Object.keys(l.rules).length === 0 && (l = t.scaffoldGroup(l.name)), Array.isArray(i) ? i.forEach((c) => {
81
+ l.rules[c.name] = c;
82
+ }) : l.rules[i.name] = i, l.logic = t.constructLogic(l, r), l;
83
+ }
84
+ static removeEntry(a, i, r) {
85
+ const l = v.cloneDeep(a);
86
+ return delete l.rules[i], l.logic = t.constructLogic(l, r), l;
87
+ }
88
+ static constructRule(a) {
89
+ switch (a.type) {
90
+ case "timeframe": {
91
+ const i = a.property, r = t.scaffoldGroup("timeframe"), l = [];
92
+ return (a.start || a.end) && l.push(
93
+ t.constructEntry(i, "_isBetween", {
94
+ start: a.start || void 0,
95
+ end: a.end || void 0
96
+ })
97
+ ), t.setRuleToGroup(r, l, "&&");
98
+ }
99
+ default:
100
+ throw Error("invalid config type");
101
+ }
102
+ }
103
+ static getRules(a) {
104
+ return a && "rules" in a ? Object.values(a.rules) : [];
105
+ }
106
+ static simplify(a) {
107
+ const [i] = Object.entries(a.conditions);
108
+ return i[0], {
109
+ property: a.property,
110
+ operator: i[0],
111
+ equator: i[1]
112
+ };
113
+ }
114
+ static isRuleExceed(a, i) {
115
+ const l = Object.keys(a.rules).length + (Array.isArray(i) ? i.length : 1);
116
+ if (l > 10)
117
+ throw new X(10, l);
118
+ return !0;
119
+ }
120
+ }
121
+ class X extends Error {
122
+ constructor(a, i) {
123
+ super(
124
+ `Maximum of ${a} rules allowed per group. Attempted to add ${i} rules.`
125
+ ), this.name = "MaxRulesExceededError";
126
+ }
127
+ }
128
+ const Q = {
129
+ collectionName: "AuditLogs",
130
+ transform: {
131
+ _id: "oid",
132
+ business: "oid",
133
+ timestamp: "date"
134
+ },
135
+ lookups: {
136
+ business: {
137
+ as: "pf_business",
138
+ fromCollection: "Businesses"
139
+ }
140
+ }
141
+ }, $ = e.enum([
142
+ "GET",
143
+ "POST",
144
+ "PUT",
145
+ "PATCH",
146
+ "DELETE",
147
+ "OPTIONS",
148
+ "HEAD",
149
+ "ALL"
150
+ ]), Z = e.enum([
151
+ "CAMPAIGN",
152
+ "LOCATION",
153
+ "MARKETING MATERIALS",
154
+ "MEMBERSHIP",
155
+ "STORE",
156
+ "TRANSACTION",
157
+ "SETTINGS",
158
+ "SEGMENTATION",
159
+ "USER"
160
+ ]), ee = e.object({
161
+ httpMethod: $,
162
+ url: e.string().min(1),
163
+ userAgent: e.string(),
164
+ host: e.string().min(1),
165
+ params: e.object({}).passthrough().nullish(),
166
+ query: e.object({}).passthrough().nullish(),
167
+ body: e.object({}).passthrough().nullish()
168
+ }), te = e.object({
169
+ statusCode: e.number().int().min(100).max(599),
170
+ body: e.object({}).passthrough().nullish()
171
+ });
172
+ e.object({
173
+ _id: n,
174
+ user: e.string().length(28),
175
+ userName: e.string().min(1),
176
+ userPhoneNumber: e.string().refine((o) => M(o)).nullish(),
177
+ moduleType: Z,
178
+ business: n.nullish(),
179
+ clientIp: e.string().nullish(),
180
+ timestamp: e.string().datetime(),
181
+ request: ee,
182
+ response: te
183
+ }).describe(m.describe(Q));
184
+ const it = {
11
185
  PROMOTION: {
12
186
  name: "Promotion Template",
13
187
  description: "Promotion template for campaign creation.",
@@ -413,7 +587,7 @@ const Me = {
413
587
  // },
414
588
  hideInApp: !0
415
589
  },
416
- configs: o("VOUCHER", {
590
+ configs: p("VOUCHER", {
417
591
  name: "",
418
592
  business: null,
419
593
  noCampaign: !1
@@ -1403,7 +1577,7 @@ const Me = {
1403
1577
  rewards: []
1404
1578
  }
1405
1579
  },
1406
- configs: o("GAME", {
1580
+ configs: p("GAME", {
1407
1581
  name: "Token",
1408
1582
  business: null,
1409
1583
  noCampaign: !1
@@ -1644,18 +1818,184 @@ const Me = {
1644
1818
  type: "timeframe"
1645
1819
  }
1646
1820
  },
1647
- configs: o("STAMP", {
1821
+ configs: p("STAMP", {
1648
1822
  business: null,
1649
1823
  noCampaign: !1
1650
1824
  })
1651
1825
  }
1826
+ },
1827
+ GRAB: {
1828
+ name: "Grab Campaign Template",
1829
+ description: "Grab campaign template for campaign creation.",
1830
+ steps: [
1831
+ {
1832
+ name: "connect.template.general_information",
1833
+ groups: [
1834
+ {
1835
+ name: "connect.template.general",
1836
+ fields: [
1837
+ {
1838
+ label: "connect.template.campaign_name",
1839
+ property: "campaign.name",
1840
+ type: "text"
1841
+ },
1842
+ {
1843
+ label: "connect.template.campaign_period",
1844
+ property: "campaign.timeframeOptions",
1845
+ type: "timeframe"
1846
+ }
1847
+ ]
1848
+ }
1849
+ ]
1850
+ },
1851
+ {
1852
+ name: "connect.template.discount",
1853
+ groups: [
1854
+ {
1855
+ name: "connect.template.discount",
1856
+ fields: [
1857
+ {
1858
+ label: void 0,
1859
+ property: "campaign.discount",
1860
+ type: "grab_effect"
1861
+ }
1862
+ ]
1863
+ },
1864
+ {
1865
+ name: "connect.template.grab_quota",
1866
+ fields: [
1867
+ {
1868
+ label: void 0,
1869
+ property: "campaign.quotas",
1870
+ type: "grab_quota"
1871
+ }
1872
+ ]
1873
+ },
1874
+ {
1875
+ name: "connect.template.grab_condition",
1876
+ fields: [
1877
+ {
1878
+ label: void 0,
1879
+ property: "campaign.conditions",
1880
+ type: "grab_conditions"
1881
+ }
1882
+ ]
1883
+ }
1884
+ ]
1885
+ },
1886
+ {
1887
+ name: "connect.template.terms_conditions",
1888
+ groups: [
1889
+ {
1890
+ name: "Location",
1891
+ fields: [
1892
+ {
1893
+ label: "Target location",
1894
+ property: "campaign.targetLocation",
1895
+ type: "target_location"
1896
+ }
1897
+ ]
1898
+ }
1899
+ ]
1900
+ }
1901
+ ],
1902
+ defaultValue: {
1903
+ templateId: "",
1904
+ campaign: {
1905
+ type: "GRAB",
1906
+ templateId: "",
1907
+ name: "",
1908
+ description: "",
1909
+ image: "",
1910
+ discount: null,
1911
+ group: null,
1912
+ event: {
1913
+ type: "MAKING_ORDER",
1914
+ rule: t.scaffoldGroup()
1915
+ },
1916
+ quotas: {
1917
+ totalCount: 10,
1918
+ totalCountPerUser: 2
1919
+ },
1920
+ conditions: {
1921
+ startTime: "",
1922
+ endTime: "",
1923
+ eaterType: "all",
1924
+ minBasketAmount: 10,
1925
+ bundleQuantity: 2,
1926
+ workingHour: {
1927
+ sun: {
1928
+ periods: [
1929
+ {
1930
+ startTime: "11:30",
1931
+ endTime: "14:00"
1932
+ }
1933
+ ]
1934
+ },
1935
+ mon: {
1936
+ periods: [
1937
+ {
1938
+ startTime: "11:30",
1939
+ endTime: "14:00"
1940
+ }
1941
+ ]
1942
+ },
1943
+ tue: {
1944
+ periods: [
1945
+ {
1946
+ startTime: "11:30",
1947
+ endTime: "14:00"
1948
+ }
1949
+ ]
1950
+ },
1951
+ wed: {
1952
+ periods: [
1953
+ {
1954
+ startTime: "11:30",
1955
+ endTime: "14:00"
1956
+ }
1957
+ ]
1958
+ },
1959
+ thu: {
1960
+ periods: [
1961
+ {
1962
+ startTime: "11:30",
1963
+ endTime: "14:00"
1964
+ }
1965
+ ]
1966
+ },
1967
+ fri: {
1968
+ periods: [
1969
+ {
1970
+ startTime: "11:30",
1971
+ endTime: "14:00"
1972
+ }
1973
+ ]
1974
+ },
1975
+ sat: {
1976
+ periods: [
1977
+ {
1978
+ startTime: "11:30",
1979
+ endTime: "14:00"
1980
+ }
1981
+ ]
1982
+ }
1983
+ }
1984
+ },
1985
+ targetLocation: null,
1986
+ timeframeOptions: {
1987
+ type: "timeframe",
1988
+ property: "__now"
1989
+ }
1990
+ }
1991
+ }
1652
1992
  }
1653
1993
  };
1654
- t.scaffoldGroup(), o("STAMP", {
1994
+ t.scaffoldGroup(), p("STAMP", {
1655
1995
  business: null,
1656
1996
  noCampaign: !1
1657
1997
  });
1658
- const Ge = {
1998
+ const lt = {
1659
1999
  _id: "",
1660
2000
  intention: [],
1661
2001
  name: "Spend and get voucher",
@@ -2053,7 +2393,7 @@ const Ge = {
2053
2393
  amount: 1
2054
2394
  }
2055
2395
  },
2056
- configs: o("VOUCHER", {
2396
+ configs: p("VOUCHER", {
2057
2397
  name: "",
2058
2398
  business: null,
2059
2399
  noCampaign: !1
@@ -2062,7 +2402,7 @@ const Ge = {
2062
2402
  };
2063
2403
  ({
2064
2404
  ...t.scaffoldGroup()
2065
- }, o("VOUCHER", {
2405
+ }, p("VOUCHER", {
2066
2406
  name: "",
2067
2407
  business: null,
2068
2408
  noCampaign: !1
@@ -2073,7 +2413,7 @@ const Ge = {
2073
2413
  ({
2074
2414
  ...t.scaffoldGroup()
2075
2415
  });
2076
- const ke = {
2416
+ const rt = {
2077
2417
  _id: "",
2078
2418
  intention: [],
2079
2419
  name: "Spend and earn points",
@@ -2448,7 +2788,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2448
2788
  });
2449
2789
  ({
2450
2790
  ...t.scaffoldGroup()
2451
- }, o("VOUCHER", {
2791
+ }, p("VOUCHER", {
2452
2792
  name: "",
2453
2793
  business: null,
2454
2794
  noCampaign: !1
@@ -2494,12 +2834,12 @@ t.setRuleToGroup(
2494
2834
  "&&"
2495
2835
  )
2496
2836
  );
2497
- t.scaffoldGroup(), t.scaffoldGroup(), o("GAME", {
2837
+ t.scaffoldGroup(), t.scaffoldGroup(), p("GAME", {
2498
2838
  name: "Token",
2499
2839
  business: null,
2500
2840
  noCampaign: !1
2501
2841
  });
2502
- const Be = {
2842
+ const ct = {
2503
2843
  _id: "",
2504
2844
  intention: [],
2505
2845
  name: "Welcome voucher",
@@ -2845,7 +3185,7 @@ const Be = {
2845
3185
  amount: 1
2846
3186
  }
2847
3187
  },
2848
- configs: o("VOUCHER", {
3188
+ configs: p("VOUCHER", {
2849
3189
  name: "",
2850
3190
  business: null,
2851
3191
  noCampaign: !1
@@ -2876,7 +3216,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2876
3216
  ],
2877
3217
  "&&"
2878
3218
  )
2879
- ]), o("VOUCHER", {
3219
+ ]), p("VOUCHER", {
2880
3220
  name: "",
2881
3221
  business: null,
2882
3222
  noCampaign: !1
@@ -2899,7 +3239,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2899
3239
  ({
2900
3240
  ...t.scaffoldGroup()
2901
3241
  });
2902
- const D = e.enum([
3242
+ const ae = e.enum([
2903
3243
  "MEMBER_REWARD",
2904
3244
  "PAID_LOYALTY",
2905
3245
  "COLLECT_FEEDBACK",
@@ -2909,7 +3249,7 @@ const D = e.enum([
2909
3249
  "BROADCAST",
2910
3250
  "BIRTHDAY",
2911
3251
  "GAME"
2912
- ]), w = e.enum([
3252
+ ]), ne = e.enum([
2913
3253
  "text",
2914
3254
  "number",
2915
3255
  "textarea",
@@ -2935,88 +3275,91 @@ const D = e.enum([
2935
3275
  "rule_bill",
2936
3276
  "rule_feedback",
2937
3277
  "rule_birthday",
2938
- "promotion_game_type"
2939
- ]), A = e.object({
3278
+ "promotion_game_type",
3279
+ "grab_effect",
3280
+ "grab_quota",
3281
+ "grab_conditions"
3282
+ ]), oe = e.object({
2940
3283
  label: e.string().optional(),
2941
3284
  label_locale: e.record(e.string()).nullish(),
2942
3285
  property: e.string().or(e.any()),
2943
- type: w,
3286
+ type: ne,
2944
3287
  extras: e.string().optional(),
2945
3288
  isRuleChildren: e.boolean().optional()
2946
- }), f = e.object({
3289
+ }), S = e.object({
2947
3290
  not: e.boolean().optional(),
2948
3291
  property: e.string(),
2949
3292
  value: e.any()
2950
- }), F = e.object({
3293
+ }), ie = e.object({
2951
3294
  name: e.string().optional(),
2952
3295
  name_locale: e.record(e.string()).nullish(),
2953
- fields: e.array(A),
2954
- condition: f.optional().or(
2955
- e.array(f)
3296
+ fields: e.array(oe),
3297
+ condition: S.optional().or(
3298
+ e.array(S)
2956
3299
  )
2957
- }), M = e.object({
3300
+ }), le = e.object({
2958
3301
  name: e.string(),
2959
3302
  name_locale: e.record(e.string()).nullish(),
2960
- groups: e.array(F)
3303
+ groups: e.array(ie)
2961
3304
  });
2962
3305
  e.object({
2963
- _id: a,
3306
+ _id: n,
2964
3307
  name: e.string(),
2965
3308
  name_locale: e.record(e.string()).nullish(),
2966
3309
  description: e.string().nullish(),
2967
3310
  description_locale: e.record(e.string()).nullish(),
2968
- steps: e.array(M).min(1),
2969
- intention: e.array(D),
3311
+ steps: e.array(le).min(1),
3312
+ intention: e.array(ae),
2970
3313
  defaultValue: e.any()
2971
3314
  }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
2972
- const G = {
3315
+ const re = {
2973
3316
  collectionName: "Businesses",
2974
3317
  transform: {
2975
3318
  _id: "oid"
2976
3319
  }
2977
3320
  };
2978
3321
  e.object({
2979
- _id: a,
3322
+ _id: n,
2980
3323
  ownerId: e.string(),
2981
3324
  name: e.string(),
2982
3325
  credit: e.number(),
2983
3326
  forceSend: e.boolean().optional()
2984
- }).describe(i.describe(G));
2985
- const z = e.enum(["PHONE"]), k = e.enum([
3327
+ }).describe(m.describe(re));
3328
+ const P = e.enum(["PHONE"]), ce = e.enum([
2986
3329
  "MOCEAN",
2987
3330
  "SLACK",
2988
3331
  "SMS",
2989
3332
  "EMAIL",
2990
3333
  "WHATSAPP"
2991
- ]), B = e.enum(["PENDING", "COMPLETED", "FAILED"]), V = e.enum([
3334
+ ]), pe = e.enum(["PENDING", "COMPLETED", "FAILED"]), me = e.enum([
2992
3335
  "General",
2993
3336
  "Otp",
2994
3337
  "Marketing",
2995
3338
  "Ordering",
2996
3339
  "MemberInvitation",
2997
3340
  "MarketingPromotion"
2998
- ]), W = e.object({
2999
- type: z
3000
- }), C = W.extend({
3001
- type: e.literal(z.enum.PHONE),
3002
- provider: k,
3003
- usage: V.optional()
3004
- }), T = e.enum([
3341
+ ]), se = e.object({
3342
+ type: P
3343
+ }), j = se.extend({
3344
+ type: e.literal(P.enum.PHONE),
3345
+ provider: ce,
3346
+ usage: me.optional()
3347
+ }), E = e.enum([
3005
3348
  "Accepted",
3006
3349
  "PartiallyAccepted",
3007
3350
  "Queued",
3008
3351
  "Unknown",
3009
3352
  "Failed"
3010
- ]), Y = e.enum([
3353
+ ]), ge = e.enum([
3011
3354
  "PENDING",
3012
3355
  "SUBMITTED",
3013
3356
  "SETTLED",
3014
3357
  "FAILED"
3015
- ]), v = e.object({
3358
+ ]), J = e.object({
3016
3359
  channel: e.string(),
3017
3360
  status: e.string(),
3018
3361
  statusDetails: e.string().nullish()
3019
- }), K = {
3362
+ }), de = {
3020
3363
  collectionName: "Notifications",
3021
3364
  transform: {
3022
3365
  _id: "oid",
@@ -3026,51 +3369,51 @@ const z = e.enum(["PHONE"]), k = e.enum([
3026
3369
  }
3027
3370
  };
3028
3371
  e.object({
3029
- _id: a,
3030
- business: a,
3031
- status: B,
3372
+ _id: n,
3373
+ business: n,
3374
+ status: pe,
3032
3375
  ref: e.string().optional(),
3033
3376
  title: e.string().optional(),
3034
3377
  // Single-channel fields. Absent on multi-channel dispatches, which carry
3035
3378
  // their content per channel in the submitted request instead.
3036
3379
  target: e.string().optional(),
3037
3380
  message: e.string().optional(),
3038
- option: C.optional(),
3381
+ option: j.optional(),
3039
3382
  // Multi-channel dispatch fields.
3040
- campaign: a.nullish(),
3041
- member: a.nullish(),
3383
+ campaign: n.nullish(),
3384
+ member: n.nullish(),
3042
3385
  /**
3043
3386
  * The scheduled run this dispatch belongs to. With campaign and member it
3044
3387
  * identifies one intended send, so a redelivered queue job is recognised
3045
3388
  * rather than sent twice.
3046
3389
  */
3047
3390
  runAt: e.coerce.date().nullish(),
3048
- mode: u.nullish(),
3049
- channels: e.array(H).nullish(),
3391
+ mode: z.nullish(),
3392
+ channels: e.array(U).nullish(),
3050
3393
  /**
3051
3394
  * Local submission state, kept separate from the upstream outcome so an
3052
3395
  * interrupted worker can tell "never sent" from "sent, result unknown".
3053
3396
  */
3054
- state: Y.nullish(),
3055
- outcome: T.nullish(),
3397
+ state: ge.nullish(),
3398
+ outcome: E.nullish(),
3056
3399
  /** Upstream correlation id, preserved even when the request failed. */
3057
3400
  requestId: e.string().nullish(),
3058
- attempts: e.array(v).nullish(),
3401
+ attempts: e.array(J).nullish(),
3059
3402
  /** Credit consumed upstream, recorded for reconciliation. */
3060
- creditUsed: r.nullish(),
3061
- balanceAfter: r.nullish(),
3403
+ creditUsed: d.nullish(),
3404
+ balanceAfter: d.nullish(),
3062
3405
  error: e.string().nullish(),
3063
3406
  createdAt: e.coerce.date().nullish(),
3064
3407
  submittedAt: e.coerce.date().nullish(),
3065
3408
  settledAt: e.coerce.date().nullish()
3066
- }).describe(i.describe(K));
3067
- const X = e.object({
3409
+ }).describe(m.describe(de));
3410
+ const ue = e.object({
3068
3411
  target: e.string(),
3069
3412
  title: e.string().optional(),
3070
3413
  message: e.string(),
3071
- option: C,
3414
+ option: j,
3072
3415
  ref: e.string().optional()
3073
- }), q = e.object({
3416
+ }), he = e.object({
3074
3417
  memberId: e.string(),
3075
3418
  name: e.string().nullish(),
3076
3419
  phoneNumber: e.string().nullish(),
@@ -3085,7 +3428,7 @@ const X = e.object({
3085
3428
  e.object({
3086
3429
  businessId: e.string(),
3087
3430
  forceSend: e.boolean(),
3088
- mode: u,
3431
+ mode: z,
3089
3432
  channels: e.array(
3090
3433
  e.enum(["SMS", "WHATSAPP", "EMAIL", "APP_INBOX", "PUSH_NOTIFICATION"])
3091
3434
  ),
@@ -3097,34 +3440,34 @@ e.object({
3097
3440
  });
3098
3441
  e.object({
3099
3442
  requestId: e.string().nullish(),
3100
- status: T.nullish(),
3101
- attempts: e.array(v).nullish(),
3102
- creditUsed: r.nullish(),
3103
- balance: r.nullish()
3443
+ status: E.nullish(),
3444
+ attempts: e.array(J).nullish(),
3445
+ creditUsed: d.nullish(),
3446
+ balance: d.nullish()
3104
3447
  });
3105
- const Q = e.object({
3448
+ const _e = e.object({
3106
3449
  campaignId: e.string(),
3107
3450
  business: e.string(),
3108
3451
  runAt: e.coerce.date(),
3109
- recipient: q,
3452
+ recipient: he,
3110
3453
  /** Personalised, editor-data-free content keyed by channel. */
3111
3454
  content: e.record(e.string(), e.unknown()),
3112
- mode: u,
3113
- channels: e.array(H)
3455
+ mode: z,
3456
+ channels: e.array(U)
3114
3457
  });
3115
3458
  e.object({
3116
3459
  campaignId: e.string(),
3117
3460
  /** Absent only on multi-channel jobs, which carry `dispatch` instead. */
3118
- notification: X.optional(),
3461
+ notification: ue.optional(),
3119
3462
  business: e.string(),
3120
3463
  /**
3121
3464
  * Present only for multi-channel broadcasts. When set the job takes the
3122
3465
  * multi-channel dispatch path; when absent the legacy single-channel path
3123
3466
  * runs unchanged.
3124
3467
  */
3125
- dispatch: Q.optional()
3126
- }).superRefine((n, h) => {
3127
- !n.notification && !n.dispatch && h.addIssue({
3468
+ dispatch: _e.optional()
3469
+ }).superRefine((o, a) => {
3470
+ !o.notification && !o.dispatch && a.addIssue({
3128
3471
  code: e.ZodIssueCode.custom,
3129
3472
  message: "Job must carry either a notification or a dispatch"
3130
3473
  });
@@ -3133,19 +3476,19 @@ e.object({
3133
3476
  phone: e.string(),
3134
3477
  message: e.string()
3135
3478
  });
3136
- const b = e.object({
3479
+ const N = e.object({
3137
3480
  name: e.string().optional(),
3138
3481
  address: e.string()
3139
- }), Z = e.object({
3482
+ }), ye = e.object({
3140
3483
  filename: e.string(),
3141
3484
  content: e.instanceof(Uint8Array)
3142
3485
  });
3143
3486
  e.object({
3144
- from: b.optional(),
3145
- to: e.array(b),
3487
+ from: N.optional(),
3488
+ to: e.array(N),
3146
3489
  subject: e.string(),
3147
3490
  html: e.string().optional(),
3148
- attachments: e.array(Z).optional()
3491
+ attachments: e.array(ye).optional()
3149
3492
  });
3150
3493
  e.object({
3151
3494
  subject: e.string(),
@@ -3185,7 +3528,7 @@ e.object({
3185
3528
  billId: e.string()
3186
3529
  });
3187
3530
  e.object({
3188
- amount: O,
3531
+ amount: A,
3189
3532
  member: e.string(),
3190
3533
  bill: e.string(),
3191
3534
  otp: e.string().nullish(),
@@ -3194,15 +3537,15 @@ e.object({
3194
3537
  e.object({
3195
3538
  orderId: e.string()
3196
3539
  });
3197
- var S = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(S || {});
3198
- e.nativeEnum(S);
3540
+ var O = /* @__PURE__ */ ((o) => (o[o.feedMe = 0] = "feedMe", o[o.business = 1] = "business", o[o.restaurant = 2] = "restaurant", o))(O || {});
3541
+ e.nativeEnum(O);
3199
3542
  e.enum(["manage", "create", "read", "update", "delete"]);
3200
3543
  e.enum(["all", "restaurant", "business", "delivery", "agent"]);
3201
3544
  e.enum(["quota"]);
3202
- var N = /* @__PURE__ */ ((n) => (n.marketing = "business::marketing", n.campaign = "business::campaign", n.counter = "business::counter", n.permission = "business::permission", n.role = "business::role", n))(N || {});
3203
- e.nativeEnum(N);
3545
+ var I = /* @__PURE__ */ ((o) => (o.marketing = "business::marketing", o.campaign = "business::campaign", o.counter = "business::counter", o.permission = "business::permission", o.role = "business::role", o))(I || {});
3546
+ e.nativeEnum(I);
3204
3547
  e.enum(["restaurant"]);
3205
- const $ = e.object({
3548
+ const fe = e.object({
3206
3549
  label: e.string(),
3207
3550
  subject: e.union([e.string(), e.array(e.string())]),
3208
3551
  actions: e.union([e.string(), e.array(e.string())]),
@@ -3212,41 +3555,41 @@ const $ = e.object({
3212
3555
  reason: e.string().optional()
3213
3556
  });
3214
3557
  e.object({
3215
- _id: a,
3558
+ _id: n,
3216
3559
  businessId: e.string(),
3217
3560
  userId: e.string(),
3218
3561
  email: e.string().nullish(),
3219
3562
  phoneNo: e.string().nullish(),
3220
- permissions: e.array(e.lazy(() => $))
3563
+ permissions: e.array(e.lazy(() => fe))
3221
3564
  }).describe(
3222
- i.describe({
3565
+ m.describe({
3223
3566
  collectionName: "PermissionUsers",
3224
3567
  transform: {
3225
3568
  _id: "oid"
3226
3569
  }
3227
3570
  })
3228
3571
  );
3229
- const U = e.object({
3572
+ const R = e.object({
3230
3573
  userId: e.string(),
3231
3574
  level: e.number(),
3232
3575
  role: e.string().optional(),
3233
3576
  businessId: e.string().optional(),
3234
3577
  restaurantId: e.string().optional()
3235
- }), ee = e.function().args(e.any(), U).returns(e.boolean()), te = e.function().args(U).returns(e.promise(e.array(e.any())));
3578
+ }), be = e.function().args(e.any(), R).returns(e.boolean()), He = e.function().args(R).returns(e.promise(e.array(e.any())));
3236
3579
  e.object({
3237
- isAdmin: ee,
3238
- getRules: te
3580
+ isAdmin: be,
3581
+ getRules: He
3239
3582
  });
3240
3583
  e.object({
3241
- transactions: e.array(R),
3242
- collections: e.array(L)
3584
+ transactions: e.array(F),
3585
+ collections: e.array(G)
3243
3586
  });
3244
- const P = e.enum([
3587
+ const L = e.enum([
3245
3588
  "ROCK_PAPER_SCISSOR"
3246
3589
  ]);
3247
- P.enum.ROCK_PAPER_SCISSOR + "";
3590
+ L.enum.ROCK_PAPER_SCISSOR + "";
3248
3591
  e.object({
3249
- type: P
3592
+ type: L
3250
3593
  });
3251
3594
  e.object({
3252
3595
  host: e.string().url(),
@@ -3255,7 +3598,7 @@ e.object({
3255
3598
  roomId: e.string()
3256
3599
  });
3257
3600
  e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
3258
- const ae = {
3601
+ const ze = {
3259
3602
  collectionName: "MarketingMaterials",
3260
3603
  transform: {
3261
3604
  _id: "oid",
@@ -3263,14 +3606,14 @@ const ae = {
3263
3606
  }
3264
3607
  };
3265
3608
  e.object({
3266
- _id: a,
3267
- business: a,
3609
+ _id: n,
3610
+ business: n,
3268
3611
  imageUrl: e.string().url(),
3269
3612
  headline: e.string(),
3270
3613
  caption: e.string(),
3271
3614
  editedAt: e.coerce.date(),
3272
3615
  deletedAt: e.coerce.date().optional()
3273
- }).describe(i.describe(ae));
3616
+ }).describe(m.describe(ze));
3274
3617
  e.object({
3275
3618
  id: e.number(),
3276
3619
  name: e.string(),
@@ -3290,12 +3633,12 @@ e.object({
3290
3633
  phone: e.string().optional(),
3291
3634
  email: e.string().optional()
3292
3635
  });
3293
- const ne = e.enum([
3636
+ const Te = e.enum([
3294
3637
  "PENDING",
3295
3638
  "SUCCESS",
3296
3639
  "FAILED",
3297
3640
  "RETRYING"
3298
- ]), oe = {
3641
+ ]), Ce = {
3299
3642
  collectionName: "WebhookLogs",
3300
3643
  transform: {
3301
3644
  _id: "oid",
@@ -3303,39 +3646,39 @@ const ne = e.enum([
3303
3646
  }
3304
3647
  };
3305
3648
  e.object({
3306
- _id: a,
3307
- business: a,
3649
+ _id: n,
3650
+ business: n,
3308
3651
  type: e.string(),
3309
3652
  payload: e.record(e.any()),
3310
- status: ne,
3653
+ status: Te,
3311
3654
  response: e.any().optional(),
3312
3655
  error: e.string().optional()
3313
- }).describe(i.describe(oe));
3314
- const ie = e.enum(["AUTO", "MANUAL"]);
3656
+ }).describe(m.describe(Ce));
3657
+ const ve = e.enum(["AUTO", "MANUAL"]);
3315
3658
  e.enum(["IN_PROGRESS", "COMPLETED"]);
3316
- const j = e.object({
3317
- _id: a,
3659
+ const x = e.object({
3660
+ _id: n,
3318
3661
  name: e.string().min(1, "Name is required").max(50),
3319
- type: ie,
3320
- event: x.optional()
3321
- }), le = e.object({
3662
+ type: ve,
3663
+ event: V.optional()
3664
+ }), Se = e.object({
3322
3665
  from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
3323
3666
  to: e.number().int("Must be integer").nullish()
3324
- }).superRefine((n, h) => {
3325
- n.from && n.to && n.from > n.to && h.addIssue({
3667
+ }).superRefine((o, a) => {
3668
+ o.from && o.to && o.from > o.to && a.addIssue({
3326
3669
  code: "custom",
3327
3670
  message: "Max referral count must be more than min referral count"
3328
3671
  });
3329
- }), re = e.object({
3330
- threshold: le,
3331
- rewards: e.array(a),
3332
- pf_reward: e.array(_).optional()
3333
- }), y = e.object({
3672
+ }), Ne = e.object({
3673
+ threshold: Se,
3674
+ rewards: e.array(n),
3675
+ pf_reward: e.array(T).optional()
3676
+ }), C = e.object({
3334
3677
  id: e.string(),
3335
3678
  name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
3336
- rule: I.optional(),
3337
- rewards: e.array(re)
3338
- }), ce = {
3679
+ rule: B.optional(),
3680
+ rewards: e.array(Ne)
3681
+ }), Ue = {
3339
3682
  collectionName: "ReferralRecords",
3340
3683
  transform: {
3341
3684
  _id: "oid",
@@ -3344,25 +3687,25 @@ const j = e.object({
3344
3687
  referee: "oid",
3345
3688
  refereeReward: "oid"
3346
3689
  }
3347
- }, pe = e.object({
3690
+ }, Pe = e.object({
3348
3691
  completedAt: e.coerce.date(),
3349
- criteria: a,
3692
+ criteria: n,
3350
3693
  ref: e.string()
3351
- }), me = e.object({
3352
- _id: a,
3353
- business: a,
3354
- referer: a,
3355
- referee: a,
3356
- criteria: e.array(j),
3357
- reward: e.array(y),
3358
- refereeReward: e.array(a).optional(),
3359
- criteria_progress: e.array(pe),
3694
+ }), je = e.object({
3695
+ _id: n,
3696
+ business: n,
3697
+ referer: n,
3698
+ referee: n,
3699
+ criteria: e.array(x),
3700
+ reward: e.array(C),
3701
+ refereeReward: e.array(n).optional(),
3702
+ criteria_progress: e.array(Pe),
3360
3703
  status: e.string(),
3361
- pf_referer: c.optional(),
3362
- pf_referee: c.optional(),
3363
- pf_refereeReward: e.array(_).optional()
3364
- }).describe(i.describe(ce));
3365
- me.pick({
3704
+ pf_referer: g.optional(),
3705
+ pf_referee: g.optional(),
3706
+ pf_refereeReward: e.array(T).optional()
3707
+ }).describe(m.describe(Ue));
3708
+ je.pick({
3366
3709
  _id: !0,
3367
3710
  business: !0,
3368
3711
  referer: !0,
@@ -3370,79 +3713,83 @@ me.pick({
3370
3713
  criteria_progress: !0,
3371
3714
  criteria: !0
3372
3715
  }).extend({
3373
- pf_referee: c.pick({
3716
+ pf_referee: g.pick({
3374
3717
  _id: !0,
3375
3718
  name: !0,
3376
3719
  phoneNumber: !0,
3377
3720
  photoUrl: !0
3378
3721
  })
3379
3722
  });
3380
- const se = {
3723
+ const Ee = {
3381
3724
  collectionName: "ReferralProgram",
3382
3725
  transform: {
3383
3726
  _id: "oid",
3384
3727
  business: "oid"
3385
3728
  }
3386
- }, J = e.object({
3387
- _id: a,
3388
- business: a,
3729
+ }, D = e.object({
3730
+ _id: n,
3731
+ business: n,
3389
3732
  term_and_condition: e.string().optional(),
3390
- refereeReward: e.array(a).optional(),
3391
- reward: e.array(y),
3392
- criteria: e.array(j)
3393
- }).describe(i.describe(se));
3733
+ refereeReward: e.array(n).optional(),
3734
+ reward: e.array(C),
3735
+ criteria: e.array(x)
3736
+ }).describe(m.describe(Ee));
3394
3737
  e.object({
3395
- referer: a,
3396
- referee: a,
3397
- business: a
3738
+ referer: n,
3739
+ referee: n,
3740
+ business: n
3398
3741
  });
3399
3742
  e.object({
3400
- program: J.pick({
3743
+ program: D.pick({
3401
3744
  _id: !0,
3402
3745
  business: !0,
3403
3746
  term_and_condition: !0
3404
3747
  }).extend({
3405
- reward: y.optional(),
3406
- pf_refereeReward: e.array(_).optional()
3748
+ reward: C.optional(),
3749
+ pf_refereeReward: e.array(T).optional()
3407
3750
  }),
3408
3751
  referralCount: e.number(),
3409
3752
  successReferralCount: e.number(),
3410
- referredBy: c.pick({
3753
+ referredBy: g.pick({
3411
3754
  _id: !0,
3412
3755
  name: !0,
3413
3756
  phoneNumber: !0,
3414
3757
  photoUrl: !0
3415
3758
  }).optional()
3416
3759
  });
3417
- J.extend({
3760
+ D.extend({
3418
3761
  updateReferralRecord: e.boolean().optional()
3419
3762
  });
3420
- const ge = e.object({
3763
+ const Je = e.object({
3421
3764
  facebookPageId: e.string(),
3422
3765
  pageName: e.string(),
3423
3766
  pageProfileImageUrl: e.string(),
3424
3767
  pageAccessToken: e.string().optional(),
3425
- locationIds: e.array(a)
3426
- }), de = e.object({
3427
- locationId: a.nullable(),
3768
+ locationIds: e.array(n)
3769
+ }), Oe = e.object({
3770
+ locationId: n.nullable(),
3428
3771
  googleLocationName: e.string(),
3429
3772
  displayName: e.string().optional()
3430
- }), he = e.object({
3773
+ }), Ie = e.object({
3431
3774
  accessToken: e.string().nullable(),
3432
3775
  refreshToken: e.string().nullable(),
3433
3776
  accessTokenExpiresAt: e.date().nullable(),
3434
- locations: e.array(de)
3435
- }), ue = e.object({
3777
+ locations: e.array(Oe),
3778
+ lastSyncTime: e.coerce.date().nullish(),
3779
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3780
+ }), Re = e.object({
3436
3781
  token: e.string().nullable(),
3437
- pages: e.array(ge)
3782
+ pages: e.array(Je),
3783
+ lastSyncTime: e.coerce.date().nullish(),
3784
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3438
3785
  });
3439
3786
  e.object({
3440
- _id: a,
3441
- businessId: a,
3442
- google: he.nullable(),
3443
- facebook: ue.nullable()
3787
+ _id: n,
3788
+ businessId: n,
3789
+ google: Ie.nullable(),
3790
+ facebook: Re.nullable()
3444
3791
  }).describe(
3445
- i.describe({
3792
+ m.describe({
3446
3793
  collectionName: "ReviewSourceConfig",
3447
3794
  transform: {
3448
3795
  _id: "oid",
@@ -3486,7 +3833,9 @@ e.object({
3486
3833
  displayName: e.string().optional(),
3487
3834
  locationId: e.string().nullable()
3488
3835
  })
3489
- )
3836
+ ),
3837
+ lastSyncTime: e.string().datetime().nullable(),
3838
+ syncFrequency: e.number().int().min(1).max(30)
3490
3839
  }).nullable(),
3491
3840
  facebook: e.object({
3492
3841
  token: e.string().nullable(),
@@ -3497,30 +3846,32 @@ e.object({
3497
3846
  pageProfileImageUrl: e.string(),
3498
3847
  locationIds: e.array(e.string())
3499
3848
  })
3500
- )
3849
+ ),
3850
+ lastSyncTime: e.string().datetime().nullable(),
3851
+ syncFrequency: e.number().int().min(1).max(30)
3501
3852
  }).nullable()
3502
3853
  });
3503
- const p = e.object({
3854
+ const u = e.object({
3504
3855
  name: e.string(),
3505
3856
  pictureUrl: e.string(),
3506
3857
  phoneNumber: e.string().optional()
3507
- }), _e = p.extend({
3858
+ }), Le = u.extend({
3508
3859
  isAnonymous: e.boolean().optional()
3509
- }), ye = p.extend({
3860
+ }), xe = u.extend({
3510
3861
  id: e.string().optional()
3511
- }), m = e.object({
3862
+ }), h = e.object({
3512
3863
  comment: e.string(),
3513
3864
  updateTime: e.coerce.date()
3514
3865
  });
3515
3866
  e.object({
3516
3867
  comment: e.string().trim().min(1).max(4096)
3517
3868
  });
3518
- const l = e.object({
3869
+ const s = e.object({
3519
3870
  externalId: e.string().optional(),
3520
3871
  thumbnailUrl: e.string(),
3521
3872
  thumbnailLabel: e.string(),
3522
3873
  videoUrl: e.string().optional()
3523
- }), fe = {
3874
+ }), De = {
3524
3875
  collectionName: "Reviews",
3525
3876
  transform: {
3526
3877
  _id: "oid",
@@ -3528,31 +3879,31 @@ const l = e.object({
3528
3879
  reviewerId: "oid",
3529
3880
  restaurantId: "oid"
3530
3881
  }
3531
- }, E = e.enum([
3882
+ }, w = e.enum([
3532
3883
  "google",
3533
3884
  "facebook",
3534
3885
  "feedme",
3535
3886
  "feedvibe"
3536
3887
  ]);
3537
- E.options;
3888
+ w.options;
3538
3889
  e.enum(["google", "facebook"]);
3539
- const be = e.enum([
3890
+ const we = e.enum([
3540
3891
  "createTime_desc",
3541
3892
  "createTime_asc",
3542
3893
  "rating_asc",
3543
3894
  "rating_desc"
3544
3895
  ]);
3545
3896
  e.object({
3546
- source: E.array().optional(),
3897
+ source: w.array().optional(),
3547
3898
  dateFrom: e.string().datetime({ offset: !0 }).optional(),
3548
3899
  dateTo: e.string().datetime({ offset: !0 }).optional(),
3549
3900
  locationId: e.string().optional(),
3550
3901
  excludeDeleted: e.boolean().optional(),
3551
- sort: be.optional(),
3902
+ sort: we.optional(),
3552
3903
  limit: e.coerce.number().int().positive().optional(),
3553
3904
  skip: e.coerce.number().int().min(0).optional()
3554
3905
  });
3555
- const Ve = e.object({
3906
+ const pt = e.object({
3556
3907
  averageScore: e.number(),
3557
3908
  total: e.number().int().nonnegative(),
3558
3909
  starCounts: e.array(
@@ -3561,54 +3912,54 @@ const Ve = e.object({
3561
3912
  count: e.number().int().nonnegative()
3562
3913
  })
3563
3914
  )
3564
- }), s = e.object({
3915
+ }), _ = e.object({
3565
3916
  name: e.string(),
3566
3917
  pictureUrl: e.string().optional(),
3567
3918
  phoneNumber: e.string().optional()
3568
- }), He = s.extend({
3919
+ }), Ae = _.extend({
3569
3920
  _id: e.string().optional()
3570
- }), ze = s.extend({
3921
+ }), Me = _.extend({
3571
3922
  _id: e.string()
3572
- }), Ce = s.extend({
3923
+ }), Fe = _.extend({
3573
3924
  isAnonymous: e.boolean().optional()
3574
- }), Te = s.extend({
3925
+ }), Ge = _.extend({
3575
3926
  id: e.string().optional()
3576
- }), g = e.object({
3577
- _id: a,
3927
+ }), y = e.object({
3928
+ _id: n,
3578
3929
  comment: e.string(),
3579
3930
  createTime: e.coerce.date(),
3580
3931
  updateTime: e.coerce.date().nullish(),
3581
- restaurantId: a,
3932
+ restaurantId: n,
3582
3933
  restaurantName: e.string()
3583
- }), ve = g.extend({
3934
+ }), ke = y.extend({
3584
3935
  source: e.literal("google"),
3585
3936
  externalId: e.string().min(1),
3586
3937
  translatedComment: e.string().optional(),
3587
- reviewer: Ce.optional(),
3588
- reply: m.optional(),
3589
- mediaItems: e.array(l),
3938
+ reviewer: Fe.optional(),
3939
+ reply: h.optional(),
3940
+ mediaItems: e.array(s),
3590
3941
  starRating: e.number(),
3591
3942
  locationName: e.string(),
3592
3943
  locationDisplayName: e.string(),
3593
3944
  originalUrl: e.string().optional()
3594
- }), Se = g.extend({
3945
+ }), Be = y.extend({
3595
3946
  source: e.literal("facebook"),
3596
3947
  externalId: e.string().min(1),
3597
- reviewer: Te.optional(),
3948
+ reviewer: Ge.optional(),
3598
3949
  isPositive: e.boolean().optional(),
3599
3950
  pageId: e.string(),
3600
3951
  pageName: e.string()
3601
- }), Ne = g.extend({
3952
+ }), Ve = y.extend({
3602
3953
  source: e.literal("feedme"),
3603
- reviewer: He.optional(),
3604
- reply: m.optional(),
3954
+ reviewer: Ae.optional(),
3955
+ reply: h.optional(),
3605
3956
  starRating: e.number(),
3606
- mediaItems: e.array(l),
3957
+ mediaItems: e.array(s),
3607
3958
  billId: e.string()
3608
- }), Ue = g.extend({
3959
+ }), We = y.extend({
3609
3960
  source: e.literal("feedvibe"),
3610
3961
  externalId: e.string().min(1),
3611
- reviewer: ze.optional(),
3962
+ reviewer: Me.optional(),
3612
3963
  rating: e.object({
3613
3964
  overall: e.number(),
3614
3965
  food: e.number(),
@@ -3616,67 +3967,67 @@ const Ve = e.object({
3616
3967
  atmosphere: e.number()
3617
3968
  }),
3618
3969
  verified: e.boolean(),
3619
- mediaItems: e.array(l).default([])
3970
+ mediaItems: e.array(s).default([])
3620
3971
  });
3621
3972
  e.discriminatedUnion("source", [
3622
- ve,
3623
- Se,
3624
- Ne,
3625
- Ue
3973
+ ke,
3974
+ Be,
3975
+ Ve,
3976
+ We
3626
3977
  ]);
3627
3978
  e.object({
3628
3979
  comment: e.string(),
3629
3980
  starRating: e.number(),
3630
3981
  billId: e.string(),
3631
3982
  isAnonymous: e.boolean(),
3632
- mediaItems: e.array(l).optional()
3983
+ mediaItems: e.array(s).optional()
3633
3984
  });
3634
3985
  e.object({
3635
3986
  name: e.string().trim().min(1),
3636
3987
  phoneNumber: e.string().trim().min(1).optional()
3637
3988
  });
3638
- const d = e.object({
3639
- _id: a,
3640
- businessId: a,
3989
+ const f = e.object({
3990
+ _id: n,
3991
+ businessId: n,
3641
3992
  comment: e.string(),
3642
3993
  createTime: e.coerce.date(),
3643
3994
  updateTime: e.coerce.date().nullish(),
3644
- restaurantId: a,
3995
+ restaurantId: n,
3645
3996
  restaurantName: e.string(),
3646
3997
  deletedAt: e.coerce.date().optional()
3647
- }), Pe = d.extend({
3998
+ }), Ye = f.extend({
3648
3999
  source: e.literal("google"),
3649
4000
  externalId: e.string().min(1),
3650
4001
  translatedComment: e.string().optional(),
3651
- reviewer: _e.optional(),
3652
- reply: m.optional(),
3653
- mediaItems: e.array(l),
4002
+ reviewer: Le.optional(),
4003
+ reply: h.optional(),
4004
+ mediaItems: e.array(s),
3654
4005
  starRating: e.number(),
3655
4006
  locationName: e.string(),
3656
4007
  locationDisplayName: e.string(),
3657
4008
  originalUrl: e.string().optional()
3658
- }), je = d.extend({
4009
+ }), Ke = f.extend({
3659
4010
  source: e.literal("facebook"),
3660
4011
  externalId: e.string().min(1),
3661
- reviewer: ye.optional(),
4012
+ reviewer: xe.optional(),
3662
4013
  isPositive: e.boolean().optional(),
3663
4014
  pageId: e.string(),
3664
4015
  pageName: e.string()
3665
- }), Je = d.extend({
4016
+ }), qe = f.extend({
3666
4017
  source: e.literal("feedme"),
3667
4018
  isAnonymous: e.boolean(),
3668
4019
  metadata: e.record(e.string(), e.unknown()).optional(),
3669
- reviewerId: a.optional(),
3670
- reviewer: p.optional(),
3671
- reply: m.optional(),
4020
+ reviewerId: n.optional(),
4021
+ reviewer: u.optional(),
4022
+ reply: h.optional(),
3672
4023
  starRating: e.number(),
3673
4024
  billId: e.string(),
3674
- mediaItems: e.array(l)
3675
- }), Ee = d.extend({
4025
+ mediaItems: e.array(s)
4026
+ }), Xe = f.extend({
3676
4027
  source: e.literal("feedvibe"),
3677
4028
  externalId: e.string().min(1),
3678
- reviewerId: a,
3679
- reviewer: p,
4029
+ reviewerId: n,
4030
+ reviewer: u,
3680
4031
  rating: e.object({
3681
4032
  overall: e.number(),
3682
4033
  food: e.number(),
@@ -3684,23 +4035,29 @@ const d = e.object({
3684
4035
  atmosphere: e.number()
3685
4036
  }),
3686
4037
  verified: e.boolean(),
3687
- mediaItems: e.array(l).default([])
4038
+ mediaItems: e.array(s).default([])
3688
4039
  });
3689
4040
  e.discriminatedUnion("source", [
3690
- Pe,
3691
- je,
3692
- Je,
3693
- Ee
3694
- ]).describe(i.describe(fe));
4041
+ Ye,
4042
+ Ke,
4043
+ qe,
4044
+ Xe
4045
+ ]).describe(m.describe(De));
3695
4046
  export {
3696
- D as F,
3697
- Ge as S,
3698
- Me as T,
3699
- Be as W,
3700
- ke as a,
3701
- re as b,
3702
- j as c,
3703
- y as d,
3704
- Ve as e,
3705
- m as f
4047
+ ae as F,
4048
+ t as R,
4049
+ lt as S,
4050
+ it as T,
4051
+ ct as W,
4052
+ H as a,
4053
+ rt as b,
4054
+ C as c,
4055
+ Ne as d,
4056
+ x as e,
4057
+ $ as f,
4058
+ Z as g,
4059
+ pt as h,
4060
+ W as i,
4061
+ h as j,
4062
+ q as s
3706
4063
  };