@feedmepos/mf-connect 0.1.38-beta.59 → 0.1.38-beta.60
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/package.json +5 -3
- package/dist/Analytic-DwoLGg4q.js +0 -760
- package/dist/App-CbNpSsTx.js +0 -4638
- package/dist/AuditLogs-DHItENug.js +0 -1887
- package/dist/Bin-CjqvbjiX.js +0 -166
- package/dist/Broadcast-O6WqL0WM.js +0 -232
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CQTGbWsC.js +0 -122
- package/dist/Card-BkbvLM78.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-DRmED98I.js +0 -540
- package/dist/Credit-DJ5cJY6d.js +0 -225
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D4C-fpN-.js +0 -3151
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVNfTZFX.js +0 -347
- package/dist/Experience-DRmAZF_y.js +0 -224
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-fDLTYN62.js +0 -299
- package/dist/Grab-qCAaG_tC.js +0 -300
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BpBsOlP-.js +0 -145
- package/dist/Index-DC_hP9Vu.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-BxJd8LEF.js +0 -21761
- package/dist/Member-DxLyAHl0.js +0 -281
- package/dist/MemberList-t4sO4eNo.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-qPv37NL2.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bv22gIM1.js +0 -60616
- package/dist/Mission-Df9So3a7.js +0 -303
- package/dist/Overview-7LyOV_Xe.js +0 -1079
- package/dist/Point-C7HQR7NU.js +0 -227
- package/dist/Promotion-COpyH3Jy.js +0 -363
- package/dist/Queue-DrnemuvH.js +0 -260
- package/dist/Record-DQOjVag_.js +0 -341
- package/dist/Reward-BDh3g9v4.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-9D0kMhvK.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Lq65YU0I.js +0 -1767
- package/dist/Segment-ToQ--rix.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-D3h9Q1C1.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DxTxcXrD.js +0 -189
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DYMV_6G4.js +0 -147
- package/dist/Setting-1XY_9QUk.js +0 -1993
- package/dist/SettingAdvertisements-BP79SS8j.js +0 -264
- package/dist/Store-CL4DwsUo.js +0 -1936
- package/dist/StoreRewards-DztdNWRH.js +0 -535
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BLn1RzVd.js +0 -1036
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C3YB11LU.js +0 -8093
- package/dist/Tier-B3ohvQIZ.js +0 -970
- package/dist/Title-CUTapIxw.js +0 -568
- package/dist/Transaction-Dsdll8BN.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-B01ishWS.js +0 -130
- package/dist/Voucher-BlclebZc.js +0 -399
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-B1gePcpt.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BX5aHGIh.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-ZbnMOjMo.js +0 -42658
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-BE2NNRgv.js +0 -82
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DGZsvhoz.js +0 -253
- package/dist/campaign-DQzP0lzN.js +0 -219
- package/dist/campaign.enum-BZuGSgZv.js +0 -21
- package/dist/campaign.fn-BlaNCoOb.js +0 -776
- package/dist/collectible.enum-X59zAhgN.js +0 -19
- package/dist/collection.fn-kjWrac0y.js +0 -26
- package/dist/dto-NWQmJvRM.js +0 -222
- package/dist/effect-DpSxQ-N5.js +0 -78
- package/dist/email-addresses-D96VA3I3.js +0 -705
- package/dist/export-BjfHXqTR.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-C8OHgq2a.js +0 -86
- package/dist/index-7eOWPThg.js +0 -31
- package/dist/index-B1IJ4pjv.js +0 -2407
- package/dist/index-B9TK-7yy.js +0 -146
- package/dist/index-BFIYtayJ.js +0 -32456
- package/dist/index-BUIbtGUn.js +0 -54
- package/dist/index-Bf0ahJk1.js +0 -8884
- package/dist/index-C-jkOXyh.js +0 -38
- package/dist/index-CIlx2w3d.js +0 -32
- package/dist/index-Cs8q0R7b.js +0 -3419
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/index-D1Y-Txn3.js +0 -30076
- package/dist/index-c71I5Bvt.js +0 -56
- package/dist/index-nRJyihl3.js +0 -3
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index-xSGsAoAs.js +0 -76
- package/dist/index.esm2017-BfIF_Qxi.js +0 -3069
- package/dist/loading-DtG5daSr.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-BTQfrhjS.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-0eEEhUsF.js +0 -15
- package/dist/number-BKlatpG1.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BOsp36rn.js +0 -145
- package/dist/plugins-CQLxX5lH.js +0 -1817
- package/dist/reward-EfOaSMd2.js +0 -36
- package/dist/rule-CAML5bj4.js +0 -1951
- package/dist/rule-builder-E7zRNd4e.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-CiX1Kipi.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-MzvR1JHx.js +0 -1151
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-CcbZ-UCr.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-XLoFzAl-.js +0 -55
- package/dist/vue-i18n-CRlEE5s3.js +0 -2365
- package/dist/xlsx-gW1LPKTx.js +0 -15491
- package/dist/zod-BQC7KOw1.js +0 -91
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { h as s } from "./moment-D7p2TMB-.js";
|
|
2
|
-
import "./index-Cs8q0R7b.js";
|
|
3
|
-
import { e as f } from "./effect-DpSxQ-N5.js";
|
|
4
|
-
import { components as l } from "@feedmepos/ui-library";
|
|
5
|
-
import { i as h } from "./rule-builder-E7zRNd4e.js";
|
|
6
|
-
import { c as O } from "./rule-CAML5bj4.js";
|
|
7
|
-
import { u as C } from "./business-BE2NNRgv.js";
|
|
8
|
-
import { C as m } from "./campaign.fn-BlaNCoOb.js";
|
|
9
|
-
import { i as d, c as g } from "./plugins-CQLxX5lH.js";
|
|
10
|
-
import { h as p } from "vue";
|
|
11
|
-
import { F as a } from "./campaign.enum-BZuGSgZv.js";
|
|
12
|
-
const o = d.global.t;
|
|
13
|
-
function E() {
|
|
14
|
-
const e = d.global.locale;
|
|
15
|
-
return typeof e == "string" ? e : e.value;
|
|
16
|
-
}
|
|
17
|
-
function u(e) {
|
|
18
|
-
return new Intl.DateTimeFormat(E(), {
|
|
19
|
-
day: "2-digit",
|
|
20
|
-
month: "short",
|
|
21
|
-
year: "numeric"
|
|
22
|
-
}).format(new Date(e));
|
|
23
|
-
}
|
|
24
|
-
function c(e) {
|
|
25
|
-
return p(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
29
|
-
},
|
|
30
|
-
[
|
|
31
|
-
p(l.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
|
|
32
|
-
p("span", { class: "fm-typo-en-body-md-600" }, e.name)
|
|
33
|
-
]
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
const A = {
|
|
37
|
-
[a.enum.CREDIT]: {
|
|
38
|
-
chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
|
|
39
|
-
icon: "local_activity",
|
|
40
|
-
get name() {
|
|
41
|
-
return o("connect.campaign.common.typeName.CREDIT");
|
|
42
|
-
},
|
|
43
|
-
chip() {
|
|
44
|
-
return c(this);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
[a.enum.PROMOTION]: {
|
|
48
|
-
chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
|
|
49
|
-
icon: "loyalty",
|
|
50
|
-
get name() {
|
|
51
|
-
return o("connect.campaign.common.typeName.PROMOTION");
|
|
52
|
-
},
|
|
53
|
-
chip() {
|
|
54
|
-
return c(this);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[a.enum.VOUCHER]: {
|
|
58
|
-
chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
|
|
59
|
-
icon: "sell",
|
|
60
|
-
get name() {
|
|
61
|
-
return o("connect.campaign.common.typeName.VOUCHER");
|
|
62
|
-
},
|
|
63
|
-
chip() {
|
|
64
|
-
return c(this);
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
[a.enum.POINT]: {
|
|
68
|
-
chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
|
|
69
|
-
icon: "award_star",
|
|
70
|
-
get name() {
|
|
71
|
-
return o("connect.campaign.common.typeName.POINT");
|
|
72
|
-
},
|
|
73
|
-
chip() {
|
|
74
|
-
return c(this);
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
[a.enum.BROADCAST]: {
|
|
78
|
-
chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
79
|
-
icon: "campaign",
|
|
80
|
-
get name() {
|
|
81
|
-
return o("connect.campaign.common.typeName.BROADCAST");
|
|
82
|
-
},
|
|
83
|
-
chip() {
|
|
84
|
-
return c(this);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
[a.enum.GAME]: {
|
|
88
|
-
chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
|
|
89
|
-
icon: "database",
|
|
90
|
-
get name() {
|
|
91
|
-
return o("connect.campaign.common.typeName.GAME");
|
|
92
|
-
},
|
|
93
|
-
chip() {
|
|
94
|
-
return c(this);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
[a.enum.REWARD_POOL]: {
|
|
98
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
99
|
-
icon: "editor_choice",
|
|
100
|
-
get name() {
|
|
101
|
-
return o("connect.campaign.common.typeName.REWARD_POOL");
|
|
102
|
-
},
|
|
103
|
-
chip() {
|
|
104
|
-
return c(this);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
[a.enum.COIN]: {
|
|
108
|
-
chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
|
|
109
|
-
icon: "monetization_on",
|
|
110
|
-
get name() {
|
|
111
|
-
return o("connect.campaign.common.typeName.COIN");
|
|
112
|
-
},
|
|
113
|
-
chip() {
|
|
114
|
-
return c(this);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
[a.enum.MEMBERSHIP]: {
|
|
118
|
-
chipClass: "",
|
|
119
|
-
icon: "",
|
|
120
|
-
get name() {
|
|
121
|
-
return o("connect.campaign.common.typeName.MEMBERSHIP");
|
|
122
|
-
},
|
|
123
|
-
chip() {
|
|
124
|
-
return c(this);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
[a.enum.MISSION]: {
|
|
128
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
129
|
-
icon: "editor_choice",
|
|
130
|
-
get name() {
|
|
131
|
-
return o("connect.campaign.common.typeName.MISSION");
|
|
132
|
-
},
|
|
133
|
-
chip() {
|
|
134
|
-
return c(this);
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
[a.enum.GRAB]: {
|
|
138
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
139
|
-
icon: "editor_choice",
|
|
140
|
-
name: "Grab",
|
|
141
|
-
chip() {
|
|
142
|
-
return c(this);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
function P(e) {
|
|
147
|
-
const t = b(e), r = {
|
|
148
|
-
active: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
149
|
-
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
150
|
-
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
151
|
-
};
|
|
152
|
-
return e.type == "VOUCHER" ? p(l.FmChip, {
|
|
153
|
-
class: r[t],
|
|
154
|
-
label: g.title(o(`connect.campaign.common.status.${t}`)),
|
|
155
|
-
compact: !0
|
|
156
|
-
}) : p(l.FmChip, {
|
|
157
|
-
class: r[t],
|
|
158
|
-
label: g.title(o(`connect.campaign.common.status.${t}`)),
|
|
159
|
-
compact: !0
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function L(e) {
|
|
163
|
-
const t = e.timeframeOptions;
|
|
164
|
-
if (!t || !t.start && !t.end)
|
|
165
|
-
return o("connect.campaign.common.always_active");
|
|
166
|
-
if (!t.start && t.end)
|
|
167
|
-
return o("connect.campaign.common.valid_until", {
|
|
168
|
-
date: u(t.end)
|
|
169
|
-
});
|
|
170
|
-
const r = u(t.start), n = t.end ? u(t.end) : o("connect.campaign.common.unlimited");
|
|
171
|
-
return `${r} -> ${n}`;
|
|
172
|
-
}
|
|
173
|
-
function w(e) {
|
|
174
|
-
const { campaign: t } = e;
|
|
175
|
-
function r(n) {
|
|
176
|
-
if (!n || !n.start && !n.end)
|
|
177
|
-
return "connect.campaign.common.always";
|
|
178
|
-
const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
|
|
179
|
-
return `${i} - ${y}`;
|
|
180
|
-
}
|
|
181
|
-
return {
|
|
182
|
-
"connect.campaign.common.campaign_name": t.name,
|
|
183
|
-
"connect.campaign.common.campaign_period": r(
|
|
184
|
-
t.timeframeOptions
|
|
185
|
-
),
|
|
186
|
-
get "connect.campaign.common.next_schedule_at"() {
|
|
187
|
-
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !h(t.event.rule))
|
|
188
|
-
return;
|
|
189
|
-
const n = O(
|
|
190
|
-
t.event.rule.rules.g_schedule
|
|
191
|
-
);
|
|
192
|
-
return n ? s(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
|
|
193
|
-
},
|
|
194
|
-
get "connect.campaign.common.discount_type"() {
|
|
195
|
-
if (t.type == "PROMOTION") return f(t.effect);
|
|
196
|
-
if ("configs" in e && e.configs.type == "VOUCHER")
|
|
197
|
-
return f(e.configs.extras.effect);
|
|
198
|
-
},
|
|
199
|
-
get "connect.campaign.common.available_at"() {
|
|
200
|
-
return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
|
|
201
|
-
(n) => C().locationItems.find((i) => i.value == n).label
|
|
202
|
-
).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function b(e) {
|
|
207
|
-
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? s().isBetween(
|
|
208
|
-
e.timeframeOptions.start ?? s().subtract(1, "d"),
|
|
209
|
-
e.timeframeOptions.end ?? s().add(1, "d")
|
|
210
|
-
) ? "active" : s().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
211
|
-
}
|
|
212
|
-
function B(e) {
|
|
213
|
-
var t, r;
|
|
214
|
-
switch (e.event.type) {
|
|
215
|
-
case "BILL_COMPLETED":
|
|
216
|
-
const n = `Spend to get ${m.formattedType(e.type)}`;
|
|
217
|
-
switch (e.type) {
|
|
218
|
-
case "POINT":
|
|
219
|
-
case "CREDIT":
|
|
220
|
-
case "COIN":
|
|
221
|
-
return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
|
|
222
|
-
case "VOUCHER":
|
|
223
|
-
const i = (r = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : r.effect;
|
|
224
|
-
return i ? `${n} - ${f(i)}` : n;
|
|
225
|
-
default:
|
|
226
|
-
return n;
|
|
227
|
-
}
|
|
228
|
-
case "FEEDBACK":
|
|
229
|
-
return `Give feedback to receive ${m.formattedType(e.type)}`;
|
|
230
|
-
case "SCHEDULE":
|
|
231
|
-
return `Receive ${m.formattedType(e.type)} on scheduled time`;
|
|
232
|
-
case "SIMPLE_CLAIM":
|
|
233
|
-
return "Simple claim voucher";
|
|
234
|
-
case "TIER_UPGRADED":
|
|
235
|
-
return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
|
|
236
|
-
case "MEMBERSHIP_JOINED":
|
|
237
|
-
return `Receive ${m.formattedType(e.type)} when member joined`;
|
|
238
|
-
case "MAKING_ORDER":
|
|
239
|
-
return e.type !== "PROMOTION" ? void 0 : f(e.effect);
|
|
240
|
-
default:
|
|
241
|
-
throw new Error(
|
|
242
|
-
`Not implemented ${JSON.stringify({ cause: e.event.type })}`
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
A as C,
|
|
248
|
-
b as a,
|
|
249
|
-
P as b,
|
|
250
|
-
B as c,
|
|
251
|
-
w as d,
|
|
252
|
-
L as g
|
|
253
|
-
};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { defineStore as w } from "pinia";
|
|
2
|
-
import { reactive as I, onMounted as b, ref as o } from "vue";
|
|
3
|
-
import { g as a, S as l, b as d } from "./index-D1Y-Txn3.js";
|
|
4
|
-
const s = () => {
|
|
5
|
-
const e = l.getBusinessId();
|
|
6
|
-
if (!e) throw new Error("Invalid business ID");
|
|
7
|
-
return d(`businesses/${e}/campaigns`, {
|
|
8
|
-
// url: 'http://localhost:3000/portal/',
|
|
9
|
-
});
|
|
10
|
-
}, u = {
|
|
11
|
-
async readAllGrouped(e) {
|
|
12
|
-
const t = a(
|
|
13
|
-
await s().get("grouped", { params: e })
|
|
14
|
-
);
|
|
15
|
-
return {
|
|
16
|
-
meta: t.meta,
|
|
17
|
-
resources: t.resources
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
async readAll(e, t) {
|
|
21
|
-
const n = a(
|
|
22
|
-
await s().get("", {
|
|
23
|
-
params: { ...e, ...t }
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
return {
|
|
27
|
-
meta: n.meta,
|
|
28
|
-
resources: n.resources
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
async readById(e) {
|
|
32
|
-
return a(await s().get(`/${e}`));
|
|
33
|
-
},
|
|
34
|
-
async create(e) {
|
|
35
|
-
return a(await s().post("", e));
|
|
36
|
-
},
|
|
37
|
-
async update(e, t) {
|
|
38
|
-
return a(await s().put(e, t));
|
|
39
|
-
},
|
|
40
|
-
async delete(e) {
|
|
41
|
-
return a(await s().delete(e));
|
|
42
|
-
},
|
|
43
|
-
async readCollectionsByCampaignId(e, t) {
|
|
44
|
-
const n = a(
|
|
45
|
-
await s().get(`/${e}/collections`, {
|
|
46
|
-
params: t
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
return {
|
|
50
|
-
meta: n.meta,
|
|
51
|
-
resources: n.resources
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
async readTransactions(e) {
|
|
55
|
-
return a(
|
|
56
|
-
await s().get(
|
|
57
|
-
`/${e}/collections/transactions`
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
},
|
|
61
|
-
async createCollectionByCampaignId(e, t) {
|
|
62
|
-
return a(
|
|
63
|
-
await s().post(`/${e}/collections`, t)
|
|
64
|
-
);
|
|
65
|
-
},
|
|
66
|
-
async readGroups() {
|
|
67
|
-
return a(await s().get("/groups")) ?? [];
|
|
68
|
-
},
|
|
69
|
-
async readStats(e) {
|
|
70
|
-
return a(
|
|
71
|
-
await s().get("/stats", { params: e })
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
async createGroup(e) {
|
|
75
|
-
return a(await s().post("/groups", e));
|
|
76
|
-
},
|
|
77
|
-
async updateGroup(e, t) {
|
|
78
|
-
return a(
|
|
79
|
-
await s().put(`/groups/${e}`, t)
|
|
80
|
-
);
|
|
81
|
-
},
|
|
82
|
-
async deleteGroup(e) {
|
|
83
|
-
return a(await s().delete(`/groups/${e}`));
|
|
84
|
-
},
|
|
85
|
-
async sendCollection(e, t) {
|
|
86
|
-
return a(
|
|
87
|
-
await s().post(
|
|
88
|
-
`/${e}/collections/send`,
|
|
89
|
-
t
|
|
90
|
-
)
|
|
91
|
-
);
|
|
92
|
-
},
|
|
93
|
-
async sendStamp(e, t) {
|
|
94
|
-
return a(
|
|
95
|
-
await s().post(
|
|
96
|
-
`/${e}/collections/send-stamp`,
|
|
97
|
-
t
|
|
98
|
-
)
|
|
99
|
-
);
|
|
100
|
-
},
|
|
101
|
-
async syncAllPromotion() {
|
|
102
|
-
return a(await s().post("/promotion/sync"));
|
|
103
|
-
},
|
|
104
|
-
async readAllDeleted(e, t) {
|
|
105
|
-
const n = a(
|
|
106
|
-
await s().get("/bin", {
|
|
107
|
-
params: { ...e, ...t }
|
|
108
|
-
})
|
|
109
|
-
);
|
|
110
|
-
return {
|
|
111
|
-
meta: n.meta,
|
|
112
|
-
resources: n.resources
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
async restore(e) {
|
|
116
|
-
return a(
|
|
117
|
-
await s().post(`/${e}/restore`)
|
|
118
|
-
);
|
|
119
|
-
},
|
|
120
|
-
async getPromotionQueue() {
|
|
121
|
-
return a(await s().get("/promotion/queue"));
|
|
122
|
-
}
|
|
123
|
-
}, p = () => {
|
|
124
|
-
const e = l.getBusinessId();
|
|
125
|
-
if (!e) throw new Error("Invalid business ID");
|
|
126
|
-
return d(`businesses/${e}/campaigns`, {
|
|
127
|
-
noIdRequired: !0
|
|
128
|
-
});
|
|
129
|
-
}, f = {
|
|
130
|
-
async readAll() {
|
|
131
|
-
return a(await p().get("templates"));
|
|
132
|
-
},
|
|
133
|
-
async readById(e) {
|
|
134
|
-
return a(
|
|
135
|
-
await p().get(`templates/${e}`)
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}, E = w("mf-connect-campaign", () => {
|
|
139
|
-
const e = I({
|
|
140
|
-
promotion: [],
|
|
141
|
-
voucher: [],
|
|
142
|
-
broadcast: [],
|
|
143
|
-
experience: [],
|
|
144
|
-
point: [],
|
|
145
|
-
credit: [],
|
|
146
|
-
token: [],
|
|
147
|
-
mission: [],
|
|
148
|
-
grab: [],
|
|
149
|
-
all: []
|
|
150
|
-
});
|
|
151
|
-
b(() => {
|
|
152
|
-
console.log("🔧 CampaignStore Installed");
|
|
153
|
-
});
|
|
154
|
-
const t = o([]), n = o([]), c = o([]);
|
|
155
|
-
async function m(h) {
|
|
156
|
-
const i = await u.readAll({
|
|
157
|
-
limit: 1e3,
|
|
158
|
-
skip: 0,
|
|
159
|
-
sortBy: "_id",
|
|
160
|
-
descending: !0
|
|
161
|
-
});
|
|
162
|
-
Object.keys(e).forEach((r) => {
|
|
163
|
-
e[r] = [];
|
|
164
|
-
}), e.all = i.resources.filter(
|
|
165
|
-
(r) => r.type !== "MEMBERSHIP"
|
|
166
|
-
);
|
|
167
|
-
for (const r of i.resources)
|
|
168
|
-
switch (r.type) {
|
|
169
|
-
case "PROMOTION":
|
|
170
|
-
e.promotion.push(r);
|
|
171
|
-
break;
|
|
172
|
-
case "VOUCHER":
|
|
173
|
-
e.voucher.push(r), c.value.push(r);
|
|
174
|
-
break;
|
|
175
|
-
case "BROADCAST":
|
|
176
|
-
["SCHEDULE", "FEEDBACK"].includes(r.event.type) && e.broadcast.push(r);
|
|
177
|
-
break;
|
|
178
|
-
case "POINT":
|
|
179
|
-
e.experience.push(r);
|
|
180
|
-
break;
|
|
181
|
-
case "COIN":
|
|
182
|
-
e.point.push(r);
|
|
183
|
-
break;
|
|
184
|
-
case "CREDIT":
|
|
185
|
-
e.credit.push(r);
|
|
186
|
-
break;
|
|
187
|
-
case "GAME":
|
|
188
|
-
e.token.push(r);
|
|
189
|
-
break;
|
|
190
|
-
case "MISSION":
|
|
191
|
-
e.mission.push(r);
|
|
192
|
-
break;
|
|
193
|
-
case "GRAB":
|
|
194
|
-
e.grab.push(r);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function g() {
|
|
199
|
-
n.value = await u.readGroups();
|
|
200
|
-
}
|
|
201
|
-
async function y() {
|
|
202
|
-
t.value = await f.readAll();
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
// State
|
|
206
|
-
campaigns: e,
|
|
207
|
-
templates: t,
|
|
208
|
-
groups: n,
|
|
209
|
-
voucher: c,
|
|
210
|
-
// Actions
|
|
211
|
-
read: m,
|
|
212
|
-
readGroups: g,
|
|
213
|
-
readTemplates: y
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
export {
|
|
217
|
-
u as c,
|
|
218
|
-
E as u
|
|
219
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z as E } from "./index-BFIYtayJ.js";
|
|
2
|
-
const I = E.enum([
|
|
3
|
-
"VOUCHER",
|
|
4
|
-
"PROMOTION",
|
|
5
|
-
"POINT",
|
|
6
|
-
"CREDIT",
|
|
7
|
-
"MEMBERSHIP",
|
|
8
|
-
"BROADCAST",
|
|
9
|
-
"COIN",
|
|
10
|
-
"REWARD_POOL",
|
|
11
|
-
"GAME",
|
|
12
|
-
"MISSION",
|
|
13
|
-
"GRAB"
|
|
14
|
-
]), O = E.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), R = {
|
|
15
|
-
[O.enum.TIME_BASED_PROMOTION]: "7.7.4",
|
|
16
|
-
[O.enum.GAME_PROMOTION]: "7.7.4"
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
I as F,
|
|
20
|
-
R as f
|
|
21
|
-
};
|