@cakemail-org/ui-components-v2 2.1.30 → 2.1.32
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/dist/cjs/index.js +6 -6
- package/dist/cjs/models/campaign/index.d.ts +1 -3
- package/dist/cjs/models/form/index.d.ts +1 -3
- package/dist/cjs/types/promisePool.d.ts +4 -2
- package/dist/esm/index.js +6 -6
- package/dist/esm/models/campaign/index.d.ts +1 -3
- package/dist/esm/models/form/index.d.ts +1 -3
- package/dist/esm/types/promisePool.d.ts +4 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2227,6 +2227,7 @@ exports.EPartialInfoPool = void 0;
|
|
|
2227
2227
|
EPartialInfoPool["partialAutomationReport"] = "partialAutomationReport";
|
|
2228
2228
|
EPartialInfoPool["partialUsers"] = "partialUsers";
|
|
2229
2229
|
EPartialInfoPool["partialLists"] = "partialLists";
|
|
2230
|
+
EPartialInfoPool["partialCampaignReports"] = "partialCampaignReports";
|
|
2230
2231
|
})(exports.EPartialInfoPool || (exports.EPartialInfoPool = {}));
|
|
2231
2232
|
|
|
2232
2233
|
// Storage
|
|
@@ -16698,16 +16699,15 @@ var ListCampaignModel = /** @class */ (function () {
|
|
|
16698
16699
|
});
|
|
16699
16700
|
});
|
|
16700
16701
|
};
|
|
16701
|
-
ListCampaignModel.prototype.save = function (
|
|
16702
|
+
ListCampaignModel.prototype.save = function (campaign) {
|
|
16702
16703
|
return __awaiter(this, void 0, void 0, function () {
|
|
16703
|
-
var campaign;
|
|
16704
16704
|
var _this = this;
|
|
16705
16705
|
return __generator(this, function (_a) {
|
|
16706
|
-
campaign = (params === null || params === void 0 ? void 0 : params.campaign) || this.toJson();
|
|
16707
16706
|
if (!this.id) {
|
|
16708
16707
|
throw new Error("Campaign was not initialized");
|
|
16709
16708
|
}
|
|
16710
|
-
if (!
|
|
16709
|
+
if (!campaign) {
|
|
16710
|
+
campaign = this.toJson();
|
|
16711
16711
|
campaign === null || campaign === void 0 ? true : delete campaign.sender;
|
|
16712
16712
|
}
|
|
16713
16713
|
return [2 /*return*/, updateCampaign({ campaign: campaign, id: this.id }).then(function (data) {
|
|
@@ -17218,14 +17218,14 @@ var CommonFormModel = /** @class */ (function () {
|
|
|
17218
17218
|
});
|
|
17219
17219
|
});
|
|
17220
17220
|
};
|
|
17221
|
-
CommonFormModel.prototype.save = function (
|
|
17221
|
+
CommonFormModel.prototype.save = function (form) {
|
|
17222
17222
|
return __awaiter(this, void 0, void 0, function () {
|
|
17223
17223
|
var _this = this;
|
|
17224
17224
|
return __generator(this, function (_a) {
|
|
17225
17225
|
if (!this.id) {
|
|
17226
17226
|
throw new Error("Form was not initialized");
|
|
17227
17227
|
}
|
|
17228
|
-
return [2 /*return*/, patchForm({ id: this.id.toString(), data:
|
|
17228
|
+
return [2 /*return*/, patchForm({ id: this.id.toString(), data: form || this.toJson() }).then(function (data) {
|
|
17229
17229
|
trackEvent(exports.EEvents.FORM_UPDATED, { id: _this.id });
|
|
17230
17230
|
return data.data;
|
|
17231
17231
|
})];
|
|
@@ -25,9 +25,7 @@ export declare class ListCampaignModel {
|
|
|
25
25
|
toJson(): any;
|
|
26
26
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
27
27
|
delete(): Promise<TDeleteApiResource>;
|
|
28
|
-
save(
|
|
29
|
-
campaign: Partial<TCampaignUpdate>;
|
|
30
|
-
}): Promise<CampaignModel>;
|
|
28
|
+
save(campaign?: Partial<TCampaignUpdate>): Promise<CampaignModel>;
|
|
31
29
|
render({ contactId }: {
|
|
32
30
|
contactId?: number;
|
|
33
31
|
}): Promise<string>;
|
|
@@ -14,9 +14,7 @@ export declare class CommonFormModel {
|
|
|
14
14
|
toJson(): any;
|
|
15
15
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
16
16
|
delete(): Promise<TDeleteApiResource>;
|
|
17
|
-
save(
|
|
18
|
-
form: Partial<TEnhancedFormModel>;
|
|
19
|
-
}): Promise<EnhancedFormModel>;
|
|
17
|
+
save(form?: Partial<TEnhancedFormModel>): Promise<EnhancedFormModel>;
|
|
20
18
|
}
|
|
21
19
|
export declare class FormModel extends CommonFormModel {
|
|
22
20
|
readonly status: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stoppable, UsesConcurrency } from "@supercharge/promise-pool";
|
|
2
2
|
import { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
|
-
import { TListModel, TUserModel } from "../models";
|
|
3
|
+
import { TCampaignReport, TListModel, TUserModel } from "../models";
|
|
4
4
|
import { TSenderModel } from "../models/sender";
|
|
5
5
|
import { TListTemplateModel, TTemplateModel } from "../models/templates";
|
|
6
6
|
import { TNumStr } from "./generic";
|
|
@@ -31,10 +31,12 @@ export declare enum EPartialInfoPool {
|
|
|
31
31
|
"partialAccountReport" = "partialAccountReport",
|
|
32
32
|
"partialAutomationReport" = "partialAutomationReport",
|
|
33
33
|
"partialUsers" = "partialUsers",
|
|
34
|
-
"partialLists" = "partialLists"
|
|
34
|
+
"partialLists" = "partialLists",
|
|
35
|
+
"partialCampaignReports" = "partialCampaignReports"
|
|
35
36
|
}
|
|
36
37
|
export type TPromisePoolPartialUser = Pick<TUserModel, "id" | "email" | "status" | "last_activity_on" | "first_name" | "last_name" | "language" | "timezone"> | undefined;
|
|
37
38
|
export type TPromisePoolPartialSender = Pick<TSenderModel, "email" | "name" | "confirmed"> | undefined;
|
|
38
39
|
export type TPromisePoolPartialTemplates = Pick<TTemplateModel | TListTemplateModel, "name" | "thumbnail_url" | "description"> | undefined;
|
|
39
40
|
export type TPromisePoolPartialList = Pick<TListModel, "id" | "name" | "status"> | undefined;
|
|
41
|
+
export type TPromisePoolPartialCampaignReports = Pick<TCampaignReport, "open_rate" | "click_rate" | "unsubscribe_rate" | "spam_rate" | "bounce_rate" | "unique_clicks" | "unique_opens"> | undefined;
|
|
40
42
|
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -2207,6 +2207,7 @@ var EPartialInfoPool;
|
|
|
2207
2207
|
EPartialInfoPool["partialAutomationReport"] = "partialAutomationReport";
|
|
2208
2208
|
EPartialInfoPool["partialUsers"] = "partialUsers";
|
|
2209
2209
|
EPartialInfoPool["partialLists"] = "partialLists";
|
|
2210
|
+
EPartialInfoPool["partialCampaignReports"] = "partialCampaignReports";
|
|
2210
2211
|
})(EPartialInfoPool || (EPartialInfoPool = {}));
|
|
2211
2212
|
|
|
2212
2213
|
// Storage
|
|
@@ -16678,16 +16679,15 @@ var ListCampaignModel = /** @class */ (function () {
|
|
|
16678
16679
|
});
|
|
16679
16680
|
});
|
|
16680
16681
|
};
|
|
16681
|
-
ListCampaignModel.prototype.save = function (
|
|
16682
|
+
ListCampaignModel.prototype.save = function (campaign) {
|
|
16682
16683
|
return __awaiter(this, void 0, void 0, function () {
|
|
16683
|
-
var campaign;
|
|
16684
16684
|
var _this = this;
|
|
16685
16685
|
return __generator(this, function (_a) {
|
|
16686
|
-
campaign = (params === null || params === void 0 ? void 0 : params.campaign) || this.toJson();
|
|
16687
16686
|
if (!this.id) {
|
|
16688
16687
|
throw new Error("Campaign was not initialized");
|
|
16689
16688
|
}
|
|
16690
|
-
if (!
|
|
16689
|
+
if (!campaign) {
|
|
16690
|
+
campaign = this.toJson();
|
|
16691
16691
|
campaign === null || campaign === void 0 ? true : delete campaign.sender;
|
|
16692
16692
|
}
|
|
16693
16693
|
return [2 /*return*/, updateCampaign({ campaign: campaign, id: this.id }).then(function (data) {
|
|
@@ -17198,14 +17198,14 @@ var CommonFormModel = /** @class */ (function () {
|
|
|
17198
17198
|
});
|
|
17199
17199
|
});
|
|
17200
17200
|
};
|
|
17201
|
-
CommonFormModel.prototype.save = function (
|
|
17201
|
+
CommonFormModel.prototype.save = function (form) {
|
|
17202
17202
|
return __awaiter(this, void 0, void 0, function () {
|
|
17203
17203
|
var _this = this;
|
|
17204
17204
|
return __generator(this, function (_a) {
|
|
17205
17205
|
if (!this.id) {
|
|
17206
17206
|
throw new Error("Form was not initialized");
|
|
17207
17207
|
}
|
|
17208
|
-
return [2 /*return*/, patchForm({ id: this.id.toString(), data:
|
|
17208
|
+
return [2 /*return*/, patchForm({ id: this.id.toString(), data: form || this.toJson() }).then(function (data) {
|
|
17209
17209
|
trackEvent(EEvents.FORM_UPDATED, { id: _this.id });
|
|
17210
17210
|
return data.data;
|
|
17211
17211
|
})];
|
|
@@ -25,9 +25,7 @@ export declare class ListCampaignModel {
|
|
|
25
25
|
toJson(): any;
|
|
26
26
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
27
27
|
delete(): Promise<TDeleteApiResource>;
|
|
28
|
-
save(
|
|
29
|
-
campaign: Partial<TCampaignUpdate>;
|
|
30
|
-
}): Promise<CampaignModel>;
|
|
28
|
+
save(campaign?: Partial<TCampaignUpdate>): Promise<CampaignModel>;
|
|
31
29
|
render({ contactId }: {
|
|
32
30
|
contactId?: number;
|
|
33
31
|
}): Promise<string>;
|
|
@@ -14,9 +14,7 @@ export declare class CommonFormModel {
|
|
|
14
14
|
toJson(): any;
|
|
15
15
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
16
16
|
delete(): Promise<TDeleteApiResource>;
|
|
17
|
-
save(
|
|
18
|
-
form: Partial<TEnhancedFormModel>;
|
|
19
|
-
}): Promise<EnhancedFormModel>;
|
|
17
|
+
save(form?: Partial<TEnhancedFormModel>): Promise<EnhancedFormModel>;
|
|
20
18
|
}
|
|
21
19
|
export declare class FormModel extends CommonFormModel {
|
|
22
20
|
readonly status: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stoppable, UsesConcurrency } from "@supercharge/promise-pool";
|
|
2
2
|
import { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
|
-
import { TListModel, TUserModel } from "../models";
|
|
3
|
+
import { TCampaignReport, TListModel, TUserModel } from "../models";
|
|
4
4
|
import { TSenderModel } from "../models/sender";
|
|
5
5
|
import { TListTemplateModel, TTemplateModel } from "../models/templates";
|
|
6
6
|
import { TNumStr } from "./generic";
|
|
@@ -31,10 +31,12 @@ export declare enum EPartialInfoPool {
|
|
|
31
31
|
"partialAccountReport" = "partialAccountReport",
|
|
32
32
|
"partialAutomationReport" = "partialAutomationReport",
|
|
33
33
|
"partialUsers" = "partialUsers",
|
|
34
|
-
"partialLists" = "partialLists"
|
|
34
|
+
"partialLists" = "partialLists",
|
|
35
|
+
"partialCampaignReports" = "partialCampaignReports"
|
|
35
36
|
}
|
|
36
37
|
export type TPromisePoolPartialUser = Pick<TUserModel, "id" | "email" | "status" | "last_activity_on" | "first_name" | "last_name" | "language" | "timezone"> | undefined;
|
|
37
38
|
export type TPromisePoolPartialSender = Pick<TSenderModel, "email" | "name" | "confirmed"> | undefined;
|
|
38
39
|
export type TPromisePoolPartialTemplates = Pick<TTemplateModel | TListTemplateModel, "name" | "thumbnail_url" | "description"> | undefined;
|
|
39
40
|
export type TPromisePoolPartialList = Pick<TListModel, "id" | "name" | "status"> | undefined;
|
|
41
|
+
export type TPromisePoolPartialCampaignReports = Pick<TCampaignReport, "open_rate" | "click_rate" | "unsubscribe_rate" | "spam_rate" | "bounce_rate" | "unique_clicks" | "unique_opens"> | undefined;
|
|
40
42
|
export {};
|