@feedmepos/mf-connect 0.1.116-dev → 0.1.117-prod
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.
- package/README.md +1 -66
- package/dist/{App-DWDgsBqW.js → App-CAo1izHr.js} +618 -652
- package/dist/{Bin-Cz6fmewG.js → Bin-DDDfjisJ.js} +8 -8
- package/dist/{Broadcast-CQ0pfKpx.js → Broadcast-BsCulZhE.js} +21 -22
- package/dist/{CampaignAnalytic-CiRCB3kh.js → CampaignAnalytic-CnVYFSkT.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bp7UeQWJ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZTHyZ_0y.js} +9 -9
- package/dist/{Card-Kw2PFL2m.js → Card-DPyQH9qZ.js} +24 -25
- package/dist/{Collections-D8Vx_EEH.js → Collections-CZCVA969.js} +185 -197
- package/dist/{Credit-B1jsQ5zg.js → Credit-BTg364-i.js} +20 -21
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B6Fpf8zy.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BJx8K6Ja.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ijya9Cho.js +3494 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cdpr9Ku4.js → EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js} +32 -32
- package/dist/{Experience-B0JIA3sL.js → Experience-Bk_eUcSX.js} +31 -32
- package/dist/{FileSaver.min-M-9kTN8q.js → FileSaver.min-CXFiZAp7.js} +1 -1
- package/dist/{Game-CNJyqnK3.js → Game-CBnKpFdl.js} +18 -19
- package/dist/{GiftCardSetup-DSQIC7fD.js → GiftCardSetup-q75wNV_F.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ABiLOF1j.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-Cga0Th2O.js} +7 -7
- package/dist/{Goals-DBPzGIRK.js → Goals-Bbbgurfd.js} +4 -4
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B2edB52s.js → ImageInput.vue_vue_type_script_setup_true_lang-CZS05h1r.js} +1 -1
- package/dist/{Index-CiWyZXnK.js → Index-C8_OWllb.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DnP03_b7.js → LocationPicker.vue_vue_type_script_setup_true_lang-BlCg-jI7.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DM17LaNE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CACxChIo.js} +1 -1
- package/dist/{LoyaltyDashboard-C4ZlK9Hv.js → LoyaltyDashboard-DJlE0371.js} +15 -15
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CJncINki.js → MainLayout-Bs2UPvFx.js} +4 -5
- package/dist/Marketing-BvRYzFV8.js +236 -0
- package/dist/{remy-icon-BhUGu2NI.js → MarketingMaterialEdit-o88sdvTM.js} +1031 -2
- package/dist/{Member-B-l5P9jk.js → Member-C4yqwsMH.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C_ZjHH4I.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbumjyC_.js} +50 -43
- package/dist/{MemberImportHistory-BJcu-ahG.js → MemberImportHistory-CbuXCdxC.js} +7 -7
- package/dist/{MemberList-DVsWNWIc.js → MemberList-CpAepPBe.js} +105 -103
- package/dist/{MemberTransactions-C2VPySEO.js → MemberTransactions-BbpXvsSk.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BXqrn9tg.js → MessageInput.vue_vue_type_script_setup_true_lang-BaWgxbad.js} +14 -14
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BouFp66T.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CEgMElLo.js} +1 -1
- package/dist/{Mission-DWO-IF0f.js → Mission-Bdb9KVeP.js} +21 -22
- package/dist/{Overview-DPcWm2S0.js → Overview-CEiyGMcf.js} +22 -23
- package/dist/{Overview-Dbp4Sv-H.js → Overview-D_9JwnFU.js} +144 -145
- package/dist/{Point-PnWrzVOY.js → Point-Bd5cMXQx.js} +21 -22
- package/dist/{Promotion-Bwpi60dN.js → Promotion-D9gZDvgR.js} +131 -137
- package/dist/{Queue-BvEcKyVJ.js → Queue-BnAOL_rp.js} +45 -46
- package/dist/{Record-DzNvU2fM.js → Record-D6TWFKe0.js} +9 -9
- package/dist/{Review-HDYwnMd6.js → Review-DLEgvnc-.js} +2 -2
- package/dist/ReviewFacebookCallback-jVlm2O8f.js +238 -0
- package/dist/{ReviewGoogleCallback-6V9JNKsl.js → ReviewGoogleCallback-BgAbO3pI.js} +5 -5
- package/dist/{Reward-DI6IyG-d.js → Reward-DBheQiFu.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DFAIPMe7.js → RewardGroup.vue_vue_type_script_setup_true_lang-Bt-EqsiH.js} +15 -16
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CKL8MEld.js +1883 -0
- package/dist/{Segment-DrV6pQyx.js → Segment-B9Se5FFw.js} +305 -304
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CXHt_ZeT.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-f7AS5vwv.js} +30 -31
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-XRXkLy6j.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-3BKA0UFI.js} +4 -4
- package/dist/Setting-B92JT_Y4.js +2037 -0
- package/dist/{SettingAdvertisements-BtqKt4Ca.js → SettingAdvertisements-CLw-dqiA.js} +12 -12
- package/dist/Settings-BmmM8ZnR.js +179 -0
- package/dist/{Store-HZs9GG03.js → Store-B5PPP5zM.js} +30 -31
- package/dist/{StoreRewards-BSTXL4FR.js → StoreRewards-DllyaVBY.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3Vvqf6_H.js +1264 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-7ZZ0e5tQ.js +142 -0
- package/dist/{Tier-Ka0rbjC_.js → Tier-M_TApfju.js} +687 -2576
- package/dist/{Title-7jvrf34J.js → Title-Cpltm-I2.js} +92 -94
- package/dist/{Transaction-D-M3udf5.js → Transaction-BYfAYRpv.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CrlpuElX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BOhfGxVj.js} +26 -26
- package/dist/{Voucher-BZCLPyDk.js → Voucher-DHoyg0YZ.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C_MOMFkX.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js} +16 -16
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Do4GTTKx.js → ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js} +2 -2
- package/dist/{app-CEe3kSZM.js → app-B_doYklh.js} +7107 -8879
- package/dist/app.js +3 -4
- package/dist/{base.export-BjSdr85q.js → base.export-DmbnT_bp.js} +2 -2
- package/dist/{business-CJjiItSo.js → business-DdVGtTvx.js} +1 -1
- package/dist/{campaign-DEXq52fE.js → campaign-CVkA08zl.js} +25 -31
- package/dist/{campaign-D4MWLs1D.js → campaign-jEhKmpKg.js} +94 -121
- package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-DWu6-kOo.js} +2 -3
- package/dist/{campaign.fn-DiadKjES.js → campaign.fn-BlgEyeFz.js} +82 -82
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CVLkXKml.js} +1 -1
- package/dist/{collection.fn-CfqIdnSS.js → collection.fn-DLNGTrPf.js} +2 -2
- package/dist/{currency-CPB6E_s-.js → currency-DKS1md4e.js} +1 -1
- package/dist/{effect-DFodA5mh.js → effect-Bk-zYexf.js} +1 -1
- package/dist/{email-addresses-C0CwgNs_.js → email-addresses-I9A5iLzf.js} +2 -2
- package/dist/{feature-flag-Bap2oi_S.js → feature-flag-DQti61iR.js} +74 -74
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-DKKsSb2o.js → helper-9cPlo6ae.js} +1 -1
- package/dist/{index-CJGb1iJi.js → index-1Cdj34z1.js} +1 -1
- package/dist/{index-CtwPthW5.js → index-3V8E9GaZ.js} +2 -2
- package/dist/{index-CfqmNZUH.js → index-728mP6kW.js} +581 -683
- package/dist/{index-DDmpyI6z.js → index-BRm0LMTo.js} +252 -611
- package/dist/{index-qAQiQd-s.js → index-BxpbI0GH.js} +7 -7
- package/dist/{index-DFV2ydYE.js → index-C-OnJpT8.js} +1 -1
- package/dist/{index-D5veZ8LP.js → index-CIwdXphn.js} +2613 -2700
- package/dist/{index-DxmlvoHV.js → index-CNUXbXvG.js} +6 -19
- package/dist/{index-RUdMURTx.js → index-Cj6oxbl0.js} +10 -11
- package/dist/{index-CXqPYmyv.js → index-ClYX4COd.js} +3 -4
- package/dist/{index-CEFEuMOF.js → index-CuyzSc1l.js} +1 -1
- package/dist/{index-BS6725ZB.js → index-DOE2VR99.js} +198 -198
- package/dist/{index-C_4eW8Sr.js → index-DWkuIfHy.js} +232 -390
- package/dist/{index-BdGo-qgB.js → index-Dj51vqab.js} +4 -4
- package/dist/{index-DRnUcSVN.js → index-DuvnRxeo.js} +1 -1
- package/dist/{index-BJCirs9i.js → index-cgtAlOl9.js} +10767 -8028
- package/dist/{index-BWsGYTzB.js → index-fHiFL1dW.js} +15 -29
- package/dist/{index-CFZMwKR6.js → index-oNMFyOGe.js} +7 -8
- package/dist/{index-4LQanFJi.js → index-vKvGJ4Ve.js} +2 -2
- package/dist/{index.esm2017-i1myv90H.js → index.esm2017-CsF37oA-.js} +177 -177
- package/dist/{loading-BAFiJnEb.js → loading-BJJmTFoe.js} +1 -1
- package/dist/{lodash-De2KDgqX.js → lodash-BMJ6_hsa.js} +1 -1
- package/dist/{member-import-BP4RZGbA.js → member-import-DrGxVJt9.js} +5 -6
- package/dist/{membership-CQWw-rTa.js → membership-CAqKihwy.js} +3 -3
- package/dist/{money-rwjWYzdi.js → money-Bf9d2ZUH.js} +1 -1
- package/dist/{number-DwSvkBpS.js → number-CWXlGZa5.js} +1 -1
- package/dist/objectid-2DN5a9sY.js +145 -0
- package/dist/{onboarding-u7cpl6k3.js → onboarding-Dn9O7r3a.js} +25 -25
- package/dist/{onboardingSetup-DoxDlcVN.js → onboardingSetup-BMkDoGy-.js} +2 -2
- package/dist/{plugins-CKaeoHSK.js → plugins-KDgceFWV.js} +3 -3
- package/dist/{reward-BasbGRWt.js → reward-eilGRaXi.js} +1 -1
- package/dist/{rule-IN41b-qE.js → rule-Dr9Zjg_o.js} +492 -572
- package/dist/rule-builder-cz6Dy-no.js +102 -0
- package/dist/style.css +1 -1
- package/dist/template-DwbazO8p.js +236 -0
- package/dist/{timezone-C68y8HiI.js → timezone-C5CIfvHs.js} +1 -1
- package/dist/{transaction.fn-Ckxm2gof.js → transaction.fn-Cr-FLjh0.js} +2 -2
- package/dist/{trigger-xA8j3s9B.js → trigger-B0Fv6wbN.js} +8 -8
- package/dist/useMarketingMaterialActions-CNk3LR9M.js +96 -0
- package/dist/{usePagination-CIRxyVr8.js → usePagination-BcA-imTr.js} +1 -1
- package/dist/{user-PTTQTMyQ.js → user-DRvLwlBE.js} +1 -1
- package/dist/vue-i18n-y7bHQpNx.js +2365 -0
- package/dist/{xlsx-l0AsOrP1.js → xlsx-CBObn76o.js} +379 -379
- package/dist/{zod-Bm1pKYLC.js → zod-DWU5EdQV.js} +1 -1
- package/package.json +2 -6
- package/dist/AuditLogs-BqEtvKFs.js +0 -2016
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW1RntIP.js +0 -4442
- package/dist/Grab-CGWinKBS.js +0 -301
- package/dist/MainLayout-D22Q2_jN.js +0 -4
- package/dist/Marketing-CmVnvEN6.js +0 -269
- package/dist/MarketingMaterialEdit-CQ55zG-W.js +0 -1037
- package/dist/ReviewFacebookCallback-rAlgcTQ_.js +0 -225
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CDoba0oG.js +0 -1923
- package/dist/Setting-aLQCUCP9.js +0 -574
- package/dist/Settings-BkYtKb4l.js +0 -286
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D9nykzc3.js +0 -1319
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DBnHk6jn.js +0 -7007
- package/dist/WhatsappAccount-BG0dIroG.js +0 -159
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Co05OXon.js +0 -39
- package/dist/WhatsappBot-O5h5UKXz.js +0 -876
- package/dist/WhatsappBotLogs-BOPTuu6o.js +0 -372
- package/dist/WhatsappBotSettings-BSiIvpGO.js +0 -705
- package/dist/WhatsappLayout-DLVIfkzJ.js +0 -21
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DJdi7dV6.js +0 -253
- package/dist/browser-BSAOEeIM.js +0 -1478
- package/dist/duplicateCampaign-BzWvsZwc.js +0 -51
- package/dist/feature-flag--GbS6Qn_.js +0 -50
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/index-C-iwb2Ln.js +0 -109
- package/dist/index-C1C21iKU.js +0 -74
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/objectid-DtEPzPd_.js +0 -145
- package/dist/template-3Nu_MAMG.js +0 -188
- package/dist/useMarketingMaterialActions-ClYoBaFw.js +0 -125
- package/dist/vue-i18n-DYnrLWFT.js +0 -2365
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { z as e } from "./index-
|
|
2
|
-
import { F as
|
|
3
|
-
import { F as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as p, f as ae } from "./index-BS6725ZB.js";
|
|
1
|
+
import { z as e, F as t, b as y, m as p, d as K } from "./index-cgtAlOl9.js";
|
|
2
|
+
import { F as h } from "./campaign.enum-DWu6-kOo.js";
|
|
3
|
+
import { d as F, F as D, e as d, f as V, g as f, h as c, i as J, c as Y } from "./index-CIwdXphn.js";
|
|
4
|
+
import { A as M, B as A, C as q, E as Z } from "./index-728mP6kW.js";
|
|
5
|
+
import { c as u, d as $ } from "./index-DOE2VR99.js";
|
|
7
6
|
e.object({
|
|
8
7
|
location: t,
|
|
9
8
|
memberId: t,
|
|
10
|
-
nettTotal:
|
|
9
|
+
nettTotal: y,
|
|
11
10
|
remark: e.string().optional()
|
|
12
11
|
});
|
|
13
|
-
const
|
|
12
|
+
const X = e.enum(["COUNTER", "POS"]);
|
|
14
13
|
e.object({
|
|
15
14
|
id: e.string(),
|
|
16
15
|
userId: e.string(),
|
|
@@ -21,9 +20,9 @@ e.object({
|
|
|
21
20
|
level: e.number().nullish(),
|
|
22
21
|
mostPurchasedItems: e.array(e.string()).nullish()
|
|
23
22
|
});
|
|
24
|
-
const
|
|
23
|
+
const Q = {
|
|
25
24
|
collectionName: "Bills"
|
|
26
|
-
},
|
|
25
|
+
}, ee = e.object({
|
|
27
26
|
_id: e.string(),
|
|
28
27
|
items: e.record(e.string(), e.number()).nullish(),
|
|
29
28
|
// business: z.string(),
|
|
@@ -32,27 +31,25 @@ const se = {
|
|
|
32
31
|
user: e.string().nullish(),
|
|
33
32
|
memberid: e.string().nullish(),
|
|
34
33
|
// roundToNearest: z.number().nullish(),
|
|
35
|
-
nettTotal:
|
|
36
|
-
adjustedTotal:
|
|
34
|
+
nettTotal: y,
|
|
35
|
+
adjustedTotal: y.optional(),
|
|
37
36
|
// activeItems: z.array(z.string()),
|
|
38
37
|
remark: e.string().nullish(),
|
|
39
38
|
createdAt: e.coerce.date(),
|
|
40
39
|
completedAt: e.coerce.date(),
|
|
41
|
-
refunded: e.boolean().nullish(),
|
|
42
|
-
refundRecord: e.array(e.string()).nullish(),
|
|
43
40
|
location: e.string(),
|
|
44
|
-
channel:
|
|
45
|
-
}).transform((
|
|
46
|
-
...
|
|
47
|
-
createdTime:
|
|
48
|
-
completedTime:
|
|
41
|
+
channel: X.optional()
|
|
42
|
+
}).transform((a) => ({
|
|
43
|
+
...a,
|
|
44
|
+
createdTime: a.createdAt,
|
|
45
|
+
completedTime: a.completedAt,
|
|
49
46
|
get amount() {
|
|
50
|
-
return
|
|
47
|
+
return a.nettTotal.amount / 10 ** a.nettTotal.precision;
|
|
51
48
|
},
|
|
52
49
|
get adjustmentAmount() {
|
|
53
|
-
return
|
|
50
|
+
return a.adjustedTotal ? a.adjustedTotal.amount / 10 ** a.adjustedTotal.precision : void 0;
|
|
54
51
|
}
|
|
55
|
-
})).describe(
|
|
52
|
+
})).describe(p.describe(Q)), te = e.object({
|
|
56
53
|
_id: e.string(),
|
|
57
54
|
rating: e.coerce.number(),
|
|
58
55
|
user: e.string().optional(),
|
|
@@ -63,7 +60,6 @@ const se = {
|
|
|
63
60
|
"SIMPLE_CLAIM",
|
|
64
61
|
"LINK_CLAIM",
|
|
65
62
|
"BILL_COMPLETED",
|
|
66
|
-
"BILL_REFUNDED",
|
|
67
63
|
"SCHEDULE",
|
|
68
64
|
"BIRTHDAY",
|
|
69
65
|
"FEEDBACK",
|
|
@@ -78,7 +74,7 @@ const se = {
|
|
|
78
74
|
"REFERRAL_ADDED",
|
|
79
75
|
"MEMBER_IMPORTED",
|
|
80
76
|
"SEGMENTATION_IMPORTED"
|
|
81
|
-
]),
|
|
77
|
+
]), ve = o.extract([
|
|
82
78
|
"BILL_COMPLETED",
|
|
83
79
|
"FEEDBACK",
|
|
84
80
|
"GAME_COMPLETED",
|
|
@@ -91,64 +87,64 @@ const se = {
|
|
|
91
87
|
]);
|
|
92
88
|
e.enum(["START_OF", "BEFORE"]);
|
|
93
89
|
e.enum(["WEEK", "MONTH"]);
|
|
94
|
-
const
|
|
90
|
+
const ne = e.enum([
|
|
95
91
|
"WAITING",
|
|
96
92
|
"ACTIVE",
|
|
97
93
|
"COMPLETED",
|
|
98
94
|
"FAILED"
|
|
99
|
-
]),
|
|
95
|
+
]), i = e.object({
|
|
100
96
|
// type: F_EVENT_TYPE,
|
|
101
|
-
rule:
|
|
102
|
-
}),
|
|
97
|
+
rule: F.optional()
|
|
98
|
+
}), oe = i.extend({
|
|
103
99
|
type: e.literal(o.enum.BILL_COMPLETED)
|
|
104
|
-
}),
|
|
100
|
+
}), ie = i.extend({
|
|
105
101
|
type: e.literal(o.enum.FEEDBACK)
|
|
106
|
-
}),
|
|
102
|
+
}), ae = i.extend({
|
|
107
103
|
type: e.literal(o.enum.SIMPLE_CLAIM)
|
|
108
104
|
});
|
|
109
|
-
|
|
105
|
+
i.extend({
|
|
110
106
|
type: e.literal(o.enum.ENTER_SEGMENT),
|
|
111
107
|
segment: e.string()
|
|
112
108
|
});
|
|
113
|
-
const
|
|
109
|
+
const le = i.extend({
|
|
114
110
|
type: e.literal(o.enum.MEMBER_REWARD)
|
|
115
|
-
}),
|
|
111
|
+
}), se = i.extend({
|
|
116
112
|
type: e.literal(o.enum.SCHEDULE)
|
|
117
113
|
// option: FdoCronRule,
|
|
118
|
-
}),
|
|
114
|
+
}), re = i.extend({
|
|
119
115
|
type: e.literal(o.enum.MEMBERSHIP_JOINED)
|
|
120
|
-
}),
|
|
116
|
+
}), de = i.extend({
|
|
121
117
|
type: e.literal(o.enum.TIER_UPGRADED)
|
|
122
|
-
}),
|
|
118
|
+
}), ce = i.extend({
|
|
123
119
|
type: e.literal(o.enum.MAKING_ORDER)
|
|
124
|
-
}),
|
|
120
|
+
}), me = i.extend({
|
|
125
121
|
type: e.literal(o.enum.ISSUE_REWARD)
|
|
126
|
-
}),
|
|
122
|
+
}), ue = i.extend({
|
|
127
123
|
type: e.literal(o.enum.GAME_COMPLETED)
|
|
128
124
|
});
|
|
129
|
-
|
|
125
|
+
i.extend({
|
|
130
126
|
type: e.literal(o.enum.REFERRAL_ADDED)
|
|
131
127
|
});
|
|
132
|
-
|
|
128
|
+
i.extend({
|
|
133
129
|
type: e.literal(o.enum.MEMBER_IMPORTED)
|
|
134
130
|
});
|
|
135
|
-
const
|
|
136
|
-
|
|
131
|
+
const Ee = e.discriminatedUnion("type", [
|
|
132
|
+
ae,
|
|
133
|
+
oe,
|
|
134
|
+
se,
|
|
135
|
+
ie,
|
|
136
|
+
re,
|
|
137
|
+
de,
|
|
137
138
|
ce,
|
|
138
|
-
Ee,
|
|
139
139
|
me,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
ye,
|
|
143
|
-
Ce,
|
|
144
|
-
pe,
|
|
145
|
-
Re
|
|
140
|
+
le,
|
|
141
|
+
ue
|
|
146
142
|
]);
|
|
147
143
|
e.object({
|
|
148
144
|
_id: t,
|
|
149
145
|
type: o,
|
|
150
146
|
ref: e.string(),
|
|
151
|
-
status:
|
|
147
|
+
status: ne.optional(),
|
|
152
148
|
context: e.record(e.string(), e.any()).optional(),
|
|
153
149
|
failedReason: e.any().optional()
|
|
154
150
|
}).describe(JSON.stringify({ collectionName: "EventLogs" }));
|
|
@@ -159,24 +155,18 @@ const l = e.object({
|
|
|
159
155
|
campaignIds: e.array(t).optional(),
|
|
160
156
|
slackWebhookUrl: e.string().optional(),
|
|
161
157
|
emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
|
|
162
|
-
}),
|
|
158
|
+
}), pe = l.extend({
|
|
163
159
|
type: e.literal(o.enum.BILL_COMPLETED),
|
|
164
160
|
context: e.object({
|
|
165
|
-
bill:
|
|
161
|
+
bill: ee,
|
|
166
162
|
rawBill: e.any()
|
|
167
163
|
})
|
|
168
|
-
}),
|
|
169
|
-
type: e.literal(o.enum.BILL_REFUNDED),
|
|
170
|
-
context: e.object({
|
|
171
|
-
bill: j,
|
|
172
|
-
rawBill: e.any()
|
|
173
|
-
})
|
|
174
|
-
}), fe = l.extend({
|
|
164
|
+
}), ge = l.extend({
|
|
175
165
|
type: e.literal(o.enum.SCHEDULE),
|
|
176
166
|
context: e.object({
|
|
177
167
|
triggeredAt: e.coerce.date()
|
|
178
168
|
})
|
|
179
|
-
}),
|
|
169
|
+
}), be = l.extend({
|
|
180
170
|
type: e.literal(o.enum.PAGINATE_SCHEDULE),
|
|
181
171
|
context: e.object({
|
|
182
172
|
triggeredAt: e.coerce.date(),
|
|
@@ -184,85 +174,83 @@ const l = e.object({
|
|
|
184
174
|
skip: e.coerce.number(),
|
|
185
175
|
limit: e.coerce.number()
|
|
186
176
|
})
|
|
187
|
-
}),
|
|
177
|
+
}), ye = l.extend({
|
|
188
178
|
type: e.literal(o.enum.FEEDBACK),
|
|
189
179
|
context: e.object({
|
|
190
|
-
feedback:
|
|
180
|
+
feedback: te
|
|
191
181
|
})
|
|
192
|
-
}),
|
|
182
|
+
}), Ce = l.extend({
|
|
193
183
|
type: e.literal(o.enum.MEMBERSHIP_JOINED),
|
|
194
184
|
context: e.object({
|
|
195
|
-
user:
|
|
185
|
+
user: M
|
|
196
186
|
})
|
|
197
|
-
}),
|
|
187
|
+
}), Re = l.extend({
|
|
198
188
|
type: e.literal(o.enum.TIER_UPGRADED),
|
|
199
189
|
context: e.object({
|
|
200
|
-
transaction:
|
|
190
|
+
transaction: A
|
|
201
191
|
})
|
|
202
|
-
}),
|
|
192
|
+
}), _e = l.extend({
|
|
203
193
|
type: e.literal(o.enum.ISSUE_REWARD),
|
|
204
194
|
context: e.object({
|
|
205
|
-
transaction:
|
|
206
|
-
collection:
|
|
195
|
+
transaction: A,
|
|
196
|
+
collection: q
|
|
207
197
|
})
|
|
208
|
-
}),
|
|
198
|
+
}), Ie = l.extend({
|
|
209
199
|
type: e.literal(o.enum.REFERRAL_ADDED),
|
|
210
200
|
context: e.object({
|
|
211
|
-
user:
|
|
201
|
+
user: M
|
|
212
202
|
})
|
|
213
|
-
}),
|
|
203
|
+
}), T = e.object({
|
|
214
204
|
ref: t,
|
|
215
205
|
originalName: e.string(),
|
|
216
206
|
mimeType: e.string(),
|
|
217
207
|
size: e.number(),
|
|
218
208
|
fbFilePath: e.string(),
|
|
219
209
|
isFbFileDeleted: e.boolean().nullish()
|
|
220
|
-
}),
|
|
210
|
+
}), he = e.object({
|
|
221
211
|
resetCollectionExpiryBalance: e.boolean().nullish()
|
|
222
|
-
}),
|
|
212
|
+
}), Fe = l.extend({
|
|
223
213
|
type: e.literal(o.enum.MEMBER_IMPORTED),
|
|
224
214
|
context: e.object({
|
|
225
215
|
business: e.string(),
|
|
226
|
-
file:
|
|
227
|
-
config:
|
|
216
|
+
file: T,
|
|
217
|
+
config: he.optional()
|
|
228
218
|
})
|
|
229
|
-
}),
|
|
219
|
+
}), De = l.extend({
|
|
230
220
|
type: e.literal(o.enum.SEGMENTATION_IMPORTED),
|
|
231
221
|
context: e.object({
|
|
232
222
|
business: e.string(),
|
|
233
223
|
segment: e.string(),
|
|
234
|
-
file:
|
|
224
|
+
file: T
|
|
235
225
|
})
|
|
236
226
|
});
|
|
237
227
|
e.discriminatedUnion("type", [
|
|
228
|
+
pe,
|
|
229
|
+
ge,
|
|
230
|
+
ye,
|
|
231
|
+
Ce,
|
|
232
|
+
Re,
|
|
238
233
|
_e,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
De,
|
|
242
|
-
Ae,
|
|
243
|
-
Me,
|
|
244
|
-
Te,
|
|
234
|
+
be,
|
|
235
|
+
Ie,
|
|
245
236
|
Fe,
|
|
246
|
-
|
|
247
|
-
xe,
|
|
248
|
-
Pe
|
|
237
|
+
De
|
|
249
238
|
]);
|
|
250
|
-
const
|
|
239
|
+
const fe = {
|
|
251
240
|
collectionName: "Locations",
|
|
252
241
|
transform: {
|
|
253
242
|
_id: "oid",
|
|
254
243
|
business: "oid"
|
|
255
244
|
}
|
|
256
|
-
},
|
|
245
|
+
}, O = e.object({
|
|
257
246
|
_id: t,
|
|
258
247
|
business: t,
|
|
259
248
|
name: e.string(),
|
|
260
249
|
code: e.string().nullish(),
|
|
261
250
|
otp: e.string().nullish(),
|
|
262
251
|
otpExpiredAt: e.coerce.date().nullish(),
|
|
263
|
-
apiToken: e.string().nullish()
|
|
264
|
-
|
|
265
|
-
}).describe(g.describe(Se));
|
|
252
|
+
apiToken: e.string().nullish()
|
|
253
|
+
}).describe(p.describe(fe));
|
|
266
254
|
e.object({
|
|
267
255
|
_id: t,
|
|
268
256
|
name: e.string(),
|
|
@@ -270,7 +258,7 @@ e.object({
|
|
|
270
258
|
os: e.string(),
|
|
271
259
|
apiToken: e.string().nullish()
|
|
272
260
|
}).describe(
|
|
273
|
-
|
|
261
|
+
p.describe({
|
|
274
262
|
collectionName: "LocationDevices",
|
|
275
263
|
transform: {
|
|
276
264
|
_id: "oid",
|
|
@@ -282,177 +270,76 @@ e.object({
|
|
|
282
270
|
_id: e.string(),
|
|
283
271
|
name: e.string()
|
|
284
272
|
});
|
|
285
|
-
const
|
|
286
|
-
type: e.literal(
|
|
273
|
+
const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "Weight need to be at least 0"), _ = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), L = e.object({
|
|
274
|
+
type: e.literal(C.enum.NO_REWARD),
|
|
287
275
|
collectible: e.null(),
|
|
288
|
-
weight:
|
|
289
|
-
}),
|
|
290
|
-
type: e.literal(
|
|
276
|
+
weight: R
|
|
277
|
+
}), P = e.object({
|
|
278
|
+
type: e.literal(C.enum.VOUCHER),
|
|
291
279
|
collectible: t,
|
|
292
|
-
collectibleConfig: e.lazy(() =>
|
|
293
|
-
earningOption: e.lazy(() =>
|
|
294
|
-
}),
|
|
295
|
-
type: e.literal(
|
|
280
|
+
collectibleConfig: e.lazy(() => D._def.right.options[0]),
|
|
281
|
+
earningOption: e.lazy(() => d)
|
|
282
|
+
}), b = e.object({
|
|
283
|
+
type: e.literal(C.enum.LOYALTY),
|
|
296
284
|
collectible: t,
|
|
297
|
-
earningOption: e.lazy(() =>
|
|
298
|
-
validityOption: e.lazy(() =>
|
|
299
|
-
}),
|
|
300
|
-
weight:
|
|
301
|
-
}),
|
|
285
|
+
earningOption: e.lazy(() => d),
|
|
286
|
+
validityOption: e.lazy(() => V)
|
|
287
|
+
}), x = P.extend({
|
|
288
|
+
weight: R
|
|
289
|
+
}), S = b.extend({
|
|
302
290
|
weight: e.number().min(0, "Weight need to be at least 0")
|
|
303
|
-
}),
|
|
304
|
-
validityOption:
|
|
305
|
-
weight:
|
|
306
|
-
}),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
]),
|
|
311
|
-
|
|
291
|
+
}), ze = b.extend({
|
|
292
|
+
validityOption: f,
|
|
293
|
+
weight: R
|
|
294
|
+
}), Me = e.discriminatedUnion("type", [
|
|
295
|
+
x,
|
|
296
|
+
S,
|
|
297
|
+
L
|
|
298
|
+
]), I = e.discriminatedUnion("type", [
|
|
299
|
+
x.extend({
|
|
312
300
|
collectible: t.nullish(),
|
|
313
301
|
business: t.nullish()
|
|
314
302
|
}),
|
|
315
|
-
|
|
303
|
+
S.extend({
|
|
316
304
|
collectible: t.nullish(),
|
|
317
305
|
business: t.nullish()
|
|
318
306
|
}),
|
|
319
|
-
|
|
320
|
-
]),
|
|
321
|
-
threshold:
|
|
322
|
-
}),
|
|
323
|
-
threshold:
|
|
324
|
-
}),
|
|
325
|
-
validityOption:
|
|
326
|
-
threshold:
|
|
327
|
-
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
]),
|
|
331
|
-
|
|
307
|
+
L
|
|
308
|
+
]), N = P.extend({
|
|
309
|
+
threshold: _
|
|
310
|
+
}), B = b.extend({
|
|
311
|
+
threshold: _
|
|
312
|
+
}), He = b.extend({
|
|
313
|
+
validityOption: f,
|
|
314
|
+
threshold: _
|
|
315
|
+
}), j = e.discriminatedUnion("type", [
|
|
316
|
+
N,
|
|
317
|
+
B
|
|
318
|
+
]), Ae = e.discriminatedUnion("type", [
|
|
319
|
+
N.extend({
|
|
332
320
|
collectible: t.nullish(),
|
|
333
321
|
business: t.nullish()
|
|
334
322
|
}),
|
|
335
|
-
|
|
323
|
+
B.extend({
|
|
336
324
|
collectible: t.nullish(),
|
|
337
|
-
collectibleConfig:
|
|
325
|
+
collectibleConfig: D.nullish(),
|
|
338
326
|
business: t.nullish()
|
|
339
327
|
})
|
|
340
|
-
]),
|
|
341
|
-
type:
|
|
328
|
+
]), Te = e.enum(["PROGRESSIVE", "STAMP"]), Oe = e.object({
|
|
329
|
+
type: Te,
|
|
342
330
|
end: e.number().int().min(0, "Threshold need to be at least 1"),
|
|
343
|
-
rewards: e.array(e.lazy(() =>
|
|
344
|
-
}).superRefine((
|
|
345
|
-
|
|
331
|
+
rewards: e.array(e.lazy(() => j)).nullish()
|
|
332
|
+
}).superRefine((a, m) => {
|
|
333
|
+
a.type == "STAMP" && a.end > 40 && (m.addIssue({
|
|
346
334
|
code: "custom",
|
|
347
335
|
path: [],
|
|
348
336
|
message: "Stamp mission can have at most 40 threshold"
|
|
349
|
-
}),
|
|
337
|
+
}), m.addIssue({
|
|
350
338
|
code: "custom",
|
|
351
339
|
path: ["end"],
|
|
352
340
|
message: "Stamp mission can have at most 40 threshold"
|
|
353
341
|
}));
|
|
354
|
-
}),
|
|
355
|
-
totalCount: e.number().optional(),
|
|
356
|
-
totalCountPerUser: e.number().optional()
|
|
357
|
-
}), m = e.object({
|
|
358
|
-
periods: e.array(
|
|
359
|
-
e.object({
|
|
360
|
-
startTime: e.string(),
|
|
361
|
-
endTime: e.string()
|
|
362
|
-
})
|
|
363
|
-
)
|
|
364
|
-
}), R = e.object({
|
|
365
|
-
startTime: e.string(),
|
|
366
|
-
// ISO 8601 date string
|
|
367
|
-
endTime: e.string(),
|
|
368
|
-
// ISO 8601 date string
|
|
369
|
-
eaterType: e.enum(["all", "new", "existing"]),
|
|
370
|
-
minBasketAmount: e.number().optional(),
|
|
371
|
-
bundleQuantity: e.number().optional(),
|
|
372
|
-
workingHour: e.object({
|
|
373
|
-
mon: m.optional(),
|
|
374
|
-
tue: m.optional(),
|
|
375
|
-
wed: m.optional(),
|
|
376
|
-
thu: m.optional(),
|
|
377
|
-
fri: m.optional(),
|
|
378
|
-
sat: m.optional(),
|
|
379
|
-
sun: m.optional()
|
|
380
|
-
}).optional()
|
|
381
|
-
}), Ue = e.object({
|
|
382
|
-
type: e.enum(["items", "category", "order"]),
|
|
383
|
-
objectIDs: e.array(e.string()).optional()
|
|
384
|
-
}), I = e.object({
|
|
385
|
-
type: e.enum([
|
|
386
|
-
"net",
|
|
387
|
-
// dollar off
|
|
388
|
-
"percentage",
|
|
389
|
-
// percentage off
|
|
390
|
-
"bundleSameFixPrice",
|
|
391
|
-
// bundle fix price (same item)
|
|
392
|
-
"bundleDiffFixPrice",
|
|
393
|
-
// bundle fix price (different items)
|
|
394
|
-
"bundleSameNet",
|
|
395
|
-
// bundle dollar off (same item)
|
|
396
|
-
"bundleDiffNet",
|
|
397
|
-
// bundle dollar off (different items)
|
|
398
|
-
"bundleSamePercentage",
|
|
399
|
-
// bundle percentage off (same item)
|
|
400
|
-
"bundleDiffPercentage",
|
|
401
|
-
// bundle percentage off (different items)
|
|
402
|
-
"delivery",
|
|
403
|
-
// delivery fee off
|
|
404
|
-
"freeItem"
|
|
405
|
-
// free item
|
|
406
|
-
]),
|
|
407
|
-
value: e.number(),
|
|
408
|
-
cap: e.number().optional(),
|
|
409
|
-
// for percentage off campaigns
|
|
410
|
-
scope: Ue
|
|
411
|
-
});
|
|
412
|
-
e.object({
|
|
413
|
-
merchantID: e.string().optional(),
|
|
414
|
-
name: e.string().max(256),
|
|
415
|
-
quotas: C.optional(),
|
|
416
|
-
conditions: R,
|
|
417
|
-
discount: I,
|
|
418
|
-
customTag: e.string().max(22).optional()
|
|
419
|
-
});
|
|
420
|
-
e.object({
|
|
421
|
-
id: e.string()
|
|
422
|
-
});
|
|
423
|
-
e.object({
|
|
424
|
-
merchantID: e.string().optional(),
|
|
425
|
-
name: e.string().max(256).optional(),
|
|
426
|
-
quotas: C.optional(),
|
|
427
|
-
conditions: R.optional(),
|
|
428
|
-
discount: I.optional(),
|
|
429
|
-
customTag: e.string().max(22).optional()
|
|
430
|
-
});
|
|
431
|
-
const A = e.object({
|
|
432
|
-
id: e.string(),
|
|
433
|
-
merchantID: e.string(),
|
|
434
|
-
name: e.string(),
|
|
435
|
-
quotas: C.optional(),
|
|
436
|
-
conditions: R,
|
|
437
|
-
discount: I,
|
|
438
|
-
customTag: e.string().optional(),
|
|
439
|
-
status: e.enum(["ongoing", "upcoming", "expired", "cancelled"]).optional(),
|
|
440
|
-
createdAt: e.string().optional(),
|
|
441
|
-
updatedAt: e.string().optional()
|
|
442
|
-
});
|
|
443
|
-
e.object({
|
|
444
|
-
ongoing: e.array(A),
|
|
445
|
-
upcoming: e.array(A)
|
|
446
|
-
});
|
|
447
|
-
e.object({
|
|
448
|
-
merchantID: e.string()
|
|
449
|
-
});
|
|
450
|
-
e.object({
|
|
451
|
-
target: e.string(),
|
|
452
|
-
reason: e.string(),
|
|
453
|
-
message: e.string()
|
|
454
|
-
});
|
|
455
|
-
const we = {
|
|
342
|
+
}), Le = {
|
|
456
343
|
collectionName: "Groups",
|
|
457
344
|
transform: {
|
|
458
345
|
_id: "oid",
|
|
@@ -470,36 +357,33 @@ const we = {
|
|
|
470
357
|
foreignField: "group"
|
|
471
358
|
}
|
|
472
359
|
}
|
|
473
|
-
},
|
|
360
|
+
}, We = e.object({
|
|
474
361
|
_id: t,
|
|
475
362
|
name: e.string().min(1).max(300),
|
|
476
363
|
business: t,
|
|
477
364
|
pf_campaigns: e.array(e.any()).optional()
|
|
478
|
-
}).describe(
|
|
365
|
+
}).describe(p.describe(Le)), Pe = e.object({
|
|
479
366
|
from: e.string().email().nullish(),
|
|
480
367
|
name: e.string().min(1).max(50).nullish()
|
|
481
|
-
}),
|
|
368
|
+
}), xe = e.object({
|
|
482
369
|
_id: e.string(),
|
|
483
370
|
url: e.string(),
|
|
484
371
|
targetLocation: e.array(t).nullish(),
|
|
485
372
|
// null/empty = all locations
|
|
486
373
|
order: e.number().optional()
|
|
487
|
-
}),
|
|
488
|
-
type: e.literal(
|
|
374
|
+
}), U = e.object({
|
|
375
|
+
type: e.literal(h.enum.MEMBERSHIP),
|
|
489
376
|
business: t,
|
|
490
377
|
name: e.string().min(1).max(50),
|
|
491
378
|
image: e.string().nullish(),
|
|
492
379
|
url: e.string().nullish(),
|
|
493
|
-
tiers: e.array(e.lazy(() =>
|
|
380
|
+
tiers: e.array(e.lazy(() => Z)),
|
|
494
381
|
titles: e.array(t),
|
|
495
382
|
tierCycleEnable: e.boolean().optional(),
|
|
496
|
-
tierCycle: e.lazy(() =>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
welcomeMessage: p.optional(),
|
|
500
|
-
advertisements: e.union([e.array(e.string()), e.array(ze)]).optional(),
|
|
383
|
+
tierCycle: e.lazy(() => F).nullish(),
|
|
384
|
+
welcomeMessage: u.optional(),
|
|
385
|
+
advertisements: e.union([e.array(e.string()), e.array(xe)]).optional(),
|
|
501
386
|
cardEnable: e.boolean().optional(),
|
|
502
|
-
autoRevertReward: e.boolean().optional(),
|
|
503
387
|
design: e.array(
|
|
504
388
|
e.object({
|
|
505
389
|
_id: t,
|
|
@@ -508,15 +392,18 @@ const we = {
|
|
|
508
392
|
).optional(),
|
|
509
393
|
targetLocation: e.array(t).nullish(),
|
|
510
394
|
brand: e.string().nullish(),
|
|
511
|
-
email:
|
|
395
|
+
email: Pe.nullish(),
|
|
512
396
|
freeCreditAsDiscount: e.boolean().optional(),
|
|
513
|
-
pf_title: e.array(e.lazy(() =>
|
|
514
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
515
|
-
allowedPhoneCountries: e.union([
|
|
397
|
+
pf_title: e.array(e.lazy(() => c)).optional(),
|
|
398
|
+
pf_targetLocation: e.array(e.lazy(() => O)).optional(),
|
|
399
|
+
allowedPhoneCountries: e.union([
|
|
400
|
+
e.array(e.string().regex(/^\+\d{1,4}$/)),
|
|
401
|
+
e.null()
|
|
402
|
+
]).optional(),
|
|
516
403
|
// new structure
|
|
517
404
|
group: e.string().nullish(),
|
|
518
405
|
templateId: t.nullish()
|
|
519
|
-
}), n =
|
|
406
|
+
}), n = h.exclude(["MEMBERSHIP"]), s = e.object({
|
|
520
407
|
_id: t.nullish(),
|
|
521
408
|
type: n,
|
|
522
409
|
// common information
|
|
@@ -524,8 +411,8 @@ const we = {
|
|
|
524
411
|
name: e.string().min(1).max(50),
|
|
525
412
|
image: e.string().nullish(),
|
|
526
413
|
description: e.string().max(500).nullish(),
|
|
527
|
-
timeframeOptions:
|
|
528
|
-
|
|
414
|
+
timeframeOptions: J.superRefine((a, m) => {
|
|
415
|
+
a.start && a.end && a.end < a.start && m.addIssue({
|
|
529
416
|
code: "custom",
|
|
530
417
|
path: [],
|
|
531
418
|
params: {
|
|
@@ -534,13 +421,13 @@ const we = {
|
|
|
534
421
|
});
|
|
535
422
|
}).nullish(),
|
|
536
423
|
targetLocation: e.array(t).nullish(),
|
|
537
|
-
event:
|
|
538
|
-
config:
|
|
424
|
+
event: Ee,
|
|
425
|
+
config: Y.nullish(),
|
|
539
426
|
currentReceive: e.coerce.number().optional(),
|
|
540
427
|
// new group structure
|
|
541
428
|
group: t.nullish(),
|
|
542
429
|
templateId: t.nullish(),
|
|
543
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
430
|
+
pf_targetLocation: e.array(e.lazy(() => O)).optional(),
|
|
544
431
|
deletedAt: e.coerce.date().optional()
|
|
545
432
|
}), r = {
|
|
546
433
|
[n.enum.VOUCHER]: [
|
|
@@ -552,7 +439,6 @@ const we = {
|
|
|
552
439
|
"SIMPLE_CLAIM"
|
|
553
440
|
],
|
|
554
441
|
[n.enum.PROMOTION]: ["MAKING_ORDER"],
|
|
555
|
-
[n.enum.GRAB]: ["MAKING_ORDER"],
|
|
556
442
|
[n.enum.POINT]: [
|
|
557
443
|
"BILL_COMPLETED",
|
|
558
444
|
"FEEDBACK",
|
|
@@ -593,40 +479,40 @@ const we = {
|
|
|
593
479
|
"FEEDBACK",
|
|
594
480
|
"SCHEDULE"
|
|
595
481
|
]
|
|
596
|
-
},
|
|
482
|
+
}, G = s.extend({
|
|
597
483
|
type: e.literal(n.enum.VOUCHER),
|
|
598
484
|
// event
|
|
599
485
|
code: e.string().min(0).max(15).regex(/^[A-Za-z0-9\-_.@]*$/, {
|
|
600
486
|
message: "Code can only contain letters, numbers, and - _ . @"
|
|
601
487
|
}).optional(),
|
|
602
|
-
event:
|
|
488
|
+
event: i.merge(
|
|
603
489
|
e.object({
|
|
604
490
|
type: e.enum(r[n.enum.VOUCHER])
|
|
605
491
|
})
|
|
606
492
|
),
|
|
607
|
-
earningOption:
|
|
493
|
+
earningOption: d.default({
|
|
608
494
|
amount: 1,
|
|
609
495
|
type: "FIXED"
|
|
610
496
|
}),
|
|
611
497
|
collectible: t,
|
|
612
498
|
hideInApp: e.boolean().optional(),
|
|
613
499
|
notify: e.boolean().optional(),
|
|
614
|
-
notifyMessage: e.lazy(() =>
|
|
500
|
+
notifyMessage: e.lazy(() => u).optional(),
|
|
615
501
|
notifyCampaign: t.nullish(),
|
|
616
|
-
pf_collectible: e.lazy(() =>
|
|
502
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
617
503
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
618
|
-
}),
|
|
504
|
+
}), Se = e.object({
|
|
619
505
|
gameType: e.string()
|
|
620
|
-
}),
|
|
506
|
+
}), w = s.extend({
|
|
621
507
|
type: e.literal(n.enum.PROMOTION),
|
|
622
508
|
// event
|
|
623
|
-
event:
|
|
509
|
+
event: i.merge(
|
|
624
510
|
e.object({
|
|
625
511
|
type: e.enum(r[n.enum.PROMOTION])
|
|
626
512
|
})
|
|
627
513
|
),
|
|
628
|
-
effect: e.custom().superRefine((
|
|
629
|
-
|
|
514
|
+
effect: e.custom().superRefine((a, m) => {
|
|
515
|
+
a || m.addIssue({
|
|
630
516
|
code: "custom",
|
|
631
517
|
path: [],
|
|
632
518
|
params: {
|
|
@@ -634,41 +520,41 @@ const we = {
|
|
|
634
520
|
}
|
|
635
521
|
});
|
|
636
522
|
}),
|
|
637
|
-
gameConfig:
|
|
638
|
-
}),
|
|
523
|
+
gameConfig: Se.nullish()
|
|
524
|
+
}), v = s.extend({
|
|
639
525
|
type: e.literal(n.enum.POINT),
|
|
640
526
|
// event
|
|
641
|
-
event:
|
|
527
|
+
event: i.merge(
|
|
642
528
|
e.object({
|
|
643
529
|
type: e.enum(r[n.enum.POINT])
|
|
644
530
|
})
|
|
645
531
|
),
|
|
646
|
-
earningOption:
|
|
532
|
+
earningOption: d,
|
|
647
533
|
collectible: t,
|
|
648
534
|
notify: e.boolean().optional(),
|
|
649
|
-
notifyMessage: e.lazy(() =>
|
|
535
|
+
notifyMessage: e.lazy(() => u).optional(),
|
|
650
536
|
notifyCampaign: t.nullish(),
|
|
651
|
-
pf_collectible: e.lazy(() =>
|
|
537
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
652
538
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
653
|
-
}),
|
|
539
|
+
}), z = s.extend({
|
|
654
540
|
type: e.literal(n.enum.CREDIT),
|
|
655
541
|
// event
|
|
656
|
-
event:
|
|
542
|
+
event: i.merge(
|
|
657
543
|
e.object({
|
|
658
544
|
type: e.enum(r[n.enum.CREDIT])
|
|
659
545
|
})
|
|
660
546
|
),
|
|
661
|
-
earningOption:
|
|
547
|
+
earningOption: d,
|
|
662
548
|
collectible: t,
|
|
663
549
|
notify: e.boolean().optional(),
|
|
664
|
-
notifyMessage: e.lazy(() =>
|
|
550
|
+
notifyMessage: e.lazy(() => u).optional(),
|
|
665
551
|
notifyCampaign: t.nullish(),
|
|
666
|
-
pf_collectible: e.lazy(() =>
|
|
552
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
667
553
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
668
554
|
}), E = s.extend({
|
|
669
555
|
type: e.literal(n.enum.BROADCAST),
|
|
670
556
|
// event
|
|
671
|
-
event:
|
|
557
|
+
event: i.merge(
|
|
672
558
|
e.object({
|
|
673
559
|
type: e.enum(r[n.enum.BROADCAST])
|
|
674
560
|
})
|
|
@@ -678,99 +564,59 @@ const we = {
|
|
|
678
564
|
// path, which never reads `message`; it is still mirrored when a routable
|
|
679
565
|
// channel exists (see toLegacyMessage) so an older reader degrades to
|
|
680
566
|
// sending one real message rather than nothing.
|
|
681
|
-
message:
|
|
682
|
-
delivery: e.lazy(() =>
|
|
567
|
+
message: u.nullish(),
|
|
568
|
+
delivery: e.lazy(() => $).nullish(),
|
|
683
569
|
linkedCampaign: t.nullish()
|
|
684
|
-
}),
|
|
570
|
+
}), H = s.extend({
|
|
685
571
|
type: e.literal(n.enum.COIN),
|
|
686
572
|
// event
|
|
687
|
-
event:
|
|
573
|
+
event: i.merge(
|
|
688
574
|
e.object({
|
|
689
575
|
type: e.enum(r[n.enum.COIN])
|
|
690
576
|
})
|
|
691
577
|
),
|
|
692
|
-
earningOption:
|
|
578
|
+
earningOption: d,
|
|
693
579
|
collectible: t,
|
|
694
580
|
notify: e.boolean().optional(),
|
|
695
|
-
notifyMessage: e.lazy(() =>
|
|
581
|
+
notifyMessage: e.lazy(() => u).optional(),
|
|
696
582
|
notifyCampaign: t.nullish(),
|
|
697
|
-
pf_collectible: e.lazy(() =>
|
|
583
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
698
584
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
699
|
-
}),
|
|
585
|
+
}), g = s.extend({
|
|
700
586
|
type: e.literal(n.enum.REWARD_POOL),
|
|
701
587
|
// event
|
|
702
|
-
event:
|
|
588
|
+
event: i.merge(
|
|
703
589
|
e.object({
|
|
704
590
|
type: e.enum(r[n.enum.REWARD_POOL])
|
|
705
591
|
})
|
|
706
592
|
),
|
|
707
|
-
rewards: e.array(e.lazy(() =>
|
|
708
|
-
}),
|
|
593
|
+
rewards: e.array(e.lazy(() => Me)).min(1, "Requires at least 1 reward")
|
|
594
|
+
}), W = s.extend({
|
|
709
595
|
type: e.literal(n.enum.GAME),
|
|
710
596
|
// event
|
|
711
|
-
event:
|
|
597
|
+
event: i.merge(
|
|
712
598
|
e.object({
|
|
713
599
|
type: e.enum(r[n.enum.GAME])
|
|
714
600
|
})
|
|
715
601
|
),
|
|
716
|
-
earningOption:
|
|
602
|
+
earningOption: d,
|
|
717
603
|
collectible: t,
|
|
718
|
-
game: e.lazy(() =>
|
|
719
|
-
pf_collectible: e.lazy(() =>
|
|
604
|
+
game: e.lazy(() => g).optional(),
|
|
605
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
720
606
|
rewardPool: t.optional()
|
|
721
|
-
}),
|
|
607
|
+
}), k = s.extend({
|
|
722
608
|
type: e.literal(n.enum.MISSION),
|
|
723
|
-
event:
|
|
609
|
+
event: i.merge(
|
|
724
610
|
e.object({
|
|
725
611
|
type: e.enum(r[n.enum.MISSION])
|
|
726
612
|
})
|
|
727
613
|
),
|
|
728
|
-
earningOption:
|
|
614
|
+
earningOption: d,
|
|
729
615
|
collectible: t,
|
|
730
|
-
pf_collectible: e.lazy(() =>
|
|
731
|
-
mission: e.lazy(() =>
|
|
732
|
-
rewards: e.array(e.lazy(() =>
|
|
733
|
-
}),
|
|
734
|
-
timeframeOptions: !0
|
|
735
|
-
}).extend({
|
|
736
|
-
type: e.literal(n.enum.GRAB),
|
|
737
|
-
event: a.merge(
|
|
738
|
-
e.object({
|
|
739
|
-
type: e.enum(r[n.enum.GRAB])
|
|
740
|
-
})
|
|
741
|
-
),
|
|
742
|
-
business: t,
|
|
743
|
-
name: e.string().min(1).max(50),
|
|
744
|
-
targetLocation: e.array(t).nullish(),
|
|
745
|
-
group: e.string().nullish(),
|
|
746
|
-
templateId: t.nullish(),
|
|
747
|
-
// Grab specific fields
|
|
748
|
-
conditions: R,
|
|
749
|
-
quotas: C,
|
|
750
|
-
discount: I,
|
|
751
|
-
grabCampaignMeta: e.array(
|
|
752
|
-
e.object({
|
|
753
|
-
locationId: e.string(),
|
|
754
|
-
campaignId: e.string()
|
|
755
|
-
})
|
|
756
|
-
).optional(),
|
|
757
|
-
// Make timeframeOptions required (remove .nullish() from parent)
|
|
758
|
-
timeframeOptions: x.superRefine((i, d) => {
|
|
759
|
-
(!i.start || !i.end) && d.addIssue({
|
|
760
|
-
code: "custom",
|
|
761
|
-
path: [],
|
|
762
|
-
params: {
|
|
763
|
-
i18n: { key: "timeframe.required" }
|
|
764
|
-
}
|
|
765
|
-
}), i.start && i.end && i.end < i.start && d.addIssue({
|
|
766
|
-
code: "custom",
|
|
767
|
-
path: [],
|
|
768
|
-
params: {
|
|
769
|
-
i18n: { key: "timeframe.end_before_start" }
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
})
|
|
773
|
-
}), ke = {
|
|
616
|
+
pf_collectible: e.lazy(() => c).optional(),
|
|
617
|
+
mission: e.lazy(() => Oe),
|
|
618
|
+
rewards: e.array(e.lazy(() => j)).min(1, "Requires at least 1 reward")
|
|
619
|
+
}), Ne = {
|
|
774
620
|
collectionName: "Campaigns",
|
|
775
621
|
transform: {
|
|
776
622
|
_id: "oid",
|
|
@@ -812,58 +658,54 @@ const we = {
|
|
|
812
658
|
as: "game"
|
|
813
659
|
}
|
|
814
660
|
}
|
|
815
|
-
},
|
|
661
|
+
}, ke = e.object({ _id: t }).and(
|
|
816
662
|
e.discriminatedUnion("type", [
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
663
|
+
U,
|
|
664
|
+
G,
|
|
665
|
+
w,
|
|
666
|
+
v,
|
|
667
|
+
z,
|
|
822
668
|
E,
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
$
|
|
669
|
+
H,
|
|
670
|
+
g,
|
|
671
|
+
W,
|
|
672
|
+
k
|
|
828
673
|
])
|
|
829
|
-
).describe(
|
|
830
|
-
|
|
674
|
+
).describe(p.describe(Ne)), Ke = e.discriminatedUnion("type", [
|
|
675
|
+
G.extend({
|
|
831
676
|
business: t.nullish()
|
|
832
677
|
}),
|
|
833
|
-
|
|
678
|
+
w.extend({
|
|
834
679
|
business: t.nullish()
|
|
835
680
|
}),
|
|
836
|
-
|
|
681
|
+
v.extend({
|
|
837
682
|
business: t.nullish()
|
|
838
683
|
}),
|
|
839
|
-
|
|
684
|
+
z.extend({
|
|
840
685
|
business: t.nullish()
|
|
841
686
|
}),
|
|
842
687
|
E.extend({
|
|
843
688
|
business: t.nullish()
|
|
844
689
|
}),
|
|
845
|
-
|
|
690
|
+
H.extend({
|
|
846
691
|
business: t.nullish()
|
|
847
692
|
}),
|
|
848
|
-
|
|
849
|
-
rewards: e.array(e.lazy(() =>
|
|
693
|
+
g.extend({
|
|
694
|
+
rewards: e.array(e.lazy(() => I)).min(1, "Requires at least 1 reward")
|
|
850
695
|
}),
|
|
851
|
-
|
|
696
|
+
W.extend({
|
|
852
697
|
business: t.nullish(),
|
|
853
|
-
game:
|
|
698
|
+
game: g.extend({
|
|
854
699
|
business: t.nullish(),
|
|
855
|
-
rewards: e.array(e.lazy(() =>
|
|
700
|
+
rewards: e.array(e.lazy(() => I)).min(1, "Requires at least 1 reward")
|
|
856
701
|
})
|
|
857
702
|
}),
|
|
858
|
-
|
|
703
|
+
k.extend({
|
|
859
704
|
business: t.nullish(),
|
|
860
|
-
rewards: e.array(e.lazy(() =>
|
|
861
|
-
}),
|
|
862
|
-
$.extend({
|
|
863
|
-
business: t.nullish()
|
|
705
|
+
rewards: e.array(e.lazy(() => Ae)).min(1, "Requires at least 1 reward")
|
|
864
706
|
})
|
|
865
707
|
]);
|
|
866
|
-
|
|
708
|
+
U.pick({
|
|
867
709
|
business: !0,
|
|
868
710
|
name: !0,
|
|
869
711
|
image: !0,
|
|
@@ -871,7 +713,7 @@ W.pick({
|
|
|
871
713
|
tiers: !0,
|
|
872
714
|
// titles: true,
|
|
873
715
|
cardEnable: !0,
|
|
874
|
-
|
|
716
|
+
design: !0,
|
|
875
717
|
targetLocation: !0,
|
|
876
718
|
brand: !0,
|
|
877
719
|
email: !0,
|
|
@@ -880,23 +722,23 @@ W.pick({
|
|
|
880
722
|
pf_title: !0,
|
|
881
723
|
pf_targetLocation: !0
|
|
882
724
|
}).extend({
|
|
883
|
-
allowedPhoneCountryDetails: e.array(
|
|
725
|
+
allowedPhoneCountryDetails: e.array(K).nullish()
|
|
884
726
|
});
|
|
885
727
|
export {
|
|
886
728
|
r as C,
|
|
887
729
|
n as F,
|
|
888
730
|
o as a,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
731
|
+
ke as b,
|
|
732
|
+
ve as c,
|
|
733
|
+
Ee as d,
|
|
734
|
+
We as e,
|
|
735
|
+
Ke as f,
|
|
736
|
+
ze as g,
|
|
737
|
+
I as h,
|
|
738
|
+
Te as i,
|
|
739
|
+
He as j,
|
|
740
|
+
Ae as k,
|
|
741
|
+
Oe as l,
|
|
742
|
+
U as m,
|
|
743
|
+
ne as n
|
|
902
744
|
};
|