@cakemail-org/ui-components-v2 2.1.29 → 2.1.30

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
@@ -16698,16 +16698,16 @@ var ListCampaignModel = /** @class */ (function () {
16698
16698
  });
16699
16699
  });
16700
16700
  };
16701
- ListCampaignModel.prototype.save = function () {
16702
- return __awaiter(this, arguments, void 0, function (_a) {
16701
+ ListCampaignModel.prototype.save = function (params) {
16702
+ return __awaiter(this, void 0, void 0, function () {
16703
+ var campaign;
16703
16704
  var _this = this;
16704
- var _b = _a === void 0 ? {} : _a, campaign = _b.campaign;
16705
- return __generator(this, function (_c) {
16705
+ return __generator(this, function (_a) {
16706
+ campaign = (params === null || params === void 0 ? void 0 : params.campaign) || this.toJson();
16706
16707
  if (!this.id) {
16707
16708
  throw new Error("Campaign was not initialized");
16708
16709
  }
16709
- if (!campaign) {
16710
- campaign = this.toJson();
16710
+ if (!(params === null || params === void 0 ? void 0 : params.campaign)) {
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,15 +17218,14 @@ var CommonFormModel = /** @class */ (function () {
17218
17218
  });
17219
17219
  });
17220
17220
  };
17221
- CommonFormModel.prototype.save = function () {
17222
- return __awaiter(this, arguments, void 0, function (_a) {
17221
+ CommonFormModel.prototype.save = function (params) {
17222
+ return __awaiter(this, void 0, void 0, function () {
17223
17223
  var _this = this;
17224
- var _b = _a === void 0 ? {} : _a, form = _b.form;
17225
- return __generator(this, function (_c) {
17224
+ return __generator(this, function (_a) {
17226
17225
  if (!this.id) {
17227
17226
  throw new Error("Form was not initialized");
17228
17227
  }
17229
- return [2 /*return*/, patchForm({ id: this.id.toString(), data: form || this.toJson() }).then(function (data) {
17228
+ return [2 /*return*/, patchForm({ id: this.id.toString(), data: (params === null || params === void 0 ? void 0 : params.form) || this.toJson() }).then(function (data) {
17230
17229
  trackEvent(exports.EEvents.FORM_UPDATED, { id: _this.id });
17231
17230
  return data.data;
17232
17231
  })];
@@ -25,8 +25,8 @@ 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({ campaign }?: {
29
- campaign?: Partial<TCampaignUpdate>;
28
+ save(params?: {
29
+ campaign: Partial<TCampaignUpdate>;
30
30
  }): Promise<CampaignModel>;
31
31
  render({ contactId }: {
32
32
  contactId?: number;
@@ -14,8 +14,8 @@ 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({ form }?: {
18
- form?: Partial<TEnhancedFormModel>;
17
+ save(params?: {
18
+ form: Partial<TEnhancedFormModel>;
19
19
  }): Promise<EnhancedFormModel>;
20
20
  }
21
21
  export declare class FormModel extends CommonFormModel {
package/dist/esm/index.js CHANGED
@@ -16678,16 +16678,16 @@ var ListCampaignModel = /** @class */ (function () {
16678
16678
  });
16679
16679
  });
16680
16680
  };
16681
- ListCampaignModel.prototype.save = function () {
16682
- return __awaiter(this, arguments, void 0, function (_a) {
16681
+ ListCampaignModel.prototype.save = function (params) {
16682
+ return __awaiter(this, void 0, void 0, function () {
16683
+ var campaign;
16683
16684
  var _this = this;
16684
- var _b = _a === void 0 ? {} : _a, campaign = _b.campaign;
16685
- return __generator(this, function (_c) {
16685
+ return __generator(this, function (_a) {
16686
+ campaign = (params === null || params === void 0 ? void 0 : params.campaign) || this.toJson();
16686
16687
  if (!this.id) {
16687
16688
  throw new Error("Campaign was not initialized");
16688
16689
  }
16689
- if (!campaign) {
16690
- campaign = this.toJson();
16690
+ if (!(params === null || params === void 0 ? void 0 : params.campaign)) {
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,15 +17198,14 @@ var CommonFormModel = /** @class */ (function () {
17198
17198
  });
17199
17199
  });
17200
17200
  };
17201
- CommonFormModel.prototype.save = function () {
17202
- return __awaiter(this, arguments, void 0, function (_a) {
17201
+ CommonFormModel.prototype.save = function (params) {
17202
+ return __awaiter(this, void 0, void 0, function () {
17203
17203
  var _this = this;
17204
- var _b = _a === void 0 ? {} : _a, form = _b.form;
17205
- return __generator(this, function (_c) {
17204
+ return __generator(this, function (_a) {
17206
17205
  if (!this.id) {
17207
17206
  throw new Error("Form was not initialized");
17208
17207
  }
17209
- return [2 /*return*/, patchForm({ id: this.id.toString(), data: form || this.toJson() }).then(function (data) {
17208
+ return [2 /*return*/, patchForm({ id: this.id.toString(), data: (params === null || params === void 0 ? void 0 : params.form) || this.toJson() }).then(function (data) {
17210
17209
  trackEvent(EEvents.FORM_UPDATED, { id: _this.id });
17211
17210
  return data.data;
17212
17211
  })];
@@ -25,8 +25,8 @@ 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({ campaign }?: {
29
- campaign?: Partial<TCampaignUpdate>;
28
+ save(params?: {
29
+ campaign: Partial<TCampaignUpdate>;
30
30
  }): Promise<CampaignModel>;
31
31
  render({ contactId }: {
32
32
  contactId?: number;
@@ -14,8 +14,8 @@ 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({ form }?: {
18
- form?: Partial<TEnhancedFormModel>;
17
+ save(params?: {
18
+ form: Partial<TEnhancedFormModel>;
19
19
  }): Promise<EnhancedFormModel>;
20
20
  }
21
21
  export declare class FormModel extends CommonFormModel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.29",
3
+ "version": "2.1.30",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",