@cakemail-org/ui-components-v2 2.1.26 → 2.1.28

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
@@ -16678,6 +16678,8 @@ var ListCampaignModel = /** @class */ (function () {
16678
16678
  this.suspended = params.suspended || false;
16679
16679
  this.web_email_link = params.web_email_link || "";
16680
16680
  this.thumbnail_url = params.thumbnail_url || "";
16681
+ this.over_limit = params.over_limit || false;
16682
+ this.under_review = params.under_review || false;
16681
16683
  }
16682
16684
  ListCampaignModel.prototype.toJson = function () {
16683
16685
  return modelToJson(this);
@@ -16696,11 +16698,18 @@ var ListCampaignModel = /** @class */ (function () {
16696
16698
  });
16697
16699
  });
16698
16700
  };
16699
- ListCampaignModel.prototype.update = function (_a) {
16701
+ ListCampaignModel.prototype.save = function (_a) {
16700
16702
  return __awaiter(this, arguments, void 0, function (_b) {
16701
16703
  var _this = this;
16702
16704
  var campaign = _b.campaign;
16703
16705
  return __generator(this, function (_c) {
16706
+ if (!this.id) {
16707
+ throw new Error("Campaign was not initialized");
16708
+ }
16709
+ if (!campaign) {
16710
+ campaign = this.toJson();
16711
+ campaign === null || campaign === void 0 ? true : delete campaign.sender;
16712
+ }
16704
16713
  return [2 /*return*/, updateCampaign({ campaign: campaign, id: this.id }).then(function (data) {
16705
16714
  trackEvent(exports.EEvents.CAMPAIGN_UPDATED, { id: _this.id });
16706
16715
  return new CampaignModel(data.data);
@@ -19,12 +19,14 @@ export declare class ListCampaignModel {
19
19
  suspended: boolean;
20
20
  web_email_link: string;
21
21
  thumbnail_url: string;
22
+ over_limit: boolean;
23
+ under_review: boolean;
22
24
  constructor(params: Partial<TListCampaignModel>);
23
25
  toJson(): any;
24
26
  set<T extends keyof this>(property: T, value: this[T]): void;
25
27
  delete(): Promise<TDeleteApiResource>;
26
- update({ campaign }: {
27
- campaign: Partial<TCampaignUpdate>;
28
+ save({ campaign }: {
29
+ campaign?: Partial<TCampaignUpdate>;
28
30
  }): Promise<CampaignModel>;
29
31
  render({ contactId }: {
30
32
  contactId?: number;
@@ -27,6 +27,8 @@ export type TListCampaignModel = {
27
27
  suspended: boolean;
28
28
  web_email_link: string;
29
29
  thumbnail_url: string;
30
+ over_limit: boolean;
31
+ under_review: boolean;
30
32
  };
31
33
  export interface TCampaignModel extends TListCampaignModel {
32
34
  tracking?: TCampaignTracking;
package/dist/esm/index.js CHANGED
@@ -16658,6 +16658,8 @@ var ListCampaignModel = /** @class */ (function () {
16658
16658
  this.suspended = params.suspended || false;
16659
16659
  this.web_email_link = params.web_email_link || "";
16660
16660
  this.thumbnail_url = params.thumbnail_url || "";
16661
+ this.over_limit = params.over_limit || false;
16662
+ this.under_review = params.under_review || false;
16661
16663
  }
16662
16664
  ListCampaignModel.prototype.toJson = function () {
16663
16665
  return modelToJson(this);
@@ -16676,11 +16678,18 @@ var ListCampaignModel = /** @class */ (function () {
16676
16678
  });
16677
16679
  });
16678
16680
  };
16679
- ListCampaignModel.prototype.update = function (_a) {
16681
+ ListCampaignModel.prototype.save = function (_a) {
16680
16682
  return __awaiter(this, arguments, void 0, function (_b) {
16681
16683
  var _this = this;
16682
16684
  var campaign = _b.campaign;
16683
16685
  return __generator(this, function (_c) {
16686
+ if (!this.id) {
16687
+ throw new Error("Campaign was not initialized");
16688
+ }
16689
+ if (!campaign) {
16690
+ campaign = this.toJson();
16691
+ campaign === null || campaign === void 0 ? true : delete campaign.sender;
16692
+ }
16684
16693
  return [2 /*return*/, updateCampaign({ campaign: campaign, id: this.id }).then(function (data) {
16685
16694
  trackEvent(EEvents.CAMPAIGN_UPDATED, { id: _this.id });
16686
16695
  return new CampaignModel(data.data);
@@ -19,12 +19,14 @@ export declare class ListCampaignModel {
19
19
  suspended: boolean;
20
20
  web_email_link: string;
21
21
  thumbnail_url: string;
22
+ over_limit: boolean;
23
+ under_review: boolean;
22
24
  constructor(params: Partial<TListCampaignModel>);
23
25
  toJson(): any;
24
26
  set<T extends keyof this>(property: T, value: this[T]): void;
25
27
  delete(): Promise<TDeleteApiResource>;
26
- update({ campaign }: {
27
- campaign: Partial<TCampaignUpdate>;
28
+ save({ campaign }: {
29
+ campaign?: Partial<TCampaignUpdate>;
28
30
  }): Promise<CampaignModel>;
29
31
  render({ contactId }: {
30
32
  contactId?: number;
@@ -27,6 +27,8 @@ export type TListCampaignModel = {
27
27
  suspended: boolean;
28
28
  web_email_link: string;
29
29
  thumbnail_url: string;
30
+ over_limit: boolean;
31
+ under_review: boolean;
30
32
  };
31
33
  export interface TCampaignModel extends TListCampaignModel {
32
34
  tracking?: TCampaignTracking;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.26",
3
+ "version": "2.1.28",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",