@cakemail-org/ui-components-v2 2.1.50 → 2.1.52

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.
@@ -7,6 +7,7 @@ export * from "./contacts";
7
7
  export * from "./emailAPI";
8
8
  export * from "./forms";
9
9
  export * from "./lists";
10
+ export * from "./popups";
10
11
  export * from "./senders";
11
12
  export * from "./support";
12
13
  export * from "./suppressedEmails";
@@ -0,0 +1,14 @@
1
+ import { ListPopupModel, PopupModel } from "../../models/popups";
2
+ import { TPopupModel } from "../../models/popups/types";
3
+ import { TGenericListParams, TGenericListReturn } from "../../types";
4
+ export declare class PopupsFactory {
5
+ static list({ ...params }: TGenericListParams & {
6
+ name?: string;
7
+ tags?: string[];
8
+ enabled?: boolean;
9
+ }): Promise<TGenericListReturn<ListPopupModel>>;
10
+ static create({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
11
+ static get({ id }: {
12
+ id: string;
13
+ }): Promise<PopupModel>;
14
+ }
package/dist/cjs/index.js CHANGED
@@ -5331,6 +5331,12 @@ exports.EEvents = void 0;
5331
5331
  EEvents["MFA_DISABLE_FLOW"] = "MFA.Disable.Flow.Started";
5332
5332
  EEvents["MFA_ENABLED"] = "MFA.Enabled";
5333
5333
  EEvents["MFA_DISABLED"] = "MFA.Disabled";
5334
+ EEvents["POPUP_CREATED"] = "Popup.Created";
5335
+ EEvents["POPUP_UPDATED"] = "Popup.Updated";
5336
+ EEvents["POPUP_DELETED"] = "Popup.Deleted";
5337
+ EEvents["POPUP_ENABLED"] = "Popup.Enabled";
5338
+ EEvents["POPUP_DISABLED"] = "Popup.Disabled";
5339
+ EEvents["POPUP_PUBLISHED"] = "Popup.Published";
5334
5340
  })(exports.EEvents || (exports.EEvents = {}));
5335
5341
  function eventCondition(type, disabledEvents) {
5336
5342
  if (disabledEvents === void 0) { disabledEvents = []; }
@@ -10538,6 +10544,127 @@ function downloadListLogExport(_a) {
10538
10544
  });
10539
10545
  }
10540
10546
 
10547
+ function listPopups(_a) {
10548
+ return __awaiter(this, void 0, void 0, function () {
10549
+ var options = __rest(_a, []);
10550
+ return __generator(this, function (_b) {
10551
+ return [2 /*return*/, callApi({
10552
+ url: uiKitConfig.GATEWAY_PROXY + "/popups",
10553
+ query: camelCase(options),
10554
+ fetchOptions: {
10555
+ method: exports.EMethods.get
10556
+ }
10557
+ })];
10558
+ });
10559
+ });
10560
+ }
10561
+ function createPopup(_a) {
10562
+ return __awaiter(this, void 0, void 0, function () {
10563
+ var popup = __rest(_a, []);
10564
+ return __generator(this, function (_b) {
10565
+ return [2 /*return*/, callApi({
10566
+ url: uiKitConfig.GATEWAY_PROXY + "/popups",
10567
+ fetchOptions: {
10568
+ body: popup,
10569
+ method: exports.EMethods.post
10570
+ }
10571
+ })];
10572
+ });
10573
+ });
10574
+ }
10575
+ function getPopup(_a) {
10576
+ return __awaiter(this, arguments, void 0, function (_b) {
10577
+ var id = _b.id;
10578
+ return __generator(this, function (_c) {
10579
+ return [2 /*return*/, callApi({
10580
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10581
+ fetchOptions: {
10582
+ method: exports.EMethods.get
10583
+ }
10584
+ })];
10585
+ });
10586
+ });
10587
+ }
10588
+ function deletePopup(_a) {
10589
+ return __awaiter(this, arguments, void 0, function (_b) {
10590
+ var id = _b.id;
10591
+ return __generator(this, function (_c) {
10592
+ return [2 /*return*/, callApi({
10593
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10594
+ fetchOptions: {
10595
+ method: exports.EMethods.get
10596
+ }
10597
+ })];
10598
+ });
10599
+ });
10600
+ }
10601
+ function updatePopup(_a) {
10602
+ return __awaiter(this, void 0, void 0, function () {
10603
+ var id = _a.id, popup = __rest(_a, ["id"]);
10604
+ return __generator(this, function (_b) {
10605
+ return [2 /*return*/, callApi({
10606
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10607
+ fetchOptions: {
10608
+ method: exports.EMethods.patch,
10609
+ body: popup
10610
+ }
10611
+ })];
10612
+ });
10613
+ });
10614
+ }
10615
+ function enablePopup(_a) {
10616
+ return __awaiter(this, arguments, void 0, function (_b) {
10617
+ var id = _b.id;
10618
+ return __generator(this, function (_c) {
10619
+ return [2 /*return*/, callApi({
10620
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/enable"),
10621
+ fetchOptions: {
10622
+ method: exports.EMethods.post,
10623
+ }
10624
+ })];
10625
+ });
10626
+ });
10627
+ }
10628
+ function disablePopup(_a) {
10629
+ return __awaiter(this, arguments, void 0, function (_b) {
10630
+ var id = _b.id;
10631
+ return __generator(this, function (_c) {
10632
+ return [2 /*return*/, callApi({
10633
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/disable"),
10634
+ fetchOptions: {
10635
+ method: exports.EMethods.post,
10636
+ }
10637
+ })];
10638
+ });
10639
+ });
10640
+ }
10641
+ function publishPopup(_a) {
10642
+ return __awaiter(this, arguments, void 0, function (_b) {
10643
+ var id = _b.id;
10644
+ return __generator(this, function (_c) {
10645
+ return [2 /*return*/, callApi({
10646
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/publish"),
10647
+ fetchOptions: {
10648
+ method: exports.EMethods.post,
10649
+ }
10650
+ })];
10651
+ });
10652
+ });
10653
+ }
10654
+ function renderPopup(_a) {
10655
+ return __awaiter(this, arguments, void 0, function (_b) {
10656
+ var id = _b.id;
10657
+ return __generator(this, function (_c) {
10658
+ return [2 /*return*/, callApi({
10659
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/render"),
10660
+ fetchOptions: {
10661
+ method: exports.EMethods.get,
10662
+ }
10663
+ })];
10664
+ });
10665
+ });
10666
+ }
10667
+
10541
10668
  function listSenders(_a) {
10542
10669
  var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
10543
10670
  return callApi({
@@ -17636,6 +17763,112 @@ var ListModel = /** @class */ (function () {
17636
17763
  return ListModel;
17637
17764
  }());
17638
17765
 
17766
+ var ListPopupModel = /** @class */ (function () {
17767
+ function ListPopupModel(params) {
17768
+ this.id = params.id;
17769
+ this.account_id = params.account_id;
17770
+ this.name = params.name;
17771
+ this.description = params.description;
17772
+ this.enabled = params.enabled;
17773
+ this.created_on = params.created_on;
17774
+ this.updated_on = params.updated_on;
17775
+ this.published_on = params.published_on;
17776
+ this.branding = params.branding;
17777
+ this.tags = params.tags;
17778
+ this.edited_by = params.edited_by;
17779
+ this.content = params.content;
17780
+ this.trigger = params.trigger;
17781
+ this.targeting = params.targeting;
17782
+ this.display_frequency = params.display_frequency;
17783
+ this.published_content_url = params.published_content_url;
17784
+ this.thumbnail_url = params.thumbnail_url;
17785
+ }
17786
+ ListPopupModel.prototype.toJson = function () {
17787
+ return modelToJson(this);
17788
+ };
17789
+ ListPopupModel.prototype.set = function (property, value) {
17790
+ modelSet(this, property, value);
17791
+ };
17792
+ ListPopupModel.prototype.delete = function () {
17793
+ return __awaiter(this, void 0, void 0, function () {
17794
+ var _this = this;
17795
+ return __generator(this, function (_a) {
17796
+ return [2 /*return*/, deletePopup({ id: this.id }).then(function (data) {
17797
+ trackEvent(exports.EEvents.POPUP_DELETED, { id: _this.id });
17798
+ return data;
17799
+ })];
17800
+ });
17801
+ });
17802
+ };
17803
+ ListPopupModel.prototype.save = function (_a) {
17804
+ return __awaiter(this, void 0, void 0, function () {
17805
+ var _this = this;
17806
+ var popup = __rest(_a, []);
17807
+ return __generator(this, function (_b) {
17808
+ return [2 /*return*/, updatePopup({ id: this.id, popup: popup }).then(function (data) {
17809
+ trackEvent(exports.EEvents.POPUP_UPDATED, { id: _this.id });
17810
+ return new PopupModel(data.data);
17811
+ })];
17812
+ });
17813
+ });
17814
+ };
17815
+ ListPopupModel.prototype.enable = function () {
17816
+ return __awaiter(this, void 0, void 0, function () {
17817
+ var _this = this;
17818
+ return __generator(this, function (_a) {
17819
+ return [2 /*return*/, enablePopup({ id: this.id }).then(function (data) {
17820
+ trackEvent(exports.EEvents.POPUP_ENABLED, { id: _this.id });
17821
+ return new PopupModel(data.data);
17822
+ })];
17823
+ });
17824
+ });
17825
+ };
17826
+ ListPopupModel.prototype.disable = function () {
17827
+ return __awaiter(this, void 0, void 0, function () {
17828
+ var _this = this;
17829
+ return __generator(this, function (_a) {
17830
+ return [2 /*return*/, disablePopup({ id: this.id }).then(function (data) {
17831
+ trackEvent(exports.EEvents.POPUP_DISABLED, { id: _this.id });
17832
+ return new PopupModel(data.data);
17833
+ })];
17834
+ });
17835
+ });
17836
+ };
17837
+ ListPopupModel.prototype.publish = function () {
17838
+ return __awaiter(this, void 0, void 0, function () {
17839
+ var _this = this;
17840
+ return __generator(this, function (_a) {
17841
+ return [2 /*return*/, publishPopup({ id: this.id }).then(function (data) {
17842
+ trackEvent(exports.EEvents.POPUP_PUBLISHED, { id: _this.id });
17843
+ return new PopupModel(data.data);
17844
+ })];
17845
+ });
17846
+ });
17847
+ };
17848
+ ListPopupModel.prototype.render = function () {
17849
+ return __awaiter(this, void 0, void 0, function () {
17850
+ return __generator(this, function (_a) {
17851
+ return [2 /*return*/, renderPopup({ id: this.id }).then(function (data) {
17852
+ return data.data;
17853
+ })];
17854
+ });
17855
+ });
17856
+ };
17857
+ return ListPopupModel;
17858
+ }());
17859
+ var PopupModel = /** @class */ (function (_super) {
17860
+ __extends(PopupModel, _super);
17861
+ function PopupModel(params) {
17862
+ var _this = _super.call(this, params) || this;
17863
+ _this.content = params.content;
17864
+ return _this;
17865
+ }
17866
+ PopupModel.prototype.toJson = function () {
17867
+ return modelToJson(this);
17868
+ };
17869
+ return PopupModel;
17870
+ }(ListPopupModel));
17871
+
17639
17872
  var SenderModel = /** @class */ (function () {
17640
17873
  function SenderModel(_a) {
17641
17874
  var id = _a.id, name = _a.name, email = _a.email, confirmed = _a.confirmed, confirmed_on = _a.confirmed_on, language = _a.language, last_confirmation_sent_on = _a.last_confirmation_sent_on;
@@ -17961,6 +18194,45 @@ var ListsFactory = /** @class */ (function () {
17961
18194
  return ListsFactory;
17962
18195
  }());
17963
18196
 
18197
+ var PopupsFactory = /** @class */ (function () {
18198
+ function PopupsFactory() {
18199
+ }
18200
+ PopupsFactory.list = function (_a) {
18201
+ return __awaiter(this, void 0, void 0, function () {
18202
+ var params = __rest(_a, []);
18203
+ return __generator(this, function (_b) {
18204
+ return [2 /*return*/, listPopups(params).then(function (data) {
18205
+ return __assign(__assign({}, data), { data: data.data.map(function (popup) { return new ListPopupModel(popup); }) });
18206
+ })];
18207
+ });
18208
+ });
18209
+ };
18210
+ PopupsFactory.create = function (_a) {
18211
+ return __awaiter(this, void 0, void 0, function () {
18212
+ var popup = __rest(_a, []);
18213
+ return __generator(this, function (_b) {
18214
+ return [2 /*return*/, createPopup(popup).then(function (data) {
18215
+ trackEvent(exports.EEvents.POPUP_CREATED, {
18216
+ name: data.data.name
18217
+ });
18218
+ return new PopupModel(data.data);
18219
+ })];
18220
+ });
18221
+ });
18222
+ };
18223
+ PopupsFactory.get = function (_a) {
18224
+ return __awaiter(this, arguments, void 0, function (_b) {
18225
+ var id = _b.id;
18226
+ return __generator(this, function (_c) {
18227
+ return [2 /*return*/, getPopup({ id: id }).then(function (data) {
18228
+ return new PopupModel(data.data);
18229
+ })];
18230
+ });
18231
+ });
18232
+ };
18233
+ return PopupsFactory;
18234
+ }());
18235
+
17964
18236
  var SendersFactory = /** @class */ (function () {
17965
18237
  function SendersFactory() {
17966
18238
  }
@@ -18394,6 +18666,7 @@ exports.LinearProgress = LinearProgress;
18394
18666
  exports.Link = Link;
18395
18667
  exports.ListCampaignModel = ListCampaignModel;
18396
18668
  exports.ListModel = ListModel;
18669
+ exports.ListPopupModel = ListPopupModel;
18397
18670
  exports.ListTemplateModel = ListTemplateModel;
18398
18671
  exports.ListsFactory = ListsFactory;
18399
18672
  exports.LoadingContainer = LoadingContainer;
@@ -18406,6 +18679,8 @@ exports.ModalHandler = ModalHandler;
18406
18679
  exports.ModalHeading = ModalHeading;
18407
18680
  exports.OverlayHandler = OverlayHandler;
18408
18681
  exports.PhoneTextField = PhoneTextField;
18682
+ exports.PopupModel = PopupModel;
18683
+ exports.PopupsFactory = PopupsFactory;
18409
18684
  exports.Radio = Radio;
18410
18685
  exports.ResourceEdit = ResourceEdit;
18411
18686
  exports.Search = Search;
@@ -18456,6 +18731,7 @@ exports.createCampaign = createCampaign;
18456
18731
  exports.createCampaignLogsExports = createCampaignLogsExports;
18457
18732
  exports.createCampaignsReportsExport = createCampaignsReportsExport;
18458
18733
  exports.createForm = createForm;
18734
+ exports.createPopup = createPopup;
18459
18735
  exports.createSuppressedEmailExport = createSuppressedEmailExport;
18460
18736
  exports.createTemplate = createTemplate;
18461
18737
  exports.deepMergeObject = deepMergeObject;
@@ -18464,6 +18740,7 @@ exports.deleteCampaignsReportsExport = deleteCampaignsReportsExport;
18464
18740
  exports.deleteForm = deleteForm;
18465
18741
  exports.deleteList = deleteList;
18466
18742
  exports.deletePartialInformation = deletePartialInformation;
18743
+ exports.deletePopup = deletePopup;
18467
18744
  exports.deleteStorageItem = deleteStorageItem;
18468
18745
  exports.deleteSuppressedEmail = deleteSuppressedEmail;
18469
18746
  exports.deleteTaskService = deleteTaskService;
@@ -18471,6 +18748,7 @@ exports.deleteTemplate = deleteTemplate;
18471
18748
  exports.deleteUser = deleteUser;
18472
18749
  exports.descendingComparator = descendingComparator;
18473
18750
  exports.disableForm = disableForm;
18751
+ exports.disablePopup = disablePopup;
18474
18752
  exports.downloadCampaignLogExport = downloadCampaignLogExport;
18475
18753
  exports.downloadCampaignsReportsExport = downloadCampaignsReportsExport;
18476
18754
  exports.downloadContactsExport = downloadContactsExport;
@@ -18479,6 +18757,7 @@ exports.downloadSuppressedEmailExport = downloadSuppressedEmailExport;
18479
18757
  exports.emptyAccountAddress = emptyAccountAddress;
18480
18758
  exports.emptyAccountLimits = emptyAccountLimits;
18481
18759
  exports.enableForm = enableForm;
18760
+ exports.enablePopup = enablePopup;
18482
18761
  exports.enrichBrand = enrichBrand;
18483
18762
  exports.enrichOrganization = enrichOrganization;
18484
18763
  exports.enrichProfile = enrichProfile;
@@ -18523,6 +18802,7 @@ exports.getList = getList;
18523
18802
  exports.getListLogs = getListLogs;
18524
18803
  exports.getListReport = getListReport;
18525
18804
  exports.getNestedProperty = getNestedProperty;
18805
+ exports.getPopup = getPopup;
18526
18806
  exports.getPropertyValue = getPropertyValue;
18527
18807
  exports.getSender = getSender;
18528
18808
  exports.getStartOfDate = getStartOfDate;
@@ -18556,6 +18836,7 @@ exports.listForms = listForms;
18556
18836
  exports.listList = listList;
18557
18837
  exports.listListAttributes = listListAttributes;
18558
18838
  exports.listListInterests = listListInterests;
18839
+ exports.listPopups = listPopups;
18559
18840
  exports.listSenders = listSenders;
18560
18841
  exports.listSuppressedEmails = listSuppressedEmails;
18561
18842
  exports.listSystemEmails = listSystemEmails;
@@ -18572,12 +18853,14 @@ exports.patchForm = patchForm;
18572
18853
  exports.popImpersonificationTree = popImpersonificationTree;
18573
18854
  exports.postMessage = postMessage;
18574
18855
  exports.publishForm = publishForm;
18856
+ exports.publishPopup = publishPopup;
18575
18857
  exports.reScheduleCampaign = reScheduleCampaign;
18576
18858
  exports.removeEmptyProperties = removeEmptyProperties;
18577
18859
  exports.removeQueryParams = removeQueryParams;
18578
18860
  exports.removeTrailingChar = removeTrailingChar;
18579
18861
  exports.renderCampaign = renderCampaign;
18580
18862
  exports.renderForm = renderForm;
18863
+ exports.renderPopup = renderPopup;
18581
18864
  exports.renderPublicHtmlForm = renderPublicHtmlForm;
18582
18865
  exports.renderTemplate = renderTemplate;
18583
18866
  exports.requestSupportService = requestSupportService;
@@ -18605,6 +18888,7 @@ exports.unshareTemplate = unshareTemplate;
18605
18888
  exports.updateAccount = updateAccount;
18606
18889
  exports.updateAndClearUrlParams = updateAndClearUrlParams;
18607
18890
  exports.updateCampaign = updateCampaign;
18891
+ exports.updatePopup = updatePopup;
18608
18892
  exports.updateSystemEmails = updateSystemEmails;
18609
18893
  exports.updateTemplate = updateTemplate;
18610
18894
  exports.updateUser = updateUser;
@@ -5,6 +5,7 @@ export * from "./customer";
5
5
  export * from "./emailAPI";
6
6
  export * from "./form";
7
7
  export * from "./list";
8
+ export * from "./popups";
8
9
  export * from "./sender";
9
10
  export * from "./systemEmails";
10
11
  export * from "./tasks";
@@ -0,0 +1,35 @@
1
+ import { TDeleteApiResource } from "../../types";
2
+ import { EPopupBranding, EPopupDisplayFrequency, TPopupContent, TPopupModel, TPopupTargeting, TPopupTrigger, TPopupUser } from "./types";
3
+ export declare class ListPopupModel {
4
+ id: string;
5
+ readonly account_id: number;
6
+ name: string | null;
7
+ description: string | null;
8
+ enabled: boolean;
9
+ readonly created_on: number;
10
+ updated_on: number;
11
+ published_on: number | null;
12
+ branding: EPopupBranding;
13
+ tags: string[] | null;
14
+ edited_by: TPopupUser;
15
+ content: Omit<TPopupContent, "json">;
16
+ trigger: TPopupTrigger;
17
+ targeting: TPopupTargeting;
18
+ display_frequency: EPopupDisplayFrequency;
19
+ published_content_url: string | null;
20
+ thumbnail_url: string;
21
+ constructor(params: TPopupModel);
22
+ toJson(): any;
23
+ set<T extends keyof this>(property: T, value: this[T]): void;
24
+ delete(): Promise<TDeleteApiResource>;
25
+ save({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
26
+ enable(): Promise<PopupModel>;
27
+ disable(): Promise<PopupModel>;
28
+ publish(): Promise<PopupModel>;
29
+ render(): Promise<string>;
30
+ }
31
+ export declare class PopupModel extends ListPopupModel {
32
+ content: TPopupContent;
33
+ constructor(params: TPopupModel);
34
+ toJson(): any;
35
+ }
@@ -0,0 +1,94 @@
1
+ export type TPopupModel = {
2
+ id: string;
3
+ account_id: number;
4
+ name: string | null;
5
+ description: string | null;
6
+ enabled: boolean;
7
+ created_on: number;
8
+ updated_on: number;
9
+ published_on: number | null;
10
+ branding: EPopupBranding;
11
+ tags: string[] | null;
12
+ edited_by: TPopupUser;
13
+ content: TPopupContent;
14
+ trigger: TPopupTrigger;
15
+ targeting: TPopupTargeting;
16
+ display_frequency: EPopupDisplayFrequency;
17
+ published_content_url: string | null;
18
+ thumbnail_url: string;
19
+ };
20
+ export type TPopupUser = {
21
+ id: string;
22
+ email: string;
23
+ };
24
+ export type TPopupTrigger = {
25
+ type: EPopupTriggerType;
26
+ delay_seconds: number | null;
27
+ scroll_percentage: number | null;
28
+ selector: string | null;
29
+ start_date: number | null;
30
+ end_date: number | null;
31
+ };
32
+ export type TPopupTargeting = {
33
+ pages: string[] | null;
34
+ exclude_pages: string[] | null;
35
+ devices: EPopupDeviceType[] | null;
36
+ browsers: EPopupBrowserType[] | null;
37
+ languages: string[] | null;
38
+ countries: string[] | null;
39
+ referrers: string[] | null;
40
+ utm_params: Record<string, string> | null;
41
+ };
42
+ export type TPopupContent = {
43
+ position: EPopupPosition | null;
44
+ json?: Record<string, any>;
45
+ };
46
+ export declare enum EPopupTriggerType {
47
+ on_page_load = "on_page_load",
48
+ on_exit_intent = "on_exit_intent",
49
+ on_scroll = "on_scroll",
50
+ on_time_delay = "on_time_delay",
51
+ on_click = "on_click"
52
+ }
53
+ export declare enum EPopupDisplayFrequency {
54
+ once_per_session = "once_per_session",
55
+ once_per_day = "once_per_day",
56
+ once_per_week = "once_per_week",
57
+ always = "always",
58
+ once = "once"
59
+ }
60
+ export declare enum EPopupDeviceType {
61
+ desktop = "desktop",
62
+ mobile = "mobile",
63
+ tablet = "tablet"
64
+ }
65
+ export declare enum EPopupBrowserType {
66
+ chrome = "chrome",
67
+ firefox = "firefox",
68
+ safari = "safari",
69
+ edge = "edge",
70
+ opera = "opera",
71
+ other = "other"
72
+ }
73
+ export declare enum EPopupPosition {
74
+ center = "classic-center",
75
+ top_right = "classic-top-right",
76
+ top_left = "classic-top-left",
77
+ top_center = "classic-top-center",
78
+ bottom_left = "classic-bottom-left",
79
+ bottom_center = "classic-bottom-center",
80
+ bottom_right = "classic-bottom-right",
81
+ drawer_left = "drawer-left",
82
+ drawer_right = "drawer-right",
83
+ drawer_top = "bar-top",
84
+ drawer_bottom = "bar-bottom"
85
+ }
86
+ export declare enum EPopupBranding {
87
+ smart = "smart",
88
+ basic = "basic"
89
+ }
90
+ export type TPopupFilters = {
91
+ name: string;
92
+ tags: string[];
93
+ enabled: string;
94
+ };
@@ -9,6 +9,7 @@ export * from "./emailAPI";
9
9
  export * from "./forms";
10
10
  export * from "./hidden";
11
11
  export * from "./lists";
12
+ export * from "./popups";
12
13
  export * from "./senders";
13
14
  export * from "./suppressedEmails";
14
15
  export * from "./systemEmails";
@@ -0,0 +1,31 @@
1
+ import { TPopupModel } from "../../models/popups/types";
2
+ import { TGenericListParams, TGenericListReturn, TGenericReturn } from "../../types";
3
+ import { TCreateApiResource, TDeleteApiResource, TDisableApiResource, TEnableApiResource, TRenderResponse, TUpdateApiResource } from "../../types/generic";
4
+ export declare function listPopups({ ...options }: TGenericListParams & {
5
+ name?: string;
6
+ tags?: string[];
7
+ enabled?: boolean;
8
+ }): Promise<TGenericListReturn<TPopupModel>>;
9
+ export declare function createPopup({ ...popup }: Partial<TPopupModel>): Promise<TCreateApiResource<TPopupModel>>;
10
+ export declare function getPopup({ id }: {
11
+ id: string;
12
+ }): Promise<TGenericReturn<TPopupModel>>;
13
+ export declare function deletePopup({ id }: {
14
+ id: string;
15
+ }): Promise<TDeleteApiResource>;
16
+ export declare function updatePopup({ id, ...popup }: {
17
+ id: string;
18
+ popup: Partial<TPopupModel>;
19
+ }): Promise<TUpdateApiResource<TPopupModel>>;
20
+ export declare function enablePopup({ id }: {
21
+ id: string;
22
+ }): Promise<TEnableApiResource<TPopupModel>>;
23
+ export declare function disablePopup({ id }: {
24
+ id: string;
25
+ }): Promise<TDisableApiResource<TPopupModel>>;
26
+ export declare function publishPopup({ id }: {
27
+ id: string;
28
+ }): Promise<TUpdateApiResource<TPopupModel>>;
29
+ export declare function renderPopup({ id }: {
30
+ id: string;
31
+ }): Promise<TRenderResponse>;
@@ -112,6 +112,9 @@ export type TCreateApiResource<T> = {
112
112
  object: string;
113
113
  data: T;
114
114
  };
115
+ export type TRenderResponse = {
116
+ data: string;
117
+ };
115
118
  export type TActionApiResource = {
116
119
  id: number;
117
120
  object: string;
@@ -143,7 +143,13 @@ export declare enum EEvents {
143
143
  MFA_ACTIVATION_FLOW = "MFA.Activation.Flow.Started",
144
144
  MFA_DISABLE_FLOW = "MFA.Disable.Flow.Started",
145
145
  MFA_ENABLED = "MFA.Enabled",
146
- MFA_DISABLED = "MFA.Disabled"
146
+ MFA_DISABLED = "MFA.Disabled",
147
+ POPUP_CREATED = "Popup.Created",
148
+ POPUP_UPDATED = "Popup.Updated",
149
+ POPUP_DELETED = "Popup.Deleted",
150
+ POPUP_ENABLED = "Popup.Enabled",
151
+ POPUP_DISABLED = "Popup.Disabled",
152
+ POPUP_PUBLISHED = "Popup.Published"
147
153
  }
148
154
  export declare function eventCondition(type: EEvents | string, disabledEvents?: string[]): boolean;
149
155
  export declare function trackEvent(type: EEvents | string, data?: any, dataParser?: (event: EEvents | string, data: any) => any, disabledEvents?: string[]): void;
@@ -7,6 +7,7 @@ export * from "./contacts";
7
7
  export * from "./emailAPI";
8
8
  export * from "./forms";
9
9
  export * from "./lists";
10
+ export * from "./popups";
10
11
  export * from "./senders";
11
12
  export * from "./support";
12
13
  export * from "./suppressedEmails";
@@ -0,0 +1,14 @@
1
+ import { ListPopupModel, PopupModel } from "../../models/popups";
2
+ import { TPopupModel } from "../../models/popups/types";
3
+ import { TGenericListParams, TGenericListReturn } from "../../types";
4
+ export declare class PopupsFactory {
5
+ static list({ ...params }: TGenericListParams & {
6
+ name?: string;
7
+ tags?: string[];
8
+ enabled?: boolean;
9
+ }): Promise<TGenericListReturn<ListPopupModel>>;
10
+ static create({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
11
+ static get({ id }: {
12
+ id: string;
13
+ }): Promise<PopupModel>;
14
+ }
package/dist/esm/index.js CHANGED
@@ -5311,6 +5311,12 @@ var EEvents;
5311
5311
  EEvents["MFA_DISABLE_FLOW"] = "MFA.Disable.Flow.Started";
5312
5312
  EEvents["MFA_ENABLED"] = "MFA.Enabled";
5313
5313
  EEvents["MFA_DISABLED"] = "MFA.Disabled";
5314
+ EEvents["POPUP_CREATED"] = "Popup.Created";
5315
+ EEvents["POPUP_UPDATED"] = "Popup.Updated";
5316
+ EEvents["POPUP_DELETED"] = "Popup.Deleted";
5317
+ EEvents["POPUP_ENABLED"] = "Popup.Enabled";
5318
+ EEvents["POPUP_DISABLED"] = "Popup.Disabled";
5319
+ EEvents["POPUP_PUBLISHED"] = "Popup.Published";
5314
5320
  })(EEvents || (EEvents = {}));
5315
5321
  function eventCondition(type, disabledEvents) {
5316
5322
  if (disabledEvents === void 0) { disabledEvents = []; }
@@ -10518,6 +10524,127 @@ function downloadListLogExport(_a) {
10518
10524
  });
10519
10525
  }
10520
10526
 
10527
+ function listPopups(_a) {
10528
+ return __awaiter(this, void 0, void 0, function () {
10529
+ var options = __rest(_a, []);
10530
+ return __generator(this, function (_b) {
10531
+ return [2 /*return*/, callApi({
10532
+ url: uiKitConfig.GATEWAY_PROXY + "/popups",
10533
+ query: camelCase(options),
10534
+ fetchOptions: {
10535
+ method: EMethods.get
10536
+ }
10537
+ })];
10538
+ });
10539
+ });
10540
+ }
10541
+ function createPopup(_a) {
10542
+ return __awaiter(this, void 0, void 0, function () {
10543
+ var popup = __rest(_a, []);
10544
+ return __generator(this, function (_b) {
10545
+ return [2 /*return*/, callApi({
10546
+ url: uiKitConfig.GATEWAY_PROXY + "/popups",
10547
+ fetchOptions: {
10548
+ body: popup,
10549
+ method: EMethods.post
10550
+ }
10551
+ })];
10552
+ });
10553
+ });
10554
+ }
10555
+ function getPopup(_a) {
10556
+ return __awaiter(this, arguments, void 0, function (_b) {
10557
+ var id = _b.id;
10558
+ return __generator(this, function (_c) {
10559
+ return [2 /*return*/, callApi({
10560
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10561
+ fetchOptions: {
10562
+ method: EMethods.get
10563
+ }
10564
+ })];
10565
+ });
10566
+ });
10567
+ }
10568
+ function deletePopup(_a) {
10569
+ return __awaiter(this, arguments, void 0, function (_b) {
10570
+ var id = _b.id;
10571
+ return __generator(this, function (_c) {
10572
+ return [2 /*return*/, callApi({
10573
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10574
+ fetchOptions: {
10575
+ method: EMethods.get
10576
+ }
10577
+ })];
10578
+ });
10579
+ });
10580
+ }
10581
+ function updatePopup(_a) {
10582
+ return __awaiter(this, void 0, void 0, function () {
10583
+ var id = _a.id, popup = __rest(_a, ["id"]);
10584
+ return __generator(this, function (_b) {
10585
+ return [2 /*return*/, callApi({
10586
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10587
+ fetchOptions: {
10588
+ method: EMethods.patch,
10589
+ body: popup
10590
+ }
10591
+ })];
10592
+ });
10593
+ });
10594
+ }
10595
+ function enablePopup(_a) {
10596
+ return __awaiter(this, arguments, void 0, function (_b) {
10597
+ var id = _b.id;
10598
+ return __generator(this, function (_c) {
10599
+ return [2 /*return*/, callApi({
10600
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/enable"),
10601
+ fetchOptions: {
10602
+ method: EMethods.post,
10603
+ }
10604
+ })];
10605
+ });
10606
+ });
10607
+ }
10608
+ function disablePopup(_a) {
10609
+ return __awaiter(this, arguments, void 0, function (_b) {
10610
+ var id = _b.id;
10611
+ return __generator(this, function (_c) {
10612
+ return [2 /*return*/, callApi({
10613
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/disable"),
10614
+ fetchOptions: {
10615
+ method: EMethods.post,
10616
+ }
10617
+ })];
10618
+ });
10619
+ });
10620
+ }
10621
+ function publishPopup(_a) {
10622
+ return __awaiter(this, arguments, void 0, function (_b) {
10623
+ var id = _b.id;
10624
+ return __generator(this, function (_c) {
10625
+ return [2 /*return*/, callApi({
10626
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/publish"),
10627
+ fetchOptions: {
10628
+ method: EMethods.post,
10629
+ }
10630
+ })];
10631
+ });
10632
+ });
10633
+ }
10634
+ function renderPopup(_a) {
10635
+ return __awaiter(this, arguments, void 0, function (_b) {
10636
+ var id = _b.id;
10637
+ return __generator(this, function (_c) {
10638
+ return [2 /*return*/, callApi({
10639
+ url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id, "/render"),
10640
+ fetchOptions: {
10641
+ method: EMethods.get,
10642
+ }
10643
+ })];
10644
+ });
10645
+ });
10646
+ }
10647
+
10521
10648
  function listSenders(_a) {
10522
10649
  var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
10523
10650
  return callApi({
@@ -17616,6 +17743,112 @@ var ListModel = /** @class */ (function () {
17616
17743
  return ListModel;
17617
17744
  }());
17618
17745
 
17746
+ var ListPopupModel = /** @class */ (function () {
17747
+ function ListPopupModel(params) {
17748
+ this.id = params.id;
17749
+ this.account_id = params.account_id;
17750
+ this.name = params.name;
17751
+ this.description = params.description;
17752
+ this.enabled = params.enabled;
17753
+ this.created_on = params.created_on;
17754
+ this.updated_on = params.updated_on;
17755
+ this.published_on = params.published_on;
17756
+ this.branding = params.branding;
17757
+ this.tags = params.tags;
17758
+ this.edited_by = params.edited_by;
17759
+ this.content = params.content;
17760
+ this.trigger = params.trigger;
17761
+ this.targeting = params.targeting;
17762
+ this.display_frequency = params.display_frequency;
17763
+ this.published_content_url = params.published_content_url;
17764
+ this.thumbnail_url = params.thumbnail_url;
17765
+ }
17766
+ ListPopupModel.prototype.toJson = function () {
17767
+ return modelToJson(this);
17768
+ };
17769
+ ListPopupModel.prototype.set = function (property, value) {
17770
+ modelSet(this, property, value);
17771
+ };
17772
+ ListPopupModel.prototype.delete = function () {
17773
+ return __awaiter(this, void 0, void 0, function () {
17774
+ var _this = this;
17775
+ return __generator(this, function (_a) {
17776
+ return [2 /*return*/, deletePopup({ id: this.id }).then(function (data) {
17777
+ trackEvent(EEvents.POPUP_DELETED, { id: _this.id });
17778
+ return data;
17779
+ })];
17780
+ });
17781
+ });
17782
+ };
17783
+ ListPopupModel.prototype.save = function (_a) {
17784
+ return __awaiter(this, void 0, void 0, function () {
17785
+ var _this = this;
17786
+ var popup = __rest(_a, []);
17787
+ return __generator(this, function (_b) {
17788
+ return [2 /*return*/, updatePopup({ id: this.id, popup: popup }).then(function (data) {
17789
+ trackEvent(EEvents.POPUP_UPDATED, { id: _this.id });
17790
+ return new PopupModel(data.data);
17791
+ })];
17792
+ });
17793
+ });
17794
+ };
17795
+ ListPopupModel.prototype.enable = function () {
17796
+ return __awaiter(this, void 0, void 0, function () {
17797
+ var _this = this;
17798
+ return __generator(this, function (_a) {
17799
+ return [2 /*return*/, enablePopup({ id: this.id }).then(function (data) {
17800
+ trackEvent(EEvents.POPUP_ENABLED, { id: _this.id });
17801
+ return new PopupModel(data.data);
17802
+ })];
17803
+ });
17804
+ });
17805
+ };
17806
+ ListPopupModel.prototype.disable = function () {
17807
+ return __awaiter(this, void 0, void 0, function () {
17808
+ var _this = this;
17809
+ return __generator(this, function (_a) {
17810
+ return [2 /*return*/, disablePopup({ id: this.id }).then(function (data) {
17811
+ trackEvent(EEvents.POPUP_DISABLED, { id: _this.id });
17812
+ return new PopupModel(data.data);
17813
+ })];
17814
+ });
17815
+ });
17816
+ };
17817
+ ListPopupModel.prototype.publish = function () {
17818
+ return __awaiter(this, void 0, void 0, function () {
17819
+ var _this = this;
17820
+ return __generator(this, function (_a) {
17821
+ return [2 /*return*/, publishPopup({ id: this.id }).then(function (data) {
17822
+ trackEvent(EEvents.POPUP_PUBLISHED, { id: _this.id });
17823
+ return new PopupModel(data.data);
17824
+ })];
17825
+ });
17826
+ });
17827
+ };
17828
+ ListPopupModel.prototype.render = function () {
17829
+ return __awaiter(this, void 0, void 0, function () {
17830
+ return __generator(this, function (_a) {
17831
+ return [2 /*return*/, renderPopup({ id: this.id }).then(function (data) {
17832
+ return data.data;
17833
+ })];
17834
+ });
17835
+ });
17836
+ };
17837
+ return ListPopupModel;
17838
+ }());
17839
+ var PopupModel = /** @class */ (function (_super) {
17840
+ __extends(PopupModel, _super);
17841
+ function PopupModel(params) {
17842
+ var _this = _super.call(this, params) || this;
17843
+ _this.content = params.content;
17844
+ return _this;
17845
+ }
17846
+ PopupModel.prototype.toJson = function () {
17847
+ return modelToJson(this);
17848
+ };
17849
+ return PopupModel;
17850
+ }(ListPopupModel));
17851
+
17619
17852
  var SenderModel = /** @class */ (function () {
17620
17853
  function SenderModel(_a) {
17621
17854
  var id = _a.id, name = _a.name, email = _a.email, confirmed = _a.confirmed, confirmed_on = _a.confirmed_on, language = _a.language, last_confirmation_sent_on = _a.last_confirmation_sent_on;
@@ -17941,6 +18174,45 @@ var ListsFactory = /** @class */ (function () {
17941
18174
  return ListsFactory;
17942
18175
  }());
17943
18176
 
18177
+ var PopupsFactory = /** @class */ (function () {
18178
+ function PopupsFactory() {
18179
+ }
18180
+ PopupsFactory.list = function (_a) {
18181
+ return __awaiter(this, void 0, void 0, function () {
18182
+ var params = __rest(_a, []);
18183
+ return __generator(this, function (_b) {
18184
+ return [2 /*return*/, listPopups(params).then(function (data) {
18185
+ return __assign(__assign({}, data), { data: data.data.map(function (popup) { return new ListPopupModel(popup); }) });
18186
+ })];
18187
+ });
18188
+ });
18189
+ };
18190
+ PopupsFactory.create = function (_a) {
18191
+ return __awaiter(this, void 0, void 0, function () {
18192
+ var popup = __rest(_a, []);
18193
+ return __generator(this, function (_b) {
18194
+ return [2 /*return*/, createPopup(popup).then(function (data) {
18195
+ trackEvent(EEvents.POPUP_CREATED, {
18196
+ name: data.data.name
18197
+ });
18198
+ return new PopupModel(data.data);
18199
+ })];
18200
+ });
18201
+ });
18202
+ };
18203
+ PopupsFactory.get = function (_a) {
18204
+ return __awaiter(this, arguments, void 0, function (_b) {
18205
+ var id = _b.id;
18206
+ return __generator(this, function (_c) {
18207
+ return [2 /*return*/, getPopup({ id: id }).then(function (data) {
18208
+ return new PopupModel(data.data);
18209
+ })];
18210
+ });
18211
+ });
18212
+ };
18213
+ return PopupsFactory;
18214
+ }());
18215
+
17944
18216
  var SendersFactory = /** @class */ (function () {
17945
18217
  function SendersFactory() {
17946
18218
  }
@@ -18309,4 +18581,4 @@ var UsersFactory = /** @class */ (function () {
18309
18581
  return UsersFactory;
18310
18582
  }());
18311
18583
 
18312
- export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, CopyToClipboard, CountryDropdown, CustomerModel, DataTable, DataTableHead, DataTableRow, DateCalendar, DatePicker, DateTimeCalendar, DateTimePicker, Dialog, DialogActions, DialogHandler, DialogTitle, Divider, Drawer, DrawerHandler, DropMenu, Dropdown, EApiLanguages, EAssetManagerMatchType, ECampaignStatuses, EEMailSummaryStatuses, EEditorType, EEmailAttachementTypes, EEmailLogType, EEmailLogTypeParam, EEmailProviders, EEmailSummaryEngagement, EEvents, EListAttributeType, EMethods, EOperatorTypes, EPartialInfoPool, EStorageType, ETaskType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, Radio, ResourceEdit, Search, SenderModel, SendersFactory, SideMenu, SideMenuContainer, SideMenuItem, SubNav, SummaryEnhancedFormModel, SupportFactory, SuppressedEmailsFactory, SystemEmailsFactory, SystemEmailsModel, TagsFactory, TasksFactory, TemplateModel, TemplatesFactory, TextField, TimePicker, TimeSelector, Toggle, TopMenu, Typography, UserModel, UsersFactory, acceptListPolicy, addPartialInformation, addSuppressedEmail, addToImpersonificationTree, amIImpersonating, amILoggedInService, archiveCampaign, areAllPropertiesEmpty, buildMUITheme, callApi, camelCase, camelToSnakeCase, cancelCampaign, capitalizeFirstLetter, cleanPostHogId, clearImpersonificationTree, clearStorage, connectToZendeskSupportService, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, descendingComparator, disableForm, downloadCampaignLogExport, downloadCampaignsReportsExport, downloadContactsExport, downloadListLogExport, downloadSuppressedEmailExport, emptyAccountAddress, emptyAccountLimits, enableForm, enrichBrand, enrichOrganization, enrichProfile, eventCondition, eventIdentify, eventLogout, fetchRetry, fetchRoute, findNestedProperty, formatNumber, getAccount, getAccountReport, getAdjustedBillingCycle, getBeeTokenService, getBestLocalMatch, getBrand, getBrandService, getBrandUrl, getCalendarFormat, getCampaign, getCampaignLinks, getCampaignLinksReport, getCampaignLogs, getCampaignLogsExports, getCampaignReport, getCampaignRevisions, getCampaignsReportsExport, getComparator, getCustomerProfile, getDate, getDomainFromEmail, getDomainsFromEmails, getDomainsService, getEmail, getEmailActivitySummary, getEmailReport, getEndOfDate, getForm, getHashQueryWithoutHistory, getIconSize, getList, getListLogs, getListReport, getNestedProperty, getPropertyValue, getSender, getStartOfDate, getStorage, getSuppressedEmailExport, getTColor, getTaskService, getTemplate, getUnixTime, getUrlQueryParam, getUser, getUtmCookies, googlePlacesMapper, hasDecimal, impersonateService, initFieldValidation, initPostHog, isColorLight, isDomainValidService, isSimpleType, isValidEmail, isValidString, isValidUrl, lisTEmailTags, listAccounts, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, renderPublicHtmlForm, renderTemplate, requestSupportService, resendVerificationEmail, resumeCampaign, saveList, scheduleCampaign, searchCustomerProfiles, sendCampaignTest, setBrandHeadElements, setStorage, shareTemplate, splitArray, splitObject, stableSort, startPromisePool, suspendCampaign, trackEvent, truncateEmail, truncateText, uiKitConfig, unArchiveCampaign, unScheduleCampaign, unshareTemplate, updateAccount, updateAndClearUrlParams, updateCampaign, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
18584
+ export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, CopyToClipboard, CountryDropdown, CustomerModel, DataTable, DataTableHead, DataTableRow, DateCalendar, DatePicker, DateTimeCalendar, DateTimePicker, Dialog, DialogActions, DialogHandler, DialogTitle, Divider, Drawer, DrawerHandler, DropMenu, Dropdown, EApiLanguages, EAssetManagerMatchType, ECampaignStatuses, EEMailSummaryStatuses, EEditorType, EEmailAttachementTypes, EEmailLogType, EEmailLogTypeParam, EEmailProviders, EEmailSummaryEngagement, EEvents, EListAttributeType, EMethods, EOperatorTypes, EPartialInfoPool, EStorageType, ETaskType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListPopupModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, PopupModel, PopupsFactory, Radio, ResourceEdit, Search, SenderModel, SendersFactory, SideMenu, SideMenuContainer, SideMenuItem, SubNav, SummaryEnhancedFormModel, SupportFactory, SuppressedEmailsFactory, SystemEmailsFactory, SystemEmailsModel, TagsFactory, TasksFactory, TemplateModel, TemplatesFactory, TextField, TimePicker, TimeSelector, Toggle, TopMenu, Typography, UserModel, UsersFactory, acceptListPolicy, addPartialInformation, addSuppressedEmail, addToImpersonificationTree, amIImpersonating, amILoggedInService, archiveCampaign, areAllPropertiesEmpty, buildMUITheme, callApi, camelCase, camelToSnakeCase, cancelCampaign, capitalizeFirstLetter, cleanPostHogId, clearImpersonificationTree, clearStorage, connectToZendeskSupportService, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createPopup, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deletePopup, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, descendingComparator, disableForm, disablePopup, downloadCampaignLogExport, downloadCampaignsReportsExport, downloadContactsExport, downloadListLogExport, downloadSuppressedEmailExport, emptyAccountAddress, emptyAccountLimits, enableForm, enablePopup, enrichBrand, enrichOrganization, enrichProfile, eventCondition, eventIdentify, eventLogout, fetchRetry, fetchRoute, findNestedProperty, formatNumber, getAccount, getAccountReport, getAdjustedBillingCycle, getBeeTokenService, getBestLocalMatch, getBrand, getBrandService, getBrandUrl, getCalendarFormat, getCampaign, getCampaignLinks, getCampaignLinksReport, getCampaignLogs, getCampaignLogsExports, getCampaignReport, getCampaignRevisions, getCampaignsReportsExport, getComparator, getCustomerProfile, getDate, getDomainFromEmail, getDomainsFromEmails, getDomainsService, getEmail, getEmailActivitySummary, getEmailReport, getEndOfDate, getForm, getHashQueryWithoutHistory, getIconSize, getList, getListLogs, getListReport, getNestedProperty, getPopup, getPropertyValue, getSender, getStartOfDate, getStorage, getSuppressedEmailExport, getTColor, getTaskService, getTemplate, getUnixTime, getUrlQueryParam, getUser, getUtmCookies, googlePlacesMapper, hasDecimal, impersonateService, initFieldValidation, initPostHog, isColorLight, isDomainValidService, isSimpleType, isValidEmail, isValidString, isValidUrl, lisTEmailTags, listAccounts, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listPopups, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, publishPopup, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, renderPopup, renderPublicHtmlForm, renderTemplate, requestSupportService, resendVerificationEmail, resumeCampaign, saveList, scheduleCampaign, searchCustomerProfiles, sendCampaignTest, setBrandHeadElements, setStorage, shareTemplate, splitArray, splitObject, stableSort, startPromisePool, suspendCampaign, trackEvent, truncateEmail, truncateText, uiKitConfig, unArchiveCampaign, unScheduleCampaign, unshareTemplate, updateAccount, updateAndClearUrlParams, updateCampaign, updatePopup, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
@@ -5,6 +5,7 @@ export * from "./customer";
5
5
  export * from "./emailAPI";
6
6
  export * from "./form";
7
7
  export * from "./list";
8
+ export * from "./popups";
8
9
  export * from "./sender";
9
10
  export * from "./systemEmails";
10
11
  export * from "./tasks";
@@ -0,0 +1,35 @@
1
+ import { TDeleteApiResource } from "../../types";
2
+ import { EPopupBranding, EPopupDisplayFrequency, TPopupContent, TPopupModel, TPopupTargeting, TPopupTrigger, TPopupUser } from "./types";
3
+ export declare class ListPopupModel {
4
+ id: string;
5
+ readonly account_id: number;
6
+ name: string | null;
7
+ description: string | null;
8
+ enabled: boolean;
9
+ readonly created_on: number;
10
+ updated_on: number;
11
+ published_on: number | null;
12
+ branding: EPopupBranding;
13
+ tags: string[] | null;
14
+ edited_by: TPopupUser;
15
+ content: Omit<TPopupContent, "json">;
16
+ trigger: TPopupTrigger;
17
+ targeting: TPopupTargeting;
18
+ display_frequency: EPopupDisplayFrequency;
19
+ published_content_url: string | null;
20
+ thumbnail_url: string;
21
+ constructor(params: TPopupModel);
22
+ toJson(): any;
23
+ set<T extends keyof this>(property: T, value: this[T]): void;
24
+ delete(): Promise<TDeleteApiResource>;
25
+ save({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
26
+ enable(): Promise<PopupModel>;
27
+ disable(): Promise<PopupModel>;
28
+ publish(): Promise<PopupModel>;
29
+ render(): Promise<string>;
30
+ }
31
+ export declare class PopupModel extends ListPopupModel {
32
+ content: TPopupContent;
33
+ constructor(params: TPopupModel);
34
+ toJson(): any;
35
+ }
@@ -0,0 +1,94 @@
1
+ export type TPopupModel = {
2
+ id: string;
3
+ account_id: number;
4
+ name: string | null;
5
+ description: string | null;
6
+ enabled: boolean;
7
+ created_on: number;
8
+ updated_on: number;
9
+ published_on: number | null;
10
+ branding: EPopupBranding;
11
+ tags: string[] | null;
12
+ edited_by: TPopupUser;
13
+ content: TPopupContent;
14
+ trigger: TPopupTrigger;
15
+ targeting: TPopupTargeting;
16
+ display_frequency: EPopupDisplayFrequency;
17
+ published_content_url: string | null;
18
+ thumbnail_url: string;
19
+ };
20
+ export type TPopupUser = {
21
+ id: string;
22
+ email: string;
23
+ };
24
+ export type TPopupTrigger = {
25
+ type: EPopupTriggerType;
26
+ delay_seconds: number | null;
27
+ scroll_percentage: number | null;
28
+ selector: string | null;
29
+ start_date: number | null;
30
+ end_date: number | null;
31
+ };
32
+ export type TPopupTargeting = {
33
+ pages: string[] | null;
34
+ exclude_pages: string[] | null;
35
+ devices: EPopupDeviceType[] | null;
36
+ browsers: EPopupBrowserType[] | null;
37
+ languages: string[] | null;
38
+ countries: string[] | null;
39
+ referrers: string[] | null;
40
+ utm_params: Record<string, string> | null;
41
+ };
42
+ export type TPopupContent = {
43
+ position: EPopupPosition | null;
44
+ json?: Record<string, any>;
45
+ };
46
+ export declare enum EPopupTriggerType {
47
+ on_page_load = "on_page_load",
48
+ on_exit_intent = "on_exit_intent",
49
+ on_scroll = "on_scroll",
50
+ on_time_delay = "on_time_delay",
51
+ on_click = "on_click"
52
+ }
53
+ export declare enum EPopupDisplayFrequency {
54
+ once_per_session = "once_per_session",
55
+ once_per_day = "once_per_day",
56
+ once_per_week = "once_per_week",
57
+ always = "always",
58
+ once = "once"
59
+ }
60
+ export declare enum EPopupDeviceType {
61
+ desktop = "desktop",
62
+ mobile = "mobile",
63
+ tablet = "tablet"
64
+ }
65
+ export declare enum EPopupBrowserType {
66
+ chrome = "chrome",
67
+ firefox = "firefox",
68
+ safari = "safari",
69
+ edge = "edge",
70
+ opera = "opera",
71
+ other = "other"
72
+ }
73
+ export declare enum EPopupPosition {
74
+ center = "classic-center",
75
+ top_right = "classic-top-right",
76
+ top_left = "classic-top-left",
77
+ top_center = "classic-top-center",
78
+ bottom_left = "classic-bottom-left",
79
+ bottom_center = "classic-bottom-center",
80
+ bottom_right = "classic-bottom-right",
81
+ drawer_left = "drawer-left",
82
+ drawer_right = "drawer-right",
83
+ drawer_top = "bar-top",
84
+ drawer_bottom = "bar-bottom"
85
+ }
86
+ export declare enum EPopupBranding {
87
+ smart = "smart",
88
+ basic = "basic"
89
+ }
90
+ export type TPopupFilters = {
91
+ name: string;
92
+ tags: string[];
93
+ enabled: string;
94
+ };
@@ -9,6 +9,7 @@ export * from "./emailAPI";
9
9
  export * from "./forms";
10
10
  export * from "./hidden";
11
11
  export * from "./lists";
12
+ export * from "./popups";
12
13
  export * from "./senders";
13
14
  export * from "./suppressedEmails";
14
15
  export * from "./systemEmails";
@@ -0,0 +1,31 @@
1
+ import { TPopupModel } from "../../models/popups/types";
2
+ import { TGenericListParams, TGenericListReturn, TGenericReturn } from "../../types";
3
+ import { TCreateApiResource, TDeleteApiResource, TDisableApiResource, TEnableApiResource, TRenderResponse, TUpdateApiResource } from "../../types/generic";
4
+ export declare function listPopups({ ...options }: TGenericListParams & {
5
+ name?: string;
6
+ tags?: string[];
7
+ enabled?: boolean;
8
+ }): Promise<TGenericListReturn<TPopupModel>>;
9
+ export declare function createPopup({ ...popup }: Partial<TPopupModel>): Promise<TCreateApiResource<TPopupModel>>;
10
+ export declare function getPopup({ id }: {
11
+ id: string;
12
+ }): Promise<TGenericReturn<TPopupModel>>;
13
+ export declare function deletePopup({ id }: {
14
+ id: string;
15
+ }): Promise<TDeleteApiResource>;
16
+ export declare function updatePopup({ id, ...popup }: {
17
+ id: string;
18
+ popup: Partial<TPopupModel>;
19
+ }): Promise<TUpdateApiResource<TPopupModel>>;
20
+ export declare function enablePopup({ id }: {
21
+ id: string;
22
+ }): Promise<TEnableApiResource<TPopupModel>>;
23
+ export declare function disablePopup({ id }: {
24
+ id: string;
25
+ }): Promise<TDisableApiResource<TPopupModel>>;
26
+ export declare function publishPopup({ id }: {
27
+ id: string;
28
+ }): Promise<TUpdateApiResource<TPopupModel>>;
29
+ export declare function renderPopup({ id }: {
30
+ id: string;
31
+ }): Promise<TRenderResponse>;
@@ -112,6 +112,9 @@ export type TCreateApiResource<T> = {
112
112
  object: string;
113
113
  data: T;
114
114
  };
115
+ export type TRenderResponse = {
116
+ data: string;
117
+ };
115
118
  export type TActionApiResource = {
116
119
  id: number;
117
120
  object: string;
@@ -143,7 +143,13 @@ export declare enum EEvents {
143
143
  MFA_ACTIVATION_FLOW = "MFA.Activation.Flow.Started",
144
144
  MFA_DISABLE_FLOW = "MFA.Disable.Flow.Started",
145
145
  MFA_ENABLED = "MFA.Enabled",
146
- MFA_DISABLED = "MFA.Disabled"
146
+ MFA_DISABLED = "MFA.Disabled",
147
+ POPUP_CREATED = "Popup.Created",
148
+ POPUP_UPDATED = "Popup.Updated",
149
+ POPUP_DELETED = "Popup.Deleted",
150
+ POPUP_ENABLED = "Popup.Enabled",
151
+ POPUP_DISABLED = "Popup.Disabled",
152
+ POPUP_PUBLISHED = "Popup.Published"
147
153
  }
148
154
  export declare function eventCondition(type: EEvents | string, disabledEvents?: string[]): boolean;
149
155
  export declare function trackEvent(type: EEvents | string, data?: any, dataParser?: (event: EEvents | string, data: any) => any, disabledEvents?: string[]): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.50",
3
+ "version": "2.1.52",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",