@feedmepos/mf-connect 0.1.96-prod → 0.1.98-beta.1

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 (120) hide show
  1. package/dist/{App-NtFnJR3D.js → App-EPNXLOQz.js} +118 -106
  2. package/dist/AuditLogs-CadZXkap.js +2013 -0
  3. package/dist/{Bin-DvJgE8J0.js → Bin-CEWFX1MK.js} +8 -8
  4. package/dist/{Broadcast-BygITJjC.js → Broadcast-DC8W46mc.js} +18 -17
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVuhePfe.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DsojUEnT.js} +5 -6
  6. package/dist/{Card-BY8qbjNS.js → Card-BLFHOVL5.js} +19 -19
  7. package/dist/{Collections-CXZxfQmy.js → Collections-CVQV9gAI.js} +197 -185
  8. package/dist/{Credit-Dj4gJd18.js → Credit-Bvd1uiUU.js} +18 -17
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DMHQ36PW.js +3377 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-IH5P2GQ4.js → EffectSheet.vue_vue_type_style_index_0_lang-L8fftBYg.js} +105 -101
  12. package/dist/{Experience-CKLT-XKN.js → Experience-bKhm3DP2.js} +35 -34
  13. package/dist/{FileSaver.min-CqZKU_4D.js → FileSaver.min-CgnAdnBE.js} +1 -1
  14. package/dist/{Game-CMXXSxs7.js → Game-BTZ5Ftp5.js} +16 -15
  15. package/dist/Grab-DMuSoVGl.js +300 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B4u8lwM_.js → ImageInput.vue_vue_type_script_setup_true_lang-hMmCNoZI.js} +1 -1
  17. package/dist/{Index-CFGAKZTu.js → Index-BNh-_EZa.js} +10 -10
  18. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-COoygUYu.js +48 -0
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-UfQtiVK3.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D0wKkrBj.js} +1 -1
  20. package/dist/LoyaltyDashboard-Do06Mjzo.js +1082 -0
  21. package/dist/{MainLayout-UCAW-wwn.js → MainLayout-C_Zu8e2b.js} +1 -1
  22. package/dist/{Marketing-HU2MkAbE.js → Marketing-DHTow_lX.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-CS7hzmeA.js → MarketingMaterialEdit-BZqVEaXl.js} +214 -211
  24. package/dist/{Member-BG1gvC8G.js → Member-DNQICbO9.js} +20 -20
  25. package/dist/{MemberList-C7l5YNJF.js → MemberList-B5f-zT_3.js} +50 -51
  26. package/dist/{MemberTransactions-RQD9xfSN.js → MemberTransactions-BmmgHC1I.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CcTrvGEk.js → MessageInput.vue_vue_type_script_setup_true_lang-DhlFz8So.js} +11 -11
  28. package/dist/{Mission-B2ynmUaz.js → Mission-CyUldhj4.js} +35 -34
  29. package/dist/{Overview-DI1MMGCM.js → Overview-If_YcRY8.js} +19 -19
  30. package/dist/{Point-DkLfnk6D.js → Point-DXgR4D2b.js} +30 -29
  31. package/dist/{Promotion-BDsMtw76.js → Promotion-8KrS5PGT.js} +111 -105
  32. package/dist/{Queue-Bu5PffRS.js → Queue-ypegp0sQ.js} +43 -43
  33. package/dist/{Record-C9zk5pr8.js → Record-C1eVdBIL.js} +10 -10
  34. package/dist/Review-fsYAsdHU.js +871 -0
  35. package/dist/ReviewFacebookCallback-zNKnoxr_.js +243 -0
  36. package/dist/ReviewGoogleCallback-CpCT0ZYL.js +213 -0
  37. package/dist/{Reward-DLyMbKCK.js → Reward-B_k-VLJn.js} +17 -17
  38. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-XWcV6P7K.js → RewardGroup.vue_vue_type_script_setup_true_lang-BUl5B7lH.js} +12 -12
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D93zAujE.js +1911 -0
  40. package/dist/{Segment-CkvTGYMI.js → Segment-PJLbJ6YE.js} +77 -78
  41. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CmoGA4QY.js → SelectItems.vue_vue_type_script_setup_true_lang-BLwf6QCO.js} +21 -21
  42. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D0fupqWp.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-VoddUHxA.js} +12 -12
  43. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CdPBhSHS.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DOXfYdxf.js} +4 -4
  44. package/dist/{Setting-3aaebMiz.js → Setting-DItVUJHA.js} +259 -248
  45. package/dist/{SettingAdvertisements-B1rlNyFd.js → SettingAdvertisements-Bfvr60OW.js} +13 -13
  46. package/dist/{Store-7BnWIZ7G.js → Store-hyTJyNWv.js} +24 -24
  47. package/dist/{StoreRewards-CjcrPRwJ.js → StoreRewards-B7c20AF5.js} +16 -16
  48. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bl438tVa.js +1130 -0
  49. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DBb3Zfuz.js +7007 -0
  50. package/dist/{Tier-BJpbCCsL.js → Tier-CuulnY8J.js} +544 -469
  51. package/dist/{Title-CqpbvePy.js → Title-Bf9ZiFGW.js} +93 -92
  52. package/dist/{Transaction-B8gpL3cS.js → Transaction-reVAaf86.js} +2 -2
  53. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DDoia_qu.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BZP9jfwG.js} +6 -6
  54. package/dist/{Voucher-DQ6i1GyQ.js → Voucher-E8R2cCl-.js} +28 -27
  55. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BudfxMvl.js → VoucherEditor.vue_vue_type_script_setup_true_lang-1mclPYkp.js} +12 -12
  56. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B43ehs2w.js → ZodTextField.vue_vue_type_script_setup_true_lang-xP5smS4G.js} +2 -2
  57. package/dist/{app-Cdi9yyaa.js → app-BdRRCAGj.js} +47089 -32960
  58. package/dist/app.js +4 -3
  59. package/dist/{business-BPhMhPp8.js → business-caUtvXxX.js} +1 -1
  60. package/dist/{campaign-DHqBhgh5.js → campaign-CDFEhdIH.js} +13 -7
  61. package/dist/{campaign-DLWpOBzd.js → campaign-CPtzFxiR.js} +114 -64
  62. package/dist/campaign.enum-p1buII_I.js +26 -0
  63. package/dist/campaign.fn-DerIK7yj.js +776 -0
  64. package/dist/{collectible.enum-EoZwnXkR.js → collectible.enum-CJ30_XmW.js} +1 -1
  65. package/dist/duplicateCampaign-DLfhHm07.js +51 -0
  66. package/dist/effect-BJC34M9S.js +89 -0
  67. package/dist/{email-addresses-CuhtzvMR.js → email-addresses-D1aYCi0p.js} +2 -2
  68. package/dist/{export-D2wb3Zzg.js → export-ChFEuUc5.js} +3 -3
  69. package/dist/{helper-B80tn5O6.js → helper-BNWd3eM2.js} +1 -1
  70. package/dist/{timezone-BIzl2Gac.js → index-0SZADZbB.js} +21 -20
  71. package/dist/{index-B85ryzLj.js → index-6ZSFSZ-H.js} +769 -205
  72. package/dist/index-B4dazSVT.js +48 -0
  73. package/dist/{index-C7XyuCH8.js → index-B9xvXnEM.js} +3 -3
  74. package/dist/{index-Dg-VScjz.js → index-BWQK3rqq.js} +3 -3
  75. package/dist/{index-D1_JoBc_.js → index-BoeHTTcl.js} +1 -1
  76. package/dist/{index-CCfDzgJb.js → index-Br17eSOV.js} +1 -1
  77. package/dist/{index-HzTI8A55.js → index-CAVSuo6k.js} +1996 -1968
  78. package/dist/{index-B0S0BGjb.js → index-CIin0Pv0.js} +1 -1
  79. package/dist/{index-BVXwb1vw.js → index-CeSEAz_T.js} +1 -1
  80. package/dist/{index-DDLHaeVd.js → index-DNsYSxpY.js} +1539 -1267
  81. package/dist/index-Dcn4qaYt.js +67 -0
  82. package/dist/{index-DA5sHUgD.js → index-Do2cnzep.js} +1 -1
  83. package/dist/{index-v9zPLkiJ.js → index-Dp3CLZSg.js} +7 -7
  84. package/dist/{index.esm2017-CfogVJWR.js → index.esm2017-CYGo-PcK.js} +173 -173
  85. package/dist/{loading-_HLw0JNH.js → loading-DtPQnEA5.js} +1 -1
  86. package/dist/{lodash-7LLl_N0k.js → lodash-BvTKz5Pn.js} +1 -1
  87. package/dist/{membership-Dl34LatD.js → membership-Csnvqeql.js} +3 -3
  88. package/dist/{money-Ca4jlK9c.js → money-CwRxILG1.js} +1 -1
  89. package/dist/{number-CWjqupZw.js → number-qcECHCpu.js} +1 -1
  90. package/dist/object-BYyQ0PZp.js +18 -0
  91. package/dist/objectid-BKWyHH4F.js +145 -0
  92. package/dist/{plugins-uNooTC4W.js → plugins-BBpKk0ld.js} +94 -95
  93. package/dist/{reward-BRIYprM8.js → reward-CX1axU5-.js} +1 -1
  94. package/dist/{rule-CkUScWS-.js → rule-pKsATz8r.js} +505 -487
  95. package/dist/style.css +1 -1
  96. package/dist/template-BSuapoPb.js +188 -0
  97. package/dist/{trigger-Dd92AYz3.js → trigger-DnMktlx-.js} +5 -5
  98. package/dist/{useMarketingMaterialActions-DlEYiRxQ.js → useMarketingMaterialActions-Bu0-ny3z.js} +3 -3
  99. package/dist/{usePagination--trERWY4.js → usePagination-CzfJhepV.js} +1 -1
  100. package/dist/{user-CI-tPhnX.js → user-BLDWqYm_.js} +1 -1
  101. package/dist/vue-i18n-bssxjuw_.js +2365 -0
  102. package/dist/{xlsx-BtsmiXIl.js → xlsx-xNwsJDub.js} +1 -1
  103. package/dist/{zod-Cq4jls5y.js → zod-Cu18aMVT.js} +1 -1
  104. package/package.json +8 -4
  105. package/dist/Analytic-l10g_BkW.js +0 -426
  106. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Djcv8RCR.js +0 -2223
  107. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BW2MrhuC.js +0 -1888
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3mmS25r.js +0 -1118
  109. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-TVsbx26f.js +0 -142
  110. package/dist/campaign.enum-C7BourYN.js +0 -20
  111. package/dist/campaign.fn-PjAM2LtF.js +0 -776
  112. package/dist/collection.fn-Ds616d3q.js +0 -26
  113. package/dist/dto-5fg5RWhP.js +0 -216
  114. package/dist/effect-BJva6Fjl.js +0 -78
  115. package/dist/index-CmGQazKB.js +0 -55
  116. package/dist/object-qECH92oz.js +0 -26
  117. package/dist/objectid-BGNEnJDn.js +0 -145
  118. package/dist/rule-builder-Ds-h-MuV.js +0 -102
  119. package/dist/template-0zuNVS82.js +0 -236
  120. package/dist/vue-i18n-BIM-SckA.js +0 -2365
@@ -1,10 +1,184 @@
1
- import { z as e, F as t, m as l, a as b } from "./index-Dg-VScjz.js";
2
- import { a as z } from "./index-HzTI8A55.js";
3
- import { R as a } from "./rule-builder-Ds-h-MuV.js";
4
- import { i as o } from "./helper-B80tn5O6.js";
5
- import { C, E as T, G as S, H as i } from "./index-DDLHaeVd.js";
6
- import { a as c } from "./index-C7XyuCH8.js";
7
- const te = {
1
+ import { z as e, F as o, m, a as R } from "./index-BWQK3rqq.js";
2
+ import { B as L, C as x, E as D, G as w, H as g, I as A, J as G } from "./index-DNsYSxpY.js";
3
+ import { _ as M, l as H, a as F } from "./index-CAVSuo6k.js";
4
+ import { i as p } from "./helper-BNWd3eM2.js";
5
+ import { a as _ } from "./index-B9xvXnEM.js";
6
+ function h(n, a) {
7
+ let i = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
8
+ const l = r.length;
9
+ for (let c = 0; c < n; c++)
10
+ i += r.charAt(Math.floor(Math.random() * l));
11
+ return i;
12
+ }
13
+ function u(n) {
14
+ return !n.property && "rules" in n;
15
+ }
16
+ function k(n) {
17
+ return "property" in n && !!n.property;
18
+ }
19
+ const B = "g_schedule";
20
+ function V(n) {
21
+ return n.split(/\r?\n/).filter((a) => !a.trim().toUpperCase().startsWith("DTSTART")).join(`
22
+ `).trim();
23
+ }
24
+ function Y(n, a = !1) {
25
+ const i = M.cloneDeep(n);
26
+ if (k(i)) {
27
+ const r = i.conditions;
28
+ return !a && r && typeof r._rrule == "string" && (r._rrule = V(
29
+ r._rrule
30
+ )), i;
31
+ }
32
+ if (u(i))
33
+ for (const r in i.rules) {
34
+ const l = i.rules[r], c = a || u(l) && l.name === B;
35
+ i.rules[r] = Y(
36
+ l,
37
+ c
38
+ );
39
+ }
40
+ return i;
41
+ }
42
+ class t {
43
+ static scaffoldGroup(a) {
44
+ return {
45
+ name: a ?? `g_${h(4)}`,
46
+ rules: {},
47
+ logic: ""
48
+ };
49
+ }
50
+ static scaffoldEntry(a) {
51
+ return {
52
+ name: `r_${h(4)}`,
53
+ property: a ?? "",
54
+ conditions: {},
55
+ negated: !1
56
+ };
57
+ }
58
+ static constructEntry(a, i, r, l) {
59
+ return {
60
+ name: l ?? `e_${h(4)}`,
61
+ property: a,
62
+ conditions: {
63
+ [i]: r
64
+ },
65
+ negated: !1
66
+ };
67
+ }
68
+ static getLogic(a) {
69
+ return (a.logic ?? "").includes("||") ? "||" : "&&";
70
+ }
71
+ static constructLogic(a, i) {
72
+ const r = i ?? t.getLogic(a);
73
+ return Object.entries(a.rules).map(([l, c]) => u(c) ? l : `${c.negated ? "!" : ""}${l}`).join(` ${r} `);
74
+ }
75
+ static setRuleToGroup(a, i, r) {
76
+ let l = H.cloneDeep(a);
77
+ return Object.keys(l.rules).length === 0 && (l = t.scaffoldGroup(l.name)), Array.isArray(i) ? i.forEach((c) => {
78
+ l.rules[c.name] = c;
79
+ }) : l.rules[i.name] = i, l.logic = t.constructLogic(l, r), l;
80
+ }
81
+ static removeEntry(a, i, r) {
82
+ const l = H.cloneDeep(a);
83
+ return delete l.rules[i], l.logic = t.constructLogic(l, r), l;
84
+ }
85
+ static constructRule(a) {
86
+ switch (a.type) {
87
+ case "timeframe": {
88
+ const i = a.property, r = t.scaffoldGroup("timeframe"), l = [];
89
+ return (a.start || a.end) && l.push(
90
+ t.constructEntry(i, "_isBetween", {
91
+ start: a.start || void 0,
92
+ end: a.end || void 0
93
+ })
94
+ ), t.setRuleToGroup(r, l, "&&");
95
+ }
96
+ default:
97
+ throw Error("invalid config type");
98
+ }
99
+ }
100
+ static getRules(a) {
101
+ return a && "rules" in a ? Object.values(a.rules) : [];
102
+ }
103
+ static simplify(a) {
104
+ const [i] = Object.entries(a.conditions);
105
+ return i[0], {
106
+ property: a.property,
107
+ operator: i[0],
108
+ equator: i[1]
109
+ };
110
+ }
111
+ static isRuleExceed(a, i) {
112
+ const l = Object.keys(a.rules).length + (Array.isArray(i) ? i.length : 1);
113
+ if (l > 10)
114
+ throw new K(10, l);
115
+ return !0;
116
+ }
117
+ }
118
+ class K extends Error {
119
+ constructor(a, i) {
120
+ super(
121
+ `Maximum of ${a} rules allowed per group. Attempted to add ${i} rules.`
122
+ ), this.name = "MaxRulesExceededError";
123
+ }
124
+ }
125
+ const W = {
126
+ collectionName: "AuditLogs",
127
+ transform: {
128
+ _id: "oid",
129
+ business: "oid",
130
+ timestamp: "date"
131
+ },
132
+ lookups: {
133
+ business: {
134
+ as: "pf_business",
135
+ fromCollection: "Businesses"
136
+ }
137
+ }
138
+ }, X = e.enum([
139
+ "GET",
140
+ "POST",
141
+ "PUT",
142
+ "PATCH",
143
+ "DELETE",
144
+ "OPTIONS",
145
+ "HEAD",
146
+ "ALL"
147
+ ]), q = e.enum([
148
+ "CAMPAIGN",
149
+ "LOCATION",
150
+ "MARKETING MATERIALS",
151
+ "MEMBERSHIP",
152
+ "STORE",
153
+ "TRANSACTION",
154
+ "SETTINGS",
155
+ "SEGMENTATION",
156
+ "USER"
157
+ ]), Q = e.object({
158
+ httpMethod: X,
159
+ url: e.string().min(1),
160
+ userAgent: e.string(),
161
+ host: e.string().min(1),
162
+ params: e.object({}).passthrough().nullish(),
163
+ query: e.object({}).passthrough().nullish(),
164
+ body: e.object({}).passthrough().nullish()
165
+ }), $ = e.object({
166
+ statusCode: e.number().int().min(100).max(599),
167
+ body: e.object({}).passthrough().nullish()
168
+ });
169
+ e.object({
170
+ _id: o,
171
+ user: e.string().length(28),
172
+ userName: e.string().min(1),
173
+ userPhoneNumber: e.string().refine((n) => L(n)).nullish(),
174
+ moduleType: q,
175
+ business: o.nullish(),
176
+ clientIp: e.string().nullish(),
177
+ timestamp: e.string().datetime(),
178
+ request: Q,
179
+ response: $
180
+ }).describe(m.describe(W));
181
+ const Ye = {
8
182
  PROMOTION: {
9
183
  name: "Promotion Template",
10
184
  description: "Promotion template for campaign creation.",
@@ -125,7 +299,7 @@ const te = {
125
299
  effect: null,
126
300
  event: {
127
301
  type: "MAKING_ORDER",
128
- rule: a.scaffoldGroup()
302
+ rule: t.scaffoldGroup()
129
303
  },
130
304
  group: null,
131
305
  targetLocation: null,
@@ -388,7 +562,7 @@ const te = {
388
562
  code: "",
389
563
  event: {
390
564
  type: "BILL_COMPLETED",
391
- rule: a.scaffoldGroup()
565
+ rule: t.scaffoldGroup()
392
566
  },
393
567
  group: null,
394
568
  targetLocation: null,
@@ -410,7 +584,7 @@ const te = {
410
584
  // },
411
585
  hideInApp: !0
412
586
  },
413
- configs: o("VOUCHER", {
587
+ configs: p("VOUCHER", {
414
588
  name: "",
415
589
  business: null,
416
590
  noCampaign: !1
@@ -538,17 +712,17 @@ const te = {
538
712
  image: "",
539
713
  event: {
540
714
  type: "SCHEDULE",
541
- rule: a.setRuleToGroup(
542
- a.scaffoldGroup(),
543
- a.setRuleToGroup(
544
- a.scaffoldGroup("g_schedule"),
715
+ rule: t.setRuleToGroup(
716
+ t.scaffoldGroup(),
717
+ t.setRuleToGroup(
718
+ t.scaffoldGroup("g_schedule"),
545
719
  [
546
- a.constructEntry(
720
+ t.constructEntry(
547
721
  "trigger.date",
548
722
  "_rrule",
549
723
  "RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
550
724
  ),
551
- a.constructEntry(
725
+ t.constructEntry(
552
726
  "trigger.time",
553
727
  "_isOnTime",
554
728
  "00:00"
@@ -742,7 +916,7 @@ const te = {
742
916
  image: "",
743
917
  event: {
744
918
  type: "BILL_COMPLETED",
745
- rule: a.scaffoldGroup()
919
+ rule: t.scaffoldGroup()
746
920
  },
747
921
  group: null,
748
922
  targetLocation: null,
@@ -929,7 +1103,7 @@ const te = {
929
1103
  image: "",
930
1104
  event: {
931
1105
  type: "BILL_COMPLETED",
932
- rule: a.scaffoldGroup()
1106
+ rule: t.scaffoldGroup()
933
1107
  },
934
1108
  group: null,
935
1109
  targetLocation: null,
@@ -1116,7 +1290,7 @@ const te = {
1116
1290
  image: "",
1117
1291
  event: {
1118
1292
  type: "BILL_COMPLETED",
1119
- rule: a.scaffoldGroup()
1293
+ rule: t.scaffoldGroup()
1120
1294
  },
1121
1295
  group: null,
1122
1296
  targetLocation: null,
@@ -1325,7 +1499,7 @@ const te = {
1325
1499
  image: "",
1326
1500
  event: {
1327
1501
  type: "BILL_COMPLETED",
1328
- rule: a.scaffoldGroup()
1502
+ rule: t.scaffoldGroup()
1329
1503
  },
1330
1504
  group: null,
1331
1505
  targetLocation: null,
@@ -1343,7 +1517,7 @@ const te = {
1343
1517
  game: {
1344
1518
  event: {
1345
1519
  type: "GAME_COMPLETED",
1346
- rule: a.scaffoldGroup()
1520
+ rule: t.scaffoldGroup()
1347
1521
  },
1348
1522
  name: "rewardpool_",
1349
1523
  targetLocation: null,
@@ -1355,7 +1529,7 @@ const te = {
1355
1529
  rewards: []
1356
1530
  }
1357
1531
  },
1358
- configs: o("GAME", {
1532
+ configs: p("GAME", {
1359
1533
  name: "Token",
1360
1534
  business: null,
1361
1535
  noCampaign: !1
@@ -1580,7 +1754,7 @@ const te = {
1580
1754
  },
1581
1755
  event: {
1582
1756
  type: "BILL_COMPLETED",
1583
- rule: a.scaffoldGroup()
1757
+ rule: t.scaffoldGroup()
1584
1758
  },
1585
1759
  mission: {
1586
1760
  type: "STAMP",
@@ -1596,53 +1770,219 @@ const te = {
1596
1770
  type: "timeframe"
1597
1771
  }
1598
1772
  },
1599
- configs: o("STAMP", {
1773
+ configs: p("STAMP", {
1600
1774
  business: null,
1601
1775
  noCampaign: !1
1602
1776
  })
1603
1777
  }
1778
+ },
1779
+ GRAB: {
1780
+ name: "Grab Campaign Template",
1781
+ description: "Grab campaign template for campaign creation.",
1782
+ steps: [
1783
+ {
1784
+ name: "connect.template.general_information",
1785
+ groups: [
1786
+ {
1787
+ name: "connect.template.general",
1788
+ fields: [
1789
+ {
1790
+ label: "connect.template.campaign_name",
1791
+ property: "campaign.name",
1792
+ type: "text"
1793
+ },
1794
+ {
1795
+ label: "connect.template.campaign_period",
1796
+ property: "campaign.timeframeOptions",
1797
+ type: "timeframe"
1798
+ }
1799
+ ]
1800
+ }
1801
+ ]
1802
+ },
1803
+ {
1804
+ name: "connect.template.discount",
1805
+ groups: [
1806
+ {
1807
+ name: "connect.template.discount",
1808
+ fields: [
1809
+ {
1810
+ label: void 0,
1811
+ property: "campaign.discount",
1812
+ type: "grab_effect"
1813
+ }
1814
+ ]
1815
+ },
1816
+ {
1817
+ name: "connect.template.grab_quota",
1818
+ fields: [
1819
+ {
1820
+ label: void 0,
1821
+ property: "campaign.quotas",
1822
+ type: "grab_quota"
1823
+ }
1824
+ ]
1825
+ },
1826
+ {
1827
+ name: "connect.template.grab_condition",
1828
+ fields: [
1829
+ {
1830
+ label: void 0,
1831
+ property: "campaign.conditions",
1832
+ type: "grab_conditions"
1833
+ }
1834
+ ]
1835
+ }
1836
+ ]
1837
+ },
1838
+ {
1839
+ name: "connect.template.terms_conditions",
1840
+ groups: [
1841
+ {
1842
+ name: "Location",
1843
+ fields: [
1844
+ {
1845
+ label: "Target location",
1846
+ property: "campaign.targetLocation",
1847
+ type: "target_location"
1848
+ }
1849
+ ]
1850
+ }
1851
+ ]
1852
+ }
1853
+ ],
1854
+ defaultValue: {
1855
+ templateId: "",
1856
+ campaign: {
1857
+ type: "GRAB",
1858
+ templateId: "",
1859
+ name: "",
1860
+ description: "",
1861
+ image: "",
1862
+ discount: null,
1863
+ group: null,
1864
+ event: {
1865
+ type: "MAKING_ORDER",
1866
+ rule: t.scaffoldGroup()
1867
+ },
1868
+ quotas: {
1869
+ totalCount: 10,
1870
+ totalCountPerUser: 2
1871
+ },
1872
+ conditions: {
1873
+ startTime: "",
1874
+ endTime: "",
1875
+ eaterType: "all",
1876
+ minBasketAmount: 10,
1877
+ bundleQuantity: 2,
1878
+ workingHour: {
1879
+ sun: {
1880
+ periods: [
1881
+ {
1882
+ startTime: "11:30",
1883
+ endTime: "14:00"
1884
+ }
1885
+ ]
1886
+ },
1887
+ mon: {
1888
+ periods: [
1889
+ {
1890
+ startTime: "11:30",
1891
+ endTime: "14:00"
1892
+ }
1893
+ ]
1894
+ },
1895
+ tue: {
1896
+ periods: [
1897
+ {
1898
+ startTime: "11:30",
1899
+ endTime: "14:00"
1900
+ }
1901
+ ]
1902
+ },
1903
+ wed: {
1904
+ periods: [
1905
+ {
1906
+ startTime: "11:30",
1907
+ endTime: "14:00"
1908
+ }
1909
+ ]
1910
+ },
1911
+ thu: {
1912
+ periods: [
1913
+ {
1914
+ startTime: "11:30",
1915
+ endTime: "14:00"
1916
+ }
1917
+ ]
1918
+ },
1919
+ fri: {
1920
+ periods: [
1921
+ {
1922
+ startTime: "11:30",
1923
+ endTime: "14:00"
1924
+ }
1925
+ ]
1926
+ },
1927
+ sat: {
1928
+ periods: [
1929
+ {
1930
+ startTime: "11:30",
1931
+ endTime: "14:00"
1932
+ }
1933
+ ]
1934
+ }
1935
+ }
1936
+ },
1937
+ targetLocation: null,
1938
+ timeframeOptions: {
1939
+ type: "timeframe",
1940
+ property: "__now"
1941
+ }
1942
+ }
1943
+ }
1604
1944
  }
1605
1945
  };
1606
- a.scaffoldGroup(), o("STAMP", {
1946
+ t.scaffoldGroup(), p("STAMP", {
1607
1947
  business: null,
1608
1948
  noCampaign: !1
1609
1949
  });
1610
1950
  ({
1611
- ...a.scaffoldGroup()
1612
- }, o("VOUCHER", {
1951
+ ...t.scaffoldGroup()
1952
+ }, p("VOUCHER", {
1613
1953
  name: "",
1614
1954
  business: null,
1615
1955
  noCampaign: !1
1616
1956
  }));
1617
1957
  ({
1618
- ...a.scaffoldGroup()
1619
- }, o("VOUCHER", {
1958
+ ...t.scaffoldGroup()
1959
+ }, p("VOUCHER", {
1620
1960
  name: "",
1621
1961
  business: null,
1622
1962
  noCampaign: !1
1623
1963
  }));
1624
1964
  ({
1625
- ...a.scaffoldGroup()
1965
+ ...t.scaffoldGroup()
1626
1966
  });
1627
1967
  ({
1628
- ...a.scaffoldGroup()
1968
+ ...t.scaffoldGroup()
1629
1969
  });
1630
1970
  ({
1631
- ...a.scaffoldGroup()
1971
+ ...t.scaffoldGroup()
1632
1972
  });
1633
- a.setRuleToGroup(
1634
- a.scaffoldGroup(),
1635
- a.setRuleToGroup(
1636
- a.scaffoldGroup("g_user"),
1637
- [a.constructEntry("user.member", "_isIn", [!0])],
1973
+ t.setRuleToGroup(
1974
+ t.scaffoldGroup(),
1975
+ t.setRuleToGroup(
1976
+ t.scaffoldGroup("g_user"),
1977
+ [t.constructEntry("user.member", "_isIn", [!0])],
1638
1978
  "&&"
1639
1979
  )
1640
1980
  );
1641
- a.setRuleToGroup(a.scaffoldGroup(), [
1642
- a.setRuleToGroup(
1643
- a.scaffoldGroup("g_user"),
1981
+ t.setRuleToGroup(t.scaffoldGroup(), [
1982
+ t.setRuleToGroup(
1983
+ t.scaffoldGroup("g_user"),
1644
1984
  [
1645
- a.constructEntry("user.birthday", "_isRange", {
1985
+ t.constructEntry("user.birthday", "_isRange", {
1646
1986
  op: "this",
1647
1987
  unit: "month",
1648
1988
  ignoreYear: !0
@@ -1652,13 +1992,13 @@ a.setRuleToGroup(a.scaffoldGroup(), [
1652
1992
  )
1653
1993
  ]);
1654
1994
  ({
1655
- ...a.scaffoldGroup()
1995
+ ...t.scaffoldGroup()
1656
1996
  });
1657
- a.setRuleToGroup(a.scaffoldGroup(), [
1658
- a.setRuleToGroup(
1659
- a.scaffoldGroup("g_user"),
1997
+ t.setRuleToGroup(t.scaffoldGroup(), [
1998
+ t.setRuleToGroup(
1999
+ t.scaffoldGroup("g_user"),
1660
2000
  [
1661
- a.constructEntry("user.birthday", "_isRange", {
2001
+ t.constructEntry("user.birthday", "_isRange", {
1662
2002
  op: "this",
1663
2003
  unit: "month",
1664
2004
  ignoreYear: !0
@@ -1668,85 +2008,85 @@ a.setRuleToGroup(a.scaffoldGroup(), [
1668
2008
  )
1669
2009
  ]);
1670
2010
  ({
1671
- ...a.scaffoldGroup()
2011
+ ...t.scaffoldGroup()
1672
2012
  });
1673
2013
  ({
1674
- ...a.scaffoldGroup()
1675
- }, o("VOUCHER", {
2014
+ ...t.scaffoldGroup()
2015
+ }, p("VOUCHER", {
1676
2016
  name: "",
1677
2017
  business: null,
1678
2018
  noCampaign: !1
1679
2019
  }));
1680
- a.setRuleToGroup(
1681
- a.scaffoldGroup(),
1682
- a.setRuleToGroup(
1683
- a.scaffoldGroup("g_schedule"),
2020
+ t.setRuleToGroup(
2021
+ t.scaffoldGroup(),
2022
+ t.setRuleToGroup(
2023
+ t.scaffoldGroup("g_schedule"),
1684
2024
  [
1685
- a.constructEntry("trigger.date", "_isOnDate", ""),
1686
- a.constructEntry("trigger.time", "_isOnTime", "00:00")
2025
+ t.constructEntry("trigger.date", "_isOnDate", ""),
2026
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1687
2027
  ],
1688
2028
  "&&"
1689
2029
  )
1690
2030
  );
1691
- a.setRuleToGroup(a.scaffoldGroup(), [
1692
- a.setRuleToGroup(
1693
- a.scaffoldGroup("g_schedule"),
2031
+ t.setRuleToGroup(t.scaffoldGroup(), [
2032
+ t.setRuleToGroup(
2033
+ t.scaffoldGroup("g_schedule"),
1694
2034
  [
1695
- a.constructEntry(
2035
+ t.constructEntry(
1696
2036
  "trigger.date",
1697
2037
  "_rrule",
1698
2038
  "RRULE:FREQ=MONTHLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYMONTHDAY=1"
1699
2039
  ),
1700
- a.constructEntry("trigger.time", "_isOnTime", "00:00")
2040
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1701
2041
  ],
1702
2042
  "&&"
1703
2043
  )
1704
2044
  ]);
1705
- ({ ...a.scaffoldGroup() });
1706
- a.setRuleToGroup(
1707
- a.scaffoldGroup(),
1708
- a.setRuleToGroup(
1709
- a.scaffoldGroup("g_schedule"),
2045
+ ({ ...t.scaffoldGroup() });
2046
+ t.setRuleToGroup(
2047
+ t.scaffoldGroup(),
2048
+ t.setRuleToGroup(
2049
+ t.scaffoldGroup("g_schedule"),
1710
2050
  [
1711
- a.constructEntry(
2051
+ t.constructEntry(
1712
2052
  "trigger.date",
1713
2053
  "_rrule",
1714
2054
  "RRULE:FREQ=WEEKLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYDAY=MO"
1715
2055
  ),
1716
- a.constructEntry("trigger.time", "_isOnTime", "00:00")
2056
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1717
2057
  ],
1718
2058
  "&&"
1719
2059
  )
1720
2060
  );
1721
- a.scaffoldGroup(), a.scaffoldGroup(), o("GAME", {
2061
+ t.scaffoldGroup(), t.scaffoldGroup(), p("GAME", {
1722
2062
  name: "Token",
1723
2063
  business: null,
1724
2064
  noCampaign: !1
1725
2065
  });
1726
2066
  ({
1727
- ...a.scaffoldGroup()
1728
- }, o("VOUCHER", {
2067
+ ...t.scaffoldGroup()
2068
+ }, p("VOUCHER", {
1729
2069
  name: "",
1730
2070
  business: null,
1731
2071
  noCampaign: !1
1732
2072
  }));
1733
- a.setRuleToGroup(a.scaffoldGroup(), [
1734
- a.setRuleToGroup(
1735
- a.scaffoldGroup("g_schedule"),
2073
+ t.setRuleToGroup(t.scaffoldGroup(), [
2074
+ t.setRuleToGroup(
2075
+ t.scaffoldGroup("g_schedule"),
1736
2076
  [
1737
- a.constructEntry(
2077
+ t.constructEntry(
1738
2078
  "trigger.date",
1739
2079
  "_rrule",
1740
2080
  "RRULE:FREQ=MONTHLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYMONTHDAY=1"
1741
2081
  ),
1742
- a.constructEntry("trigger.time", "_isOnTime", "00:00")
2082
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1743
2083
  ],
1744
2084
  "&&"
1745
2085
  ),
1746
- a.setRuleToGroup(
1747
- a.scaffoldGroup("g_user"),
2086
+ t.setRuleToGroup(
2087
+ t.scaffoldGroup("g_user"),
1748
2088
  [
1749
- a.constructEntry("user.birthday", "_isRange", {
2089
+ t.constructEntry("user.birthday", "_isRange", {
1750
2090
  op: "this",
1751
2091
  unit: "month",
1752
2092
  ignoreYear: !0
@@ -1754,30 +2094,30 @@ a.setRuleToGroup(a.scaffoldGroup(), [
1754
2094
  ],
1755
2095
  "&&"
1756
2096
  )
1757
- ]), o("VOUCHER", {
2097
+ ]), p("VOUCHER", {
1758
2098
  name: "",
1759
2099
  business: null,
1760
2100
  noCampaign: !1
1761
2101
  });
1762
2102
  ({
1763
- ...a.scaffoldGroup()
2103
+ ...t.scaffoldGroup()
1764
2104
  });
1765
2105
  ({
1766
- ...a.scaffoldGroup()
2106
+ ...t.scaffoldGroup()
1767
2107
  });
1768
2108
  ({
1769
- ...a.scaffoldGroup()
2109
+ ...t.scaffoldGroup()
1770
2110
  });
1771
2111
  ({
1772
- ...a.scaffoldGroup()
2112
+ ...t.scaffoldGroup()
1773
2113
  });
1774
2114
  ({
1775
- ...a.scaffoldGroup()
2115
+ ...t.scaffoldGroup()
1776
2116
  });
1777
2117
  ({
1778
- ...a.scaffoldGroup()
2118
+ ...t.scaffoldGroup()
1779
2119
  });
1780
- const v = e.enum([
2120
+ const Z = e.enum([
1781
2121
  "MEMBER_REWARD",
1782
2122
  "PAID_LOYALTY",
1783
2123
  "COLLECT_FEEDBACK",
@@ -1787,7 +2127,7 @@ const v = e.enum([
1787
2127
  "BROADCAST",
1788
2128
  "BIRTHDAY",
1789
2129
  "GAME"
1790
- ]), N = e.enum([
2130
+ ]), ee = e.enum([
1791
2131
  "text",
1792
2132
  "number",
1793
2133
  "textarea",
@@ -1813,110 +2153,118 @@ const v = e.enum([
1813
2153
  "rule_bill",
1814
2154
  "rule_feedback",
1815
2155
  "rule_birthday",
1816
- "promotion_game_type"
1817
- ]), U = e.object({
2156
+ "promotion_game_type",
2157
+ "grab_effect",
2158
+ "grab_quota",
2159
+ "grab_conditions"
2160
+ ]), te = e.object({
1818
2161
  label: e.string().optional(),
1819
2162
  label_locale: e.record(e.string()).nullish(),
1820
2163
  property: e.string().or(e.any()),
1821
- type: N,
2164
+ type: ee,
1822
2165
  extras: e.string().optional(),
1823
2166
  isRuleChildren: e.boolean().optional()
1824
- }), p = e.object({
2167
+ }), z = e.object({
1825
2168
  not: e.boolean().optional(),
1826
2169
  property: e.string(),
1827
2170
  value: e.any()
1828
- }), P = e.object({
2171
+ }), ae = e.object({
1829
2172
  name: e.string().optional(),
1830
2173
  name_locale: e.record(e.string()).nullish(),
1831
- fields: e.array(U),
1832
- condition: p.optional().or(
1833
- e.array(p)
2174
+ fields: e.array(te),
2175
+ condition: z.optional().or(
2176
+ e.array(z)
1834
2177
  )
1835
- }), j = e.object({
2178
+ }), ne = e.object({
1836
2179
  name: e.string(),
1837
2180
  name_locale: e.record(e.string()).nullish(),
1838
- groups: e.array(P)
2181
+ groups: e.array(ae)
1839
2182
  });
1840
2183
  e.object({
1841
- _id: t,
2184
+ _id: o,
1842
2185
  name: e.string(),
1843
2186
  name_locale: e.record(e.string()).nullish(),
1844
2187
  description: e.string().nullish(),
1845
2188
  description_locale: e.record(e.string()).nullish(),
1846
- steps: e.array(j).min(1),
1847
- intention: e.array(v),
2189
+ steps: e.array(ne).min(1),
2190
+ intention: e.array(Z),
1848
2191
  defaultValue: e.any()
1849
2192
  }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
1850
- const J = {
2193
+ const oe = {
1851
2194
  collectionName: "Businesses",
1852
2195
  transform: {
1853
2196
  _id: "oid"
1854
2197
  }
1855
2198
  };
1856
2199
  e.object({
1857
- _id: t,
2200
+ _id: o,
1858
2201
  ownerId: e.string(),
1859
2202
  name: e.string(),
1860
2203
  credit: e.number(),
1861
2204
  forceSend: e.boolean().optional()
1862
- }).describe(l.describe(J));
1863
- const s = e.enum(["PHONE"]), E = e.enum([
2205
+ }).describe(m.describe(oe));
2206
+ const T = e.enum(["PHONE"]), ie = e.enum([
1864
2207
  "MOCEAN",
1865
2208
  "SLACK",
1866
2209
  "SMS",
1867
2210
  "EMAIL",
1868
2211
  "WHATSAPP"
1869
- ]), O = e.enum(["PENDING", "COMPLETED", "FAILED"]), I = e.enum([
2212
+ ]), le = e.enum(["PENDING", "COMPLETED", "FAILED"]), re = e.enum([
1870
2213
  "General",
1871
2214
  "Otp",
1872
2215
  "Marketing",
1873
2216
  "Ordering",
1874
2217
  "MemberInvitation",
1875
2218
  "MarketingPromotion"
1876
- ]), L = e.object({
1877
- type: s
1878
- }), g = L.extend({
1879
- type: e.literal(s.enum.PHONE),
1880
- provider: E,
1881
- usage: I.optional()
1882
- }), R = {
2219
+ ]), ce = e.object({
2220
+ type: T
2221
+ }), v = ce.extend({
2222
+ type: e.literal(T.enum.PHONE),
2223
+ provider: ie,
2224
+ usage: re.optional()
2225
+ }), pe = {
1883
2226
  collectionName: "Notifications",
1884
2227
  transform: { _id: "oid", business: "oid" }
1885
2228
  };
1886
2229
  e.object({
1887
- _id: t,
1888
- business: t,
2230
+ _id: o,
2231
+ business: o,
1889
2232
  target: e.string(),
1890
2233
  title: e.string().optional(),
1891
2234
  message: e.string(),
1892
- option: g,
1893
- status: O,
2235
+ option: v,
2236
+ status: le,
1894
2237
  ref: e.string().optional()
1895
- }).describe(l.describe(R));
1896
- e.object({
2238
+ }).describe(m.describe(pe));
2239
+ const me = e.object({
1897
2240
  target: e.string(),
1898
2241
  title: e.string().optional(),
1899
2242
  message: e.string(),
1900
- option: g,
2243
+ option: v,
1901
2244
  ref: e.string().optional()
1902
2245
  });
2246
+ e.object({
2247
+ campaignId: e.string(),
2248
+ notification: me,
2249
+ business: e.string()
2250
+ });
1903
2251
  e.object({
1904
2252
  phone: e.string(),
1905
2253
  message: e.string()
1906
2254
  });
1907
- const m = e.object({
2255
+ const C = e.object({
1908
2256
  name: e.string().optional(),
1909
2257
  address: e.string()
1910
- }), x = e.object({
2258
+ }), se = e.object({
1911
2259
  filename: e.string(),
1912
2260
  content: e.instanceof(Uint8Array)
1913
2261
  });
1914
2262
  e.object({
1915
- from: m.optional(),
1916
- to: e.array(m),
2263
+ from: C.optional(),
2264
+ to: e.array(C),
1917
2265
  subject: e.string(),
1918
2266
  html: e.string().optional(),
1919
- attachments: e.array(x).optional()
2267
+ attachments: e.array(se).optional()
1920
2268
  });
1921
2269
  e.object({
1922
2270
  subject: e.string(),
@@ -1956,7 +2304,7 @@ e.object({
1956
2304
  billId: e.string()
1957
2305
  });
1958
2306
  e.object({
1959
- amount: b,
2307
+ amount: R,
1960
2308
  member: e.string(),
1961
2309
  bill: e.string(),
1962
2310
  otp: e.string().nullish(),
@@ -1965,15 +2313,15 @@ e.object({
1965
2313
  e.object({
1966
2314
  orderId: e.string()
1967
2315
  });
1968
- var d = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(d || {});
1969
- e.nativeEnum(d);
2316
+ var S = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(S || {});
2317
+ e.nativeEnum(S);
1970
2318
  e.enum(["manage", "create", "read", "update", "delete"]);
1971
2319
  e.enum(["all", "restaurant", "business", "delivery", "agent"]);
1972
2320
  e.enum(["quota"]);
1973
- 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 || {});
1974
- e.nativeEnum(h);
2321
+ 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 || {});
2322
+ e.nativeEnum(N);
1975
2323
  e.enum(["restaurant"]);
1976
- const D = e.object({
2324
+ const ge = e.object({
1977
2325
  label: e.string(),
1978
2326
  subject: e.union([e.string(), e.array(e.string())]),
1979
2327
  actions: e.union([e.string(), e.array(e.string())]),
@@ -1983,41 +2331,41 @@ const D = e.object({
1983
2331
  reason: e.string().optional()
1984
2332
  });
1985
2333
  e.object({
1986
- _id: t,
2334
+ _id: o,
1987
2335
  businessId: e.string(),
1988
2336
  userId: e.string(),
1989
2337
  email: e.string().nullish(),
1990
2338
  phoneNo: e.string().nullish(),
1991
- permissions: e.array(e.lazy(() => D))
2339
+ permissions: e.array(e.lazy(() => ge))
1992
2340
  }).describe(
1993
- l.describe({
2341
+ m.describe({
1994
2342
  collectionName: "PermissionUsers",
1995
2343
  transform: {
1996
2344
  _id: "oid"
1997
2345
  }
1998
2346
  })
1999
2347
  );
2000
- const u = e.object({
2348
+ const U = e.object({
2001
2349
  userId: e.string(),
2002
2350
  level: e.number(),
2003
2351
  role: e.string().optional(),
2004
2352
  businessId: e.string().optional(),
2005
2353
  restaurantId: e.string().optional()
2006
- }), w = e.function().args(e.any(), u).returns(e.boolean()), M = e.function().args(u).returns(e.promise(e.array(e.any())));
2354
+ }), de = e.function().args(e.any(), U).returns(e.boolean()), he = e.function().args(U).returns(e.promise(e.array(e.any())));
2007
2355
  e.object({
2008
- isAdmin: w,
2009
- getRules: M
2356
+ isAdmin: de,
2357
+ getRules: he
2010
2358
  });
2011
2359
  e.object({
2012
- transactions: e.array(C),
2013
- collections: e.array(T)
2360
+ transactions: e.array(x),
2361
+ collections: e.array(D)
2014
2362
  });
2015
- const _ = e.enum([
2363
+ const P = e.enum([
2016
2364
  "ROCK_PAPER_SCISSOR"
2017
2365
  ]);
2018
- _.enum.ROCK_PAPER_SCISSOR + "";
2366
+ P.enum.ROCK_PAPER_SCISSOR + "";
2019
2367
  e.object({
2020
- type: _
2368
+ type: P
2021
2369
  });
2022
2370
  e.object({
2023
2371
  host: e.string().url(),
@@ -2026,7 +2374,7 @@ e.object({
2026
2374
  roomId: e.string()
2027
2375
  });
2028
2376
  e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
2029
- const G = {
2377
+ const ue = {
2030
2378
  collectionName: "MarketingMaterials",
2031
2379
  transform: {
2032
2380
  _id: "oid",
@@ -2034,13 +2382,13 @@ const G = {
2034
2382
  }
2035
2383
  };
2036
2384
  e.object({
2037
- _id: t,
2038
- business: t,
2385
+ _id: o,
2386
+ business: o,
2039
2387
  imageUrl: e.string().url(),
2040
2388
  headline: e.string(),
2041
2389
  caption: e.string(),
2042
2390
  editedAt: e.coerce.date()
2043
- }).describe(l.describe(G));
2391
+ }).describe(m.describe(ue));
2044
2392
  e.object({
2045
2393
  id: e.number(),
2046
2394
  name: e.string(),
@@ -2060,12 +2408,12 @@ e.object({
2060
2408
  phone: e.string().optional(),
2061
2409
  email: e.string().optional()
2062
2410
  });
2063
- const A = e.enum([
2411
+ const _e = e.enum([
2064
2412
  "PENDING",
2065
2413
  "SUCCESS",
2066
2414
  "FAILED",
2067
2415
  "RETRYING"
2068
- ]), F = {
2416
+ ]), ye = {
2069
2417
  collectionName: "WebhookLogs",
2070
2418
  transform: {
2071
2419
  _id: "oid",
@@ -2073,39 +2421,39 @@ const A = e.enum([
2073
2421
  }
2074
2422
  };
2075
2423
  e.object({
2076
- _id: t,
2077
- business: t,
2424
+ _id: o,
2425
+ business: o,
2078
2426
  type: e.string(),
2079
2427
  payload: e.record(e.any()),
2080
- status: A,
2428
+ status: _e,
2081
2429
  response: e.any().optional(),
2082
2430
  error: e.string().optional()
2083
- }).describe(l.describe(F));
2084
- const B = e.enum(["AUTO", "MANUAL"]);
2431
+ }).describe(m.describe(ye));
2432
+ const fe = e.enum(["AUTO", "MANUAL"]);
2085
2433
  e.enum(["IN_PROGRESS", "COMPLETED"]);
2086
- const y = e.object({
2087
- _id: t,
2434
+ const j = e.object({
2435
+ _id: o,
2088
2436
  name: e.string().min(1, "Name is required").max(50),
2089
- type: B,
2090
- event: S.optional()
2091
- }), V = e.object({
2437
+ type: fe,
2438
+ event: w.optional()
2439
+ }), be = e.object({
2092
2440
  from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
2093
2441
  to: e.number().int("Must be integer").nullish()
2094
- }).superRefine((n, H) => {
2095
- n.from && n.to && n.from > n.to && H.addIssue({
2442
+ }).superRefine((n, a) => {
2443
+ n.from && n.to && n.from > n.to && a.addIssue({
2096
2444
  code: "custom",
2097
2445
  message: "Max referral count must be more than min referral count"
2098
2446
  });
2099
- }), k = e.object({
2100
- threshold: V,
2101
- rewards: e.array(t),
2102
- pf_reward: e.array(c).optional()
2103
- }), r = e.object({
2447
+ }), He = e.object({
2448
+ threshold: be,
2449
+ rewards: e.array(o),
2450
+ pf_reward: e.array(_).optional()
2451
+ }), y = e.object({
2104
2452
  id: e.string(),
2105
2453
  name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
2106
- rule: z.optional(),
2107
- rewards: e.array(k)
2108
- }), Y = {
2454
+ rule: F.optional(),
2455
+ rewards: e.array(He)
2456
+ }), ze = {
2109
2457
  collectionName: "ReferralRecords",
2110
2458
  transform: {
2111
2459
  _id: "oid",
@@ -2114,25 +2462,25 @@ const y = e.object({
2114
2462
  referee: "oid",
2115
2463
  refereeReward: "oid"
2116
2464
  }
2117
- }, K = e.object({
2465
+ }, Ce = e.object({
2118
2466
  completedAt: e.coerce.date(),
2119
- criteria: t,
2467
+ criteria: o,
2120
2468
  ref: e.string()
2121
- }), W = e.object({
2122
- _id: t,
2123
- business: t,
2124
- referer: t,
2125
- referee: t,
2126
- criteria: e.array(y),
2127
- reward: e.array(r),
2128
- refereeReward: e.array(t).optional(),
2129
- criteria_progress: e.array(K),
2469
+ }), Te = e.object({
2470
+ _id: o,
2471
+ business: o,
2472
+ referer: o,
2473
+ referee: o,
2474
+ criteria: e.array(j),
2475
+ reward: e.array(y),
2476
+ refereeReward: e.array(o).optional(),
2477
+ criteria_progress: e.array(Ce),
2130
2478
  status: e.string(),
2131
- pf_referer: i.optional(),
2132
- pf_referee: i.optional(),
2133
- pf_refereeReward: e.array(c).optional()
2134
- }).describe(l.describe(Y));
2135
- W.pick({
2479
+ pf_referer: g.optional(),
2480
+ pf_referee: g.optional(),
2481
+ pf_refereeReward: e.array(_).optional()
2482
+ }).describe(m.describe(ze));
2483
+ Te.pick({
2136
2484
  _id: !0,
2137
2485
  business: !0,
2138
2486
  referer: !0,
@@ -2140,57 +2488,273 @@ W.pick({
2140
2488
  criteria_progress: !0,
2141
2489
  criteria: !0
2142
2490
  }).extend({
2143
- pf_referee: i.pick({
2491
+ pf_referee: g.pick({
2144
2492
  _id: !0,
2145
2493
  name: !0,
2146
2494
  phoneNumber: !0,
2147
2495
  photoUrl: !0
2148
2496
  })
2149
2497
  });
2150
- const X = {
2498
+ const ve = {
2151
2499
  collectionName: "ReferralProgram",
2152
2500
  transform: {
2153
2501
  _id: "oid",
2154
2502
  business: "oid"
2155
2503
  }
2156
- }, f = e.object({
2157
- _id: t,
2158
- business: t,
2504
+ }, J = e.object({
2505
+ _id: o,
2506
+ business: o,
2159
2507
  term_and_condition: e.string().optional(),
2160
- refereeReward: e.array(t).optional(),
2161
- reward: e.array(r),
2162
- criteria: e.array(y)
2163
- }).describe(l.describe(X));
2508
+ refereeReward: e.array(o).optional(),
2509
+ reward: e.array(y),
2510
+ criteria: e.array(j)
2511
+ }).describe(m.describe(ve));
2164
2512
  e.object({
2165
- referer: t,
2166
- referee: t,
2167
- business: t
2513
+ referer: o,
2514
+ referee: o,
2515
+ business: o
2168
2516
  });
2169
2517
  e.object({
2170
- program: f.pick({
2518
+ program: J.pick({
2171
2519
  _id: !0,
2172
2520
  business: !0,
2173
2521
  term_and_condition: !0
2174
2522
  }).extend({
2175
- reward: r.optional(),
2176
- pf_refereeReward: e.array(c).optional()
2523
+ reward: y.optional(),
2524
+ pf_refereeReward: e.array(_).optional()
2177
2525
  }),
2178
2526
  referralCount: e.number(),
2179
2527
  successReferralCount: e.number(),
2180
- referredBy: i.pick({
2528
+ referredBy: g.pick({
2181
2529
  _id: !0,
2182
2530
  name: !0,
2183
2531
  phoneNumber: !0,
2184
2532
  photoUrl: !0
2185
2533
  }).optional()
2186
2534
  });
2187
- f.extend({
2535
+ J.extend({
2188
2536
  updateReferralRecord: e.boolean().optional()
2189
2537
  });
2538
+ const Se = e.object({
2539
+ facebookPageId: e.string(),
2540
+ pageName: e.string(),
2541
+ pageProfileImageUrl: e.string(),
2542
+ pageAccessToken: e.string().optional(),
2543
+ locationIds: e.array(o)
2544
+ }), Ne = e.object({
2545
+ locationId: o.nullable(),
2546
+ googleLocationName: e.string(),
2547
+ displayName: e.string().optional()
2548
+ }), Ue = e.object({
2549
+ token: e.string().nullable(),
2550
+ locations: e.array(Ne)
2551
+ }), Pe = e.object({
2552
+ token: e.string().nullable(),
2553
+ pages: e.array(Se)
2554
+ });
2555
+ e.object({
2556
+ _id: o,
2557
+ businessId: o,
2558
+ google: Ue.nullable(),
2559
+ facebook: Pe.nullable()
2560
+ }).describe(
2561
+ m.describe({
2562
+ collectionName: "ReviewSourceConfig",
2563
+ transform: {
2564
+ _id: "oid",
2565
+ businessId: "oid"
2566
+ }
2567
+ })
2568
+ );
2569
+ e.object({
2570
+ token: e.string()
2571
+ });
2572
+ e.object({
2573
+ locations: e.array(
2574
+ e.object({
2575
+ googleLocationName: e.string(),
2576
+ locationId: e.string().nullable(),
2577
+ displayName: e.string().optional()
2578
+ })
2579
+ )
2580
+ });
2581
+ e.object({
2582
+ token: e.string()
2583
+ });
2584
+ e.object({
2585
+ pages: e.array(
2586
+ e.object({
2587
+ facebookPageId: e.string(),
2588
+ locationIds: e.array(e.string())
2589
+ })
2590
+ )
2591
+ });
2592
+ e.object({
2593
+ _id: e.string(),
2594
+ google: e.object({
2595
+ token: e.string().nullable(),
2596
+ locations: e.array(
2597
+ e.object({
2598
+ googleLocationName: e.string(),
2599
+ displayName: e.string().optional(),
2600
+ locationId: e.string().nullable()
2601
+ })
2602
+ )
2603
+ }).nullable(),
2604
+ facebook: e.object({
2605
+ token: e.string().nullable(),
2606
+ pages: e.array(
2607
+ e.object({
2608
+ facebookPageId: e.string(),
2609
+ pageName: e.string(),
2610
+ pageProfileImageUrl: e.string(),
2611
+ locationIds: e.array(e.string())
2612
+ })
2613
+ )
2614
+ }).nullable()
2615
+ });
2616
+ const E = e.object({
2617
+ name: e.string(),
2618
+ pictureUrl: e.string()
2619
+ }), je = E.extend({
2620
+ isAnonymous: e.boolean().optional()
2621
+ }), Je = E.extend({
2622
+ id: e.string().optional()
2623
+ }), d = e.object({
2624
+ comment: e.string(),
2625
+ updateTime: e.coerce.date()
2626
+ }), s = e.object({
2627
+ thumbnailUrl: e.string(),
2628
+ thumbnailLabel: e.string(),
2629
+ videoUrl: e.string().optional()
2630
+ }), Ee = {
2631
+ collectionName: "Reviews",
2632
+ transform: {
2633
+ _id: "oid",
2634
+ locationId: "oid"
2635
+ },
2636
+ lookups: {
2637
+ reviewerId: {
2638
+ as: "reviewer",
2639
+ fromCollection: "UsersV2"
2640
+ },
2641
+ locationId: {
2642
+ as: "location",
2643
+ fromCollection: "Locations"
2644
+ }
2645
+ }
2646
+ }, O = e.enum(["google", "facebook", "feedme"]);
2647
+ O.options;
2648
+ e.enum(["google", "facebook"]);
2649
+ const Oe = e.enum([
2650
+ "createTime_desc",
2651
+ "createTime_asc",
2652
+ "rating_asc",
2653
+ "rating_desc"
2654
+ ]);
2655
+ e.object({
2656
+ source: O.optional(),
2657
+ dateFrom: e.coerce.date().optional(),
2658
+ dateTo: e.coerce.date().optional(),
2659
+ locationId: e.string().optional(),
2660
+ sort: Oe.optional(),
2661
+ limit: e.coerce.number().int().positive().optional(),
2662
+ skip: e.coerce.number().int().min(0).optional()
2663
+ });
2664
+ const I = e.object({
2665
+ name: e.string(),
2666
+ pictureUrl: e.string()
2667
+ }), Ie = I.extend({
2668
+ isAnonymous: e.boolean().optional()
2669
+ }), Re = I.extend({
2670
+ id: e.string().optional()
2671
+ }), f = e.object({
2672
+ _id: o,
2673
+ comment: e.string(),
2674
+ createTime: e.coerce.date(),
2675
+ locationId: o
2676
+ }), Le = f.extend({
2677
+ source: e.literal("google"),
2678
+ reviewer: Ie.optional(),
2679
+ reply: d.optional(),
2680
+ mediaItems: e.array(s),
2681
+ starRating: e.number(),
2682
+ locationName: e.string(),
2683
+ locationDisplayName: e.string()
2684
+ }), xe = f.extend({
2685
+ source: e.literal("facebook"),
2686
+ reviewer: Re.optional(),
2687
+ isPositive: e.boolean().optional(),
2688
+ pageId: e.string(),
2689
+ pageName: e.string()
2690
+ }), De = f.extend({
2691
+ source: e.literal("feedme"),
2692
+ reviewer: A,
2693
+ reply: d.optional(),
2694
+ starRating: e.number(),
2695
+ location: G.optional(),
2696
+ mediaItems: e.array(s),
2697
+ billId: e.string()
2698
+ });
2699
+ e.discriminatedUnion("source", [
2700
+ Le,
2701
+ xe,
2702
+ De
2703
+ ]);
2704
+ e.object({
2705
+ comment: e.string(),
2706
+ starRating: e.number(),
2707
+ billId: e.string(),
2708
+ mediaItems: e.array(s).optional()
2709
+ });
2710
+ const b = e.object({
2711
+ _id: o,
2712
+ externalId: e.string().optional(),
2713
+ comment: e.string(),
2714
+ createTime: e.coerce.date(),
2715
+ // The marketing Location the review belongs to. For feedme reviews this is
2716
+ // the restaurantId (Location._id === restaurantId); for google/facebook it
2717
+ // is resolved from the review-source location/page mapping at sync time.
2718
+ locationId: o
2719
+ }), we = b.extend({
2720
+ source: e.literal("google"),
2721
+ reviewer: je.optional(),
2722
+ reply: d.optional(),
2723
+ mediaItems: e.array(s),
2724
+ starRating: e.number(),
2725
+ locationName: e.string(),
2726
+ locationDisplayName: e.string()
2727
+ }), Ae = b.extend({
2728
+ source: e.literal("facebook"),
2729
+ reviewer: Je.optional(),
2730
+ isPositive: e.boolean().optional(),
2731
+ pageId: e.string(),
2732
+ pageName: e.string()
2733
+ }), Ge = b.extend({
2734
+ source: e.literal("feedme"),
2735
+ reviewerId: o,
2736
+ reviewer: e.any().optional(),
2737
+ reply: d.optional(),
2738
+ starRating: e.number(),
2739
+ billId: e.string(),
2740
+ location: e.any().optional(),
2741
+ mediaItems: e.array(s)
2742
+ });
2743
+ e.discriminatedUnion("source", [
2744
+ we,
2745
+ Ae,
2746
+ Ge
2747
+ ]).describe(m.describe(Ee));
2190
2748
  export {
2191
- v as F,
2192
- te as T,
2749
+ Z as F,
2750
+ t as R,
2751
+ Ye as T,
2193
2752
  k as a,
2194
- y as b,
2195
- r as c
2753
+ He as b,
2754
+ j as c,
2755
+ y as d,
2756
+ X as e,
2757
+ q as f,
2758
+ u as i,
2759
+ Y as s
2196
2760
  };