@feedmepos/mf-connect 0.1.111-prod → 0.1.113-beta.3

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 (162) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-D3pYl3WL.js → App-YfpYV7C0.js} +738 -689
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DOZqpbYH.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +49 -32
  8. package/dist/Card-BUnwg0eM.js +1086 -0
  9. package/dist/{Collections-9QK5hbLo.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-8Ouy4O9a.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-DMh4hR1S.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-CL0TZvg1.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/GiftCardSetup-CVLDDpI2.js +748 -0
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-Dz5Vp-lj.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-kH8aAegB.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-2BLwDyHQ.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-C4OnSV-c.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-CT9WwxP0.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -49
  32. package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-DgLI4wty.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4821 -4690
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-CawzGzDu.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-D19oSo24.js → Overview-7G31a7B-.js} +58 -56
  39. package/dist/{Overview-CAtTlEVa.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-BPAGmKAj.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-B0Uf9vjL.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-CJEAFss_.js → Queue-M7ZpgiMT.js} +49 -47
  43. package/dist/{Record-s6hSQG2P.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-DhNCbAOm.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-BT00QsXL.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +26 -24
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-BuGhX9zg.js → Segment-DE9Bcd6R.js} +287 -287
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +37 -35
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/Store-DqQae9nE.js +2629 -0
  57. package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-OyE8oH2r.js → Tier-DWhgWush.js} +2576 -686
  61. package/dist/{Title-DAl7CKL_.js → Title-DUNeMdz8.js} +104 -101
  62. package/dist/Transaction-DAv-LVhC.js +45 -0
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-D2QGWSxs.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-QxosLNkH.js → app-Devzv4gO.js} +12854 -9732
  76. package/dist/app.js +4 -3
  77. package/dist/base.export-CCSMkvAm.js +75 -0
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-CbqG6NXr.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-Rj7oDBnN.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-EbUIyB1X.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/currency-mwm4AWXK.js +7 -0
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-B_91OlcX.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-DXnYZG-e.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-_uhiXya1.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-Cp7oHMm3.js → index-B1jP-_Z_.js} +691 -229
  96. package/dist/{index-BZ2b0Pk6.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-tbo0pMIu.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/index-B_gzo75q.js +53 -0
  99. package/dist/{index-DlQJZNwD.js → index-BfoDdVQS.js} +22 -6
  100. package/dist/{index-CDm0BWa3.js → index-BvY2hQac.js} +1 -1
  101. package/dist/index-Byg4ztr-.js +902 -0
  102. package/dist/{index-BWgc2-Qz.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-xuFTeVrb.js → index-CmzjBrHR.js} +11 -9
  105. package/dist/{index-BBihP1s2.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-Df4l6y-S.js → index-D34iYRdc.js} +1900 -2121
  107. package/dist/{index-DuhRCI0L.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-uuNGb1nv.js → index-DnepoNWn.js} +8028 -10766
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-DlGnYR5y.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-C_1iqF1Q.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-CWUmrVo_.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-CzYxnDWP.js → index-VqAbYyHH.js} +11 -6
  115. package/dist/{index-DzBzClHP.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-rIhCiB_S.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-B6fOjfjd.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-CbHn7zss.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-DkJN7jyQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-ChbDx6Nq.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-9TEd27Ku.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BN3MKVRs.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-CCibSJZa.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-DFhpsI2-.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-DjasF-NL.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-DqeChj0e.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-D0nC1LDx.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-CxpXoQJO.js → trigger-D8r76yb0.js} +18 -18
  135. package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-CrC-1v4L.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-CrylHgF1.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-CJNYF7-l.js → xlsx-Muy_Rjhk.js} +440 -440
  141. package/dist/{zod-Dzn9S95S.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-DZ4SP99P.js +0 -271
  144. package/dist/Card-B5ni027Q.js +0 -911
  145. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js +0 -2430
  146. package/dist/ReviewFacebookCallback-DeZqcpJo.js +0 -238
  147. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js +0 -1882
  148. package/dist/Setting-BOWPp05N.js +0 -2036
  149. package/dist/Settings-DekXvE-R.js +0 -179
  150. package/dist/Store-DpVlMuau.js +0 -1998
  151. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
  152. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js +0 -142
  153. package/dist/Transaction-mvKzTgLx.js +0 -39
  154. package/dist/campaign-Co4Lq-Wz.js +0 -228
  155. package/dist/campaign.fn-DolD3lYJ.js +0 -776
  156. package/dist/export-D0hWZSfH.js +0 -97
  157. package/dist/google-C3S8u0mT.js +0 -4
  158. package/dist/index-aCuOvuEC.js +0 -45
  159. package/dist/objectid-CGol1NeA.js +0 -145
  160. package/dist/rule-builder-DT854ycI.js +0 -102
  161. package/dist/template-BeCVA0-N.js +0 -236
  162. package/dist/vue-i18n-BjtkXdmG.js +0 -2365
@@ -1,10 +1,187 @@
1
- import { z as e, F as a, m as i, b as U } from "./index-uuNGb1nv.js";
2
- import { d as P } from "./index-DlGnYR5y.js";
3
- import { R as t } from "./rule-builder-DT854ycI.js";
4
- import { i as o } from "./helper-_uhiXya1.js";
5
- import { t as j, u as J, v as E, w as r } from "./index-Df4l6y-S.js";
6
- import { F as d } from "./index-BZ2b0Pk6.js";
7
- const Je = {
1
+ import { F as n, m, b as A } from "./index-DnepoNWn.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-D34iYRdc.js";
4
+ import { _ as k, l as v, f as B } from "./index-DtcUCknS.js";
5
+ import { i as p } from "./helper-D9cEaMIv.js";
6
+ import { d as z, b as U, e as d } from "./index-Drmh0FT-.js";
7
+ import { c as V } from "./index-Byg4ztr-.js";
8
+ import { F as T } from "./index-B7HH6vKF.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 = {
8
185
  PROMOTION: {
9
186
  name: "Promotion Template",
10
187
  description: "Promotion template for campaign creation.",
@@ -410,7 +587,7 @@ const Je = {
410
587
  // },
411
588
  hideInApp: !0
412
589
  },
413
- configs: o("VOUCHER", {
590
+ configs: p("VOUCHER", {
414
591
  name: "",
415
592
  business: null,
416
593
  noCampaign: !1
@@ -1400,7 +1577,7 @@ const Je = {
1400
1577
  rewards: []
1401
1578
  }
1402
1579
  },
1403
- configs: o("GAME", {
1580
+ configs: p("GAME", {
1404
1581
  name: "Token",
1405
1582
  business: null,
1406
1583
  noCampaign: !1
@@ -1641,18 +1818,184 @@ const Je = {
1641
1818
  type: "timeframe"
1642
1819
  }
1643
1820
  },
1644
- configs: o("STAMP", {
1821
+ configs: p("STAMP", {
1645
1822
  business: null,
1646
1823
  noCampaign: !1
1647
1824
  })
1648
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
+ }
1649
1992
  }
1650
1993
  };
1651
- t.scaffoldGroup(), o("STAMP", {
1994
+ t.scaffoldGroup(), p("STAMP", {
1652
1995
  business: null,
1653
1996
  noCampaign: !1
1654
1997
  });
1655
- const Ee = {
1998
+ const lt = {
1656
1999
  _id: "",
1657
2000
  intention: [],
1658
2001
  name: "Spend and get voucher",
@@ -2050,7 +2393,7 @@ const Ee = {
2050
2393
  amount: 1
2051
2394
  }
2052
2395
  },
2053
- configs: o("VOUCHER", {
2396
+ configs: p("VOUCHER", {
2054
2397
  name: "",
2055
2398
  business: null,
2056
2399
  noCampaign: !1
@@ -2059,7 +2402,7 @@ const Ee = {
2059
2402
  };
2060
2403
  ({
2061
2404
  ...t.scaffoldGroup()
2062
- }, o("VOUCHER", {
2405
+ }, p("VOUCHER", {
2063
2406
  name: "",
2064
2407
  business: null,
2065
2408
  noCampaign: !1
@@ -2070,7 +2413,7 @@ const Ee = {
2070
2413
  ({
2071
2414
  ...t.scaffoldGroup()
2072
2415
  });
2073
- const Oe = {
2416
+ const rt = {
2074
2417
  _id: "",
2075
2418
  intention: [],
2076
2419
  name: "Spend and earn points",
@@ -2445,7 +2788,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2445
2788
  });
2446
2789
  ({
2447
2790
  ...t.scaffoldGroup()
2448
- }, o("VOUCHER", {
2791
+ }, p("VOUCHER", {
2449
2792
  name: "",
2450
2793
  business: null,
2451
2794
  noCampaign: !1
@@ -2491,12 +2834,12 @@ t.setRuleToGroup(
2491
2834
  "&&"
2492
2835
  )
2493
2836
  );
2494
- t.scaffoldGroup(), t.scaffoldGroup(), o("GAME", {
2837
+ t.scaffoldGroup(), t.scaffoldGroup(), p("GAME", {
2495
2838
  name: "Token",
2496
2839
  business: null,
2497
2840
  noCampaign: !1
2498
2841
  });
2499
- const Ie = {
2842
+ const ct = {
2500
2843
  _id: "",
2501
2844
  intention: [],
2502
2845
  name: "Welcome voucher",
@@ -2842,7 +3185,7 @@ const Ie = {
2842
3185
  amount: 1
2843
3186
  }
2844
3187
  },
2845
- configs: o("VOUCHER", {
3188
+ configs: p("VOUCHER", {
2846
3189
  name: "",
2847
3190
  business: null,
2848
3191
  noCampaign: !1
@@ -2873,7 +3216,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2873
3216
  ],
2874
3217
  "&&"
2875
3218
  )
2876
- ]), o("VOUCHER", {
3219
+ ]), p("VOUCHER", {
2877
3220
  name: "",
2878
3221
  business: null,
2879
3222
  noCampaign: !1
@@ -2896,7 +3239,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2896
3239
  ({
2897
3240
  ...t.scaffoldGroup()
2898
3241
  });
2899
- const O = e.enum([
3242
+ const ae = e.enum([
2900
3243
  "MEMBER_REWARD",
2901
3244
  "PAID_LOYALTY",
2902
3245
  "COLLECT_FEEDBACK",
@@ -2906,7 +3249,7 @@ const O = e.enum([
2906
3249
  "BROADCAST",
2907
3250
  "BIRTHDAY",
2908
3251
  "GAME"
2909
- ]), I = e.enum([
3252
+ ]), ne = e.enum([
2910
3253
  "text",
2911
3254
  "number",
2912
3255
  "textarea",
@@ -2932,115 +3275,220 @@ const O = e.enum([
2932
3275
  "rule_bill",
2933
3276
  "rule_feedback",
2934
3277
  "rule_birthday",
2935
- "promotion_game_type"
2936
- ]), R = e.object({
3278
+ "promotion_game_type",
3279
+ "grab_effect",
3280
+ "grab_quota",
3281
+ "grab_conditions"
3282
+ ]), oe = e.object({
2937
3283
  label: e.string().optional(),
2938
3284
  label_locale: e.record(e.string()).nullish(),
2939
3285
  property: e.string().or(e.any()),
2940
- type: I,
3286
+ type: ne,
2941
3287
  extras: e.string().optional(),
2942
3288
  isRuleChildren: e.boolean().optional()
2943
- }), u = e.object({
3289
+ }), S = e.object({
2944
3290
  not: e.boolean().optional(),
2945
3291
  property: e.string(),
2946
3292
  value: e.any()
2947
- }), L = e.object({
3293
+ }), ie = e.object({
2948
3294
  name: e.string().optional(),
2949
3295
  name_locale: e.record(e.string()).nullish(),
2950
- fields: e.array(R),
2951
- condition: u.optional().or(
2952
- e.array(u)
3296
+ fields: e.array(oe),
3297
+ condition: S.optional().or(
3298
+ e.array(S)
2953
3299
  )
2954
- }), x = e.object({
3300
+ }), le = e.object({
2955
3301
  name: e.string(),
2956
3302
  name_locale: e.record(e.string()).nullish(),
2957
- groups: e.array(L)
3303
+ groups: e.array(ie)
2958
3304
  });
2959
3305
  e.object({
2960
- _id: a,
3306
+ _id: n,
2961
3307
  name: e.string(),
2962
3308
  name_locale: e.record(e.string()).nullish(),
2963
3309
  description: e.string().nullish(),
2964
3310
  description_locale: e.record(e.string()).nullish(),
2965
- steps: e.array(x).min(1),
2966
- intention: e.array(O),
3311
+ steps: e.array(le).min(1),
3312
+ intention: e.array(ae),
2967
3313
  defaultValue: e.any()
2968
3314
  }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
2969
- const D = {
3315
+ const re = {
2970
3316
  collectionName: "Businesses",
2971
3317
  transform: {
2972
3318
  _id: "oid"
2973
3319
  }
2974
3320
  };
2975
3321
  e.object({
2976
- _id: a,
3322
+ _id: n,
2977
3323
  ownerId: e.string(),
2978
3324
  name: e.string(),
2979
3325
  credit: e.number(),
2980
3326
  forceSend: e.boolean().optional()
2981
- }).describe(i.describe(D));
2982
- const y = e.enum(["PHONE"]), w = e.enum([
3327
+ }).describe(m.describe(re));
3328
+ const P = e.enum(["PHONE"]), ce = e.enum([
2983
3329
  "MOCEAN",
2984
3330
  "SLACK",
2985
3331
  "SMS",
2986
3332
  "EMAIL",
2987
3333
  "WHATSAPP"
2988
- ]), F = e.enum(["PENDING", "COMPLETED", "FAILED"]), A = e.enum([
3334
+ ]), pe = e.enum(["PENDING", "COMPLETED", "FAILED"]), me = e.enum([
2989
3335
  "General",
2990
3336
  "Otp",
2991
3337
  "Marketing",
2992
3338
  "Ordering",
2993
3339
  "MemberInvitation",
2994
3340
  "MarketingPromotion"
2995
- ]), M = e.object({
2996
- type: y
2997
- }), f = M.extend({
2998
- type: e.literal(y.enum.PHONE),
2999
- provider: w,
3000
- usage: A.optional()
3001
- }), 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 = {
3002
3363
  collectionName: "Notifications",
3003
- transform: { _id: "oid", business: "oid" }
3364
+ transform: {
3365
+ _id: "oid",
3366
+ business: "oid",
3367
+ campaign: "oid",
3368
+ member: "oid"
3369
+ }
3004
3370
  };
3005
3371
  e.object({
3006
- _id: a,
3007
- business: a,
3008
- target: e.string(),
3372
+ _id: n,
3373
+ business: n,
3374
+ status: pe,
3375
+ ref: e.string().optional(),
3009
3376
  title: e.string().optional(),
3010
- message: e.string(),
3011
- option: f,
3012
- status: F,
3013
- ref: e.string().optional()
3014
- }).describe(i.describe(G));
3015
- 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({
3016
3411
  target: e.string(),
3017
3412
  title: e.string().optional(),
3018
3413
  message: e.string(),
3019
- option: f,
3414
+ option: j,
3020
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())
3021
3440
  });
3022
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({
3023
3449
  campaignId: e.string(),
3024
- notification: k,
3025
- 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
+ });
3026
3474
  });
3027
3475
  e.object({
3028
3476
  phone: e.string(),
3029
3477
  message: e.string()
3030
3478
  });
3031
- const _ = e.object({
3479
+ const N = e.object({
3032
3480
  name: e.string().optional(),
3033
3481
  address: e.string()
3034
- }), B = e.object({
3482
+ }), ye = e.object({
3035
3483
  filename: e.string(),
3036
3484
  content: e.instanceof(Uint8Array)
3037
3485
  });
3038
3486
  e.object({
3039
- from: _.optional(),
3040
- to: e.array(_),
3487
+ from: N.optional(),
3488
+ to: e.array(N),
3041
3489
  subject: e.string(),
3042
3490
  html: e.string().optional(),
3043
- attachments: e.array(B).optional()
3491
+ attachments: e.array(ye).optional()
3044
3492
  });
3045
3493
  e.object({
3046
3494
  subject: e.string(),
@@ -3080,7 +3528,7 @@ e.object({
3080
3528
  billId: e.string()
3081
3529
  });
3082
3530
  e.object({
3083
- amount: U,
3531
+ amount: A,
3084
3532
  member: e.string(),
3085
3533
  bill: e.string(),
3086
3534
  otp: e.string().nullish(),
@@ -3089,15 +3537,15 @@ e.object({
3089
3537
  e.object({
3090
3538
  orderId: e.string()
3091
3539
  });
3092
- var b = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(b || {});
3093
- 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);
3094
3542
  e.enum(["manage", "create", "read", "update", "delete"]);
3095
3543
  e.enum(["all", "restaurant", "business", "delivery", "agent"]);
3096
3544
  e.enum(["quota"]);
3097
- 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 || {});
3098
- 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);
3099
3547
  e.enum(["restaurant"]);
3100
- const V = e.object({
3548
+ const fe = e.object({
3101
3549
  label: e.string(),
3102
3550
  subject: e.union([e.string(), e.array(e.string())]),
3103
3551
  actions: e.union([e.string(), e.array(e.string())]),
@@ -3107,41 +3555,41 @@ const V = e.object({
3107
3555
  reason: e.string().optional()
3108
3556
  });
3109
3557
  e.object({
3110
- _id: a,
3558
+ _id: n,
3111
3559
  businessId: e.string(),
3112
3560
  userId: e.string(),
3113
3561
  email: e.string().nullish(),
3114
3562
  phoneNo: e.string().nullish(),
3115
- permissions: e.array(e.lazy(() => V))
3563
+ permissions: e.array(e.lazy(() => fe))
3116
3564
  }).describe(
3117
- i.describe({
3565
+ m.describe({
3118
3566
  collectionName: "PermissionUsers",
3119
3567
  transform: {
3120
3568
  _id: "oid"
3121
3569
  }
3122
3570
  })
3123
3571
  );
3124
- const z = e.object({
3572
+ const R = e.object({
3125
3573
  userId: e.string(),
3126
3574
  level: e.number(),
3127
3575
  role: e.string().optional(),
3128
3576
  businessId: e.string().optional(),
3129
3577
  restaurantId: e.string().optional()
3130
- }), 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())));
3131
3579
  e.object({
3132
- isAdmin: W,
3133
- getRules: Y
3580
+ isAdmin: be,
3581
+ getRules: He
3134
3582
  });
3135
3583
  e.object({
3136
- transactions: e.array(j),
3137
- collections: e.array(J)
3584
+ transactions: e.array(F),
3585
+ collections: e.array(G)
3138
3586
  });
3139
- const C = e.enum([
3587
+ const L = e.enum([
3140
3588
  "ROCK_PAPER_SCISSOR"
3141
3589
  ]);
3142
- C.enum.ROCK_PAPER_SCISSOR + "";
3590
+ L.enum.ROCK_PAPER_SCISSOR + "";
3143
3591
  e.object({
3144
- type: C
3592
+ type: L
3145
3593
  });
3146
3594
  e.object({
3147
3595
  host: e.string().url(),
@@ -3150,7 +3598,7 @@ e.object({
3150
3598
  roomId: e.string()
3151
3599
  });
3152
3600
  e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
3153
- const K = {
3601
+ const ze = {
3154
3602
  collectionName: "MarketingMaterials",
3155
3603
  transform: {
3156
3604
  _id: "oid",
@@ -3158,13 +3606,13 @@ const K = {
3158
3606
  }
3159
3607
  };
3160
3608
  e.object({
3161
- _id: a,
3162
- business: a,
3609
+ _id: n,
3610
+ business: n,
3163
3611
  imageUrl: e.string().url(),
3164
3612
  headline: e.string(),
3165
3613
  caption: e.string(),
3166
3614
  editedAt: e.coerce.date()
3167
- }).describe(i.describe(K));
3615
+ }).describe(m.describe(ze));
3168
3616
  e.object({
3169
3617
  id: e.number(),
3170
3618
  name: e.string(),
@@ -3184,12 +3632,12 @@ e.object({
3184
3632
  phone: e.string().optional(),
3185
3633
  email: e.string().optional()
3186
3634
  });
3187
- const X = e.enum([
3635
+ const Te = e.enum([
3188
3636
  "PENDING",
3189
3637
  "SUCCESS",
3190
3638
  "FAILED",
3191
3639
  "RETRYING"
3192
- ]), q = {
3640
+ ]), Ce = {
3193
3641
  collectionName: "WebhookLogs",
3194
3642
  transform: {
3195
3643
  _id: "oid",
@@ -3197,39 +3645,39 @@ const X = e.enum([
3197
3645
  }
3198
3646
  };
3199
3647
  e.object({
3200
- _id: a,
3201
- business: a,
3648
+ _id: n,
3649
+ business: n,
3202
3650
  type: e.string(),
3203
3651
  payload: e.record(e.any()),
3204
- status: X,
3652
+ status: Te,
3205
3653
  response: e.any().optional(),
3206
3654
  error: e.string().optional()
3207
- }).describe(i.describe(q));
3208
- const Q = e.enum(["AUTO", "MANUAL"]);
3655
+ }).describe(m.describe(Ce));
3656
+ const ve = e.enum(["AUTO", "MANUAL"]);
3209
3657
  e.enum(["IN_PROGRESS", "COMPLETED"]);
3210
- const T = e.object({
3211
- _id: a,
3658
+ const x = e.object({
3659
+ _id: n,
3212
3660
  name: e.string().min(1, "Name is required").max(50),
3213
- type: Q,
3214
- event: E.optional()
3215
- }), Z = e.object({
3661
+ type: ve,
3662
+ event: V.optional()
3663
+ }), Se = e.object({
3216
3664
  from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
3217
3665
  to: e.number().int("Must be integer").nullish()
3218
- }).superRefine((n, N) => {
3219
- n.from && n.to && n.from > n.to && N.addIssue({
3666
+ }).superRefine((o, a) => {
3667
+ o.from && o.to && o.from > o.to && a.addIssue({
3220
3668
  code: "custom",
3221
3669
  message: "Max referral count must be more than min referral count"
3222
3670
  });
3223
- }), $ = e.object({
3224
- threshold: Z,
3225
- rewards: e.array(a),
3226
- pf_reward: e.array(d).optional()
3227
- }), h = e.object({
3671
+ }), Ne = e.object({
3672
+ threshold: Se,
3673
+ rewards: e.array(n),
3674
+ pf_reward: e.array(T).optional()
3675
+ }), C = e.object({
3228
3676
  id: e.string(),
3229
3677
  name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
3230
- rule: P.optional(),
3231
- rewards: e.array($)
3232
- }), ee = {
3678
+ rule: B.optional(),
3679
+ rewards: e.array(Ne)
3680
+ }), Ue = {
3233
3681
  collectionName: "ReferralRecords",
3234
3682
  transform: {
3235
3683
  _id: "oid",
@@ -3238,25 +3686,25 @@ const T = e.object({
3238
3686
  referee: "oid",
3239
3687
  refereeReward: "oid"
3240
3688
  }
3241
- }, te = e.object({
3689
+ }, Pe = e.object({
3242
3690
  completedAt: e.coerce.date(),
3243
- criteria: a,
3691
+ criteria: n,
3244
3692
  ref: e.string()
3245
- }), ae = e.object({
3246
- _id: a,
3247
- business: a,
3248
- referer: a,
3249
- referee: a,
3250
- criteria: e.array(T),
3251
- reward: e.array(h),
3252
- refereeReward: e.array(a).optional(),
3253
- criteria_progress: e.array(te),
3693
+ }), je = e.object({
3694
+ _id: n,
3695
+ business: n,
3696
+ referer: n,
3697
+ referee: n,
3698
+ criteria: e.array(x),
3699
+ reward: e.array(C),
3700
+ refereeReward: e.array(n).optional(),
3701
+ criteria_progress: e.array(Pe),
3254
3702
  status: e.string(),
3255
- pf_referer: r.optional(),
3256
- pf_referee: r.optional(),
3257
- pf_refereeReward: e.array(d).optional()
3258
- }).describe(i.describe(ee));
3259
- ae.pick({
3703
+ pf_referer: g.optional(),
3704
+ pf_referee: g.optional(),
3705
+ pf_refereeReward: e.array(T).optional()
3706
+ }).describe(m.describe(Ue));
3707
+ je.pick({
3260
3708
  _id: !0,
3261
3709
  business: !0,
3262
3710
  referer: !0,
@@ -3264,79 +3712,83 @@ ae.pick({
3264
3712
  criteria_progress: !0,
3265
3713
  criteria: !0
3266
3714
  }).extend({
3267
- pf_referee: r.pick({
3715
+ pf_referee: g.pick({
3268
3716
  _id: !0,
3269
3717
  name: !0,
3270
3718
  phoneNumber: !0,
3271
3719
  photoUrl: !0
3272
3720
  })
3273
3721
  });
3274
- const ne = {
3722
+ const Ee = {
3275
3723
  collectionName: "ReferralProgram",
3276
3724
  transform: {
3277
3725
  _id: "oid",
3278
3726
  business: "oid"
3279
3727
  }
3280
- }, v = e.object({
3281
- _id: a,
3282
- business: a,
3728
+ }, D = e.object({
3729
+ _id: n,
3730
+ business: n,
3283
3731
  term_and_condition: e.string().optional(),
3284
- refereeReward: e.array(a).optional(),
3285
- reward: e.array(h),
3286
- criteria: e.array(T)
3287
- }).describe(i.describe(ne));
3732
+ refereeReward: e.array(n).optional(),
3733
+ reward: e.array(C),
3734
+ criteria: e.array(x)
3735
+ }).describe(m.describe(Ee));
3288
3736
  e.object({
3289
- referer: a,
3290
- referee: a,
3291
- business: a
3737
+ referer: n,
3738
+ referee: n,
3739
+ business: n
3292
3740
  });
3293
3741
  e.object({
3294
- program: v.pick({
3742
+ program: D.pick({
3295
3743
  _id: !0,
3296
3744
  business: !0,
3297
3745
  term_and_condition: !0
3298
3746
  }).extend({
3299
- reward: h.optional(),
3300
- pf_refereeReward: e.array(d).optional()
3747
+ reward: C.optional(),
3748
+ pf_refereeReward: e.array(T).optional()
3301
3749
  }),
3302
3750
  referralCount: e.number(),
3303
3751
  successReferralCount: e.number(),
3304
- referredBy: r.pick({
3752
+ referredBy: g.pick({
3305
3753
  _id: !0,
3306
3754
  name: !0,
3307
3755
  phoneNumber: !0,
3308
3756
  photoUrl: !0
3309
3757
  }).optional()
3310
3758
  });
3311
- v.extend({
3759
+ D.extend({
3312
3760
  updateReferralRecord: e.boolean().optional()
3313
3761
  });
3314
- const oe = e.object({
3762
+ const Je = e.object({
3315
3763
  facebookPageId: e.string(),
3316
3764
  pageName: e.string(),
3317
3765
  pageProfileImageUrl: e.string(),
3318
3766
  pageAccessToken: e.string().optional(),
3319
- locationIds: e.array(a)
3320
- }), ie = e.object({
3321
- locationId: a.nullable(),
3767
+ locationIds: e.array(n)
3768
+ }), Oe = e.object({
3769
+ locationId: n.nullable(),
3322
3770
  googleLocationName: e.string(),
3323
3771
  displayName: e.string().optional()
3324
- }), le = e.object({
3772
+ }), Ie = e.object({
3325
3773
  accessToken: e.string().nullable(),
3326
3774
  refreshToken: e.string().nullable(),
3327
3775
  accessTokenExpiresAt: e.date().nullable(),
3328
- locations: e.array(ie)
3329
- }), re = e.object({
3776
+ locations: e.array(Oe),
3777
+ lastSyncTime: e.coerce.date().nullish(),
3778
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3779
+ }), Re = e.object({
3330
3780
  token: e.string().nullable(),
3331
- pages: e.array(oe)
3781
+ pages: e.array(Je),
3782
+ lastSyncTime: e.coerce.date().nullish(),
3783
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3332
3784
  });
3333
3785
  e.object({
3334
- _id: a,
3335
- businessId: a,
3336
- google: le.nullable(),
3337
- facebook: re.nullable()
3786
+ _id: n,
3787
+ businessId: n,
3788
+ google: Ie.nullable(),
3789
+ facebook: Re.nullable()
3338
3790
  }).describe(
3339
- i.describe({
3791
+ m.describe({
3340
3792
  collectionName: "ReviewSourceConfig",
3341
3793
  transform: {
3342
3794
  _id: "oid",
@@ -3380,7 +3832,9 @@ e.object({
3380
3832
  displayName: e.string().optional(),
3381
3833
  locationId: e.string().nullable()
3382
3834
  })
3383
- )
3835
+ ),
3836
+ lastSyncTime: e.string().datetime().nullable(),
3837
+ syncFrequency: e.number().int().min(1).max(30)
3384
3838
  }).nullable(),
3385
3839
  facebook: e.object({
3386
3840
  token: e.string().nullable(),
@@ -3391,30 +3845,32 @@ e.object({
3391
3845
  pageProfileImageUrl: e.string(),
3392
3846
  locationIds: e.array(e.string())
3393
3847
  })
3394
- )
3848
+ ),
3849
+ lastSyncTime: e.string().datetime().nullable(),
3850
+ syncFrequency: e.number().int().min(1).max(30)
3395
3851
  }).nullable()
3396
3852
  });
3397
- const c = e.object({
3853
+ const u = e.object({
3398
3854
  name: e.string(),
3399
3855
  pictureUrl: e.string(),
3400
3856
  phoneNumber: e.string().optional()
3401
- }), ce = c.extend({
3857
+ }), Le = u.extend({
3402
3858
  isAnonymous: e.boolean().optional()
3403
- }), pe = c.extend({
3859
+ }), xe = u.extend({
3404
3860
  id: e.string().optional()
3405
- }), p = e.object({
3861
+ }), h = e.object({
3406
3862
  comment: e.string(),
3407
3863
  updateTime: e.coerce.date()
3408
3864
  });
3409
3865
  e.object({
3410
3866
  comment: e.string().trim().min(1).max(4096)
3411
3867
  });
3412
- const l = e.object({
3868
+ const s = e.object({
3413
3869
  externalId: e.string().optional(),
3414
3870
  thumbnailUrl: e.string(),
3415
3871
  thumbnailLabel: e.string(),
3416
3872
  videoUrl: e.string().optional()
3417
- }), me = {
3873
+ }), De = {
3418
3874
  collectionName: "Reviews",
3419
3875
  transform: {
3420
3876
  _id: "oid",
@@ -3422,31 +3878,31 @@ const l = e.object({
3422
3878
  reviewerId: "oid",
3423
3879
  restaurantId: "oid"
3424
3880
  }
3425
- }, S = e.enum([
3881
+ }, w = e.enum([
3426
3882
  "google",
3427
3883
  "facebook",
3428
3884
  "feedme",
3429
3885
  "feedvibe"
3430
3886
  ]);
3431
- S.options;
3887
+ w.options;
3432
3888
  e.enum(["google", "facebook"]);
3433
- const se = e.enum([
3889
+ const we = e.enum([
3434
3890
  "createTime_desc",
3435
3891
  "createTime_asc",
3436
3892
  "rating_asc",
3437
3893
  "rating_desc"
3438
3894
  ]);
3439
3895
  e.object({
3440
- source: S.array().optional(),
3896
+ source: w.array().optional(),
3441
3897
  dateFrom: e.string().datetime({ offset: !0 }).optional(),
3442
3898
  dateTo: e.string().datetime({ offset: !0 }).optional(),
3443
3899
  locationId: e.string().optional(),
3444
3900
  excludeDeleted: e.boolean().optional(),
3445
- sort: se.optional(),
3901
+ sort: we.optional(),
3446
3902
  limit: e.coerce.number().int().positive().optional(),
3447
3903
  skip: e.coerce.number().int().min(0).optional()
3448
3904
  });
3449
- const Re = e.object({
3905
+ const pt = e.object({
3450
3906
  averageScore: e.number(),
3451
3907
  total: e.number().int().nonnegative(),
3452
3908
  starCounts: e.array(
@@ -3455,54 +3911,54 @@ const Re = e.object({
3455
3911
  count: e.number().int().nonnegative()
3456
3912
  })
3457
3913
  )
3458
- }), m = e.object({
3914
+ }), _ = e.object({
3459
3915
  name: e.string(),
3460
3916
  pictureUrl: e.string().optional(),
3461
3917
  phoneNumber: e.string().optional()
3462
- }), ge = m.extend({
3918
+ }), Ae = _.extend({
3463
3919
  _id: e.string().optional()
3464
- }), de = m.extend({
3920
+ }), Me = _.extend({
3465
3921
  _id: e.string()
3466
- }), he = m.extend({
3922
+ }), Fe = _.extend({
3467
3923
  isAnonymous: e.boolean().optional()
3468
- }), ue = m.extend({
3924
+ }), Ge = _.extend({
3469
3925
  id: e.string().optional()
3470
- }), s = e.object({
3471
- _id: a,
3926
+ }), y = e.object({
3927
+ _id: n,
3472
3928
  comment: e.string(),
3473
3929
  createTime: e.coerce.date(),
3474
3930
  updateTime: e.coerce.date().nullish(),
3475
- restaurantId: a,
3931
+ restaurantId: n,
3476
3932
  restaurantName: e.string()
3477
- }), _e = s.extend({
3933
+ }), ke = y.extend({
3478
3934
  source: e.literal("google"),
3479
3935
  externalId: e.string().min(1),
3480
3936
  translatedComment: e.string().optional(),
3481
- reviewer: he.optional(),
3482
- reply: p.optional(),
3483
- mediaItems: e.array(l),
3937
+ reviewer: Fe.optional(),
3938
+ reply: h.optional(),
3939
+ mediaItems: e.array(s),
3484
3940
  starRating: e.number(),
3485
3941
  locationName: e.string(),
3486
3942
  locationDisplayName: e.string(),
3487
3943
  originalUrl: e.string().optional()
3488
- }), ye = s.extend({
3944
+ }), Be = y.extend({
3489
3945
  source: e.literal("facebook"),
3490
3946
  externalId: e.string().min(1),
3491
- reviewer: ue.optional(),
3947
+ reviewer: Ge.optional(),
3492
3948
  isPositive: e.boolean().optional(),
3493
3949
  pageId: e.string(),
3494
3950
  pageName: e.string()
3495
- }), fe = s.extend({
3951
+ }), Ve = y.extend({
3496
3952
  source: e.literal("feedme"),
3497
- reviewer: ge.optional(),
3498
- reply: p.optional(),
3953
+ reviewer: Ae.optional(),
3954
+ reply: h.optional(),
3499
3955
  starRating: e.number(),
3500
- mediaItems: e.array(l),
3956
+ mediaItems: e.array(s),
3501
3957
  billId: e.string()
3502
- }), be = s.extend({
3958
+ }), We = y.extend({
3503
3959
  source: e.literal("feedvibe"),
3504
3960
  externalId: e.string().min(1),
3505
- reviewer: de.optional(),
3961
+ reviewer: Me.optional(),
3506
3962
  rating: e.object({
3507
3963
  overall: e.number(),
3508
3964
  food: e.number(),
@@ -3510,67 +3966,67 @@ const Re = e.object({
3510
3966
  atmosphere: e.number()
3511
3967
  }),
3512
3968
  verified: e.boolean(),
3513
- mediaItems: e.array(l).default([])
3969
+ mediaItems: e.array(s).default([])
3514
3970
  });
3515
3971
  e.discriminatedUnion("source", [
3516
- _e,
3517
- ye,
3518
- fe,
3519
- be
3972
+ ke,
3973
+ Be,
3974
+ Ve,
3975
+ We
3520
3976
  ]);
3521
3977
  e.object({
3522
3978
  comment: e.string(),
3523
3979
  starRating: e.number(),
3524
3980
  billId: e.string(),
3525
3981
  isAnonymous: e.boolean(),
3526
- mediaItems: e.array(l).optional()
3982
+ mediaItems: e.array(s).optional()
3527
3983
  });
3528
3984
  e.object({
3529
3985
  name: e.string().trim().min(1),
3530
3986
  phoneNumber: e.string().trim().min(1).optional()
3531
3987
  });
3532
- const g = e.object({
3533
- _id: a,
3534
- businessId: a,
3988
+ const f = e.object({
3989
+ _id: n,
3990
+ businessId: n,
3535
3991
  comment: e.string(),
3536
3992
  createTime: e.coerce.date(),
3537
3993
  updateTime: e.coerce.date().nullish(),
3538
- restaurantId: a,
3994
+ restaurantId: n,
3539
3995
  restaurantName: e.string(),
3540
3996
  deletedAt: e.coerce.date().optional()
3541
- }), He = g.extend({
3997
+ }), Ye = f.extend({
3542
3998
  source: e.literal("google"),
3543
3999
  externalId: e.string().min(1),
3544
4000
  translatedComment: e.string().optional(),
3545
- reviewer: ce.optional(),
3546
- reply: p.optional(),
3547
- mediaItems: e.array(l),
4001
+ reviewer: Le.optional(),
4002
+ reply: h.optional(),
4003
+ mediaItems: e.array(s),
3548
4004
  starRating: e.number(),
3549
4005
  locationName: e.string(),
3550
4006
  locationDisplayName: e.string(),
3551
4007
  originalUrl: e.string().optional()
3552
- }), ze = g.extend({
4008
+ }), Ke = f.extend({
3553
4009
  source: e.literal("facebook"),
3554
4010
  externalId: e.string().min(1),
3555
- reviewer: pe.optional(),
4011
+ reviewer: xe.optional(),
3556
4012
  isPositive: e.boolean().optional(),
3557
4013
  pageId: e.string(),
3558
4014
  pageName: e.string()
3559
- }), Ce = g.extend({
4015
+ }), qe = f.extend({
3560
4016
  source: e.literal("feedme"),
3561
4017
  isAnonymous: e.boolean(),
3562
4018
  metadata: e.record(e.string(), e.unknown()).optional(),
3563
- reviewerId: a.optional(),
3564
- reviewer: c.optional(),
3565
- reply: p.optional(),
4019
+ reviewerId: n.optional(),
4020
+ reviewer: u.optional(),
4021
+ reply: h.optional(),
3566
4022
  starRating: e.number(),
3567
4023
  billId: e.string(),
3568
- mediaItems: e.array(l)
3569
- }), Te = g.extend({
4024
+ mediaItems: e.array(s)
4025
+ }), Xe = f.extend({
3570
4026
  source: e.literal("feedvibe"),
3571
4027
  externalId: e.string().min(1),
3572
- reviewerId: a,
3573
- reviewer: c,
4028
+ reviewerId: n,
4029
+ reviewer: u,
3574
4030
  rating: e.object({
3575
4031
  overall: e.number(),
3576
4032
  food: e.number(),
@@ -3578,23 +4034,29 @@ const g = e.object({
3578
4034
  atmosphere: e.number()
3579
4035
  }),
3580
4036
  verified: e.boolean(),
3581
- mediaItems: e.array(l).default([])
4037
+ mediaItems: e.array(s).default([])
3582
4038
  });
3583
4039
  e.discriminatedUnion("source", [
3584
- He,
3585
- ze,
3586
- Ce,
3587
- Te
3588
- ]).describe(i.describe(me));
4040
+ Ye,
4041
+ Ke,
4042
+ qe,
4043
+ Xe
4044
+ ]).describe(m.describe(De));
3589
4045
  export {
3590
- O as F,
3591
- Ee as S,
3592
- Je as T,
3593
- Ie as W,
3594
- Oe as a,
3595
- $ as b,
3596
- T as c,
3597
- h as d,
3598
- Re as e,
3599
- p as f
4046
+ ae as F,
4047
+ t as R,
4048
+ lt as S,
4049
+ it as T,
4050
+ ct as W,
4051
+ H as a,
4052
+ rt as b,
4053
+ C as c,
4054
+ Ne as d,
4055
+ x as e,
4056
+ $ as f,
4057
+ Z as g,
4058
+ pt as h,
4059
+ W as i,
4060
+ h as j,
4061
+ q as s
3600
4062
  };