@feedmepos/mf-connect 0.1.115-prod → 0.1.117-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 (153) hide show
  1. package/README.md +64 -1
  2. package/dist/{App-CvtSY8ZO.js → App-BpcsgH7K.js} +444 -427
  3. package/dist/AuditLogs-BNnUiVnD.js +2016 -0
  4. package/dist/{Bin-B3gS9QVZ.js → Bin-Cm0wjQeR.js} +8 -8
  5. package/dist/{Broadcast-DAeb-HaN.js → Broadcast-BoJaHqnO.js} +22 -21
  6. package/dist/{CampaignAnalytic-BfTaHVem.js → CampaignAnalytic-Eg4xZW0B.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zsei4OfG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js} +9 -9
  8. package/dist/{Card-JFeVIwFs.js → Card-BfkMcFaG.js} +25 -24
  9. package/dist/{Collections-xcDpEhIm.js → Collections-RXmxQbII.js} +197 -185
  10. package/dist/{Credit-C9HJZjDS.js → Credit-CsRPM1jv.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DSqVY91w.js → DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C3J0rCTt.js → EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js} +32 -32
  14. package/dist/{Experience-DszS8gto.js → Experience-BC8Pj-v9.js} +32 -31
  15. package/dist/{FileSaver.min-CFVQKaC-.js → FileSaver.min-DzmoQFA0.js} +1 -1
  16. package/dist/{Game-DhgeN7E2.js → Game-DJXNHFBs.js} +19 -18
  17. package/dist/{GiftCardSetup-CWm6IhrS.js → GiftCardSetup-_0n8lU-t.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BuKADvmK.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js} +7 -7
  19. package/dist/{Goals-DtRVierH.js → Goals-DSZwKpds.js} +4 -4
  20. package/dist/Grab-DDc7e-AC.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DlEFyu6h.js → ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js} +1 -1
  22. package/dist/{Index-DFRcu_qE.js → Index-Cbi0bquE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B3Br4Xvi.js → LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CjNJj3qj.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js} +1 -1
  25. package/dist/{LoyaltyDashboard-BWHKDPzk.js → LoyaltyDashboard-fK90c27A.js} +15 -15
  26. package/dist/MainLayout-Bf-l9yL4.js +4 -0
  27. package/dist/{MainLayout-BmpNNAiE.js → MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js} +5 -4
  28. package/dist/Marketing-B7cZGsO-.js +269 -0
  29. package/dist/MarketingMaterialEdit-5IcV2ct6.js +1037 -0
  30. package/dist/{Member-xEzrBW_p.js → Member-BGTrRVdq.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DRoC-I0t.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js} +43 -50
  32. package/dist/{MemberImportHistory-CEQpBBF8.js → MemberImportHistory--FxkTJmu.js} +7 -7
  33. package/dist/{MemberList-CCvzkHv8.js → MemberList-EjY5dgwt.js} +103 -105
  34. package/dist/{MemberTransactions-Bmh39J2W.js → MemberTransactions-Oia7LIFK.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D3Pmk80l.js → MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js} +14 -14
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DIBKAwHP.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js} +1 -1
  37. package/dist/{Mission-CpUo2Bgw.js → Mission-BFHYb4aT.js} +22 -21
  38. package/dist/{Overview-DcDZmDXA.js → Overview-BVNyQxFL.js} +23 -22
  39. package/dist/{Overview-CwQqQ1Tn.js → Overview-d5U37aot.js} +145 -144
  40. package/dist/{Point-CUNQsQIx.js → Point-CXkqH02Z.js} +22 -21
  41. package/dist/{Promotion-Cqdim7aW.js → Promotion-DdxNvlOO.js} +137 -131
  42. package/dist/{Queue-CNBVh1UG.js → Queue-C96oNKyP.js} +46 -45
  43. package/dist/{Record-BYwz4l4o.js → Record-Bj2e2Y4i.js} +9 -9
  44. package/dist/{Review-CqLcZFj8.js → Review-CJK5S1oI.js} +2 -2
  45. package/dist/ReviewFacebookCallback-ChG7TRy5.js +225 -0
  46. package/dist/{ReviewGoogleCallback-Dg8R7QlO.js → ReviewGoogleCallback-Dmk4VyGA.js} +5 -5
  47. package/dist/{Reward-M8GZ8eHq.js → Reward-Dh2YI0Xb.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BkM9-Sx-.js → RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js +1923 -0
  50. package/dist/{Segment-CrMi6xrp.js → Segment-FYvtCkqH.js} +304 -305
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DKH5_9db.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyeAQ-hg.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js} +4 -4
  53. package/dist/Setting-CUAWjCqa.js +574 -0
  54. package/dist/{SettingAdvertisements-Dh7v4c1D.js → SettingAdvertisements-COIQwUD6.js} +12 -12
  55. package/dist/Settings-D2gFPvmW.js +286 -0
  56. package/dist/{Store-CV-BmK5b.js → Store-BAXwiyvx.js} +31 -30
  57. package/dist/{StoreRewards-DPhSLvSZ.js → StoreRewards-2mUavtUg.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js +7007 -0
  60. package/dist/{Tier-ChvYps23.js → Tier-BmAOzRHL.js} +2576 -687
  61. package/dist/{Title-v-Ivswr1.js → Title-DMxiUg30.js} +94 -92
  62. package/dist/{Transaction-CRqE1Ix0.js → Transaction-CF6hXEpN.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B0Uh9iuj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js} +26 -26
  64. package/dist/{Voucher-Bg8FOuzD.js → Voucher-DrtITxq-.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-HKxivQMF.js → VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js} +16 -16
  66. package/dist/WhatsappAccount-Bb0Y7ikk.js +159 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js +39 -0
  68. package/dist/WhatsappBot-DNvvaPey.js +876 -0
  69. package/dist/WhatsappBotLogs-C8M-1pvv.js +372 -0
  70. package/dist/WhatsappBotSettings-D6egqUyU.js +705 -0
  71. package/dist/WhatsappLayout-DeQTPuF6.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js +253 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-8d290Dcp.js → ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js} +2 -2
  74. package/dist/{app-DdNKsn2Q.js → app-BjdLqYQq.js} +8879 -7107
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-R97FrSQL.js → base.export-B68z5BF6.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-Ce8vq3wQ.js → business-D9fgkHxb.js} +1 -1
  79. package/dist/{campaign-C19If7bW.js → campaign-Dw_ujovr.js} +121 -94
  80. package/dist/{campaign-BTllt2LH.js → campaign-eMaPX8r6.js} +31 -25
  81. package/dist/{campaign.enum-9CCbalR4.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/{campaign.fn-B4g03h0A.js → campaign.fn-DFjGNvmN.js} +78 -78
  83. package/dist/{collectible.enum-MvqF7mSg.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-CR0bD33S.js → collection.fn-CCOWtB-c.js} +2 -2
  85. package/dist/{currency-DmlguGIM.js → currency-CTLKReFC.js} +1 -1
  86. package/dist/duplicateCampaign-BcpBfUGL.js +51 -0
  87. package/dist/{effect-Dx3zfl28.js → effect-CTI1ZH57.js} +1 -1
  88. package/dist/{email-addresses-De5PGOY4.js → email-addresses-B74e3bnB.js} +2 -2
  89. package/dist/{feature-flag-CD9V1V0h.js → feature-flag-DVdEaChJ.js} +182 -166
  90. package/dist/google-BQK68wbe.js +5 -0
  91. package/dist/{helper-CEiv7SaO.js → helper-as9K-piK.js} +1 -1
  92. package/dist/{index-CBJy9bxB.js → index-3LjKJhQa.js} +1 -1
  93. package/dist/{index-BW6eb3n6.js → index-8mBfDn3M.js} +611 -252
  94. package/dist/{index-D4d3l0gw.js → index-B0h0iYWP.js} +8 -7
  95. package/dist/{index-BAXKd9Gg.js → index-BEKMTiFb.js} +198 -198
  96. package/dist/{index-B8yWVB8P.js → index-BW7FoVEA.js} +4 -3
  97. package/dist/{index-BVdYxi3l.js → index-B_wRpO02.js} +29 -15
  98. package/dist/{index-B8meeQoD.js → index-Ba719MYq.js} +1 -1
  99. package/dist/{index-BDPnyro2.js → index-BbVbqe4Y.js} +19 -6
  100. package/dist/{index-CqOCJTeR.js → index-BhTrG89b.js} +390 -232
  101. package/dist/index-C-iwb2Ln.js +109 -0
  102. package/dist/{index-CPODug8b.js → index-C5V6u2Qd.js} +2700 -2613
  103. package/dist/{index-CWUrODxL.js → index-CHU3UePP.js} +1 -1
  104. package/dist/{index-IZRfmmde.js → index-CQxkDpX0.js} +683 -581
  105. package/dist/{index-DT3S00_Y.js → index-CWLOcQ6j.js} +11 -10
  106. package/dist/index-C_H8jFYf.js +2743 -0
  107. package/dist/{index-__UT3_Ey.js → index-Ckz6u3ac.js} +2 -2
  108. package/dist/{index-BYI9ttxy.js → index-Czg-2Ni0.js} +8028 -10767
  109. package/dist/{index-xct3mnu8.js → index-DKI8401o.js} +7 -7
  110. package/dist/{index-649OZ_e1.js → index-DcZiikOH.js} +2 -2
  111. package/dist/{index-BquSqx6K.js → index-QHqcSN2q.js} +4 -4
  112. package/dist/{index-BR9h5DTI.js → index-TAoQpeLQ.js} +1 -1
  113. package/dist/index-wsCCqwdr.js +74 -0
  114. package/dist/{index.esm2017-AVbZ9btd.js → index.esm2017-DL6rTGDW.js} +177 -177
  115. package/dist/{loading-BvHm1m3K.js → loading-x6IScY4K.js} +1 -1
  116. package/dist/{lodash-Dvrceo7x.js → lodash-nwnDizYo.js} +1 -1
  117. package/dist/{member-import-c9avpiSS.js → member-import-C-b01Tyd.js} +6 -5
  118. package/dist/{membership-D-pZS634.js → membership-DfarOMtO.js} +3 -3
  119. package/dist/{money-D4skwMkD.js → money-CFn-jR4W.js} +1 -1
  120. package/dist/{number-DJ6ncfT6.js → number-CSlyDL2x.js} +1 -1
  121. package/dist/objectid-zcT6ESET.js +145 -0
  122. package/dist/{onboarding-t7R1d3h-.js → onboarding-DyaFaaF2.js} +25 -25
  123. package/dist/{onboardingSetup-lTaJc0oT.js → onboardingSetup-DQt91O9f.js} +2 -2
  124. package/dist/{plugins-DQNOWwRC.js → plugins-DEHr0UOe.js} +3 -3
  125. package/dist/{MarketingMaterialEdit-x3c_N7Gs.js → remy-icon-BhUGu2NI.js} +2 -1031
  126. package/dist/{reward-BK150pjm.js → reward-Du_Pv-4p.js} +1 -1
  127. package/dist/{rule-COcdAnUu.js → rule-DfqmQTVK.js} +572 -492
  128. package/dist/style.css +1 -1
  129. package/dist/template-CcbNF4PF.js +188 -0
  130. package/dist/{timezone-BP6UC4KL.js → timezone-_4tabIaK.js} +1 -1
  131. package/dist/{transaction.fn-BY0hzon0.js → transaction.fn-C46PHwCV.js} +2 -2
  132. package/dist/{trigger-DVBjVPbN.js → trigger-Dipr6btC.js} +8 -8
  133. package/dist/useMarketingMaterialActions-BAw2ZjeF.js +125 -0
  134. package/dist/{usePagination-QT552XyF.js → usePagination-D6RZ18zS.js} +1 -1
  135. package/dist/{user-CmAxNc7T.js → user-BCexQj3Q.js} +1 -1
  136. package/dist/vue-i18n-DXvyTCZf.js +2365 -0
  137. package/dist/{xlsx-DAczoc8y.js → xlsx-BTxt_Jg6.js} +224 -224
  138. package/dist/{zod-Aj-GuVQL.js → zod-T4wMYjWT.js} +1 -1
  139. package/package.json +6 -2
  140. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D_jXVE2I.js +0 -3494
  141. package/dist/Marketing-BKK45Eve.js +0 -236
  142. package/dist/ReviewFacebookCallback-DbSCILNN.js +0 -238
  143. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CnaL93TF.js +0 -1883
  144. package/dist/Setting-BnFRI0Se.js +0 -2037
  145. package/dist/Settings-BvT8_tkQ.js +0 -179
  146. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDu1QySl.js +0 -1264
  147. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Dqz6jTlH.js +0 -142
  148. package/dist/google-C3S8u0mT.js +0 -4
  149. package/dist/objectid-DEMM_jdR.js +0 -145
  150. package/dist/rule-builder-Deufb6h_.js +0 -102
  151. package/dist/template-DeebIqJ_.js +0 -236
  152. package/dist/useMarketingMaterialActions-DpQCQHFI.js +0 -96
  153. package/dist/vue-i18n-Cze706-f.js +0 -2365
@@ -1,12 +1,187 @@
1
- import { z as e, F as a, m as i, b as O } from "./index-BYI9ttxy.js";
2
- import { d as I } from "./index-CPODug8b.js";
3
- import { R as t } from "./rule-builder-Deufb6h_.js";
4
- import { i as o } from "./helper-CEiv7SaO.js";
5
- import { e as u, b as H, f as r } from "./index-BAXKd9Gg.js";
6
- import { B as R, C as L, A as c } from "./index-IZRfmmde.js";
7
- import { d as x } from "./index-CqOCJTeR.js";
8
- import { F as _ } from "./index-D4d3l0gw.js";
9
- const Fe = {
1
+ import { F as n, m, b as A } from "./index-Czg-2Ni0.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-CQxkDpX0.js";
4
+ import { _ as k, l as v, f as B } from "./index-C5V6u2Qd.js";
5
+ import { i as p } from "./helper-as9K-piK.js";
6
+ import { d as z, b as U, e as d } from "./index-BEKMTiFb.js";
7
+ import { d as V } from "./index-BhTrG89b.js";
8
+ import { F as T } from "./index-B0h0iYWP.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 = {
10
185
  PROMOTION: {
11
186
  name: "Promotion Template",
12
187
  description: "Promotion template for campaign creation.",
@@ -412,7 +587,7 @@ const Fe = {
412
587
  // },
413
588
  hideInApp: !0
414
589
  },
415
- configs: o("VOUCHER", {
590
+ configs: p("VOUCHER", {
416
591
  name: "",
417
592
  business: null,
418
593
  noCampaign: !1
@@ -1402,7 +1577,7 @@ const Fe = {
1402
1577
  rewards: []
1403
1578
  }
1404
1579
  },
1405
- configs: o("GAME", {
1580
+ configs: p("GAME", {
1406
1581
  name: "Token",
1407
1582
  business: null,
1408
1583
  noCampaign: !1
@@ -1643,18 +1818,184 @@ const Fe = {
1643
1818
  type: "timeframe"
1644
1819
  }
1645
1820
  },
1646
- configs: o("STAMP", {
1821
+ configs: p("STAMP", {
1647
1822
  business: null,
1648
1823
  noCampaign: !1
1649
1824
  })
1650
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
+ }
1651
1992
  }
1652
1993
  };
1653
- t.scaffoldGroup(), o("STAMP", {
1994
+ t.scaffoldGroup(), p("STAMP", {
1654
1995
  business: null,
1655
1996
  noCampaign: !1
1656
1997
  });
1657
- const Me = {
1998
+ const lt = {
1658
1999
  _id: "",
1659
2000
  intention: [],
1660
2001
  name: "Spend and get voucher",
@@ -2052,7 +2393,7 @@ const Me = {
2052
2393
  amount: 1
2053
2394
  }
2054
2395
  },
2055
- configs: o("VOUCHER", {
2396
+ configs: p("VOUCHER", {
2056
2397
  name: "",
2057
2398
  business: null,
2058
2399
  noCampaign: !1
@@ -2061,7 +2402,7 @@ const Me = {
2061
2402
  };
2062
2403
  ({
2063
2404
  ...t.scaffoldGroup()
2064
- }, o("VOUCHER", {
2405
+ }, p("VOUCHER", {
2065
2406
  name: "",
2066
2407
  business: null,
2067
2408
  noCampaign: !1
@@ -2072,7 +2413,7 @@ const Me = {
2072
2413
  ({
2073
2414
  ...t.scaffoldGroup()
2074
2415
  });
2075
- const Ge = {
2416
+ const rt = {
2076
2417
  _id: "",
2077
2418
  intention: [],
2078
2419
  name: "Spend and earn points",
@@ -2447,7 +2788,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2447
2788
  });
2448
2789
  ({
2449
2790
  ...t.scaffoldGroup()
2450
- }, o("VOUCHER", {
2791
+ }, p("VOUCHER", {
2451
2792
  name: "",
2452
2793
  business: null,
2453
2794
  noCampaign: !1
@@ -2493,12 +2834,12 @@ t.setRuleToGroup(
2493
2834
  "&&"
2494
2835
  )
2495
2836
  );
2496
- t.scaffoldGroup(), t.scaffoldGroup(), o("GAME", {
2837
+ t.scaffoldGroup(), t.scaffoldGroup(), p("GAME", {
2497
2838
  name: "Token",
2498
2839
  business: null,
2499
2840
  noCampaign: !1
2500
2841
  });
2501
- const ke = {
2842
+ const ct = {
2502
2843
  _id: "",
2503
2844
  intention: [],
2504
2845
  name: "Welcome voucher",
@@ -2844,7 +3185,7 @@ const ke = {
2844
3185
  amount: 1
2845
3186
  }
2846
3187
  },
2847
- configs: o("VOUCHER", {
3188
+ configs: p("VOUCHER", {
2848
3189
  name: "",
2849
3190
  business: null,
2850
3191
  noCampaign: !1
@@ -2875,7 +3216,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2875
3216
  ],
2876
3217
  "&&"
2877
3218
  )
2878
- ]), o("VOUCHER", {
3219
+ ]), p("VOUCHER", {
2879
3220
  name: "",
2880
3221
  business: null,
2881
3222
  noCampaign: !1
@@ -2898,7 +3239,7 @@ t.setRuleToGroup(t.scaffoldGroup(), [
2898
3239
  ({
2899
3240
  ...t.scaffoldGroup()
2900
3241
  });
2901
- const D = e.enum([
3242
+ const ae = e.enum([
2902
3243
  "MEMBER_REWARD",
2903
3244
  "PAID_LOYALTY",
2904
3245
  "COLLECT_FEEDBACK",
@@ -2908,7 +3249,7 @@ const D = e.enum([
2908
3249
  "BROADCAST",
2909
3250
  "BIRTHDAY",
2910
3251
  "GAME"
2911
- ]), w = e.enum([
3252
+ ]), ne = e.enum([
2912
3253
  "text",
2913
3254
  "number",
2914
3255
  "textarea",
@@ -2934,88 +3275,91 @@ const D = e.enum([
2934
3275
  "rule_bill",
2935
3276
  "rule_feedback",
2936
3277
  "rule_birthday",
2937
- "promotion_game_type"
2938
- ]), A = e.object({
3278
+ "promotion_game_type",
3279
+ "grab_effect",
3280
+ "grab_quota",
3281
+ "grab_conditions"
3282
+ ]), oe = e.object({
2939
3283
  label: e.string().optional(),
2940
3284
  label_locale: e.record(e.string()).nullish(),
2941
3285
  property: e.string().or(e.any()),
2942
- type: w,
3286
+ type: ne,
2943
3287
  extras: e.string().optional(),
2944
3288
  isRuleChildren: e.boolean().optional()
2945
- }), f = e.object({
3289
+ }), S = e.object({
2946
3290
  not: e.boolean().optional(),
2947
3291
  property: e.string(),
2948
3292
  value: e.any()
2949
- }), F = e.object({
3293
+ }), ie = e.object({
2950
3294
  name: e.string().optional(),
2951
3295
  name_locale: e.record(e.string()).nullish(),
2952
- fields: e.array(A),
2953
- condition: f.optional().or(
2954
- e.array(f)
3296
+ fields: e.array(oe),
3297
+ condition: S.optional().or(
3298
+ e.array(S)
2955
3299
  )
2956
- }), M = e.object({
3300
+ }), le = e.object({
2957
3301
  name: e.string(),
2958
3302
  name_locale: e.record(e.string()).nullish(),
2959
- groups: e.array(F)
3303
+ groups: e.array(ie)
2960
3304
  });
2961
3305
  e.object({
2962
- _id: a,
3306
+ _id: n,
2963
3307
  name: e.string(),
2964
3308
  name_locale: e.record(e.string()).nullish(),
2965
3309
  description: e.string().nullish(),
2966
3310
  description_locale: e.record(e.string()).nullish(),
2967
- steps: e.array(M).min(1),
2968
- intention: e.array(D),
3311
+ steps: e.array(le).min(1),
3312
+ intention: e.array(ae),
2969
3313
  defaultValue: e.any()
2970
3314
  }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
2971
- const G = {
3315
+ const re = {
2972
3316
  collectionName: "Businesses",
2973
3317
  transform: {
2974
3318
  _id: "oid"
2975
3319
  }
2976
3320
  };
2977
3321
  e.object({
2978
- _id: a,
3322
+ _id: n,
2979
3323
  ownerId: e.string(),
2980
3324
  name: e.string(),
2981
3325
  credit: e.number(),
2982
3326
  forceSend: e.boolean().optional()
2983
- }).describe(i.describe(G));
2984
- const z = e.enum(["PHONE"]), k = e.enum([
3327
+ }).describe(m.describe(re));
3328
+ const P = e.enum(["PHONE"]), ce = e.enum([
2985
3329
  "MOCEAN",
2986
3330
  "SLACK",
2987
3331
  "SMS",
2988
3332
  "EMAIL",
2989
3333
  "WHATSAPP"
2990
- ]), B = e.enum(["PENDING", "COMPLETED", "FAILED"]), V = e.enum([
3334
+ ]), pe = e.enum(["PENDING", "COMPLETED", "FAILED"]), me = e.enum([
2991
3335
  "General",
2992
3336
  "Otp",
2993
3337
  "Marketing",
2994
3338
  "Ordering",
2995
3339
  "MemberInvitation",
2996
3340
  "MarketingPromotion"
2997
- ]), W = e.object({
2998
- type: z
2999
- }), C = W.extend({
3000
- type: e.literal(z.enum.PHONE),
3001
- provider: k,
3002
- usage: V.optional()
3003
- }), T = e.enum([
3341
+ ]), se = e.object({
3342
+ type: P
3343
+ }), j = se.extend({
3344
+ type: e.literal(P.enum.PHONE),
3345
+ provider: ce,
3346
+ usage: me.optional()
3347
+ }), E = e.enum([
3004
3348
  "Accepted",
3005
3349
  "PartiallyAccepted",
3006
3350
  "Queued",
3007
3351
  "Unknown",
3008
3352
  "Failed"
3009
- ]), Y = e.enum([
3353
+ ]), ge = e.enum([
3010
3354
  "PENDING",
3011
3355
  "SUBMITTED",
3012
3356
  "SETTLED",
3013
3357
  "FAILED"
3014
- ]), v = e.object({
3358
+ ]), J = e.object({
3015
3359
  channel: e.string(),
3016
3360
  status: e.string(),
3017
3361
  statusDetails: e.string().nullish()
3018
- }), K = {
3362
+ }), de = {
3019
3363
  collectionName: "Notifications",
3020
3364
  transform: {
3021
3365
  _id: "oid",
@@ -3025,51 +3369,51 @@ const z = e.enum(["PHONE"]), k = e.enum([
3025
3369
  }
3026
3370
  };
3027
3371
  e.object({
3028
- _id: a,
3029
- business: a,
3030
- status: B,
3372
+ _id: n,
3373
+ business: n,
3374
+ status: pe,
3031
3375
  ref: e.string().optional(),
3032
3376
  title: e.string().optional(),
3033
3377
  // Single-channel fields. Absent on multi-channel dispatches, which carry
3034
3378
  // their content per channel in the submitted request instead.
3035
3379
  target: e.string().optional(),
3036
3380
  message: e.string().optional(),
3037
- option: C.optional(),
3381
+ option: j.optional(),
3038
3382
  // Multi-channel dispatch fields.
3039
- campaign: a.nullish(),
3040
- member: a.nullish(),
3383
+ campaign: n.nullish(),
3384
+ member: n.nullish(),
3041
3385
  /**
3042
3386
  * The scheduled run this dispatch belongs to. With campaign and member it
3043
3387
  * identifies one intended send, so a redelivered queue job is recognised
3044
3388
  * rather than sent twice.
3045
3389
  */
3046
3390
  runAt: e.coerce.date().nullish(),
3047
- mode: u.nullish(),
3048
- channels: e.array(H).nullish(),
3391
+ mode: z.nullish(),
3392
+ channels: e.array(U).nullish(),
3049
3393
  /**
3050
3394
  * Local submission state, kept separate from the upstream outcome so an
3051
3395
  * interrupted worker can tell "never sent" from "sent, result unknown".
3052
3396
  */
3053
- state: Y.nullish(),
3054
- outcome: T.nullish(),
3397
+ state: ge.nullish(),
3398
+ outcome: E.nullish(),
3055
3399
  /** Upstream correlation id, preserved even when the request failed. */
3056
3400
  requestId: e.string().nullish(),
3057
- attempts: e.array(v).nullish(),
3401
+ attempts: e.array(J).nullish(),
3058
3402
  /** Credit consumed upstream, recorded for reconciliation. */
3059
- creditUsed: r.nullish(),
3060
- balanceAfter: r.nullish(),
3403
+ creditUsed: d.nullish(),
3404
+ balanceAfter: d.nullish(),
3061
3405
  error: e.string().nullish(),
3062
3406
  createdAt: e.coerce.date().nullish(),
3063
3407
  submittedAt: e.coerce.date().nullish(),
3064
3408
  settledAt: e.coerce.date().nullish()
3065
- }).describe(i.describe(K));
3066
- const X = e.object({
3409
+ }).describe(m.describe(de));
3410
+ const ue = e.object({
3067
3411
  target: e.string(),
3068
3412
  title: e.string().optional(),
3069
3413
  message: e.string(),
3070
- option: C,
3414
+ option: j,
3071
3415
  ref: e.string().optional()
3072
- }), q = e.object({
3416
+ }), he = e.object({
3073
3417
  memberId: e.string(),
3074
3418
  name: e.string().nullish(),
3075
3419
  phoneNumber: e.string().nullish(),
@@ -3084,7 +3428,7 @@ const X = e.object({
3084
3428
  e.object({
3085
3429
  businessId: e.string(),
3086
3430
  forceSend: e.boolean(),
3087
- mode: u,
3431
+ mode: z,
3088
3432
  channels: e.array(
3089
3433
  e.enum(["SMS", "WHATSAPP", "EMAIL", "APP_INBOX", "PUSH_NOTIFICATION"])
3090
3434
  ),
@@ -3096,34 +3440,34 @@ e.object({
3096
3440
  });
3097
3441
  e.object({
3098
3442
  requestId: e.string().nullish(),
3099
- status: T.nullish(),
3100
- attempts: e.array(v).nullish(),
3101
- creditUsed: r.nullish(),
3102
- balance: r.nullish()
3443
+ status: E.nullish(),
3444
+ attempts: e.array(J).nullish(),
3445
+ creditUsed: d.nullish(),
3446
+ balance: d.nullish()
3103
3447
  });
3104
- const Q = e.object({
3448
+ const _e = e.object({
3105
3449
  campaignId: e.string(),
3106
3450
  business: e.string(),
3107
3451
  runAt: e.coerce.date(),
3108
- recipient: q,
3452
+ recipient: he,
3109
3453
  /** Personalised, editor-data-free content keyed by channel. */
3110
3454
  content: e.record(e.string(), e.unknown()),
3111
- mode: u,
3112
- channels: e.array(H)
3455
+ mode: z,
3456
+ channels: e.array(U)
3113
3457
  });
3114
3458
  e.object({
3115
3459
  campaignId: e.string(),
3116
3460
  /** Absent only on multi-channel jobs, which carry `dispatch` instead. */
3117
- notification: X.optional(),
3461
+ notification: ue.optional(),
3118
3462
  business: e.string(),
3119
3463
  /**
3120
3464
  * Present only for multi-channel broadcasts. When set the job takes the
3121
3465
  * multi-channel dispatch path; when absent the legacy single-channel path
3122
3466
  * runs unchanged.
3123
3467
  */
3124
- dispatch: Q.optional()
3125
- }).superRefine((n, h) => {
3126
- !n.notification && !n.dispatch && h.addIssue({
3468
+ dispatch: _e.optional()
3469
+ }).superRefine((o, a) => {
3470
+ !o.notification && !o.dispatch && a.addIssue({
3127
3471
  code: e.ZodIssueCode.custom,
3128
3472
  message: "Job must carry either a notification or a dispatch"
3129
3473
  });
@@ -3132,19 +3476,19 @@ e.object({
3132
3476
  phone: e.string(),
3133
3477
  message: e.string()
3134
3478
  });
3135
- const b = e.object({
3479
+ const N = e.object({
3136
3480
  name: e.string().optional(),
3137
3481
  address: e.string()
3138
- }), Z = e.object({
3482
+ }), ye = e.object({
3139
3483
  filename: e.string(),
3140
3484
  content: e.instanceof(Uint8Array)
3141
3485
  });
3142
3486
  e.object({
3143
- from: b.optional(),
3144
- to: e.array(b),
3487
+ from: N.optional(),
3488
+ to: e.array(N),
3145
3489
  subject: e.string(),
3146
3490
  html: e.string().optional(),
3147
- attachments: e.array(Z).optional()
3491
+ attachments: e.array(ye).optional()
3148
3492
  });
3149
3493
  e.object({
3150
3494
  subject: e.string(),
@@ -3184,7 +3528,7 @@ e.object({
3184
3528
  billId: e.string()
3185
3529
  });
3186
3530
  e.object({
3187
- amount: O,
3531
+ amount: A,
3188
3532
  member: e.string(),
3189
3533
  bill: e.string(),
3190
3534
  otp: e.string().nullish(),
@@ -3193,15 +3537,15 @@ e.object({
3193
3537
  e.object({
3194
3538
  orderId: e.string()
3195
3539
  });
3196
- var S = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(S || {});
3197
- e.nativeEnum(S);
3540
+ var O = /* @__PURE__ */ ((o) => (o[o.feedMe = 0] = "feedMe", o[o.business = 1] = "business", o[o.restaurant = 2] = "restaurant", o))(O || {});
3541
+ e.nativeEnum(O);
3198
3542
  e.enum(["manage", "create", "read", "update", "delete"]);
3199
3543
  e.enum(["all", "restaurant", "business", "delivery", "agent"]);
3200
3544
  e.enum(["quota"]);
3201
- var N = /* @__PURE__ */ ((n) => (n.marketing = "business::marketing", n.campaign = "business::campaign", n.counter = "business::counter", n.permission = "business::permission", n.role = "business::role", n))(N || {});
3202
- e.nativeEnum(N);
3545
+ var I = /* @__PURE__ */ ((o) => (o.marketing = "business::marketing", o.campaign = "business::campaign", o.counter = "business::counter", o.permission = "business::permission", o.role = "business::role", o))(I || {});
3546
+ e.nativeEnum(I);
3203
3547
  e.enum(["restaurant"]);
3204
- const $ = e.object({
3548
+ const fe = e.object({
3205
3549
  label: e.string(),
3206
3550
  subject: e.union([e.string(), e.array(e.string())]),
3207
3551
  actions: e.union([e.string(), e.array(e.string())]),
@@ -3211,41 +3555,41 @@ const $ = e.object({
3211
3555
  reason: e.string().optional()
3212
3556
  });
3213
3557
  e.object({
3214
- _id: a,
3558
+ _id: n,
3215
3559
  businessId: e.string(),
3216
3560
  userId: e.string(),
3217
3561
  email: e.string().nullish(),
3218
3562
  phoneNo: e.string().nullish(),
3219
- permissions: e.array(e.lazy(() => $))
3563
+ permissions: e.array(e.lazy(() => fe))
3220
3564
  }).describe(
3221
- i.describe({
3565
+ m.describe({
3222
3566
  collectionName: "PermissionUsers",
3223
3567
  transform: {
3224
3568
  _id: "oid"
3225
3569
  }
3226
3570
  })
3227
3571
  );
3228
- const U = e.object({
3572
+ const R = e.object({
3229
3573
  userId: e.string(),
3230
3574
  level: e.number(),
3231
3575
  role: e.string().optional(),
3232
3576
  businessId: e.string().optional(),
3233
3577
  restaurantId: e.string().optional()
3234
- }), ee = e.function().args(e.any(), U).returns(e.boolean()), te = e.function().args(U).returns(e.promise(e.array(e.any())));
3578
+ }), be = e.function().args(e.any(), R).returns(e.boolean()), He = e.function().args(R).returns(e.promise(e.array(e.any())));
3235
3579
  e.object({
3236
- isAdmin: ee,
3237
- getRules: te
3580
+ isAdmin: be,
3581
+ getRules: He
3238
3582
  });
3239
3583
  e.object({
3240
- transactions: e.array(R),
3241
- collections: e.array(L)
3584
+ transactions: e.array(F),
3585
+ collections: e.array(G)
3242
3586
  });
3243
- const P = e.enum([
3587
+ const L = e.enum([
3244
3588
  "ROCK_PAPER_SCISSOR"
3245
3589
  ]);
3246
- P.enum.ROCK_PAPER_SCISSOR + "";
3590
+ L.enum.ROCK_PAPER_SCISSOR + "";
3247
3591
  e.object({
3248
- type: P
3592
+ type: L
3249
3593
  });
3250
3594
  e.object({
3251
3595
  host: e.string().url(),
@@ -3254,7 +3598,7 @@ e.object({
3254
3598
  roomId: e.string()
3255
3599
  });
3256
3600
  e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
3257
- const ae = {
3601
+ const ze = {
3258
3602
  collectionName: "MarketingMaterials",
3259
3603
  transform: {
3260
3604
  _id: "oid",
@@ -3262,13 +3606,14 @@ const ae = {
3262
3606
  }
3263
3607
  };
3264
3608
  e.object({
3265
- _id: a,
3266
- business: a,
3609
+ _id: n,
3610
+ business: n,
3267
3611
  imageUrl: e.string().url(),
3268
3612
  headline: e.string(),
3269
3613
  caption: e.string(),
3270
- editedAt: e.coerce.date()
3271
- }).describe(i.describe(ae));
3614
+ editedAt: e.coerce.date(),
3615
+ deletedAt: e.coerce.date().optional()
3616
+ }).describe(m.describe(ze));
3272
3617
  e.object({
3273
3618
  id: e.number(),
3274
3619
  name: e.string(),
@@ -3288,12 +3633,12 @@ e.object({
3288
3633
  phone: e.string().optional(),
3289
3634
  email: e.string().optional()
3290
3635
  });
3291
- const ne = e.enum([
3636
+ const Te = e.enum([
3292
3637
  "PENDING",
3293
3638
  "SUCCESS",
3294
3639
  "FAILED",
3295
3640
  "RETRYING"
3296
- ]), oe = {
3641
+ ]), Ce = {
3297
3642
  collectionName: "WebhookLogs",
3298
3643
  transform: {
3299
3644
  _id: "oid",
@@ -3301,39 +3646,39 @@ const ne = e.enum([
3301
3646
  }
3302
3647
  };
3303
3648
  e.object({
3304
- _id: a,
3305
- business: a,
3649
+ _id: n,
3650
+ business: n,
3306
3651
  type: e.string(),
3307
3652
  payload: e.record(e.any()),
3308
- status: ne,
3653
+ status: Te,
3309
3654
  response: e.any().optional(),
3310
3655
  error: e.string().optional()
3311
- }).describe(i.describe(oe));
3312
- const ie = e.enum(["AUTO", "MANUAL"]);
3656
+ }).describe(m.describe(Ce));
3657
+ const ve = e.enum(["AUTO", "MANUAL"]);
3313
3658
  e.enum(["IN_PROGRESS", "COMPLETED"]);
3314
- const j = e.object({
3315
- _id: a,
3659
+ const x = e.object({
3660
+ _id: n,
3316
3661
  name: e.string().min(1, "Name is required").max(50),
3317
- type: ie,
3318
- event: x.optional()
3319
- }), le = e.object({
3662
+ type: ve,
3663
+ event: V.optional()
3664
+ }), Se = e.object({
3320
3665
  from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
3321
3666
  to: e.number().int("Must be integer").nullish()
3322
- }).superRefine((n, h) => {
3323
- n.from && n.to && n.from > n.to && h.addIssue({
3667
+ }).superRefine((o, a) => {
3668
+ o.from && o.to && o.from > o.to && a.addIssue({
3324
3669
  code: "custom",
3325
3670
  message: "Max referral count must be more than min referral count"
3326
3671
  });
3327
- }), re = e.object({
3328
- threshold: le,
3329
- rewards: e.array(a),
3330
- pf_reward: e.array(_).optional()
3331
- }), y = e.object({
3672
+ }), Ne = e.object({
3673
+ threshold: Se,
3674
+ rewards: e.array(n),
3675
+ pf_reward: e.array(T).optional()
3676
+ }), C = e.object({
3332
3677
  id: e.string(),
3333
3678
  name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
3334
- rule: I.optional(),
3335
- rewards: e.array(re)
3336
- }), ce = {
3679
+ rule: B.optional(),
3680
+ rewards: e.array(Ne)
3681
+ }), Ue = {
3337
3682
  collectionName: "ReferralRecords",
3338
3683
  transform: {
3339
3684
  _id: "oid",
@@ -3342,25 +3687,25 @@ const j = e.object({
3342
3687
  referee: "oid",
3343
3688
  refereeReward: "oid"
3344
3689
  }
3345
- }, pe = e.object({
3690
+ }, Pe = e.object({
3346
3691
  completedAt: e.coerce.date(),
3347
- criteria: a,
3692
+ criteria: n,
3348
3693
  ref: e.string()
3349
- }), me = e.object({
3350
- _id: a,
3351
- business: a,
3352
- referer: a,
3353
- referee: a,
3354
- criteria: e.array(j),
3355
- reward: e.array(y),
3356
- refereeReward: e.array(a).optional(),
3357
- criteria_progress: e.array(pe),
3694
+ }), je = e.object({
3695
+ _id: n,
3696
+ business: n,
3697
+ referer: n,
3698
+ referee: n,
3699
+ criteria: e.array(x),
3700
+ reward: e.array(C),
3701
+ refereeReward: e.array(n).optional(),
3702
+ criteria_progress: e.array(Pe),
3358
3703
  status: e.string(),
3359
- pf_referer: c.optional(),
3360
- pf_referee: c.optional(),
3361
- pf_refereeReward: e.array(_).optional()
3362
- }).describe(i.describe(ce));
3363
- me.pick({
3704
+ pf_referer: g.optional(),
3705
+ pf_referee: g.optional(),
3706
+ pf_refereeReward: e.array(T).optional()
3707
+ }).describe(m.describe(Ue));
3708
+ je.pick({
3364
3709
  _id: !0,
3365
3710
  business: !0,
3366
3711
  referer: !0,
@@ -3368,79 +3713,83 @@ me.pick({
3368
3713
  criteria_progress: !0,
3369
3714
  criteria: !0
3370
3715
  }).extend({
3371
- pf_referee: c.pick({
3716
+ pf_referee: g.pick({
3372
3717
  _id: !0,
3373
3718
  name: !0,
3374
3719
  phoneNumber: !0,
3375
3720
  photoUrl: !0
3376
3721
  })
3377
3722
  });
3378
- const se = {
3723
+ const Ee = {
3379
3724
  collectionName: "ReferralProgram",
3380
3725
  transform: {
3381
3726
  _id: "oid",
3382
3727
  business: "oid"
3383
3728
  }
3384
- }, J = e.object({
3385
- _id: a,
3386
- business: a,
3729
+ }, D = e.object({
3730
+ _id: n,
3731
+ business: n,
3387
3732
  term_and_condition: e.string().optional(),
3388
- refereeReward: e.array(a).optional(),
3389
- reward: e.array(y),
3390
- criteria: e.array(j)
3391
- }).describe(i.describe(se));
3733
+ refereeReward: e.array(n).optional(),
3734
+ reward: e.array(C),
3735
+ criteria: e.array(x)
3736
+ }).describe(m.describe(Ee));
3392
3737
  e.object({
3393
- referer: a,
3394
- referee: a,
3395
- business: a
3738
+ referer: n,
3739
+ referee: n,
3740
+ business: n
3396
3741
  });
3397
3742
  e.object({
3398
- program: J.pick({
3743
+ program: D.pick({
3399
3744
  _id: !0,
3400
3745
  business: !0,
3401
3746
  term_and_condition: !0
3402
3747
  }).extend({
3403
- reward: y.optional(),
3404
- pf_refereeReward: e.array(_).optional()
3748
+ reward: C.optional(),
3749
+ pf_refereeReward: e.array(T).optional()
3405
3750
  }),
3406
3751
  referralCount: e.number(),
3407
3752
  successReferralCount: e.number(),
3408
- referredBy: c.pick({
3753
+ referredBy: g.pick({
3409
3754
  _id: !0,
3410
3755
  name: !0,
3411
3756
  phoneNumber: !0,
3412
3757
  photoUrl: !0
3413
3758
  }).optional()
3414
3759
  });
3415
- J.extend({
3760
+ D.extend({
3416
3761
  updateReferralRecord: e.boolean().optional()
3417
3762
  });
3418
- const ge = e.object({
3763
+ const Je = e.object({
3419
3764
  facebookPageId: e.string(),
3420
3765
  pageName: e.string(),
3421
3766
  pageProfileImageUrl: e.string(),
3422
3767
  pageAccessToken: e.string().optional(),
3423
- locationIds: e.array(a)
3424
- }), de = e.object({
3425
- locationId: a.nullable(),
3768
+ locationIds: e.array(n)
3769
+ }), Oe = e.object({
3770
+ locationId: n.nullable(),
3426
3771
  googleLocationName: e.string(),
3427
3772
  displayName: e.string().optional()
3428
- }), he = e.object({
3773
+ }), Ie = e.object({
3429
3774
  accessToken: e.string().nullable(),
3430
3775
  refreshToken: e.string().nullable(),
3431
3776
  accessTokenExpiresAt: e.date().nullable(),
3432
- locations: e.array(de)
3433
- }), ue = e.object({
3777
+ locations: e.array(Oe),
3778
+ lastSyncTime: e.coerce.date().nullish(),
3779
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3780
+ }), Re = e.object({
3434
3781
  token: e.string().nullable(),
3435
- pages: e.array(ge)
3782
+ pages: e.array(Je),
3783
+ lastSyncTime: e.coerce.date().nullish(),
3784
+ syncFrequency: e.number().int().min(1).max(30).default(30)
3436
3785
  });
3437
3786
  e.object({
3438
- _id: a,
3439
- businessId: a,
3440
- google: he.nullable(),
3441
- facebook: ue.nullable()
3787
+ _id: n,
3788
+ businessId: n,
3789
+ google: Ie.nullable(),
3790
+ facebook: Re.nullable()
3442
3791
  }).describe(
3443
- i.describe({
3792
+ m.describe({
3444
3793
  collectionName: "ReviewSourceConfig",
3445
3794
  transform: {
3446
3795
  _id: "oid",
@@ -3484,7 +3833,9 @@ e.object({
3484
3833
  displayName: e.string().optional(),
3485
3834
  locationId: e.string().nullable()
3486
3835
  })
3487
- )
3836
+ ),
3837
+ lastSyncTime: e.string().datetime().nullable(),
3838
+ syncFrequency: e.number().int().min(1).max(30)
3488
3839
  }).nullable(),
3489
3840
  facebook: e.object({
3490
3841
  token: e.string().nullable(),
@@ -3495,30 +3846,32 @@ e.object({
3495
3846
  pageProfileImageUrl: e.string(),
3496
3847
  locationIds: e.array(e.string())
3497
3848
  })
3498
- )
3849
+ ),
3850
+ lastSyncTime: e.string().datetime().nullable(),
3851
+ syncFrequency: e.number().int().min(1).max(30)
3499
3852
  }).nullable()
3500
3853
  });
3501
- const p = e.object({
3854
+ const u = e.object({
3502
3855
  name: e.string(),
3503
3856
  pictureUrl: e.string(),
3504
3857
  phoneNumber: e.string().optional()
3505
- }), _e = p.extend({
3858
+ }), Le = u.extend({
3506
3859
  isAnonymous: e.boolean().optional()
3507
- }), ye = p.extend({
3860
+ }), xe = u.extend({
3508
3861
  id: e.string().optional()
3509
- }), m = e.object({
3862
+ }), h = e.object({
3510
3863
  comment: e.string(),
3511
3864
  updateTime: e.coerce.date()
3512
3865
  });
3513
3866
  e.object({
3514
3867
  comment: e.string().trim().min(1).max(4096)
3515
3868
  });
3516
- const l = e.object({
3869
+ const s = e.object({
3517
3870
  externalId: e.string().optional(),
3518
3871
  thumbnailUrl: e.string(),
3519
3872
  thumbnailLabel: e.string(),
3520
3873
  videoUrl: e.string().optional()
3521
- }), fe = {
3874
+ }), De = {
3522
3875
  collectionName: "Reviews",
3523
3876
  transform: {
3524
3877
  _id: "oid",
@@ -3526,31 +3879,31 @@ const l = e.object({
3526
3879
  reviewerId: "oid",
3527
3880
  restaurantId: "oid"
3528
3881
  }
3529
- }, E = e.enum([
3882
+ }, w = e.enum([
3530
3883
  "google",
3531
3884
  "facebook",
3532
3885
  "feedme",
3533
3886
  "feedvibe"
3534
3887
  ]);
3535
- E.options;
3888
+ w.options;
3536
3889
  e.enum(["google", "facebook"]);
3537
- const be = e.enum([
3890
+ const we = e.enum([
3538
3891
  "createTime_desc",
3539
3892
  "createTime_asc",
3540
3893
  "rating_asc",
3541
3894
  "rating_desc"
3542
3895
  ]);
3543
3896
  e.object({
3544
- source: E.array().optional(),
3897
+ source: w.array().optional(),
3545
3898
  dateFrom: e.string().datetime({ offset: !0 }).optional(),
3546
3899
  dateTo: e.string().datetime({ offset: !0 }).optional(),
3547
3900
  locationId: e.string().optional(),
3548
3901
  excludeDeleted: e.boolean().optional(),
3549
- sort: be.optional(),
3902
+ sort: we.optional(),
3550
3903
  limit: e.coerce.number().int().positive().optional(),
3551
3904
  skip: e.coerce.number().int().min(0).optional()
3552
3905
  });
3553
- const Be = e.object({
3906
+ const pt = e.object({
3554
3907
  averageScore: e.number(),
3555
3908
  total: e.number().int().nonnegative(),
3556
3909
  starCounts: e.array(
@@ -3559,54 +3912,54 @@ const Be = e.object({
3559
3912
  count: e.number().int().nonnegative()
3560
3913
  })
3561
3914
  )
3562
- }), s = e.object({
3915
+ }), _ = e.object({
3563
3916
  name: e.string(),
3564
3917
  pictureUrl: e.string().optional(),
3565
3918
  phoneNumber: e.string().optional()
3566
- }), He = s.extend({
3919
+ }), Ae = _.extend({
3567
3920
  _id: e.string().optional()
3568
- }), ze = s.extend({
3921
+ }), Me = _.extend({
3569
3922
  _id: e.string()
3570
- }), Ce = s.extend({
3923
+ }), Fe = _.extend({
3571
3924
  isAnonymous: e.boolean().optional()
3572
- }), Te = s.extend({
3925
+ }), Ge = _.extend({
3573
3926
  id: e.string().optional()
3574
- }), g = e.object({
3575
- _id: a,
3927
+ }), y = e.object({
3928
+ _id: n,
3576
3929
  comment: e.string(),
3577
3930
  createTime: e.coerce.date(),
3578
3931
  updateTime: e.coerce.date().nullish(),
3579
- restaurantId: a,
3932
+ restaurantId: n,
3580
3933
  restaurantName: e.string()
3581
- }), ve = g.extend({
3934
+ }), ke = y.extend({
3582
3935
  source: e.literal("google"),
3583
3936
  externalId: e.string().min(1),
3584
3937
  translatedComment: e.string().optional(),
3585
- reviewer: Ce.optional(),
3586
- reply: m.optional(),
3587
- mediaItems: e.array(l),
3938
+ reviewer: Fe.optional(),
3939
+ reply: h.optional(),
3940
+ mediaItems: e.array(s),
3588
3941
  starRating: e.number(),
3589
3942
  locationName: e.string(),
3590
3943
  locationDisplayName: e.string(),
3591
3944
  originalUrl: e.string().optional()
3592
- }), Se = g.extend({
3945
+ }), Be = y.extend({
3593
3946
  source: e.literal("facebook"),
3594
3947
  externalId: e.string().min(1),
3595
- reviewer: Te.optional(),
3948
+ reviewer: Ge.optional(),
3596
3949
  isPositive: e.boolean().optional(),
3597
3950
  pageId: e.string(),
3598
3951
  pageName: e.string()
3599
- }), Ne = g.extend({
3952
+ }), Ve = y.extend({
3600
3953
  source: e.literal("feedme"),
3601
- reviewer: He.optional(),
3602
- reply: m.optional(),
3954
+ reviewer: Ae.optional(),
3955
+ reply: h.optional(),
3603
3956
  starRating: e.number(),
3604
- mediaItems: e.array(l),
3957
+ mediaItems: e.array(s),
3605
3958
  billId: e.string()
3606
- }), Ue = g.extend({
3959
+ }), We = y.extend({
3607
3960
  source: e.literal("feedvibe"),
3608
3961
  externalId: e.string().min(1),
3609
- reviewer: ze.optional(),
3962
+ reviewer: Me.optional(),
3610
3963
  rating: e.object({
3611
3964
  overall: e.number(),
3612
3965
  food: e.number(),
@@ -3614,67 +3967,67 @@ const Be = e.object({
3614
3967
  atmosphere: e.number()
3615
3968
  }),
3616
3969
  verified: e.boolean(),
3617
- mediaItems: e.array(l).default([])
3970
+ mediaItems: e.array(s).default([])
3618
3971
  });
3619
3972
  e.discriminatedUnion("source", [
3620
- ve,
3621
- Se,
3622
- Ne,
3623
- Ue
3973
+ ke,
3974
+ Be,
3975
+ Ve,
3976
+ We
3624
3977
  ]);
3625
3978
  e.object({
3626
3979
  comment: e.string(),
3627
3980
  starRating: e.number(),
3628
3981
  billId: e.string(),
3629
3982
  isAnonymous: e.boolean(),
3630
- mediaItems: e.array(l).optional()
3983
+ mediaItems: e.array(s).optional()
3631
3984
  });
3632
3985
  e.object({
3633
3986
  name: e.string().trim().min(1),
3634
3987
  phoneNumber: e.string().trim().min(1).optional()
3635
3988
  });
3636
- const d = e.object({
3637
- _id: a,
3638
- businessId: a,
3989
+ const f = e.object({
3990
+ _id: n,
3991
+ businessId: n,
3639
3992
  comment: e.string(),
3640
3993
  createTime: e.coerce.date(),
3641
3994
  updateTime: e.coerce.date().nullish(),
3642
- restaurantId: a,
3995
+ restaurantId: n,
3643
3996
  restaurantName: e.string(),
3644
3997
  deletedAt: e.coerce.date().optional()
3645
- }), Pe = d.extend({
3998
+ }), Ye = f.extend({
3646
3999
  source: e.literal("google"),
3647
4000
  externalId: e.string().min(1),
3648
4001
  translatedComment: e.string().optional(),
3649
- reviewer: _e.optional(),
3650
- reply: m.optional(),
3651
- mediaItems: e.array(l),
4002
+ reviewer: Le.optional(),
4003
+ reply: h.optional(),
4004
+ mediaItems: e.array(s),
3652
4005
  starRating: e.number(),
3653
4006
  locationName: e.string(),
3654
4007
  locationDisplayName: e.string(),
3655
4008
  originalUrl: e.string().optional()
3656
- }), je = d.extend({
4009
+ }), Ke = f.extend({
3657
4010
  source: e.literal("facebook"),
3658
4011
  externalId: e.string().min(1),
3659
- reviewer: ye.optional(),
4012
+ reviewer: xe.optional(),
3660
4013
  isPositive: e.boolean().optional(),
3661
4014
  pageId: e.string(),
3662
4015
  pageName: e.string()
3663
- }), Je = d.extend({
4016
+ }), qe = f.extend({
3664
4017
  source: e.literal("feedme"),
3665
4018
  isAnonymous: e.boolean(),
3666
4019
  metadata: e.record(e.string(), e.unknown()).optional(),
3667
- reviewerId: a.optional(),
3668
- reviewer: p.optional(),
3669
- reply: m.optional(),
4020
+ reviewerId: n.optional(),
4021
+ reviewer: u.optional(),
4022
+ reply: h.optional(),
3670
4023
  starRating: e.number(),
3671
4024
  billId: e.string(),
3672
- mediaItems: e.array(l)
3673
- }), Ee = d.extend({
4025
+ mediaItems: e.array(s)
4026
+ }), Xe = f.extend({
3674
4027
  source: e.literal("feedvibe"),
3675
4028
  externalId: e.string().min(1),
3676
- reviewerId: a,
3677
- reviewer: p,
4029
+ reviewerId: n,
4030
+ reviewer: u,
3678
4031
  rating: e.object({
3679
4032
  overall: e.number(),
3680
4033
  food: e.number(),
@@ -3682,23 +4035,29 @@ const d = e.object({
3682
4035
  atmosphere: e.number()
3683
4036
  }),
3684
4037
  verified: e.boolean(),
3685
- mediaItems: e.array(l).default([])
4038
+ mediaItems: e.array(s).default([])
3686
4039
  });
3687
4040
  e.discriminatedUnion("source", [
3688
- Pe,
3689
- je,
3690
- Je,
3691
- Ee
3692
- ]).describe(i.describe(fe));
4041
+ Ye,
4042
+ Ke,
4043
+ qe,
4044
+ Xe
4045
+ ]).describe(m.describe(De));
3693
4046
  export {
3694
- D as F,
3695
- Me as S,
3696
- Fe as T,
3697
- ke as W,
3698
- Ge as a,
3699
- re as b,
3700
- j as c,
3701
- y as d,
3702
- Be as e,
3703
- m as f
4047
+ ae as F,
4048
+ t as R,
4049
+ lt as S,
4050
+ it as T,
4051
+ ct as W,
4052
+ H as a,
4053
+ rt as b,
4054
+ 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
3704
4063
  };