@cakemail-org/ui-components-v2 2.2.2 → 2.2.4
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
CHANGED
|
@@ -17071,12 +17071,11 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17071
17071
|
AutomationModel.prototype.set = function (property, value) {
|
|
17072
17072
|
modelSet(this, property, value);
|
|
17073
17073
|
};
|
|
17074
|
+
// note: fetch automation before saving if on a listings page
|
|
17074
17075
|
AutomationModel.prototype.save = function (automation) {
|
|
17075
17076
|
return __awaiter(this, void 0, void 0, function () {
|
|
17076
|
-
var dataToUpdate;
|
|
17077
17077
|
return __generator(this, function (_a) {
|
|
17078
|
-
|
|
17079
|
-
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
|
|
17078
|
+
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: automation, v1: this.v1 }).then(function (data) {
|
|
17080
17079
|
trackEvent(exports.EEvents.AUTOMATION_UPDATED);
|
|
17081
17080
|
return new AutomationModel(data.data);
|
|
17082
17081
|
})];
|
|
@@ -17104,12 +17103,14 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17104
17103
|
});
|
|
17105
17104
|
};
|
|
17106
17105
|
AutomationModel.getContent = function (contentId) {
|
|
17107
|
-
|
|
17108
|
-
return
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
})];
|
|
17106
|
+
if (contentId === "scratchBee1") {
|
|
17107
|
+
return Promise.resolve({
|
|
17108
|
+
id: "scratchBee1",
|
|
17109
|
+
thumbnail: "/assets/images/campaigns/beeTemplate.png",
|
|
17112
17110
|
});
|
|
17111
|
+
}
|
|
17112
|
+
return getAutomationEmailContent({ contentId: contentId }).then(function (data) {
|
|
17113
|
+
return data;
|
|
17113
17114
|
});
|
|
17114
17115
|
};
|
|
17115
17116
|
return AutomationModel;
|
|
@@ -46,7 +46,7 @@ export declare class AutomationModel {
|
|
|
46
46
|
});
|
|
47
47
|
toJson(): any;
|
|
48
48
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
49
|
-
save(automation
|
|
49
|
+
save(automation: Partial<TAutomation>): Promise<AutomationModel>;
|
|
50
50
|
delete(): Promise<TDeleteApiResource>;
|
|
51
51
|
getStats({ path }: {
|
|
52
52
|
path: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -17051,12 +17051,11 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17051
17051
|
AutomationModel.prototype.set = function (property, value) {
|
|
17052
17052
|
modelSet(this, property, value);
|
|
17053
17053
|
};
|
|
17054
|
+
// note: fetch automation before saving if on a listings page
|
|
17054
17055
|
AutomationModel.prototype.save = function (automation) {
|
|
17055
17056
|
return __awaiter(this, void 0, void 0, function () {
|
|
17056
|
-
var dataToUpdate;
|
|
17057
17057
|
return __generator(this, function (_a) {
|
|
17058
|
-
|
|
17059
|
-
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
|
|
17058
|
+
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: automation, v1: this.v1 }).then(function (data) {
|
|
17060
17059
|
trackEvent(EEvents.AUTOMATION_UPDATED);
|
|
17061
17060
|
return new AutomationModel(data.data);
|
|
17062
17061
|
})];
|
|
@@ -17084,12 +17083,14 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17084
17083
|
});
|
|
17085
17084
|
};
|
|
17086
17085
|
AutomationModel.getContent = function (contentId) {
|
|
17087
|
-
|
|
17088
|
-
return
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
})];
|
|
17086
|
+
if (contentId === "scratchBee1") {
|
|
17087
|
+
return Promise.resolve({
|
|
17088
|
+
id: "scratchBee1",
|
|
17089
|
+
thumbnail: "/assets/images/campaigns/beeTemplate.png",
|
|
17092
17090
|
});
|
|
17091
|
+
}
|
|
17092
|
+
return getAutomationEmailContent({ contentId: contentId }).then(function (data) {
|
|
17093
|
+
return data;
|
|
17093
17094
|
});
|
|
17094
17095
|
};
|
|
17095
17096
|
return AutomationModel;
|
|
@@ -46,7 +46,7 @@ export declare class AutomationModel {
|
|
|
46
46
|
});
|
|
47
47
|
toJson(): any;
|
|
48
48
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
49
|
-
save(automation
|
|
49
|
+
save(automation: Partial<TAutomation>): Promise<AutomationModel>;
|
|
50
50
|
delete(): Promise<TDeleteApiResource>;
|
|
51
51
|
getStats({ path }: {
|
|
52
52
|
path: string;
|