@feedmepos/mf-connect 0.1.114-prod → 0.1.115-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 (157) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-DMYXrCc7.js → App-43mZfFAr.js} +700 -654
  3. package/dist/AuditLogs-BPpdm96t.js +2016 -0
  4. package/dist/{Bin-CHZolo56.js → Bin-CA7v180Y.js} +8 -8
  5. package/dist/Broadcast-qmdifF2Y.js +306 -0
  6. package/dist/{CampaignAnalytic-DgZvsUoF.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C42uL_JO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
  8. package/dist/{Card-wRFTJwJ9.js → Card-D8icsk7L.js} +25 -24
  9. package/dist/{Collections-9G-_9Etz.js → Collections--THcD-E_.js} +197 -185
  10. package/dist/{Credit-Bl7IDMCU.js → Credit-JrbtVMBp.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BVLJeofG.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Q1f6EQW3.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +32 -32
  14. package/dist/{Experience-Cs2iViLv.js → Experience-CFeRqBoj.js} +32 -31
  15. package/dist/{FileSaver.min-B3Levdbu.js → FileSaver.min-CCXIBm58.js} +1 -1
  16. package/dist/{Game-oXURgzan.js → Game-CPxq6Ex3.js} +19 -18
  17. package/dist/{GiftCardSetup-C2Wu-dRl.js → GiftCardSetup-D0esVZDp.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Da2e89Um.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
  19. package/dist/{Goals-B_xEM7gf.js → Goals-DaKI6uXt.js} +4 -4
  20. package/dist/Grab-BWzdN_cd.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BRJR1heE.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
  22. package/dist/{Index-kuT6W6R_.js → Index-2kENoaZm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-7JqHfSk-.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CI_4S7tW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
  25. package/dist/{LoyaltyDashboard-CqxHdZcm.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
  26. package/dist/MainLayout-DwnjGXh6.js +4 -0
  27. package/dist/{MainLayout-CAERFIms.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +5 -4
  28. package/dist/Marketing-DCco__2F.js +273 -0
  29. package/dist/MarketingMaterialEdit-BbgFtrYP.js +1037 -0
  30. package/dist/{Member-B8VZEn9t.js → Member-B--nYyr0.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-B31lVLKh.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +43 -50
  32. package/dist/{MemberImportHistory-D9tgHnTS.js → MemberImportHistory-D52Y4RTC.js} +7 -7
  33. package/dist/{MemberList-Hw_xQY1i.js → MemberList-13Owa1fj.js} +103 -105
  34. package/dist/{MemberTransactions-DiBO4plw.js → MemberTransactions-CpXEWNbq.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CbFt5X89.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BE_-Ed4z.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
  37. package/dist/{Mission-DpYei3aF.js → Mission-Ci-UzXSu.js} +22 -21
  38. package/dist/{Overview-CARquJCS.js → Overview-CKxSfAGF.js} +145 -144
  39. package/dist/{Overview-BFQMmyT6.js → Overview-CXen9Ram.js} +23 -22
  40. package/dist/{Point-Dd2ykwNv.js → Point-CR3YOaag.js} +22 -21
  41. package/dist/{Promotion-DXl-W7np.js → Promotion-tw3J4ul-.js} +137 -131
  42. package/dist/{Queue-Cd3N-4iB.js → Queue-BZGA5ZXt.js} +47 -46
  43. package/dist/{Record-C3HdDsh5.js → Record-BTevVXnT.js} +9 -9
  44. package/dist/{Review-Bif3Ub9Z.js → Review-BU7c8ZF0.js} +2 -2
  45. package/dist/ReviewFacebookCallback-BnMF6Arh.js +225 -0
  46. package/dist/{ReviewGoogleCallback-i-RNLlLm.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
  47. package/dist/{Reward-DHxzrR_7.js → Reward-jlA_7cxz.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DcrFlcSo.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js +1923 -0
  50. package/dist/{Segment-Cjpxordk.js → Segment-C1Bwm--Q.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-6u21xBu6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BOXVzfer.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
  53. package/dist/Setting-CDM4RhLW.js +574 -0
  54. package/dist/{SettingAdvertisements-aog5fz32.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
  55. package/dist/Settings-D-0tvZRr.js +286 -0
  56. package/dist/{Store-Bq3kw1l2.js → Store-C56dXtc4.js} +31 -30
  57. package/dist/{StoreRewards-ZGXKEM09.js → StoreRewards-DQ1Q6WS6.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js +7007 -0
  60. package/dist/{Tier-CfgpEHY7.js → Tier-D4CPZqw7.js} +2576 -687
  61. package/dist/{Title-B2itYWeD.js → Title-DCbwhUic.js} +94 -92
  62. package/dist/{Transaction-hJ5ygIcf.js → Transaction-C5LrasXr.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-8BgGlpTh.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +26 -26
  64. package/dist/{Voucher-TG47pGR3.js → Voucher-rrVbNZKR.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjuXCTxg.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +16 -16
  66. package/dist/WhatsappAccount-oJDo5zTr.js +159 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js +39 -0
  68. package/dist/WhatsappBot-Cl64wG_F.js +876 -0
  69. package/dist/WhatsappBotLogs-D3uT4EiB.js +372 -0
  70. package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
  71. package/dist/WhatsappLayout-C639d2HP.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js +253 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BRs-gbP0.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
  74. package/dist/{app-tPHYkJcQ.js → app-CgimGODl.js} +10610 -8223
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-BHDVnGj2.js → base.export-D2P6HFvo.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-HLyWfrXY.js → business-Bu5TqSA0.js} +1 -1
  79. package/dist/campaign-BFIXSgdJ.js +400 -0
  80. package/dist/{campaign-5zFgUNLw.js → campaign-zJxttSIk.js} +31 -25
  81. package/dist/{campaign.enum-BOkDnP2g.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/{campaign.fn-BIAoVtJj.js → campaign.fn-gvjlcEfe.js} +78 -78
  83. package/dist/{collectible.enum-BbZSAfys.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-DPSgBHnz.js → collection.fn-DOm0HsSh.js} +2 -2
  85. package/dist/{currency-BVrMqU6-.js → currency-BpbQvbm8.js} +1 -1
  86. package/dist/duplicateCampaign-CvsvjRE9.js +51 -0
  87. package/dist/{effect-BBifVx76.js → effect-D-GtNB3n.js} +1 -1
  88. package/dist/{email-addresses-9C7xHTNv.js → email-addresses-BKMoAtMi.js} +2 -2
  89. package/dist/feature-flag-BJ_eyKsq.js +868 -0
  90. package/dist/feature-flag-Bo-k5sIG.js +50 -0
  91. package/dist/google-BQK68wbe.js +5 -0
  92. package/dist/{helper-C08jyQNK.js → helper-CkfjBgMM.js} +1 -1
  93. package/dist/{index-Dhyqf1s8.js → index-B6kU3PkV.js} +2700 -2613
  94. package/dist/{index-BgwZGunW.js → index-BAtUrtqM.js} +19 -6
  95. package/dist/index-BKsxIwbi.js +14571 -0
  96. package/dist/{index-DZ-q5O-V.js → index-BdEXUNoG.js} +4 -4
  97. package/dist/{index-hIUtD2eY.js → index-Bhl5IRXy.js} +11 -10
  98. package/dist/{index-kCbkOivd.js → index-BpTIulTX.js} +1 -1
  99. package/dist/index-C-iwb2Ln.js +109 -0
  100. package/dist/{index-Ciw2TZxV.js → index-CCEXSPxk.js} +8 -7
  101. package/dist/{index-CUle4c2B.js → index-CIej31pF.js} +4 -3
  102. package/dist/{index-ihw-WFCa.js → index-CQ8XFbBk.js} +2 -2
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-CEe1kJ0T.js → index-CfQuYqXn.js} +1 -1
  105. package/dist/{index-C_WoO58V.js → index-CuREApMc.js} +8 -7
  106. package/dist/{index-NJSI4wX4.js → index-D0JK99Ko.js} +693 -231
  107. package/dist/{index-DnRMNmUA.js → index-DKxN1mMS.js} +396 -232
  108. package/dist/index-DQ8JJhxs.js +74 -0
  109. package/dist/{index-D24Q28cH.js → index-DUAZOMVJ.js} +1 -1
  110. package/dist/{index-Yo0tP8KJ.js → index-DqGs6RJG.js} +683 -581
  111. package/dist/{index-B_334Y_i.js → index-DwU3fsLW.js} +29 -15
  112. package/dist/{index-hSRM1smQ.js → index-LygS9WsG.js} +8028 -10767
  113. package/dist/{index-96ZiAKj_.js → index-feCrYhi6.js} +1 -1
  114. package/dist/{index-Dk-jg0wN.js → index-zTvr2GR4.js} +2 -2
  115. package/dist/{index.esm2017-hN99SQTb.js → index.esm2017-DZi9IQPS.js} +209 -209
  116. package/dist/{loading-CVuY4vQ4.js → loading-Brid2wnu.js} +1 -1
  117. package/dist/{lodash-GFl9_FMH.js → lodash-C1epw3Kv.js} +1 -1
  118. package/dist/{member-import-CshTzabx.js → member-import-DAIxTIiu.js} +6 -5
  119. package/dist/{membership-S0KES3Ex.js → membership-BZmljFhF.js} +3 -3
  120. package/dist/{money-JxdX8ru4.js → money-cLcyGcSZ.js} +1 -1
  121. package/dist/{number-BRLwa-mB.js → number-C2jPLJr2.js} +1 -1
  122. package/dist/objectid-C-wocWKI.js +145 -0
  123. package/dist/{onboarding-BSKYeyP7.js → onboarding-oRfy_g05.js} +25 -25
  124. package/dist/{onboardingSetup-BqT52VRm.js → onboardingSetup-BLD6m8HY.js} +2 -2
  125. package/dist/{plugins-BR_wmMFJ.js → plugins-CUsr9vB0.js} +3 -3
  126. package/dist/{MarketingMaterialEdit-BvIthCHG.js → remy-icon-BhUGu2NI.js} +2 -1031
  127. package/dist/{reward-CpCGg_W2.js → reward-UOT03odb.js} +1 -1
  128. package/dist/{rule-Dbg9e8MO.js → rule-BgJnPjkI.js} +572 -492
  129. package/dist/style.css +1 -1
  130. package/dist/template-BZyFhr73.js +188 -0
  131. package/dist/{timezone-CDVa-xPr.js → timezone-BXA4wq7Y.js} +1 -1
  132. package/dist/{transaction.fn-DrTBoF9T.js → transaction.fn-CQ4fpRt3.js} +2 -2
  133. package/dist/{trigger-wqGwQfB2.js → trigger-DXJCGT0q.js} +8 -8
  134. package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
  135. package/dist/{usePagination-fODgpZZ8.js → usePagination-Pp4okWr8.js} +1 -1
  136. package/dist/{user-DaLUK1dk.js → user-B3gXcAIy.js} +1 -1
  137. package/dist/vue-i18n-DWGiC_vs.js +2365 -0
  138. package/dist/{xlsx-Bl4_Dtrq.js → xlsx-CCaDUTgW.js} +651 -651
  139. package/dist/{zod-CAzWyVqj.js → zod-CPwjOxvW.js} +1 -1
  140. package/package.json +12 -3
  141. package/dist/Broadcast-ByWvxVhW.js +0 -271
  142. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DGpQfV5T.js +0 -2431
  143. package/dist/Marketing-KgcwGErU.js +0 -236
  144. package/dist/ReviewFacebookCallback-mJF54-9l.js +0 -238
  145. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-39f3I4BB.js +0 -1883
  146. package/dist/Setting-Dl9MelHz.js +0 -2036
  147. package/dist/Settings-DvCCClIP.js +0 -179
  148. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DscLAF0p.js +0 -1264
  149. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l_v4FHO0.js +0 -142
  150. package/dist/campaign-awCRccgX.js +0 -228
  151. package/dist/google-C3S8u0mT.js +0 -4
  152. package/dist/index-CoNJdOx7.js +0 -51
  153. package/dist/objectid-CEHN25HN.js +0 -145
  154. package/dist/rule-builder-BEIjxsE0.js +0 -102
  155. package/dist/template-CS-lExgI.js +0 -236
  156. package/dist/useMarketingMaterialActions-DC0gIyIZ.js +0 -96
  157. package/dist/vue-i18n-Dx-KXojZ.js +0 -2365
@@ -1,11 +1,187 @@
1
- import { z as e, F as a, m as i, b as U } from "./index-hSRM1smQ.js";
2
- import { d as P } from "./index-Dhyqf1s8.js";
3
- import { R as t } from "./rule-builder-BEIjxsE0.js";
4
- import { i as o } from "./helper-C08jyQNK.js";
5
- import { B as j, C as J, A as r } from "./index-Yo0tP8KJ.js";
6
- import { d as E } from "./index-DnRMNmUA.js";
7
- import { F as d } from "./index-C_WoO58V.js";
8
- const Ee = {
1
+ import { F as n, m, b as A } from "./index-LygS9WsG.js";
2
+ import { z as e } from "./index-C_H8jFYf.js";
3
+ import { l as M, m as F, n as G, o as g } from "./index-DqGs6RJG.js";
4
+ import { _ as k, l as v, f as B } from "./index-B6kU3PkV.js";
5
+ import { i as p } from "./helper-CkfjBgMM.js";
6
+ import { d as z, b as U, e as d } from "./index-BKsxIwbi.js";
7
+ import { d as V } from "./index-DKxN1mMS.js";
8
+ import { F as T } from "./index-CuREApMc.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 = {
9
185
  PROMOTION: {
10
186
  name: "Promotion Template",
11
187
  description: "Promotion template for campaign creation.",
@@ -411,7 +587,7 @@ const Ee = {
411
587
  // },
412
588
  hideInApp: !0
413
589
  },
414
- configs: o("VOUCHER", {
590
+ configs: p("VOUCHER", {
415
591
  name: "",
416
592
  business: null,
417
593
  noCampaign: !1
@@ -1401,7 +1577,7 @@ const Ee = {
1401
1577
  rewards: []
1402
1578
  }
1403
1579
  },
1404
- configs: o("GAME", {
1580
+ configs: p("GAME", {
1405
1581
  name: "Token",
1406
1582
  business: null,
1407
1583
  noCampaign: !1
@@ -1642,18 +1818,184 @@ const Ee = {
1642
1818
  type: "timeframe"
1643
1819
  }
1644
1820
  },
1645
- configs: o("STAMP", {
1821
+ configs: p("STAMP", {
1646
1822
  business: null,
1647
1823
  noCampaign: !1
1648
1824
  })
1649
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
+ }
1650
1992
  }
1651
1993
  };
1652
- t.scaffoldGroup(), o("STAMP", {
1994
+ t.scaffoldGroup(), p("STAMP", {
1653
1995
  business: null,
1654
1996
  noCampaign: !1
1655
1997
  });
1656
- const Oe = {
1998
+ const lt = {
1657
1999
  _id: "",
1658
2000
  intention: [],
1659
2001
  name: "Spend and get voucher",
@@ -2051,7 +2393,7 @@ const Oe = {
2051
2393
  amount: 1
2052
2394
  }
2053
2395
  },
2054
- configs: o("VOUCHER", {
2396
+ configs: p("VOUCHER", {
2055
2397
  name: "",
2056
2398
  business: null,
2057
2399
  noCampaign: !1
@@ -2060,7 +2402,7 @@ const Oe = {
2060
2402
  };
2061
2403
  ({
2062
2404
  ...t.scaffoldGroup()
2063
- }, o("VOUCHER", {
2405
+ }, p("VOUCHER", {
2064
2406
  name: "",
2065
2407
  business: null,
2066
2408
  noCampaign: !1
@@ -2071,7 +2413,7 @@ const Oe = {
2071
2413
  ({
2072
2414
  ...t.scaffoldGroup()
2073
2415
  });
2074
- const Ie = {
2416
+ const rt = {
2075
2417
  _id: "",
2076
2418
  intention: [],
2077
2419
  name: "Spend and earn points",
@@ -2446,7 +2788,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2446
2788
  });
2447
2789
  ({
2448
2790
  ...t.scaffoldGroup()
2449
- }, o("VOUCHER", {
2791
+ }, p("VOUCHER", {
2450
2792
  name: "",
2451
2793
  business: null,
2452
2794
  noCampaign: !1
@@ -2492,12 +2834,12 @@ t.setRuleToGroup(
2492
2834
  "&&"
2493
2835
  )
2494
2836
  );
2495
- t.scaffoldGroup(), t.scaffoldGroup(), o("GAME", {
2837
+ t.scaffoldGroup(), t.scaffoldGroup(), p("GAME", {
2496
2838
  name: "Token",
2497
2839
  business: null,
2498
2840
  noCampaign: !1
2499
2841
  });
2500
- const Re = {
2842
+ const ct = {
2501
2843
  _id: "",
2502
2844
  intention: [],
2503
2845
  name: "Welcome voucher",
@@ -2843,7 +3185,7 @@ const Re = {
2843
3185
  amount: 1
2844
3186
  }
2845
3187
  },
2846
- configs: o("VOUCHER", {
3188
+ configs: p("VOUCHER", {
2847
3189
  name: "",
2848
3190
  business: null,
2849
3191
  noCampaign: !1
@@ -2874,7 +3216,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2874
3216
  ],
2875
3217
  "&&"
2876
3218
  )
2877
- ]), o("VOUCHER", {
3219
+ ]), p("VOUCHER", {
2878
3220
  name: "",
2879
3221
  business: null,
2880
3222
  noCampaign: !1
@@ -2897,7 +3239,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2897
3239
  ({
2898
3240
  ...t.scaffoldGroup()
2899
3241
  });
2900
- const O = e.enum([
3242
+ const ae = e.enum([
2901
3243
  "MEMBER_REWARD",
2902
3244
  "PAID_LOYALTY",
2903
3245
  "COLLECT_FEEDBACK",
@@ -2907,7 +3249,7 @@ const O = e.enum([
2907
3249
  "BROADCAST",
2908
3250
  "BIRTHDAY",
2909
3251
  "GAME"
2910
- ]), I = e.enum([
3252
+ ]), ne = e.enum([
2911
3253
  "text",
2912
3254
  "number",
2913
3255
  "textarea",
@@ -2933,115 +3275,220 @@ const O = e.enum([
2933
3275
  "rule_bill",
2934
3276
  "rule_feedback",
2935
3277
  "rule_birthday",
2936
- "promotion_game_type"
2937
- ]), R = e.object({
3278
+ "promotion_game_type",
3279
+ "grab_effect",
3280
+ "grab_quota",
3281
+ "grab_conditions"
3282
+ ]), oe = e.object({
2938
3283
  label: e.string().optional(),
2939
3284
  label_locale: e.record(e.string()).nullish(),
2940
3285
  property: e.string().or(e.any()),
2941
- type: I,
3286
+ type: ne,
2942
3287
  extras: e.string().optional(),
2943
3288
  isRuleChildren: e.boolean().optional()
2944
- }), u = e.object({
3289
+ }), S = e.object({
2945
3290
  not: e.boolean().optional(),
2946
3291
  property: e.string(),
2947
3292
  value: e.any()
2948
- }), L = e.object({
3293
+ }), ie = e.object({
2949
3294
  name: e.string().optional(),
2950
3295
  name_locale: e.record(e.string()).nullish(),
2951
- fields: e.array(R),
2952
- condition: u.optional().or(
2953
- e.array(u)
3296
+ fields: e.array(oe),
3297
+ condition: S.optional().or(
3298
+ e.array(S)
2954
3299
  )
2955
- }), x = e.object({
3300
+ }), le = e.object({
2956
3301
  name: e.string(),
2957
3302
  name_locale: e.record(e.string()).nullish(),
2958
- groups: e.array(L)
3303
+ groups: e.array(ie)
2959
3304
  });
2960
3305
  e.object({
2961
- _id: a,
3306
+ _id: n,
2962
3307
  name: e.string(),
2963
3308
  name_locale: e.record(e.string()).nullish(),
2964
3309
  description: e.string().nullish(),
2965
3310
  description_locale: e.record(e.string()).nullish(),
2966
- steps: e.array(x).min(1),
2967
- intention: e.array(O),
3311
+ steps: e.array(le).min(1),
3312
+ intention: e.array(ae),
2968
3313
  defaultValue: e.any()
2969
3314
  }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
2970
- const D = {
3315
+ const re = {
2971
3316
  collectionName: "Businesses",
2972
3317
  transform: {
2973
3318
  _id: "oid"
2974
3319
  }
2975
3320
  };
2976
3321
  e.object({
2977
- _id: a,
3322
+ _id: n,
2978
3323
  ownerId: e.string(),
2979
3324
  name: e.string(),
2980
3325
  credit: e.number(),
2981
3326
  forceSend: e.boolean().optional()
2982
- }).describe(i.describe(D));
2983
- const y = e.enum(["PHONE"]), w = e.enum([
3327
+ }).describe(m.describe(re));
3328
+ const P = e.enum(["PHONE"]), ce = e.enum([
2984
3329
  "MOCEAN",
2985
3330
  "SLACK",
2986
3331
  "SMS",
2987
3332
  "EMAIL",
2988
3333
  "WHATSAPP"
2989
- ]), F = e.enum(["PENDING", "COMPLETED", "FAILED"]), A = e.enum([
3334
+ ]), pe = e.enum(["PENDING", "COMPLETED", "FAILED"]), me = e.enum([
2990
3335
  "General",
2991
3336
  "Otp",
2992
3337
  "Marketing",
2993
3338
  "Ordering",
2994
3339
  "MemberInvitation",
2995
3340
  "MarketingPromotion"
2996
- ]), M = e.object({
2997
- type: y
2998
- }), f = M.extend({
2999
- type: e.literal(y.enum.PHONE),
3000
- provider: w,
3001
- usage: A.optional()
3002
- }), G = {
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([
3348
+ "Accepted",
3349
+ "PartiallyAccepted",
3350
+ "Queued",
3351
+ "Unknown",
3352
+ "Failed"
3353
+ ]), ge = e.enum([
3354
+ "PENDING",
3355
+ "SUBMITTED",
3356
+ "SETTLED",
3357
+ "FAILED"
3358
+ ]), J = e.object({
3359
+ channel: e.string(),
3360
+ status: e.string(),
3361
+ statusDetails: e.string().nullish()
3362
+ }), de = {
3003
3363
  collectionName: "Notifications",
3004
- transform: { _id: "oid", business: "oid" }
3364
+ transform: {
3365
+ _id: "oid",
3366
+ business: "oid",
3367
+ campaign: "oid",
3368
+ member: "oid"
3369
+ }
3005
3370
  };
3006
3371
  e.object({
3007
- _id: a,
3008
- business: a,
3009
- target: e.string(),
3372
+ _id: n,
3373
+ business: n,
3374
+ status: pe,
3375
+ ref: e.string().optional(),
3010
3376
  title: e.string().optional(),
3011
- message: e.string(),
3012
- option: f,
3013
- status: F,
3014
- ref: e.string().optional()
3015
- }).describe(i.describe(G));
3016
- const k = e.object({
3377
+ // Single-channel fields. Absent on multi-channel dispatches, which carry
3378
+ // their content per channel in the submitted request instead.
3379
+ target: e.string().optional(),
3380
+ message: e.string().optional(),
3381
+ option: j.optional(),
3382
+ // Multi-channel dispatch fields.
3383
+ campaign: n.nullish(),
3384
+ member: n.nullish(),
3385
+ /**
3386
+ * The scheduled run this dispatch belongs to. With campaign and member it
3387
+ * identifies one intended send, so a redelivered queue job is recognised
3388
+ * rather than sent twice.
3389
+ */
3390
+ runAt: e.coerce.date().nullish(),
3391
+ mode: z.nullish(),
3392
+ channels: e.array(U).nullish(),
3393
+ /**
3394
+ * Local submission state, kept separate from the upstream outcome so an
3395
+ * interrupted worker can tell "never sent" from "sent, result unknown".
3396
+ */
3397
+ state: ge.nullish(),
3398
+ outcome: E.nullish(),
3399
+ /** Upstream correlation id, preserved even when the request failed. */
3400
+ requestId: e.string().nullish(),
3401
+ attempts: e.array(J).nullish(),
3402
+ /** Credit consumed upstream, recorded for reconciliation. */
3403
+ creditUsed: d.nullish(),
3404
+ balanceAfter: d.nullish(),
3405
+ error: e.string().nullish(),
3406
+ createdAt: e.coerce.date().nullish(),
3407
+ submittedAt: e.coerce.date().nullish(),
3408
+ settledAt: e.coerce.date().nullish()
3409
+ }).describe(m.describe(de));
3410
+ const ue = e.object({
3017
3411
  target: e.string(),
3018
3412
  title: e.string().optional(),
3019
3413
  message: e.string(),
3020
- option: f,
3414
+ option: j,
3021
3415
  ref: e.string().optional()
3416
+ }), he = e.object({
3417
+ memberId: e.string(),
3418
+ name: e.string().nullish(),
3419
+ phoneNumber: e.string().nullish(),
3420
+ email: e.string().nullish(),
3421
+ /**
3422
+ * Shared Firebase uid required by App Inbox and Push, sourced from
3423
+ * `FdoUserV2.externalMemberId`. Optional there, so it can legitimately be
3424
+ * absent for a member; upstream decides what that means for a channel.
3425
+ */
3426
+ firebaseUid: e.string().nullish()
3427
+ });
3428
+ e.object({
3429
+ businessId: e.string(),
3430
+ forceSend: e.boolean(),
3431
+ mode: z,
3432
+ channels: e.array(
3433
+ e.enum(["SMS", "WHATSAPP", "EMAIL", "APP_INBOX", "PUSH_NOTIFICATION"])
3434
+ ),
3435
+ metadata: e.object({
3436
+ source: e.string(),
3437
+ refValue: e.string()
3438
+ }),
3439
+ content: e.record(e.string(), e.unknown())
3022
3440
  });
3023
3441
  e.object({
3442
+ requestId: e.string().nullish(),
3443
+ status: E.nullish(),
3444
+ attempts: e.array(J).nullish(),
3445
+ creditUsed: d.nullish(),
3446
+ balance: d.nullish()
3447
+ });
3448
+ const _e = e.object({
3024
3449
  campaignId: e.string(),
3025
- notification: k,
3026
- business: e.string()
3450
+ business: e.string(),
3451
+ runAt: e.coerce.date(),
3452
+ recipient: he,
3453
+ /** Personalised, editor-data-free content keyed by channel. */
3454
+ content: e.record(e.string(), e.unknown()),
3455
+ mode: z,
3456
+ channels: e.array(U)
3457
+ });
3458
+ e.object({
3459
+ campaignId: e.string(),
3460
+ /** Absent only on multi-channel jobs, which carry `dispatch` instead. */
3461
+ notification: ue.optional(),
3462
+ business: e.string(),
3463
+ /**
3464
+ * Present only for multi-channel broadcasts. When set the job takes the
3465
+ * multi-channel dispatch path; when absent the legacy single-channel path
3466
+ * runs unchanged.
3467
+ */
3468
+ dispatch: _e.optional()
3469
+ }).superRefine((o, a) => {
3470
+ !o.notification && !o.dispatch && a.addIssue({
3471
+ code: e.ZodIssueCode.custom,
3472
+ message: "Job must carry either a notification or a dispatch"
3473
+ });
3027
3474
  });
3028
3475
  e.object({
3029
3476
  phone: e.string(),
3030
3477
  message: e.string()
3031
3478
  });
3032
- const _ = e.object({
3479
+ const N = e.object({
3033
3480
  name: e.string().optional(),
3034
3481
  address: e.string()
3035
- }), B = e.object({
3482
+ }), ye = e.object({
3036
3483
  filename: e.string(),
3037
3484
  content: e.instanceof(Uint8Array)
3038
3485
  });
3039
3486
  e.object({
3040
- from: _.optional(),
3041
- to: e.array(_),
3487
+ from: N.optional(),
3488
+ to: e.array(N),
3042
3489
  subject: e.string(),
3043
3490
  html: e.string().optional(),
3044
- attachments: e.array(B).optional()
3491
+ attachments: e.array(ye).optional()
3045
3492
  });
3046
3493
  e.object({
3047
3494
  subject: e.string(),
@@ -3081,7 +3528,7 @@ e.object({
3081
3528
  billId: e.string()
3082
3529
  });
3083
3530
  e.object({
3084
- amount: U,
3531
+ amount: A,
3085
3532
  member: e.string(),
3086
3533
  bill: e.string(),
3087
3534
  otp: e.string().nullish(),
@@ -3090,15 +3537,15 @@ e.object({
3090
3537
  e.object({
3091
3538
  orderId: e.string()
3092
3539
  });
3093
- var b = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(b || {});
3094
- e.nativeEnum(b);
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);
3095
3542
  e.enum(["manage", "create", "read", "update", "delete"]);
3096
3543
  e.enum(["all", "restaurant", "business", "delivery", "agent"]);
3097
3544
  e.enum(["quota"]);
3098
- var H = /* @__PURE__ */ ((n) => (n.marketing = "business::marketing", n.campaign = "business::campaign", n.counter = "business::counter", n.permission = "business::permission", n.role = "business::role", n))(H || {});
3099
- e.nativeEnum(H);
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);
3100
3547
  e.enum(["restaurant"]);
3101
- const V = e.object({
3548
+ const fe = e.object({
3102
3549
  label: e.string(),
3103
3550
  subject: e.union([e.string(), e.array(e.string())]),
3104
3551
  actions: e.union([e.string(), e.array(e.string())]),
@@ -3108,41 +3555,41 @@ const V = e.object({
3108
3555
  reason: e.string().optional()
3109
3556
  });
3110
3557
  e.object({
3111
- _id: a,
3558
+ _id: n,
3112
3559
  businessId: e.string(),
3113
3560
  userId: e.string(),
3114
3561
  email: e.string().nullish(),
3115
3562
  phoneNo: e.string().nullish(),
3116
- permissions: e.array(e.lazy(() => V))
3563
+ permissions: e.array(e.lazy(() => fe))
3117
3564
  }).describe(
3118
- i.describe({
3565
+ m.describe({
3119
3566
  collectionName: "PermissionUsers",
3120
3567
  transform: {
3121
3568
  _id: "oid"
3122
3569
  }
3123
3570
  })
3124
3571
  );
3125
- const z = e.object({
3572
+ const R = e.object({
3126
3573
  userId: e.string(),
3127
3574
  level: e.number(),
3128
3575
  role: e.string().optional(),
3129
3576
  businessId: e.string().optional(),
3130
3577
  restaurantId: e.string().optional()
3131
- }), W = e.function().args(e.any(), z).returns(e.boolean()), Y = e.function().args(z).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())));
3132
3579
  e.object({
3133
- isAdmin: W,
3134
- getRules: Y
3580
+ isAdmin: be,
3581
+ getRules: He
3135
3582
  });
3136
3583
  e.object({
3137
- transactions: e.array(j),
3138
- collections: e.array(J)
3584
+ transactions: e.array(F),
3585
+ collections: e.array(G)
3139
3586
  });
3140
- const C = e.enum([
3587
+ const L = e.enum([
3141
3588
  "ROCK_PAPER_SCISSOR"
3142
3589
  ]);
3143
- C.enum.ROCK_PAPER_SCISSOR + "";
3590
+ L.enum.ROCK_PAPER_SCISSOR + "";
3144
3591
  e.object({
3145
- type: C
3592
+ type: L
3146
3593
  });
3147
3594
  e.object({
3148
3595
  host: e.string().url(),
@@ -3151,7 +3598,7 @@ e.object({
3151
3598
  roomId: e.string()
3152
3599
  });
3153
3600
  e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
3154
- const K = {
3601
+ const ze = {
3155
3602
  collectionName: "MarketingMaterials",
3156
3603
  transform: {
3157
3604
  _id: "oid",
@@ -3159,13 +3606,14 @@ const K = {
3159
3606
  }
3160
3607
  };
3161
3608
  e.object({
3162
- _id: a,
3163
- business: a,
3609
+ _id: n,
3610
+ business: n,
3164
3611
  imageUrl: e.string().url(),
3165
3612
  headline: e.string(),
3166
3613
  caption: e.string(),
3167
- editedAt: e.coerce.date()
3168
- }).describe(i.describe(K));
3614
+ editedAt: e.coerce.date(),
3615
+ deletedAt: e.coerce.date().optional()
3616
+ }).describe(m.describe(ze));
3169
3617
  e.object({
3170
3618
  id: e.number(),
3171
3619
  name: e.string(),
@@ -3185,12 +3633,12 @@ e.object({
3185
3633
  phone: e.string().optional(),
3186
3634
  email: e.string().optional()
3187
3635
  });
3188
- const X = e.enum([
3636
+ const Te = e.enum([
3189
3637
  "PENDING",
3190
3638
  "SUCCESS",
3191
3639
  "FAILED",
3192
3640
  "RETRYING"
3193
- ]), q = {
3641
+ ]), Ce = {
3194
3642
  collectionName: "WebhookLogs",
3195
3643
  transform: {
3196
3644
  _id: "oid",
@@ -3198,39 +3646,39 @@ const X = e.enum([
3198
3646
  }
3199
3647
  };
3200
3648
  e.object({
3201
- _id: a,
3202
- business: a,
3649
+ _id: n,
3650
+ business: n,
3203
3651
  type: e.string(),
3204
3652
  payload: e.record(e.any()),
3205
- status: X,
3653
+ status: Te,
3206
3654
  response: e.any().optional(),
3207
3655
  error: e.string().optional()
3208
- }).describe(i.describe(q));
3209
- const Q = e.enum(["AUTO", "MANUAL"]);
3656
+ }).describe(m.describe(Ce));
3657
+ const ve = e.enum(["AUTO", "MANUAL"]);
3210
3658
  e.enum(["IN_PROGRESS", "COMPLETED"]);
3211
- const T = e.object({
3212
- _id: a,
3659
+ const x = e.object({
3660
+ _id: n,
3213
3661
  name: e.string().min(1, "Name is required").max(50),
3214
- type: Q,
3215
- event: E.optional()
3216
- }), Z = e.object({
3662
+ type: ve,
3663
+ event: V.optional()
3664
+ }), Se = e.object({
3217
3665
  from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
3218
3666
  to: e.number().int("Must be integer").nullish()
3219
- }).superRefine((n, N) => {
3220
- n.from && n.to && n.from > n.to && N.addIssue({
3667
+ }).superRefine((o, a) => {
3668
+ o.from && o.to && o.from > o.to && a.addIssue({
3221
3669
  code: "custom",
3222
3670
  message: "Max referral count must be more than min referral count"
3223
3671
  });
3224
- }), $ = e.object({
3225
- threshold: Z,
3226
- rewards: e.array(a),
3227
- pf_reward: e.array(d).optional()
3228
- }), h = 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({
3229
3677
  id: e.string(),
3230
3678
  name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
3231
- rule: P.optional(),
3232
- rewards: e.array($)
3233
- }), ee = {
3679
+ rule: B.optional(),
3680
+ rewards: e.array(Ne)
3681
+ }), Ue = {
3234
3682
  collectionName: "ReferralRecords",
3235
3683
  transform: {
3236
3684
  _id: "oid",
@@ -3239,25 +3687,25 @@ const T = e.object({
3239
3687
  referee: "oid",
3240
3688
  refereeReward: "oid"
3241
3689
  }
3242
- }, te = e.object({
3690
+ }, Pe = e.object({
3243
3691
  completedAt: e.coerce.date(),
3244
- criteria: a,
3692
+ criteria: n,
3245
3693
  ref: e.string()
3246
- }), ae = e.object({
3247
- _id: a,
3248
- business: a,
3249
- referer: a,
3250
- referee: a,
3251
- criteria: e.array(T),
3252
- reward: e.array(h),
3253
- refereeReward: e.array(a).optional(),
3254
- criteria_progress: e.array(te),
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),
3255
3703
  status: e.string(),
3256
- pf_referer: r.optional(),
3257
- pf_referee: r.optional(),
3258
- pf_refereeReward: e.array(d).optional()
3259
- }).describe(i.describe(ee));
3260
- ae.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({
3261
3709
  _id: !0,
3262
3710
  business: !0,
3263
3711
  referer: !0,
@@ -3265,79 +3713,83 @@ ae.pick({
3265
3713
  criteria_progress: !0,
3266
3714
  criteria: !0
3267
3715
  }).extend({
3268
- pf_referee: r.pick({
3716
+ pf_referee: g.pick({
3269
3717
  _id: !0,
3270
3718
  name: !0,
3271
3719
  phoneNumber: !0,
3272
3720
  photoUrl: !0
3273
3721
  })
3274
3722
  });
3275
- const ne = {
3723
+ const Ee = {
3276
3724
  collectionName: "ReferralProgram",
3277
3725
  transform: {
3278
3726
  _id: "oid",
3279
3727
  business: "oid"
3280
3728
  }
3281
- }, v = e.object({
3282
- _id: a,
3283
- business: a,
3729
+ }, D = e.object({
3730
+ _id: n,
3731
+ business: n,
3284
3732
  term_and_condition: e.string().optional(),
3285
- refereeReward: e.array(a).optional(),
3286
- reward: e.array(h),
3287
- criteria: e.array(T)
3288
- }).describe(i.describe(ne));
3733
+ refereeReward: e.array(n).optional(),
3734
+ reward: e.array(C),
3735
+ criteria: e.array(x)
3736
+ }).describe(m.describe(Ee));
3289
3737
  e.object({
3290
- referer: a,
3291
- referee: a,
3292
- business: a
3738
+ referer: n,
3739
+ referee: n,
3740
+ business: n
3293
3741
  });
3294
3742
  e.object({
3295
- program: v.pick({
3743
+ program: D.pick({
3296
3744
  _id: !0,
3297
3745
  business: !0,
3298
3746
  term_and_condition: !0
3299
3747
  }).extend({
3300
- reward: h.optional(),
3301
- pf_refereeReward: e.array(d).optional()
3748
+ reward: C.optional(),
3749
+ pf_refereeReward: e.array(T).optional()
3302
3750
  }),
3303
3751
  referralCount: e.number(),
3304
3752
  successReferralCount: e.number(),
3305
- referredBy: r.pick({
3753
+ referredBy: g.pick({
3306
3754
  _id: !0,
3307
3755
  name: !0,
3308
3756
  phoneNumber: !0,
3309
3757
  photoUrl: !0
3310
3758
  }).optional()
3311
3759
  });
3312
- v.extend({
3760
+ D.extend({
3313
3761
  updateReferralRecord: e.boolean().optional()
3314
3762
  });
3315
- const oe = e.object({
3763
+ const Je = e.object({
3316
3764
  facebookPageId: e.string(),
3317
3765
  pageName: e.string(),
3318
3766
  pageProfileImageUrl: e.string(),
3319
3767
  pageAccessToken: e.string().optional(),
3320
- locationIds: e.array(a)
3321
- }), ie = e.object({
3322
- locationId: a.nullable(),
3768
+ locationIds: e.array(n)
3769
+ }), Oe = e.object({
3770
+ locationId: n.nullable(),
3323
3771
  googleLocationName: e.string(),
3324
3772
  displayName: e.string().optional()
3325
- }), le = e.object({
3773
+ }), Ie = e.object({
3326
3774
  accessToken: e.string().nullable(),
3327
3775
  refreshToken: e.string().nullable(),
3328
3776
  accessTokenExpiresAt: e.date().nullable(),
3329
- locations: e.array(ie)
3330
- }), re = 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({
3331
3781
  token: e.string().nullable(),
3332
- pages: e.array(oe)
3782
+ pages: e.array(Je),
3783
+ lastSyncTime: e.coerce.date().nullish(),
3784
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3333
3785
  });
3334
3786
  e.object({
3335
- _id: a,
3336
- businessId: a,
3337
- google: le.nullable(),
3338
- facebook: re.nullable()
3787
+ _id: n,
3788
+ businessId: n,
3789
+ google: Ie.nullable(),
3790
+ facebook: Re.nullable()
3339
3791
  }).describe(
3340
- i.describe({
3792
+ m.describe({
3341
3793
  collectionName: "ReviewSourceConfig",
3342
3794
  transform: {
3343
3795
  _id: "oid",
@@ -3381,7 +3833,9 @@ e.object({
3381
3833
  displayName: e.string().optional(),
3382
3834
  locationId: e.string().nullable()
3383
3835
  })
3384
- )
3836
+ ),
3837
+ lastSyncTime: e.string().datetime().nullable(),
3838
+ syncFrequency: e.number().int().min(1).max(30)
3385
3839
  }).nullable(),
3386
3840
  facebook: e.object({
3387
3841
  token: e.string().nullable(),
@@ -3392,30 +3846,32 @@ e.object({
3392
3846
  pageProfileImageUrl: e.string(),
3393
3847
  locationIds: e.array(e.string())
3394
3848
  })
3395
- )
3849
+ ),
3850
+ lastSyncTime: e.string().datetime().nullable(),
3851
+ syncFrequency: e.number().int().min(1).max(30)
3396
3852
  }).nullable()
3397
3853
  });
3398
- const c = e.object({
3854
+ const u = e.object({
3399
3855
  name: e.string(),
3400
3856
  pictureUrl: e.string(),
3401
3857
  phoneNumber: e.string().optional()
3402
- }), ce = c.extend({
3858
+ }), Le = u.extend({
3403
3859
  isAnonymous: e.boolean().optional()
3404
- }), pe = c.extend({
3860
+ }), xe = u.extend({
3405
3861
  id: e.string().optional()
3406
- }), p = e.object({
3862
+ }), h = e.object({
3407
3863
  comment: e.string(),
3408
3864
  updateTime: e.coerce.date()
3409
3865
  });
3410
3866
  e.object({
3411
3867
  comment: e.string().trim().min(1).max(4096)
3412
3868
  });
3413
- const l = e.object({
3869
+ const s = e.object({
3414
3870
  externalId: e.string().optional(),
3415
3871
  thumbnailUrl: e.string(),
3416
3872
  thumbnailLabel: e.string(),
3417
3873
  videoUrl: e.string().optional()
3418
- }), me = {
3874
+ }), De = {
3419
3875
  collectionName: "Reviews",
3420
3876
  transform: {
3421
3877
  _id: "oid",
@@ -3423,31 +3879,31 @@ const l = e.object({
3423
3879
  reviewerId: "oid",
3424
3880
  restaurantId: "oid"
3425
3881
  }
3426
- }, S = e.enum([
3882
+ }, w = e.enum([
3427
3883
  "google",
3428
3884
  "facebook",
3429
3885
  "feedme",
3430
3886
  "feedvibe"
3431
3887
  ]);
3432
- S.options;
3888
+ w.options;
3433
3889
  e.enum(["google", "facebook"]);
3434
- const se = e.enum([
3890
+ const we = e.enum([
3435
3891
  "createTime_desc",
3436
3892
  "createTime_asc",
3437
3893
  "rating_asc",
3438
3894
  "rating_desc"
3439
3895
  ]);
3440
3896
  e.object({
3441
- source: S.array().optional(),
3897
+ source: w.array().optional(),
3442
3898
  dateFrom: e.string().datetime({ offset: !0 }).optional(),
3443
3899
  dateTo: e.string().datetime({ offset: !0 }).optional(),
3444
3900
  locationId: e.string().optional(),
3445
3901
  excludeDeleted: e.boolean().optional(),
3446
- sort: se.optional(),
3902
+ sort: we.optional(),
3447
3903
  limit: e.coerce.number().int().positive().optional(),
3448
3904
  skip: e.coerce.number().int().min(0).optional()
3449
3905
  });
3450
- const Le = e.object({
3906
+ const pt = e.object({
3451
3907
  averageScore: e.number(),
3452
3908
  total: e.number().int().nonnegative(),
3453
3909
  starCounts: e.array(
@@ -3456,54 +3912,54 @@ const Le = e.object({
3456
3912
  count: e.number().int().nonnegative()
3457
3913
  })
3458
3914
  )
3459
- }), m = e.object({
3915
+ }), _ = e.object({
3460
3916
  name: e.string(),
3461
3917
  pictureUrl: e.string().optional(),
3462
3918
  phoneNumber: e.string().optional()
3463
- }), ge = m.extend({
3919
+ }), Ae = _.extend({
3464
3920
  _id: e.string().optional()
3465
- }), de = m.extend({
3921
+ }), Me = _.extend({
3466
3922
  _id: e.string()
3467
- }), he = m.extend({
3923
+ }), Fe = _.extend({
3468
3924
  isAnonymous: e.boolean().optional()
3469
- }), ue = m.extend({
3925
+ }), Ge = _.extend({
3470
3926
  id: e.string().optional()
3471
- }), s = e.object({
3472
- _id: a,
3927
+ }), y = e.object({
3928
+ _id: n,
3473
3929
  comment: e.string(),
3474
3930
  createTime: e.coerce.date(),
3475
3931
  updateTime: e.coerce.date().nullish(),
3476
- restaurantId: a,
3932
+ restaurantId: n,
3477
3933
  restaurantName: e.string()
3478
- }), _e = s.extend({
3934
+ }), ke = y.extend({
3479
3935
  source: e.literal("google"),
3480
3936
  externalId: e.string().min(1),
3481
3937
  translatedComment: e.string().optional(),
3482
- reviewer: he.optional(),
3483
- reply: p.optional(),
3484
- mediaItems: e.array(l),
3938
+ reviewer: Fe.optional(),
3939
+ reply: h.optional(),
3940
+ mediaItems: e.array(s),
3485
3941
  starRating: e.number(),
3486
3942
  locationName: e.string(),
3487
3943
  locationDisplayName: e.string(),
3488
3944
  originalUrl: e.string().optional()
3489
- }), ye = s.extend({
3945
+ }), Be = y.extend({
3490
3946
  source: e.literal("facebook"),
3491
3947
  externalId: e.string().min(1),
3492
- reviewer: ue.optional(),
3948
+ reviewer: Ge.optional(),
3493
3949
  isPositive: e.boolean().optional(),
3494
3950
  pageId: e.string(),
3495
3951
  pageName: e.string()
3496
- }), fe = s.extend({
3952
+ }), Ve = y.extend({
3497
3953
  source: e.literal("feedme"),
3498
- reviewer: ge.optional(),
3499
- reply: p.optional(),
3954
+ reviewer: Ae.optional(),
3955
+ reply: h.optional(),
3500
3956
  starRating: e.number(),
3501
- mediaItems: e.array(l),
3957
+ mediaItems: e.array(s),
3502
3958
  billId: e.string()
3503
- }), be = s.extend({
3959
+ }), We = y.extend({
3504
3960
  source: e.literal("feedvibe"),
3505
3961
  externalId: e.string().min(1),
3506
- reviewer: de.optional(),
3962
+ reviewer: Me.optional(),
3507
3963
  rating: e.object({
3508
3964
  overall: e.number(),
3509
3965
  food: e.number(),
@@ -3511,67 +3967,67 @@ const Le = e.object({
3511
3967
  atmosphere: e.number()
3512
3968
  }),
3513
3969
  verified: e.boolean(),
3514
- mediaItems: e.array(l).default([])
3970
+ mediaItems: e.array(s).default([])
3515
3971
  });
3516
3972
  e.discriminatedUnion("source", [
3517
- _e,
3518
- ye,
3519
- fe,
3520
- be
3973
+ ke,
3974
+ Be,
3975
+ Ve,
3976
+ We
3521
3977
  ]);
3522
3978
  e.object({
3523
3979
  comment: e.string(),
3524
3980
  starRating: e.number(),
3525
3981
  billId: e.string(),
3526
3982
  isAnonymous: e.boolean(),
3527
- mediaItems: e.array(l).optional()
3983
+ mediaItems: e.array(s).optional()
3528
3984
  });
3529
3985
  e.object({
3530
3986
  name: e.string().trim().min(1),
3531
3987
  phoneNumber: e.string().trim().min(1).optional()
3532
3988
  });
3533
- const g = e.object({
3534
- _id: a,
3535
- businessId: a,
3989
+ const f = e.object({
3990
+ _id: n,
3991
+ businessId: n,
3536
3992
  comment: e.string(),
3537
3993
  createTime: e.coerce.date(),
3538
3994
  updateTime: e.coerce.date().nullish(),
3539
- restaurantId: a,
3995
+ restaurantId: n,
3540
3996
  restaurantName: e.string(),
3541
3997
  deletedAt: e.coerce.date().optional()
3542
- }), He = g.extend({
3998
+ }), Ye = f.extend({
3543
3999
  source: e.literal("google"),
3544
4000
  externalId: e.string().min(1),
3545
4001
  translatedComment: e.string().optional(),
3546
- reviewer: ce.optional(),
3547
- reply: p.optional(),
3548
- mediaItems: e.array(l),
4002
+ reviewer: Le.optional(),
4003
+ reply: h.optional(),
4004
+ mediaItems: e.array(s),
3549
4005
  starRating: e.number(),
3550
4006
  locationName: e.string(),
3551
4007
  locationDisplayName: e.string(),
3552
4008
  originalUrl: e.string().optional()
3553
- }), ze = g.extend({
4009
+ }), Ke = f.extend({
3554
4010
  source: e.literal("facebook"),
3555
4011
  externalId: e.string().min(1),
3556
- reviewer: pe.optional(),
4012
+ reviewer: xe.optional(),
3557
4013
  isPositive: e.boolean().optional(),
3558
4014
  pageId: e.string(),
3559
4015
  pageName: e.string()
3560
- }), Ce = g.extend({
4016
+ }), qe = f.extend({
3561
4017
  source: e.literal("feedme"),
3562
4018
  isAnonymous: e.boolean(),
3563
4019
  metadata: e.record(e.string(), e.unknown()).optional(),
3564
- reviewerId: a.optional(),
3565
- reviewer: c.optional(),
3566
- reply: p.optional(),
4020
+ reviewerId: n.optional(),
4021
+ reviewer: u.optional(),
4022
+ reply: h.optional(),
3567
4023
  starRating: e.number(),
3568
4024
  billId: e.string(),
3569
- mediaItems: e.array(l)
3570
- }), Te = g.extend({
4025
+ mediaItems: e.array(s)
4026
+ }), Xe = f.extend({
3571
4027
  source: e.literal("feedvibe"),
3572
4028
  externalId: e.string().min(1),
3573
- reviewerId: a,
3574
- reviewer: c,
4029
+ reviewerId: n,
4030
+ reviewer: u,
3575
4031
  rating: e.object({
3576
4032
  overall: e.number(),
3577
4033
  food: e.number(),
@@ -3579,23 +4035,29 @@ const g = e.object({
3579
4035
  atmosphere: e.number()
3580
4036
  }),
3581
4037
  verified: e.boolean(),
3582
- mediaItems: e.array(l).default([])
4038
+ mediaItems: e.array(s).default([])
3583
4039
  });
3584
4040
  e.discriminatedUnion("source", [
3585
- He,
3586
- ze,
3587
- Ce,
3588
- Te
3589
- ]).describe(i.describe(me));
4041
+ Ye,
4042
+ Ke,
4043
+ qe,
4044
+ Xe
4045
+ ]).describe(m.describe(De));
3590
4046
  export {
3591
- O as F,
3592
- Oe as S,
3593
- Ee as T,
3594
- Re as W,
3595
- Ie as a,
3596
- $ as b,
3597
- T as c,
3598
- h as d,
3599
- Le as e,
3600
- p 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
+ Ne as c,
4055
+ x as d,
4056
+ C 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
3601
4063
  };