@cakemail-org/ui-components-v2 2.2.0 → 2.2.2

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.
@@ -2,6 +2,9 @@ import { TGenericListParams, TGenericListReturn } from "../../types/services";
2
2
  import { TAutomationStats, TAutomationStatsParam } from "./types";
3
3
  import { AutomationModel } from "../../models/automation";
4
4
  export declare class AutomationsFactory {
5
+ static get({ id }: {
6
+ id: number;
7
+ }): Promise<AutomationModel>;
5
8
  static getAutomationStats({ ...options }: TAutomationStatsParam): Promise<TAutomationStats>;
6
9
  static list({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
7
10
  static listWorkflows({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
package/dist/cjs/index.js CHANGED
@@ -9885,7 +9885,7 @@ function loginService(_a) {
9885
9885
  });
9886
9886
  }
9887
9887
 
9888
- function getAutomationStats(_a) {
9888
+ function getAllAutomationStats(_a) {
9889
9889
  var options = __rest(_a, []);
9890
9890
  return callApi({
9891
9891
  url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
@@ -9915,6 +9915,15 @@ function listWorkflows(_a) {
9915
9915
  }
9916
9916
  });
9917
9917
  }
9918
+ function getAutomation(_a) {
9919
+ var id = _a.id;
9920
+ return callApi({
9921
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9922
+ fetchOptions: {
9923
+ method: exports.EMethods.get
9924
+ }
9925
+ });
9926
+ }
9918
9927
  function deleteAutomation(_a) {
9919
9928
  var id = _a.id;
9920
9929
  return callApi({
@@ -9944,37 +9953,54 @@ function updateAutomation(_a) {
9944
9953
  });
9945
9954
  }
9946
9955
  function deleteWorkflow(_a) {
9947
- var id = _a.id, options = __rest(_a, ["id"]);
9956
+ var id = _a.id;
9948
9957
  return callApi({
9949
9958
  url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9950
- query: camelCase(options),
9951
9959
  fetchOptions: {
9952
9960
  method: exports.EMethods.delete
9953
9961
  }
9954
9962
  });
9955
9963
  }
9956
9964
  function updateWorkflow(_a) {
9957
- var id = _a.id, data = _a.data, options = __rest(_a, ["id", "data"]);
9965
+ var id = _a.id, data = _a.data;
9958
9966
  return callApi({
9959
9967
  url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9960
- query: camelCase(options),
9961
9968
  fetchOptions: {
9962
9969
  method: exports.EMethods.patch,
9963
9970
  body: data
9964
9971
  }
9965
9972
  });
9966
9973
  }
9974
+ // implement
9975
+ function getAutomationStats(_a) {
9976
+ var id = _a.id, path = _a.path;
9977
+ return callApi({
9978
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id, "/steps/").concat(path, "/stats"),
9979
+ fetchOptions: {
9980
+ method: exports.EMethods.get
9981
+ }
9982
+ });
9983
+ }
9984
+ function getAutomationEmailContent(_a) {
9985
+ var contentId = _a.contentId;
9986
+ return callApi({
9987
+ url: uiKitConfig.GATEWAY_PROXY + "/content/".concat(contentId),
9988
+ fetchOptions: {
9989
+ method: exports.EMethods.get
9990
+ }
9991
+ });
9992
+ }
9967
9993
  function deleteAnyAutomation(_a) {
9968
- var id = _a.id, v1 = _a.v1, options = __rest(_a, ["id", "v1"]);
9994
+ var id = _a.id, v1 = _a.v1;
9969
9995
  if (v1) {
9970
- return deleteWorkflow(__assign({ id: id }, options));
9996
+ return deleteWorkflow({ id: id });
9971
9997
  }
9972
9998
  return deleteAutomation({ id: id });
9973
9999
  }
9974
10000
  function updateAnyAutomation(_a) {
9975
- var id = _a.id, data = _a.data, v1 = _a.v1, options = __rest(_a, ["id", "data", "v1"]);
10001
+ var id = _a.id, data = _a.data, v1 = _a.v1;
9976
10002
  if (v1) {
9977
- return updateWorkflow(__assign({ id: id, data: data }, options));
10003
+ return updateWorkflow({ id: id, data: data });
9978
10004
  }
9979
10005
  return updateAutomation({ id: id, data: data });
9980
10006
  }
@@ -10539,6 +10565,7 @@ exports.EEditorType = void 0;
10539
10565
  EEditorType["formDesigner"] = "form_designer";
10540
10566
  EEditorType["popUpDesigner"] = "pop_up_designer";
10541
10567
  EEditorType["pageDesigner"] = "page_designer";
10568
+ EEditorType["fileManager"] = "file_manager";
10542
10569
  })(exports.EEditorType || (exports.EEditorType = {}));
10543
10570
 
10544
10571
  function requestSupportService(_a) {
@@ -16662,7 +16689,7 @@ function ResourceEdit(_a) {
16662
16689
  function handleToggleOpen() {
16663
16690
  setOpen(!open);
16664
16691
  }
16665
- return React.createElement(material.Stack, { className: "resourceEdit-component-v2 ".concat(className || ""), gap: 6 },
16692
+ return React.createElement(material.Stack, { className: "resourceEdit-component-v2 ".concat(className || ""), gap: 4 },
16666
16693
  React.createElement(material.Stack, { direction: "row", className: "resource-heading", justifyContent: "space-between", gap: 4 },
16667
16694
  React.createElement(material.Stack, { gap: 1 },
16668
16695
  React.createElement(material.Typography, { className: "resource-title", variant: "titleS" },
@@ -17044,39 +17071,68 @@ var AutomationModel = /** @class */ (function () {
17044
17071
  AutomationModel.prototype.set = function (property, value) {
17045
17072
  modelSet(this, property, value);
17046
17073
  };
17047
- AutomationModel.prototype.save = function (automation, options) {
17074
+ AutomationModel.prototype.save = function (automation) {
17048
17075
  return __awaiter(this, void 0, void 0, function () {
17049
17076
  var dataToUpdate;
17050
17077
  return __generator(this, function (_a) {
17051
17078
  dataToUpdate = automation || this.toJson();
17052
- return [2 /*return*/, updateAnyAutomation(__assign({ id: this.id, data: dataToUpdate, v1: this.v1 }, options)).then(function (data) {
17079
+ return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
17053
17080
  trackEvent(exports.EEvents.AUTOMATION_UPDATED);
17054
17081
  return new AutomationModel(data.data);
17055
17082
  })];
17056
17083
  });
17057
17084
  });
17058
17085
  };
17059
- AutomationModel.prototype.delete = function (options) {
17086
+ AutomationModel.prototype.delete = function () {
17060
17087
  return __awaiter(this, void 0, void 0, function () {
17061
17088
  return __generator(this, function (_a) {
17062
- return [2 /*return*/, deleteAnyAutomation(__assign({ id: this.id, v1: this.v1 }, options)).then(function (data) {
17089
+ return [2 /*return*/, deleteAnyAutomation({ id: this.id, v1: this.v1 }).then(function (data) {
17063
17090
  trackEvent(exports.EEvents.AUTOMATION_DELETED);
17064
17091
  return data.data;
17065
17092
  })];
17066
17093
  });
17067
17094
  });
17068
17095
  };
17096
+ AutomationModel.prototype.getStats = function (_a) {
17097
+ return __awaiter(this, arguments, void 0, function (_b) {
17098
+ var path = _b.path;
17099
+ return __generator(this, function (_c) {
17100
+ return [2 /*return*/, getAutomationStats({ id: this.id, path: path }).then(function (data) {
17101
+ return data.data;
17102
+ })];
17103
+ });
17104
+ });
17105
+ };
17106
+ AutomationModel.getContent = function (contentId) {
17107
+ return __awaiter(this, void 0, void 0, function () {
17108
+ return __generator(this, function (_a) {
17109
+ return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17110
+ return data.data;
17111
+ })];
17112
+ });
17113
+ });
17114
+ };
17069
17115
  return AutomationModel;
17070
17116
  }());
17071
17117
 
17072
17118
  var AutomationsFactory = /** @class */ (function () {
17073
17119
  function AutomationsFactory() {
17074
17120
  }
17121
+ AutomationsFactory.get = function (_a) {
17122
+ return __awaiter(this, arguments, void 0, function (_b) {
17123
+ var id = _b.id;
17124
+ return __generator(this, function (_c) {
17125
+ return [2 /*return*/, getAutomation({ id: id }).then(function (data) {
17126
+ return new AutomationModel(data.data);
17127
+ })];
17128
+ });
17129
+ });
17130
+ };
17075
17131
  AutomationsFactory.getAutomationStats = function (_a) {
17076
17132
  return __awaiter(this, void 0, void 0, function () {
17077
17133
  var options = __rest(_a, []);
17078
17134
  return __generator(this, function (_b) {
17079
- return [2 /*return*/, getAutomationStats(__assign({}, options))];
17135
+ return [2 /*return*/, getAllAutomationStats(__assign({}, options))];
17080
17136
  });
17081
17137
  });
17082
17138
  };
@@ -19027,6 +19083,9 @@ exports.formatNumber = formatNumber;
19027
19083
  exports.getAccount = getAccount;
19028
19084
  exports.getAccountReport = getAccountReport;
19029
19085
  exports.getAdjustedBillingCycle = getAdjustedBillingCycle;
19086
+ exports.getAllAutomationStats = getAllAutomationStats;
19087
+ exports.getAutomation = getAutomation;
19088
+ exports.getAutomationEmailContent = getAutomationEmailContent;
19030
19089
  exports.getAutomationExecutionsCount = getAutomationExecutionsCount;
19031
19090
  exports.getAutomationStats = getAutomationStats;
19032
19091
  exports.getBeeTokenService = getBeeTokenService;
@@ -1,5 +1,6 @@
1
1
  import { TAutomation } from "../../factories/automations/types";
2
- import { TGenericListParams } from "../../types";
2
+ import { TAutomationEmailContent, TSingleAutomationStats } from "./types";
3
+ import { TDeleteApiResource } from "../../types";
3
4
  export declare class AutomationModel {
4
5
  readonly id: number;
5
6
  name: string;
@@ -45,7 +46,11 @@ export declare class AutomationModel {
45
46
  });
46
47
  toJson(): any;
47
48
  set<T extends keyof this>(property: T, value: this[T]): void;
48
- save(automation?: Partial<TAutomation>, options?: TGenericListParams): Promise<AutomationModel>;
49
- delete(options?: TGenericListParams): Promise<any>;
49
+ save(automation?: Partial<TAutomation>): Promise<AutomationModel>;
50
+ delete(): Promise<TDeleteApiResource>;
51
+ getStats({ path }: {
52
+ path: string;
53
+ }): Promise<TSingleAutomationStats>;
54
+ static getContent(contentId: string): Promise<TAutomationEmailContent>;
50
55
  }
51
56
  export * from "./types";
@@ -1 +1,22 @@
1
1
  export {};
2
+ export type TAutomationEmailContent = {
3
+ id: string;
4
+ thumbnail?: string;
5
+ created_on: number;
6
+ updated_on: number;
7
+ };
8
+ export type TAutomationStatsMetrics = {
9
+ open: number;
10
+ clickthru: number;
11
+ sent: number;
12
+ subscribe: number;
13
+ unsubscribe: number;
14
+ bounce: number;
15
+ soft_bounce: number;
16
+ hard_bounce: number;
17
+ spam: number;
18
+ };
19
+ export type TSingleAutomationStats = {
20
+ groupedByContact: TAutomationStatsMetrics;
21
+ totals: TAutomationStatsMetrics;
22
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./account";
2
+ export * from "./automation";
2
3
  export * from "./campaign";
3
4
  export * from "./contact";
4
5
  export * from "./customer";
@@ -11,4 +12,3 @@ export * from "./systemEmails";
11
12
  export * from "./tasks";
12
13
  export * from "./templates";
13
14
  export * from "./user";
14
- export * from "./automation";
@@ -1,8 +1,11 @@
1
1
  import { TAutomationStatsParam, TAutomation } from "../../factories/automations/types";
2
2
  import { TGenericListParams } from "../../types";
3
- export declare function getAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
3
+ export declare function getAllAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
4
4
  export declare function listAutomations({ ...options }: TGenericListParams): Promise<any>;
5
5
  export declare function listWorkflows({ ...options }: TGenericListParams): Promise<any>;
6
+ export declare function getAutomation({ id }: {
7
+ id: number;
8
+ }): Promise<any>;
6
9
  export declare function deleteAutomation({ id }: {
7
10
  id: number;
8
11
  }): Promise<any>;
@@ -13,19 +16,26 @@ export declare function updateAutomation({ id, data }: {
13
16
  id: number;
14
17
  data: Partial<TAutomation>;
15
18
  }): Promise<any>;
16
- export declare function deleteWorkflow({ id, ...options }: {
19
+ export declare function deleteWorkflow({ id }: {
17
20
  id: number;
18
- } & TGenericListParams): Promise<any>;
19
- export declare function updateWorkflow({ id, data, ...options }: {
21
+ }): Promise<any>;
22
+ export declare function updateWorkflow({ id, data }: {
20
23
  id: number;
21
24
  data: Partial<TAutomation>;
22
- } & TGenericListParams): Promise<any>;
23
- export declare function deleteAnyAutomation({ id, v1, ...options }: {
25
+ }): Promise<any>;
26
+ export declare function getAutomationStats({ id, path }: {
27
+ id: number;
28
+ path: string;
29
+ }): Promise<any>;
30
+ export declare function getAutomationEmailContent({ contentId }: {
31
+ contentId: string;
32
+ }): Promise<any>;
33
+ export declare function deleteAnyAutomation({ id, v1 }: {
24
34
  id: number;
25
35
  v1?: boolean;
26
- } & TGenericListParams): Promise<any>;
27
- export declare function updateAnyAutomation({ id, data, v1, ...options }: {
36
+ }): Promise<any>;
37
+ export declare function updateAnyAutomation({ id, data, v1 }: {
28
38
  id: number;
29
39
  data: Partial<TAutomation>;
30
40
  v1?: boolean;
31
- } & TGenericListParams): Promise<any>;
41
+ }): Promise<any>;
@@ -7,5 +7,6 @@ export declare enum EEditorType {
7
7
  emailDesigner = "email_designer",
8
8
  formDesigner = "form_designer",
9
9
  popUpDesigner = "pop_up_designer",
10
- pageDesigner = "page_designer"
10
+ pageDesigner = "page_designer",
11
+ fileManager = "file_manager"
11
12
  }
@@ -2,6 +2,9 @@ import { TGenericListParams, TGenericListReturn } from "../../types/services";
2
2
  import { TAutomationStats, TAutomationStatsParam } from "./types";
3
3
  import { AutomationModel } from "../../models/automation";
4
4
  export declare class AutomationsFactory {
5
+ static get({ id }: {
6
+ id: number;
7
+ }): Promise<AutomationModel>;
5
8
  static getAutomationStats({ ...options }: TAutomationStatsParam): Promise<TAutomationStats>;
6
9
  static list({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
7
10
  static listWorkflows({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
package/dist/esm/index.js CHANGED
@@ -9865,7 +9865,7 @@ function loginService(_a) {
9865
9865
  });
9866
9866
  }
9867
9867
 
9868
- function getAutomationStats(_a) {
9868
+ function getAllAutomationStats(_a) {
9869
9869
  var options = __rest(_a, []);
9870
9870
  return callApi({
9871
9871
  url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
@@ -9895,6 +9895,15 @@ function listWorkflows(_a) {
9895
9895
  }
9896
9896
  });
9897
9897
  }
9898
+ function getAutomation(_a) {
9899
+ var id = _a.id;
9900
+ return callApi({
9901
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9902
+ fetchOptions: {
9903
+ method: EMethods.get
9904
+ }
9905
+ });
9906
+ }
9898
9907
  function deleteAutomation(_a) {
9899
9908
  var id = _a.id;
9900
9909
  return callApi({
@@ -9924,37 +9933,54 @@ function updateAutomation(_a) {
9924
9933
  });
9925
9934
  }
9926
9935
  function deleteWorkflow(_a) {
9927
- var id = _a.id, options = __rest(_a, ["id"]);
9936
+ var id = _a.id;
9928
9937
  return callApi({
9929
9938
  url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9930
- query: camelCase(options),
9931
9939
  fetchOptions: {
9932
9940
  method: EMethods.delete
9933
9941
  }
9934
9942
  });
9935
9943
  }
9936
9944
  function updateWorkflow(_a) {
9937
- var id = _a.id, data = _a.data, options = __rest(_a, ["id", "data"]);
9945
+ var id = _a.id, data = _a.data;
9938
9946
  return callApi({
9939
9947
  url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9940
- query: camelCase(options),
9941
9948
  fetchOptions: {
9942
9949
  method: EMethods.patch,
9943
9950
  body: data
9944
9951
  }
9945
9952
  });
9946
9953
  }
9954
+ // implement
9955
+ function getAutomationStats(_a) {
9956
+ var id = _a.id, path = _a.path;
9957
+ return callApi({
9958
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id, "/steps/").concat(path, "/stats"),
9959
+ fetchOptions: {
9960
+ method: EMethods.get
9961
+ }
9962
+ });
9963
+ }
9964
+ function getAutomationEmailContent(_a) {
9965
+ var contentId = _a.contentId;
9966
+ return callApi({
9967
+ url: uiKitConfig.GATEWAY_PROXY + "/content/".concat(contentId),
9968
+ fetchOptions: {
9969
+ method: EMethods.get
9970
+ }
9971
+ });
9972
+ }
9947
9973
  function deleteAnyAutomation(_a) {
9948
- var id = _a.id, v1 = _a.v1, options = __rest(_a, ["id", "v1"]);
9974
+ var id = _a.id, v1 = _a.v1;
9949
9975
  if (v1) {
9950
- return deleteWorkflow(__assign({ id: id }, options));
9976
+ return deleteWorkflow({ id: id });
9951
9977
  }
9952
9978
  return deleteAutomation({ id: id });
9953
9979
  }
9954
9980
  function updateAnyAutomation(_a) {
9955
- var id = _a.id, data = _a.data, v1 = _a.v1, options = __rest(_a, ["id", "data", "v1"]);
9981
+ var id = _a.id, data = _a.data, v1 = _a.v1;
9956
9982
  if (v1) {
9957
- return updateWorkflow(__assign({ id: id, data: data }, options));
9983
+ return updateWorkflow({ id: id, data: data });
9958
9984
  }
9959
9985
  return updateAutomation({ id: id, data: data });
9960
9986
  }
@@ -10519,6 +10545,7 @@ var EEditorType;
10519
10545
  EEditorType["formDesigner"] = "form_designer";
10520
10546
  EEditorType["popUpDesigner"] = "pop_up_designer";
10521
10547
  EEditorType["pageDesigner"] = "page_designer";
10548
+ EEditorType["fileManager"] = "file_manager";
10522
10549
  })(EEditorType || (EEditorType = {}));
10523
10550
 
10524
10551
  function requestSupportService(_a) {
@@ -16642,7 +16669,7 @@ function ResourceEdit(_a) {
16642
16669
  function handleToggleOpen() {
16643
16670
  setOpen(!open);
16644
16671
  }
16645
- return React__default.createElement(Stack$1, { className: "resourceEdit-component-v2 ".concat(className || ""), gap: 6 },
16672
+ return React__default.createElement(Stack$1, { className: "resourceEdit-component-v2 ".concat(className || ""), gap: 4 },
16646
16673
  React__default.createElement(Stack$1, { direction: "row", className: "resource-heading", justifyContent: "space-between", gap: 4 },
16647
16674
  React__default.createElement(Stack$1, { gap: 1 },
16648
16675
  React__default.createElement(Typography$1, { className: "resource-title", variant: "titleS" },
@@ -17024,39 +17051,68 @@ var AutomationModel = /** @class */ (function () {
17024
17051
  AutomationModel.prototype.set = function (property, value) {
17025
17052
  modelSet(this, property, value);
17026
17053
  };
17027
- AutomationModel.prototype.save = function (automation, options) {
17054
+ AutomationModel.prototype.save = function (automation) {
17028
17055
  return __awaiter(this, void 0, void 0, function () {
17029
17056
  var dataToUpdate;
17030
17057
  return __generator(this, function (_a) {
17031
17058
  dataToUpdate = automation || this.toJson();
17032
- return [2 /*return*/, updateAnyAutomation(__assign({ id: this.id, data: dataToUpdate, v1: this.v1 }, options)).then(function (data) {
17059
+ return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
17033
17060
  trackEvent(EEvents.AUTOMATION_UPDATED);
17034
17061
  return new AutomationModel(data.data);
17035
17062
  })];
17036
17063
  });
17037
17064
  });
17038
17065
  };
17039
- AutomationModel.prototype.delete = function (options) {
17066
+ AutomationModel.prototype.delete = function () {
17040
17067
  return __awaiter(this, void 0, void 0, function () {
17041
17068
  return __generator(this, function (_a) {
17042
- return [2 /*return*/, deleteAnyAutomation(__assign({ id: this.id, v1: this.v1 }, options)).then(function (data) {
17069
+ return [2 /*return*/, deleteAnyAutomation({ id: this.id, v1: this.v1 }).then(function (data) {
17043
17070
  trackEvent(EEvents.AUTOMATION_DELETED);
17044
17071
  return data.data;
17045
17072
  })];
17046
17073
  });
17047
17074
  });
17048
17075
  };
17076
+ AutomationModel.prototype.getStats = function (_a) {
17077
+ return __awaiter(this, arguments, void 0, function (_b) {
17078
+ var path = _b.path;
17079
+ return __generator(this, function (_c) {
17080
+ return [2 /*return*/, getAutomationStats({ id: this.id, path: path }).then(function (data) {
17081
+ return data.data;
17082
+ })];
17083
+ });
17084
+ });
17085
+ };
17086
+ AutomationModel.getContent = function (contentId) {
17087
+ return __awaiter(this, void 0, void 0, function () {
17088
+ return __generator(this, function (_a) {
17089
+ return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17090
+ return data.data;
17091
+ })];
17092
+ });
17093
+ });
17094
+ };
17049
17095
  return AutomationModel;
17050
17096
  }());
17051
17097
 
17052
17098
  var AutomationsFactory = /** @class */ (function () {
17053
17099
  function AutomationsFactory() {
17054
17100
  }
17101
+ AutomationsFactory.get = function (_a) {
17102
+ return __awaiter(this, arguments, void 0, function (_b) {
17103
+ var id = _b.id;
17104
+ return __generator(this, function (_c) {
17105
+ return [2 /*return*/, getAutomation({ id: id }).then(function (data) {
17106
+ return new AutomationModel(data.data);
17107
+ })];
17108
+ });
17109
+ });
17110
+ };
17055
17111
  AutomationsFactory.getAutomationStats = function (_a) {
17056
17112
  return __awaiter(this, void 0, void 0, function () {
17057
17113
  var options = __rest(_a, []);
17058
17114
  return __generator(this, function (_b) {
17059
- return [2 /*return*/, getAutomationStats(__assign({}, options))];
17115
+ return [2 /*return*/, getAllAutomationStats(__assign({}, options))];
17060
17116
  });
17061
17117
  });
17062
17118
  };
@@ -18833,4 +18889,4 @@ var UsersFactory = /** @class */ (function () {
18833
18889
  return UsersFactory;
18834
18890
  }());
18835
18891
 
18836
- export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationModel, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, 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, EPopupBranding, EPopupBrowserType, EPopupCloseButtonPosition, EPopupDeviceType, EPopupDisplayFrequency, EPopupPosition, EPopupTriggerType, 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, copyToClipboard, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createPopup, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteAnyAutomation, deleteAutomation, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deletePopup, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, deleteWorkflow, 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, getAutomationExecutionsCount, getAutomationStats, 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, listAutomations, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listPopups, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, listWorkflows, 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, updateAnyAutomation, updateAutomation, updateCampaign, updatePopup, updateSystemEmails, updateTemplate, updateUser, updateWorkflow, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
18892
+ export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationModel, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, 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, EPopupBranding, EPopupBrowserType, EPopupCloseButtonPosition, EPopupDeviceType, EPopupDisplayFrequency, EPopupPosition, EPopupTriggerType, 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, copyToClipboard, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createPopup, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteAnyAutomation, deleteAutomation, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deletePopup, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, deleteWorkflow, 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, getAllAutomationStats, getAutomation, getAutomationEmailContent, getAutomationExecutionsCount, getAutomationStats, 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, listAutomations, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listPopups, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, listWorkflows, 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, updateAnyAutomation, updateAutomation, updateCampaign, updatePopup, updateSystemEmails, updateTemplate, updateUser, updateWorkflow, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
@@ -1,5 +1,6 @@
1
1
  import { TAutomation } from "../../factories/automations/types";
2
- import { TGenericListParams } from "../../types";
2
+ import { TAutomationEmailContent, TSingleAutomationStats } from "./types";
3
+ import { TDeleteApiResource } from "../../types";
3
4
  export declare class AutomationModel {
4
5
  readonly id: number;
5
6
  name: string;
@@ -45,7 +46,11 @@ export declare class AutomationModel {
45
46
  });
46
47
  toJson(): any;
47
48
  set<T extends keyof this>(property: T, value: this[T]): void;
48
- save(automation?: Partial<TAutomation>, options?: TGenericListParams): Promise<AutomationModel>;
49
- delete(options?: TGenericListParams): Promise<any>;
49
+ save(automation?: Partial<TAutomation>): Promise<AutomationModel>;
50
+ delete(): Promise<TDeleteApiResource>;
51
+ getStats({ path }: {
52
+ path: string;
53
+ }): Promise<TSingleAutomationStats>;
54
+ static getContent(contentId: string): Promise<TAutomationEmailContent>;
50
55
  }
51
56
  export * from "./types";
@@ -1 +1,22 @@
1
1
  export {};
2
+ export type TAutomationEmailContent = {
3
+ id: string;
4
+ thumbnail?: string;
5
+ created_on: number;
6
+ updated_on: number;
7
+ };
8
+ export type TAutomationStatsMetrics = {
9
+ open: number;
10
+ clickthru: number;
11
+ sent: number;
12
+ subscribe: number;
13
+ unsubscribe: number;
14
+ bounce: number;
15
+ soft_bounce: number;
16
+ hard_bounce: number;
17
+ spam: number;
18
+ };
19
+ export type TSingleAutomationStats = {
20
+ groupedByContact: TAutomationStatsMetrics;
21
+ totals: TAutomationStatsMetrics;
22
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./account";
2
+ export * from "./automation";
2
3
  export * from "./campaign";
3
4
  export * from "./contact";
4
5
  export * from "./customer";
@@ -11,4 +12,3 @@ export * from "./systemEmails";
11
12
  export * from "./tasks";
12
13
  export * from "./templates";
13
14
  export * from "./user";
14
- export * from "./automation";
@@ -1,8 +1,11 @@
1
1
  import { TAutomationStatsParam, TAutomation } from "../../factories/automations/types";
2
2
  import { TGenericListParams } from "../../types";
3
- export declare function getAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
3
+ export declare function getAllAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
4
4
  export declare function listAutomations({ ...options }: TGenericListParams): Promise<any>;
5
5
  export declare function listWorkflows({ ...options }: TGenericListParams): Promise<any>;
6
+ export declare function getAutomation({ id }: {
7
+ id: number;
8
+ }): Promise<any>;
6
9
  export declare function deleteAutomation({ id }: {
7
10
  id: number;
8
11
  }): Promise<any>;
@@ -13,19 +16,26 @@ export declare function updateAutomation({ id, data }: {
13
16
  id: number;
14
17
  data: Partial<TAutomation>;
15
18
  }): Promise<any>;
16
- export declare function deleteWorkflow({ id, ...options }: {
19
+ export declare function deleteWorkflow({ id }: {
17
20
  id: number;
18
- } & TGenericListParams): Promise<any>;
19
- export declare function updateWorkflow({ id, data, ...options }: {
21
+ }): Promise<any>;
22
+ export declare function updateWorkflow({ id, data }: {
20
23
  id: number;
21
24
  data: Partial<TAutomation>;
22
- } & TGenericListParams): Promise<any>;
23
- export declare function deleteAnyAutomation({ id, v1, ...options }: {
25
+ }): Promise<any>;
26
+ export declare function getAutomationStats({ id, path }: {
27
+ id: number;
28
+ path: string;
29
+ }): Promise<any>;
30
+ export declare function getAutomationEmailContent({ contentId }: {
31
+ contentId: string;
32
+ }): Promise<any>;
33
+ export declare function deleteAnyAutomation({ id, v1 }: {
24
34
  id: number;
25
35
  v1?: boolean;
26
- } & TGenericListParams): Promise<any>;
27
- export declare function updateAnyAutomation({ id, data, v1, ...options }: {
36
+ }): Promise<any>;
37
+ export declare function updateAnyAutomation({ id, data, v1 }: {
28
38
  id: number;
29
39
  data: Partial<TAutomation>;
30
40
  v1?: boolean;
31
- } & TGenericListParams): Promise<any>;
41
+ }): Promise<any>;
@@ -7,5 +7,6 @@ export declare enum EEditorType {
7
7
  emailDesigner = "email_designer",
8
8
  formDesigner = "form_designer",
9
9
  popUpDesigner = "pop_up_designer",
10
- pageDesigner = "page_designer"
10
+ pageDesigner = "page_designer",
11
+ fileManager = "file_manager"
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",