@cakemail-org/ui-components-v2 2.1.66 → 2.1.68

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/README.md CHANGED
@@ -1 +1,66 @@
1
1
  # ui-componentsv2
2
+
3
+ UI component library built with Material UI.
4
+
5
+ ## Local Development with Yalc
6
+
7
+ ### Setup
8
+
9
+ 1. **Install yalc globally** (one-time):
10
+ ```bash
11
+ npm install -g yalc
12
+ ```
13
+
14
+ 2. **Publish to local yalc store**:
15
+ ```bash
16
+ yalc publish
17
+ ```
18
+
19
+ 3. **In your consuming app**, add the package:
20
+ ```bash
21
+ yalc add @cakemail-org/ui-components-v2
22
+ ```
23
+
24
+ ### Development Workflow
25
+
26
+ **Watch mode** (automatically rebuilds and pushes on changes):
27
+ ```bash
28
+ npm run dev
29
+ ```
30
+
31
+ Should output something like
32
+ ```
33
+ Pushing @cakemail-org/ui-components-v2@2.1.58 in /Users/<YourUser>//salar/nextGenApp-salar/app
34
+ Occasionally, if you run into breaking changes with scss imports you may need restart the npm run dev in ui-components-v2 and re-add the dependencey in the other project
35
+ ```bash
36
+ ) ✗ yalc add @cakemail-org/ui-components-v2@2.1.58
37
+ ```
38
+
39
+
40
+ ```
41
+ **Manual build**:
42
+ ```bash
43
+ npm run build
44
+ ```
45
+
46
+ Both commands automatically push to yalc after building.
47
+
48
+ ### Cleanup
49
+
50
+ Remove yalc link from consuming app:
51
+ ```bash
52
+ yalc remove @cakemail-org/ui-components-v2
53
+ npm install
54
+ ```
55
+
56
+ ## Scripts
57
+
58
+ - `npm run build` - Build package
59
+ - `npm run dev` - Watch mode with auto-push to yalc
60
+ - `npm run storybook` - Run Storybook
61
+ - `npm test` - Run tests
62
+
63
+ ## Notes
64
+
65
+ - Yalc is 100% local, nothing publishes to npm
66
+ - Add `.yalc` and `yalc.lock` to `.gitignore` in consuming apps
@@ -848,6 +848,9 @@ export default function getMuiTextField(theme: Theme): {
848
848
  "&.MuiFilledInput-root": {};
849
849
  "&.MuiInput-root": {};
850
850
  input: {
851
+ borderRadius: number;
852
+ padding: string;
853
+ backgroundColor: string;
851
854
  "&:not(:placeholder-shown)": {
852
855
  color: string;
853
856
  };
@@ -875,7 +878,6 @@ export default function getMuiTextField(theme: Theme): {
875
878
  backgroundAttachment?: import("csstype").Property.BackgroundAttachment | undefined;
876
879
  backgroundBlendMode?: import("csstype").Property.BackgroundBlendMode | undefined;
877
880
  backgroundClip?: import("csstype").Property.BackgroundClip | undefined;
878
- backgroundColor?: import("csstype").Property.BackgroundColor | undefined;
879
881
  backgroundImage?: import("csstype").Property.BackgroundImage | undefined;
880
882
  backgroundOrigin?: import("csstype").Property.BackgroundOrigin | undefined;
881
883
  backgroundPositionX?: import("csstype").Property.BackgroundPositionX<string | number> | undefined;
@@ -1242,7 +1244,6 @@ export default function getMuiTextField(theme: Theme): {
1242
1244
  borderInlineEnd?: import("csstype").Property.BorderInlineEnd<string | number> | undefined;
1243
1245
  borderInlineStart?: import("csstype").Property.BorderInlineStart<string | number> | undefined;
1244
1246
  borderLeft?: import("csstype").Property.BorderLeft<string | number> | undefined;
1245
- borderRadius?: import("csstype").Property.BorderRadius<string | number> | undefined;
1246
1247
  borderRight?: import("csstype").Property.BorderRight<string | number> | undefined;
1247
1248
  borderStyle?: import("csstype").Property.BorderStyle | undefined;
1248
1249
  borderTop?: import("csstype").Property.BorderTop<string | number> | undefined;
@@ -1276,7 +1277,6 @@ export default function getMuiTextField(theme: Theme): {
1276
1277
  outline?: import("csstype").Property.Outline<string | number> | undefined;
1277
1278
  overflow?: import("csstype").Property.Overflow | undefined;
1278
1279
  overscrollBehavior?: import("csstype").Property.OverscrollBehavior | undefined;
1279
- padding?: import("csstype").Property.Padding<string | number> | undefined;
1280
1280
  paddingBlock?: import("csstype").Property.PaddingBlock<string | number> | undefined;
1281
1281
  paddingInline?: import("csstype").Property.PaddingInline<string | number> | undefined;
1282
1282
  placeContent?: import("csstype").Property.PlaceContent | undefined;
@@ -1,5 +1,9 @@
1
+ import { TGenericListParams, TGenericListReturn } from "../../types/services";
1
2
  import { TAutomationStats, TAutomationStatsParam } from "./types";
3
+ import { AutomationModel } from "../../models/automation";
2
4
  export declare class AutomationsFactory {
3
5
  static getAutomationStats({ ...options }: TAutomationStatsParam): Promise<TAutomationStats>;
6
+ static list({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
7
+ static listWorkflows({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
4
8
  }
5
9
  export * from "./types";
@@ -9,3 +9,49 @@ export type TAutomationStatsParam = {
9
9
  actionType?: string;
10
10
  accountId: number;
11
11
  };
12
+ export type TAutomationTrigger = {
13
+ name: string;
14
+ args: Record<string, any>;
15
+ };
16
+ export type TAutomationStep = {
17
+ name: string;
18
+ action: string;
19
+ args: Record<string, any>;
20
+ description?: string;
21
+ pausable?: boolean;
22
+ next?: string;
23
+ };
24
+ export type TAutomationCondition = {
25
+ eq?: {
26
+ var: string;
27
+ value: any;
28
+ };
29
+ or?: TAutomationCondition[];
30
+ and?: TAutomationCondition[];
31
+ not?: TAutomationCondition;
32
+ };
33
+ export type TAutomationMain = {
34
+ steps: TAutomationStep[];
35
+ };
36
+ export type TAutomationSubAutomation = {
37
+ name: string;
38
+ params: string[];
39
+ steps: TAutomationStep[];
40
+ };
41
+ export type TAutomation = {
42
+ id: number;
43
+ name: string;
44
+ description: string;
45
+ status: "active" | "inactive" | "deleted";
46
+ paused: boolean;
47
+ created_on: number;
48
+ updated_on: number;
49
+ committed_on: number | null;
50
+ committed_revision: string | null;
51
+ editor_version: string;
52
+ lineage: string[];
53
+ list_id: number;
54
+ trigger: TAutomationTrigger[];
55
+ main: TAutomationMain;
56
+ sub_automations: TAutomationSubAutomation[];
57
+ };
package/dist/cjs/index.js CHANGED
@@ -1549,7 +1549,7 @@ function LoadingContainer(_a) {
1549
1549
  React.createElement(Container, { className: "loadingContainer-component-v2", sx: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%" } }, loader)));
1550
1550
  }
1551
1551
 
1552
- var css_248z$v = ".textfield-component-v2 {\n position: relative;\n}\n.textfield-component-v2.disabled {\n opacity: 0.65;\n pointer-events: none;\n}\n.textfield-component-v2 .MuiSvgIcon-root ~ .MuiFormControl-root .MuiInputBase-input {\n padding-left: 42px;\n}\n.textfield-component-v2 .MuiSvgIcon-root {\n position: absolute;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n\n.locationTextField-component-v2 {\n position: relative;\n}\n.locationTextField-component-v2 .autocomplete-dropdown-container {\n position: absolute;\n width: 100%;\n z-index: 10000;\n}\n\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-select {\n padding-right: 1.75rem !important;\n}\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-icon {\n display: inline-block;\n right: 0.5rem;\n}\n\n.react-international-phone-flag-emoji {\n width: 1.5rem;\n height: 1.5rem;\n}\n\n.colorTextField-component-v2 {\n position: relative;\n}\n.colorTextField-component-v2 .boxedColor {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n.colorTextField-component-v2 .boxedColor .MuiSvgIcon-root {\n width: unset;\n height: unset;\n}\n.colorTextField-component-v2 .boxedColor::after {\n position: absolute;\n width: 6px;\n height: 6px;\n content: \"\";\n background-color: var(--white, #FFFFFF);\n border-radius: 20px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.colorTextField-component-v2 .boxedColor ~ .textfield-component-v2 .MuiInputBase-input {\n padding-left: 44px;\n}\n.colorTextField-component-v2.bottom .react-colorful {\n top: 3.5rem;\n}\n.colorTextField-component-v2.top .react-colorful {\n bottom: 4rem;\n}\n.colorTextField-component-v2 .react-colorful {\n width: 100%;\n position: absolute;\n}";
1552
+ var css_248z$v = ".textfield-component-v2 {\n position: relative;\n}\n.textfield-component-v2.disabled {\n opacity: 0.65;\n pointer-events: none;\n}\n.textfield-component-v2 .MuiSvgIcon-root ~ .MuiFormControl-root .MuiInputBase-input {\n padding-left: 42px;\n}\n.textfield-component-v2 .MuiSvgIcon-root {\n position: absolute;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n z-index: 1;\n}\n\n.locationTextField-component-v2 {\n position: relative;\n}\n.locationTextField-component-v2 .autocomplete-dropdown-container {\n position: absolute;\n width: 100%;\n z-index: 10000;\n}\n\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-select {\n padding-right: 1.75rem !important;\n}\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-icon {\n display: inline-block;\n right: 0.5rem;\n}\n\n.react-international-phone-flag-emoji {\n width: 1.5rem;\n height: 1.5rem;\n}\n\n.colorTextField-component-v2 {\n position: relative;\n}\n.colorTextField-component-v2 .boxedColor {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n.colorTextField-component-v2 .boxedColor .MuiSvgIcon-root {\n width: unset;\n height: unset;\n}\n.colorTextField-component-v2 .boxedColor::after {\n position: absolute;\n width: 6px;\n height: 6px;\n content: \"\";\n background-color: var(--white, #FFFFFF);\n border-radius: 20px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.colorTextField-component-v2 .boxedColor ~ .textfield-component-v2 .MuiInputBase-input {\n padding-left: 44px;\n}\n.colorTextField-component-v2.bottom .react-colorful {\n top: 3.5rem;\n}\n.colorTextField-component-v2.top .react-colorful {\n bottom: 4rem;\n}\n.colorTextField-component-v2 .react-colorful {\n width: 100%;\n position: absolute;\n}";
1553
1553
  styleInject(css_248z$v);
1554
1554
 
1555
1555
  var TextField = React.forwardRef(function (_a, ref) {
@@ -2407,7 +2407,7 @@ function amIImpersonating(returnId) {
2407
2407
  if (returnId === true) {
2408
2408
  var latestImpersonation = impersonationTree[impersonationTree.length - 1];
2409
2409
  // Assuming impersonationTree contains either a string/number or is empty
2410
- return latestImpersonation !== undefined ? latestImpersonation : 0;
2410
+ return (latestImpersonation !== undefined ? latestImpersonation : 0);
2411
2411
  }
2412
2412
  return impersonationTree.length > 0;
2413
2413
  }
@@ -6673,7 +6673,7 @@ function getMuiSelect(theme) {
6673
6673
  if ((_c = ownerState.className) === null || _c === void 0 ? void 0 : _c.includes("small")) {
6674
6674
  styles = {
6675
6675
  ".MuiSelect-select": {
6676
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(2) + "!important" : theme.spacing(2, 3) + "!important",
6676
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(2) + "!important" : theme.spacing(2, 3.5) + "!important",
6677
6677
  ".MuiTypography-root": {
6678
6678
  fontSize: theme.typography.body1S.fontSize,
6679
6679
  lineHeight: theme.typography.body1S.lineHeight,
@@ -6685,7 +6685,7 @@ function getMuiSelect(theme) {
6685
6685
  else if ((_d = ownerState.className) === null || _d === void 0 ? void 0 : _d.includes("medium")) {
6686
6686
  styles = {
6687
6687
  ".MuiSelect-select": {
6688
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(3) + "!important" : theme.spacing(3, 4) + "!important",
6688
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(3) + "!important" : theme.spacing(3, 3.5) + "!important",
6689
6689
  ".MuiTypography-root": {
6690
6690
  fontSize: theme.typography.body1.fontSize,
6691
6691
  lineHeight: theme.typography.body1.lineHeight,
@@ -6696,7 +6696,7 @@ function getMuiSelect(theme) {
6696
6696
  else if ((_e = ownerState.className) === null || _e === void 0 ? void 0 : _e.includes("large")) {
6697
6697
  styles = {
6698
6698
  ".MuiSelect-select": {
6699
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(5) + "!important" : theme.spacing(5, 8) + "!important",
6699
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(5) + "!important" : theme.spacing(4, 3.5) + "!important",
6700
6700
  ".MuiTypography-root": {
6701
6701
  fontSize: theme.typography.body1L.fontSize,
6702
6702
  lineHeight: theme.typography.body1L.lineHeight,
@@ -7197,7 +7197,7 @@ function getMuiTextField(theme) {
7197
7197
  "&.MuiOutlinedInput-root": {},
7198
7198
  "&.MuiFilledInput-root": {},
7199
7199
  "&.MuiInput-root": {},
7200
- "input": __assign(__assign({}, theme.typography.body2L), { "&:not(:placeholder-shown)": {
7200
+ "input": __assign(__assign({}, theme.typography.body2L), { borderRadius: 8, padding: theme.spacing(4, 3.5), backgroundColor: theme.palette.common.white, "&:not(:placeholder-shown)": {
7201
7201
  color: theme.palette.primary.main
7202
7202
  } }),
7203
7203
  "fieldset": {
@@ -9850,6 +9850,100 @@ function loginService(_a) {
9850
9850
  });
9851
9851
  }
9852
9852
 
9853
+ function getAutomationStats(_a) {
9854
+ var options = __rest(_a, []);
9855
+ return callApi({
9856
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
9857
+ query: camelCase(options),
9858
+ fetchOptions: {
9859
+ method: exports.EMethods.get
9860
+ }
9861
+ });
9862
+ }
9863
+ function listAutomations(_a) {
9864
+ var options = __rest(_a, []);
9865
+ return callApi({
9866
+ url: uiKitConfig.GATEWAY_PROXY + "/automations",
9867
+ query: camelCase(options),
9868
+ fetchOptions: {
9869
+ method: exports.EMethods.get
9870
+ }
9871
+ });
9872
+ }
9873
+ function listWorkflows(_a) {
9874
+ var options = __rest(_a, []);
9875
+ return callApi({
9876
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows",
9877
+ query: camelCase(options),
9878
+ fetchOptions: {
9879
+ method: exports.EMethods.get
9880
+ }
9881
+ });
9882
+ }
9883
+ function deleteAutomation(_a) {
9884
+ var id = _a.id;
9885
+ return callApi({
9886
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9887
+ fetchOptions: {
9888
+ method: exports.EMethods.delete
9889
+ }
9890
+ });
9891
+ }
9892
+ function getAutomationExecutionsCount(_a) {
9893
+ var id = _a.id;
9894
+ return callApi({
9895
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id, "/actionExecutionsCount"),
9896
+ fetchOptions: {
9897
+ method: exports.EMethods.get
9898
+ }
9899
+ });
9900
+ }
9901
+ function updateAutomation(_a) {
9902
+ var id = _a.id, data = _a.data;
9903
+ return callApi({
9904
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9905
+ fetchOptions: {
9906
+ method: exports.EMethods.put,
9907
+ body: data
9908
+ }
9909
+ });
9910
+ }
9911
+ function deleteWorkflow(_a) {
9912
+ var id = _a.id, options = __rest(_a, ["id"]);
9913
+ return callApi({
9914
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9915
+ query: camelCase(options),
9916
+ fetchOptions: {
9917
+ method: exports.EMethods.delete
9918
+ }
9919
+ });
9920
+ }
9921
+ function updateWorkflow(_a) {
9922
+ var id = _a.id, data = _a.data, options = __rest(_a, ["id", "data"]);
9923
+ return callApi({
9924
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9925
+ query: camelCase(options),
9926
+ fetchOptions: {
9927
+ method: exports.EMethods.patch,
9928
+ body: data
9929
+ }
9930
+ });
9931
+ }
9932
+ function deleteAnyAutomation(_a) {
9933
+ var id = _a.id, v1 = _a.v1, options = __rest(_a, ["id", "v1"]);
9934
+ if (v1) {
9935
+ return deleteWorkflow(__assign({ id: id }, options));
9936
+ }
9937
+ return deleteAutomation({ id: id });
9938
+ }
9939
+ function updateAnyAutomation(_a) {
9940
+ var id = _a.id, data = _a.data, v1 = _a.v1, options = __rest(_a, ["id", "data", "v1"]);
9941
+ if (v1) {
9942
+ return updateWorkflow(__assign({ id: id, data: data }, options));
9943
+ }
9944
+ return updateAutomation({ id: id, data: data });
9945
+ }
9946
+
9853
9947
  function getBrand(_a) {
9854
9948
  var id = _a.id, _b = _a.compiled, compiled = _b === void 0 ? true : _b;
9855
9949
  return callApi({
@@ -16889,16 +16983,55 @@ var AccountsFactory = /** @class */ (function () {
16889
16983
  return AccountsFactory;
16890
16984
  }());
16891
16985
 
16892
- function getAutomationStats(_a) {
16893
- var options = __rest(_a, []);
16894
- return callApi({
16895
- url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
16896
- query: camelCase(options),
16897
- fetchOptions: {
16898
- method: exports.EMethods.get
16899
- }
16900
- });
16901
- }
16986
+ var AutomationModel = /** @class */ (function () {
16987
+ function AutomationModel(automation) {
16988
+ this.id = automation.id || 0;
16989
+ this.name = automation.name || "";
16990
+ this.description = automation.description || "";
16991
+ this.status = automation.status || "inactive";
16992
+ this.paused = automation.paused || false;
16993
+ this.created_on = automation.created_on || 0;
16994
+ this.updated_on = automation.updated_on || 0;
16995
+ this.committed_on = automation.committed_on || null;
16996
+ this.committed_revision = automation.committed_revision || null;
16997
+ this.editor_version = automation.editor_version || "";
16998
+ this.lineage = automation.lineage || [];
16999
+ this.list_id = automation.list_id || 0;
17000
+ this.v1 = automation.v1;
17001
+ this.trigger = automation.trigger || [];
17002
+ this.main = automation.main || { steps: [] };
17003
+ this.sub_automations = automation.sub_automations || [];
17004
+ }
17005
+ AutomationModel.prototype.toJson = function () {
17006
+ return modelToJson(this, ["id"]);
17007
+ };
17008
+ AutomationModel.prototype.set = function (property, value) {
17009
+ modelSet(this, property, value);
17010
+ };
17011
+ AutomationModel.prototype.save = function (automation, options) {
17012
+ return __awaiter(this, void 0, void 0, function () {
17013
+ var dataToUpdate;
17014
+ return __generator(this, function (_a) {
17015
+ dataToUpdate = automation || this.toJson();
17016
+ return [2 /*return*/, updateAnyAutomation(__assign({ id: this.id, data: dataToUpdate, v1: this.v1 }, options)).then(function (data) {
17017
+ trackEvent(exports.EEvents.AUTOMATION_UPDATED);
17018
+ return new AutomationModel(data.data);
17019
+ })];
17020
+ });
17021
+ });
17022
+ };
17023
+ AutomationModel.prototype.delete = function (options) {
17024
+ return __awaiter(this, void 0, void 0, function () {
17025
+ return __generator(this, function (_a) {
17026
+ return [2 /*return*/, deleteAnyAutomation(__assign({ id: this.id, v1: this.v1 }, options)).then(function (data) {
17027
+ trackEvent(exports.EEvents.AUTOMATION_DELETED);
17028
+ return data.data;
17029
+ })];
17030
+ });
17031
+ });
17032
+ };
17033
+ return AutomationModel;
17034
+ }());
16902
17035
 
16903
17036
  var AutomationsFactory = /** @class */ (function () {
16904
17037
  function AutomationsFactory() {
@@ -16911,6 +17044,22 @@ var AutomationsFactory = /** @class */ (function () {
16911
17044
  });
16912
17045
  });
16913
17046
  };
17047
+ AutomationsFactory.list = function (_a) {
17048
+ return __awaiter(this, void 0, void 0, function () {
17049
+ var options = __rest(_a, []);
17050
+ return __generator(this, function (_b) {
17051
+ return [2 /*return*/, listAutomations(__assign({}, options)).then(function (response) { return (__assign(__assign({}, response), { data: response.data.map(function (automation) { return new AutomationModel(automation); }) })); })];
17052
+ });
17053
+ });
17054
+ };
17055
+ AutomationsFactory.listWorkflows = function (_a) {
17056
+ return __awaiter(this, void 0, void 0, function () {
17057
+ var options = __rest(_a, []);
17058
+ return __generator(this, function (_b) {
17059
+ return [2 /*return*/, listWorkflows(__assign({}, options)).then(function (response) { return (__assign(__assign({}, response), { data: response.data.map(function (automation) { return new AutomationModel(automation); }) })); })];
17060
+ });
17061
+ });
17062
+ };
16914
17063
  return AutomationsFactory;
16915
17064
  }());
16916
17065
 
@@ -18664,6 +18813,7 @@ exports.AccountsFactory = AccountsFactory;
18664
18813
  exports.ActionBarContainer = ActionBarContainer;
18665
18814
  exports.ActionBarContainerHandler = ActionBarContainerHandler;
18666
18815
  exports.AssetManager = AssetManager;
18816
+ exports.AutomationModel = AutomationModel;
18667
18817
  exports.AutomationsFactory = AutomationsFactory;
18668
18818
  exports.Avatar = Avatar;
18669
18819
  exports.BillingFactory = BillingFactory;
@@ -18793,6 +18943,8 @@ exports.createPopup = createPopup;
18793
18943
  exports.createSuppressedEmailExport = createSuppressedEmailExport;
18794
18944
  exports.createTemplate = createTemplate;
18795
18945
  exports.deepMergeObject = deepMergeObject;
18946
+ exports.deleteAnyAutomation = deleteAnyAutomation;
18947
+ exports.deleteAutomation = deleteAutomation;
18796
18948
  exports.deleteCampaign = deleteCampaign;
18797
18949
  exports.deleteCampaignsReportsExport = deleteCampaignsReportsExport;
18798
18950
  exports.deleteForm = deleteForm;
@@ -18804,6 +18956,7 @@ exports.deleteSuppressedEmail = deleteSuppressedEmail;
18804
18956
  exports.deleteTaskService = deleteTaskService;
18805
18957
  exports.deleteTemplate = deleteTemplate;
18806
18958
  exports.deleteUser = deleteUser;
18959
+ exports.deleteWorkflow = deleteWorkflow;
18807
18960
  exports.descendingComparator = descendingComparator;
18808
18961
  exports.disableForm = disableForm;
18809
18962
  exports.disablePopup = disablePopup;
@@ -18829,6 +18982,8 @@ exports.formatNumber = formatNumber;
18829
18982
  exports.getAccount = getAccount;
18830
18983
  exports.getAccountReport = getAccountReport;
18831
18984
  exports.getAdjustedBillingCycle = getAdjustedBillingCycle;
18985
+ exports.getAutomationExecutionsCount = getAutomationExecutionsCount;
18986
+ exports.getAutomationStats = getAutomationStats;
18832
18987
  exports.getBeeTokenService = getBeeTokenService;
18833
18988
  exports.getBestLocalMatch = getBestLocalMatch;
18834
18989
  exports.getBrand = getBrand;
@@ -18886,6 +19041,7 @@ exports.isValidString = isValidString;
18886
19041
  exports.isValidUrl = isValidUrl;
18887
19042
  exports.lisTEmailTags = lisTEmailTags;
18888
19043
  exports.listAccounts = listAccounts;
19044
+ exports.listAutomations = listAutomations;
18889
19045
  exports.listCampaigns = listCampaigns;
18890
19046
  exports.listCampaignsReportsExports = listCampaignsReportsExports;
18891
19047
  exports.listContacts = listContacts;
@@ -18901,6 +19057,7 @@ exports.listSystemEmails = listSystemEmails;
18901
19057
  exports.listTasksService = listTasksService;
18902
19058
  exports.listTemplates = listTemplates;
18903
19059
  exports.listUsers = listUsers;
19060
+ exports.listWorkflows = listWorkflows;
18904
19061
  exports.logOutService = logOutService;
18905
19062
  exports.loginService = loginService;
18906
19063
  exports.miliToSecond = miliToSecond;
@@ -18945,11 +19102,14 @@ exports.unScheduleCampaign = unScheduleCampaign;
18945
19102
  exports.unshareTemplate = unshareTemplate;
18946
19103
  exports.updateAccount = updateAccount;
18947
19104
  exports.updateAndClearUrlParams = updateAndClearUrlParams;
19105
+ exports.updateAnyAutomation = updateAnyAutomation;
19106
+ exports.updateAutomation = updateAutomation;
18948
19107
  exports.updateCampaign = updateCampaign;
18949
19108
  exports.updatePopup = updatePopup;
18950
19109
  exports.updateSystemEmails = updateSystemEmails;
18951
19110
  exports.updateTemplate = updateTemplate;
18952
19111
  exports.updateUser = updateUser;
19112
+ exports.updateWorkflow = updateWorkflow;
18953
19113
  exports.validateColor = validateColor;
18954
19114
  exports.validateEmail = validateEmail;
18955
19115
  exports.validateGenericInput = validateGenericInput;
@@ -0,0 +1,51 @@
1
+ import { TAutomation } from "../../factories/automations/types";
2
+ import { TGenericListParams } from "../../types";
3
+ export declare class AutomationModel {
4
+ readonly id: number;
5
+ name: string;
6
+ description: string;
7
+ status: "active" | "inactive" | "deleted";
8
+ paused: boolean;
9
+ created_on: number;
10
+ updated_on: number;
11
+ committed_on: number | null;
12
+ committed_revision: string | null;
13
+ editor_version: string;
14
+ lineage: string[];
15
+ list_id: number;
16
+ v1?: boolean;
17
+ trigger: Array<{
18
+ name: string;
19
+ args: Record<string, any>;
20
+ }>;
21
+ main: {
22
+ steps: Array<{
23
+ name: string;
24
+ action: string;
25
+ args: Record<string, any>;
26
+ description?: string;
27
+ pausable?: boolean;
28
+ next?: string;
29
+ }>;
30
+ };
31
+ sub_automations: Array<{
32
+ name: string;
33
+ params: string[];
34
+ steps: Array<{
35
+ name: string;
36
+ action: string;
37
+ args: Record<string, any>;
38
+ description?: string;
39
+ pausable?: boolean;
40
+ next?: string;
41
+ }>;
42
+ }>;
43
+ constructor(automation: Partial<TAutomation> & {
44
+ v1?: boolean;
45
+ });
46
+ toJson(): any;
47
+ 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>;
50
+ }
51
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export {};
@@ -11,3 +11,4 @@ export * from "./systemEmails";
11
11
  export * from "./tasks";
12
12
  export * from "./templates";
13
13
  export * from "./user";
14
+ export * from "./automation";
@@ -1,7 +1,31 @@
1
- import { TAutomationStatsParam } from "../../factories/automations/types";
1
+ import { TAutomationStatsParam, TAutomation } from "../../factories/automations/types";
2
2
  import { TGenericListParams } from "../../types";
3
3
  export declare function getAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
4
- export declare function list({ ...options }: TGenericListParams): Promise<any>;
4
+ export declare function listAutomations({ ...options }: TGenericListParams): Promise<any>;
5
+ export declare function listWorkflows({ ...options }: TGenericListParams): Promise<any>;
6
+ export declare function deleteAutomation({ id }: {
7
+ id: number;
8
+ }): Promise<any>;
5
9
  export declare function getAutomationExecutionsCount({ id }: {
6
10
  id: string;
7
11
  }): Promise<any>;
12
+ export declare function updateAutomation({ id, data }: {
13
+ id: number;
14
+ data: Partial<TAutomation>;
15
+ }): Promise<any>;
16
+ export declare function deleteWorkflow({ id, ...options }: {
17
+ id: number;
18
+ } & TGenericListParams): Promise<any>;
19
+ export declare function updateWorkflow({ id, data, ...options }: {
20
+ id: number;
21
+ data: Partial<TAutomation>;
22
+ } & TGenericListParams): Promise<any>;
23
+ export declare function deleteAnyAutomation({ id, v1, ...options }: {
24
+ id: number;
25
+ v1?: boolean;
26
+ } & TGenericListParams): Promise<any>;
27
+ export declare function updateAnyAutomation({ id, data, v1, ...options }: {
28
+ id: number;
29
+ data: Partial<TAutomation>;
30
+ v1?: boolean;
31
+ } & TGenericListParams): Promise<any>;
@@ -1,5 +1,6 @@
1
1
  export * from "./accounts";
2
2
  export * from "./auth";
3
+ export * from "./automations";
3
4
  export * from "./billing";
4
5
  export * from "./brands";
5
6
  export * from "./campaigns";
@@ -848,6 +848,9 @@ export default function getMuiTextField(theme: Theme): {
848
848
  "&.MuiFilledInput-root": {};
849
849
  "&.MuiInput-root": {};
850
850
  input: {
851
+ borderRadius: number;
852
+ padding: string;
853
+ backgroundColor: string;
851
854
  "&:not(:placeholder-shown)": {
852
855
  color: string;
853
856
  };
@@ -875,7 +878,6 @@ export default function getMuiTextField(theme: Theme): {
875
878
  backgroundAttachment?: import("csstype").Property.BackgroundAttachment | undefined;
876
879
  backgroundBlendMode?: import("csstype").Property.BackgroundBlendMode | undefined;
877
880
  backgroundClip?: import("csstype").Property.BackgroundClip | undefined;
878
- backgroundColor?: import("csstype").Property.BackgroundColor | undefined;
879
881
  backgroundImage?: import("csstype").Property.BackgroundImage | undefined;
880
882
  backgroundOrigin?: import("csstype").Property.BackgroundOrigin | undefined;
881
883
  backgroundPositionX?: import("csstype").Property.BackgroundPositionX<string | number> | undefined;
@@ -1242,7 +1244,6 @@ export default function getMuiTextField(theme: Theme): {
1242
1244
  borderInlineEnd?: import("csstype").Property.BorderInlineEnd<string | number> | undefined;
1243
1245
  borderInlineStart?: import("csstype").Property.BorderInlineStart<string | number> | undefined;
1244
1246
  borderLeft?: import("csstype").Property.BorderLeft<string | number> | undefined;
1245
- borderRadius?: import("csstype").Property.BorderRadius<string | number> | undefined;
1246
1247
  borderRight?: import("csstype").Property.BorderRight<string | number> | undefined;
1247
1248
  borderStyle?: import("csstype").Property.BorderStyle | undefined;
1248
1249
  borderTop?: import("csstype").Property.BorderTop<string | number> | undefined;
@@ -1276,7 +1277,6 @@ export default function getMuiTextField(theme: Theme): {
1276
1277
  outline?: import("csstype").Property.Outline<string | number> | undefined;
1277
1278
  overflow?: import("csstype").Property.Overflow | undefined;
1278
1279
  overscrollBehavior?: import("csstype").Property.OverscrollBehavior | undefined;
1279
- padding?: import("csstype").Property.Padding<string | number> | undefined;
1280
1280
  paddingBlock?: import("csstype").Property.PaddingBlock<string | number> | undefined;
1281
1281
  paddingInline?: import("csstype").Property.PaddingInline<string | number> | undefined;
1282
1282
  placeContent?: import("csstype").Property.PlaceContent | undefined;
@@ -1,5 +1,9 @@
1
+ import { TGenericListParams, TGenericListReturn } from "../../types/services";
1
2
  import { TAutomationStats, TAutomationStatsParam } from "./types";
3
+ import { AutomationModel } from "../../models/automation";
2
4
  export declare class AutomationsFactory {
3
5
  static getAutomationStats({ ...options }: TAutomationStatsParam): Promise<TAutomationStats>;
6
+ static list({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
7
+ static listWorkflows({ ...options }: TGenericListParams): Promise<TGenericListReturn<AutomationModel>>;
4
8
  }
5
9
  export * from "./types";
@@ -9,3 +9,49 @@ export type TAutomationStatsParam = {
9
9
  actionType?: string;
10
10
  accountId: number;
11
11
  };
12
+ export type TAutomationTrigger = {
13
+ name: string;
14
+ args: Record<string, any>;
15
+ };
16
+ export type TAutomationStep = {
17
+ name: string;
18
+ action: string;
19
+ args: Record<string, any>;
20
+ description?: string;
21
+ pausable?: boolean;
22
+ next?: string;
23
+ };
24
+ export type TAutomationCondition = {
25
+ eq?: {
26
+ var: string;
27
+ value: any;
28
+ };
29
+ or?: TAutomationCondition[];
30
+ and?: TAutomationCondition[];
31
+ not?: TAutomationCondition;
32
+ };
33
+ export type TAutomationMain = {
34
+ steps: TAutomationStep[];
35
+ };
36
+ export type TAutomationSubAutomation = {
37
+ name: string;
38
+ params: string[];
39
+ steps: TAutomationStep[];
40
+ };
41
+ export type TAutomation = {
42
+ id: number;
43
+ name: string;
44
+ description: string;
45
+ status: "active" | "inactive" | "deleted";
46
+ paused: boolean;
47
+ created_on: number;
48
+ updated_on: number;
49
+ committed_on: number | null;
50
+ committed_revision: string | null;
51
+ editor_version: string;
52
+ lineage: string[];
53
+ list_id: number;
54
+ trigger: TAutomationTrigger[];
55
+ main: TAutomationMain;
56
+ sub_automations: TAutomationSubAutomation[];
57
+ };
package/dist/esm/index.js CHANGED
@@ -1529,7 +1529,7 @@ function LoadingContainer(_a) {
1529
1529
  React__default.createElement(Container, { className: "loadingContainer-component-v2", sx: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%" } }, loader)));
1530
1530
  }
1531
1531
 
1532
- var css_248z$v = ".textfield-component-v2 {\n position: relative;\n}\n.textfield-component-v2.disabled {\n opacity: 0.65;\n pointer-events: none;\n}\n.textfield-component-v2 .MuiSvgIcon-root ~ .MuiFormControl-root .MuiInputBase-input {\n padding-left: 42px;\n}\n.textfield-component-v2 .MuiSvgIcon-root {\n position: absolute;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n\n.locationTextField-component-v2 {\n position: relative;\n}\n.locationTextField-component-v2 .autocomplete-dropdown-container {\n position: absolute;\n width: 100%;\n z-index: 10000;\n}\n\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-select {\n padding-right: 1.75rem !important;\n}\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-icon {\n display: inline-block;\n right: 0.5rem;\n}\n\n.react-international-phone-flag-emoji {\n width: 1.5rem;\n height: 1.5rem;\n}\n\n.colorTextField-component-v2 {\n position: relative;\n}\n.colorTextField-component-v2 .boxedColor {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n.colorTextField-component-v2 .boxedColor .MuiSvgIcon-root {\n width: unset;\n height: unset;\n}\n.colorTextField-component-v2 .boxedColor::after {\n position: absolute;\n width: 6px;\n height: 6px;\n content: \"\";\n background-color: var(--white, #FFFFFF);\n border-radius: 20px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.colorTextField-component-v2 .boxedColor ~ .textfield-component-v2 .MuiInputBase-input {\n padding-left: 44px;\n}\n.colorTextField-component-v2.bottom .react-colorful {\n top: 3.5rem;\n}\n.colorTextField-component-v2.top .react-colorful {\n bottom: 4rem;\n}\n.colorTextField-component-v2 .react-colorful {\n width: 100%;\n position: absolute;\n}";
1532
+ var css_248z$v = ".textfield-component-v2 {\n position: relative;\n}\n.textfield-component-v2.disabled {\n opacity: 0.65;\n pointer-events: none;\n}\n.textfield-component-v2 .MuiSvgIcon-root ~ .MuiFormControl-root .MuiInputBase-input {\n padding-left: 42px;\n}\n.textfield-component-v2 .MuiSvgIcon-root {\n position: absolute;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n z-index: 1;\n}\n\n.locationTextField-component-v2 {\n position: relative;\n}\n.locationTextField-component-v2 .autocomplete-dropdown-container {\n position: absolute;\n width: 100%;\n z-index: 10000;\n}\n\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-select {\n padding-right: 1.75rem !important;\n}\n.phoneTextField-component-v2 .MuiInputAdornment-root .MuiSelect-icon {\n display: inline-block;\n right: 0.5rem;\n}\n\n.react-international-phone-flag-emoji {\n width: 1.5rem;\n height: 1.5rem;\n}\n\n.colorTextField-component-v2 {\n position: relative;\n}\n.colorTextField-component-v2 .boxedColor {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n left: 1rem;\n top: 1.75rem;\n transform: translateY(-50%);\n}\n.colorTextField-component-v2 .boxedColor .MuiSvgIcon-root {\n width: unset;\n height: unset;\n}\n.colorTextField-component-v2 .boxedColor::after {\n position: absolute;\n width: 6px;\n height: 6px;\n content: \"\";\n background-color: var(--white, #FFFFFF);\n border-radius: 20px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.colorTextField-component-v2 .boxedColor ~ .textfield-component-v2 .MuiInputBase-input {\n padding-left: 44px;\n}\n.colorTextField-component-v2.bottom .react-colorful {\n top: 3.5rem;\n}\n.colorTextField-component-v2.top .react-colorful {\n bottom: 4rem;\n}\n.colorTextField-component-v2 .react-colorful {\n width: 100%;\n position: absolute;\n}";
1533
1533
  styleInject(css_248z$v);
1534
1534
 
1535
1535
  var TextField = forwardRef(function (_a, ref) {
@@ -2387,7 +2387,7 @@ function amIImpersonating(returnId) {
2387
2387
  if (returnId === true) {
2388
2388
  var latestImpersonation = impersonationTree[impersonationTree.length - 1];
2389
2389
  // Assuming impersonationTree contains either a string/number or is empty
2390
- return latestImpersonation !== undefined ? latestImpersonation : 0;
2390
+ return (latestImpersonation !== undefined ? latestImpersonation : 0);
2391
2391
  }
2392
2392
  return impersonationTree.length > 0;
2393
2393
  }
@@ -6653,7 +6653,7 @@ function getMuiSelect(theme) {
6653
6653
  if ((_c = ownerState.className) === null || _c === void 0 ? void 0 : _c.includes("small")) {
6654
6654
  styles = {
6655
6655
  ".MuiSelect-select": {
6656
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(2) + "!important" : theme.spacing(2, 3) + "!important",
6656
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(2) + "!important" : theme.spacing(2, 3.5) + "!important",
6657
6657
  ".MuiTypography-root": {
6658
6658
  fontSize: theme.typography.body1S.fontSize,
6659
6659
  lineHeight: theme.typography.body1S.lineHeight,
@@ -6665,7 +6665,7 @@ function getMuiSelect(theme) {
6665
6665
  else if ((_d = ownerState.className) === null || _d === void 0 ? void 0 : _d.includes("medium")) {
6666
6666
  styles = {
6667
6667
  ".MuiSelect-select": {
6668
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(3) + "!important" : theme.spacing(3, 4) + "!important",
6668
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(3) + "!important" : theme.spacing(3, 3.5) + "!important",
6669
6669
  ".MuiTypography-root": {
6670
6670
  fontSize: theme.typography.body1.fontSize,
6671
6671
  lineHeight: theme.typography.body1.lineHeight,
@@ -6676,7 +6676,7 @@ function getMuiSelect(theme) {
6676
6676
  else if ((_e = ownerState.className) === null || _e === void 0 ? void 0 : _e.includes("large")) {
6677
6677
  styles = {
6678
6678
  ".MuiSelect-select": {
6679
- padding: ownerState.className.includes("iconOnly") ? theme.spacing(5) + "!important" : theme.spacing(5, 8) + "!important",
6679
+ padding: ownerState.className.includes("iconOnly") ? theme.spacing(5) + "!important" : theme.spacing(4, 3.5) + "!important",
6680
6680
  ".MuiTypography-root": {
6681
6681
  fontSize: theme.typography.body1L.fontSize,
6682
6682
  lineHeight: theme.typography.body1L.lineHeight,
@@ -7177,7 +7177,7 @@ function getMuiTextField(theme) {
7177
7177
  "&.MuiOutlinedInput-root": {},
7178
7178
  "&.MuiFilledInput-root": {},
7179
7179
  "&.MuiInput-root": {},
7180
- "input": __assign(__assign({}, theme.typography.body2L), { "&:not(:placeholder-shown)": {
7180
+ "input": __assign(__assign({}, theme.typography.body2L), { borderRadius: 8, padding: theme.spacing(4, 3.5), backgroundColor: theme.palette.common.white, "&:not(:placeholder-shown)": {
7181
7181
  color: theme.palette.primary.main
7182
7182
  } }),
7183
7183
  "fieldset": {
@@ -9830,6 +9830,100 @@ function loginService(_a) {
9830
9830
  });
9831
9831
  }
9832
9832
 
9833
+ function getAutomationStats(_a) {
9834
+ var options = __rest(_a, []);
9835
+ return callApi({
9836
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
9837
+ query: camelCase(options),
9838
+ fetchOptions: {
9839
+ method: EMethods.get
9840
+ }
9841
+ });
9842
+ }
9843
+ function listAutomations(_a) {
9844
+ var options = __rest(_a, []);
9845
+ return callApi({
9846
+ url: uiKitConfig.GATEWAY_PROXY + "/automations",
9847
+ query: camelCase(options),
9848
+ fetchOptions: {
9849
+ method: EMethods.get
9850
+ }
9851
+ });
9852
+ }
9853
+ function listWorkflows(_a) {
9854
+ var options = __rest(_a, []);
9855
+ return callApi({
9856
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows",
9857
+ query: camelCase(options),
9858
+ fetchOptions: {
9859
+ method: EMethods.get
9860
+ }
9861
+ });
9862
+ }
9863
+ function deleteAutomation(_a) {
9864
+ var id = _a.id;
9865
+ return callApi({
9866
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9867
+ fetchOptions: {
9868
+ method: EMethods.delete
9869
+ }
9870
+ });
9871
+ }
9872
+ function getAutomationExecutionsCount(_a) {
9873
+ var id = _a.id;
9874
+ return callApi({
9875
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id, "/actionExecutionsCount"),
9876
+ fetchOptions: {
9877
+ method: EMethods.get
9878
+ }
9879
+ });
9880
+ }
9881
+ function updateAutomation(_a) {
9882
+ var id = _a.id, data = _a.data;
9883
+ return callApi({
9884
+ url: uiKitConfig.GATEWAY_PROXY + "/automations/".concat(id),
9885
+ fetchOptions: {
9886
+ method: EMethods.put,
9887
+ body: data
9888
+ }
9889
+ });
9890
+ }
9891
+ function deleteWorkflow(_a) {
9892
+ var id = _a.id, options = __rest(_a, ["id"]);
9893
+ return callApi({
9894
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9895
+ query: camelCase(options),
9896
+ fetchOptions: {
9897
+ method: EMethods.delete
9898
+ }
9899
+ });
9900
+ }
9901
+ function updateWorkflow(_a) {
9902
+ var id = _a.id, data = _a.data, options = __rest(_a, ["id", "data"]);
9903
+ return callApi({
9904
+ url: uiKitConfig.GATEWAY_PROXY + "/workflows/".concat(id),
9905
+ query: camelCase(options),
9906
+ fetchOptions: {
9907
+ method: EMethods.patch,
9908
+ body: data
9909
+ }
9910
+ });
9911
+ }
9912
+ function deleteAnyAutomation(_a) {
9913
+ var id = _a.id, v1 = _a.v1, options = __rest(_a, ["id", "v1"]);
9914
+ if (v1) {
9915
+ return deleteWorkflow(__assign({ id: id }, options));
9916
+ }
9917
+ return deleteAutomation({ id: id });
9918
+ }
9919
+ function updateAnyAutomation(_a) {
9920
+ var id = _a.id, data = _a.data, v1 = _a.v1, options = __rest(_a, ["id", "data", "v1"]);
9921
+ if (v1) {
9922
+ return updateWorkflow(__assign({ id: id, data: data }, options));
9923
+ }
9924
+ return updateAutomation({ id: id, data: data });
9925
+ }
9926
+
9833
9927
  function getBrand(_a) {
9834
9928
  var id = _a.id, _b = _a.compiled, compiled = _b === void 0 ? true : _b;
9835
9929
  return callApi({
@@ -16869,16 +16963,55 @@ var AccountsFactory = /** @class */ (function () {
16869
16963
  return AccountsFactory;
16870
16964
  }());
16871
16965
 
16872
- function getAutomationStats(_a) {
16873
- var options = __rest(_a, []);
16874
- return callApi({
16875
- url: uiKitConfig.GATEWAY_PROXY + "/automations/generalStats/" + options.accountId,
16876
- query: camelCase(options),
16877
- fetchOptions: {
16878
- method: EMethods.get
16879
- }
16880
- });
16881
- }
16966
+ var AutomationModel = /** @class */ (function () {
16967
+ function AutomationModel(automation) {
16968
+ this.id = automation.id || 0;
16969
+ this.name = automation.name || "";
16970
+ this.description = automation.description || "";
16971
+ this.status = automation.status || "inactive";
16972
+ this.paused = automation.paused || false;
16973
+ this.created_on = automation.created_on || 0;
16974
+ this.updated_on = automation.updated_on || 0;
16975
+ this.committed_on = automation.committed_on || null;
16976
+ this.committed_revision = automation.committed_revision || null;
16977
+ this.editor_version = automation.editor_version || "";
16978
+ this.lineage = automation.lineage || [];
16979
+ this.list_id = automation.list_id || 0;
16980
+ this.v1 = automation.v1;
16981
+ this.trigger = automation.trigger || [];
16982
+ this.main = automation.main || { steps: [] };
16983
+ this.sub_automations = automation.sub_automations || [];
16984
+ }
16985
+ AutomationModel.prototype.toJson = function () {
16986
+ return modelToJson(this, ["id"]);
16987
+ };
16988
+ AutomationModel.prototype.set = function (property, value) {
16989
+ modelSet(this, property, value);
16990
+ };
16991
+ AutomationModel.prototype.save = function (automation, options) {
16992
+ return __awaiter(this, void 0, void 0, function () {
16993
+ var dataToUpdate;
16994
+ return __generator(this, function (_a) {
16995
+ dataToUpdate = automation || this.toJson();
16996
+ return [2 /*return*/, updateAnyAutomation(__assign({ id: this.id, data: dataToUpdate, v1: this.v1 }, options)).then(function (data) {
16997
+ trackEvent(EEvents.AUTOMATION_UPDATED);
16998
+ return new AutomationModel(data.data);
16999
+ })];
17000
+ });
17001
+ });
17002
+ };
17003
+ AutomationModel.prototype.delete = function (options) {
17004
+ return __awaiter(this, void 0, void 0, function () {
17005
+ return __generator(this, function (_a) {
17006
+ return [2 /*return*/, deleteAnyAutomation(__assign({ id: this.id, v1: this.v1 }, options)).then(function (data) {
17007
+ trackEvent(EEvents.AUTOMATION_DELETED);
17008
+ return data.data;
17009
+ })];
17010
+ });
17011
+ });
17012
+ };
17013
+ return AutomationModel;
17014
+ }());
16882
17015
 
16883
17016
  var AutomationsFactory = /** @class */ (function () {
16884
17017
  function AutomationsFactory() {
@@ -16891,6 +17024,22 @@ var AutomationsFactory = /** @class */ (function () {
16891
17024
  });
16892
17025
  });
16893
17026
  };
17027
+ AutomationsFactory.list = function (_a) {
17028
+ return __awaiter(this, void 0, void 0, function () {
17029
+ var options = __rest(_a, []);
17030
+ return __generator(this, function (_b) {
17031
+ return [2 /*return*/, listAutomations(__assign({}, options)).then(function (response) { return (__assign(__assign({}, response), { data: response.data.map(function (automation) { return new AutomationModel(automation); }) })); })];
17032
+ });
17033
+ });
17034
+ };
17035
+ AutomationsFactory.listWorkflows = function (_a) {
17036
+ return __awaiter(this, void 0, void 0, function () {
17037
+ var options = __rest(_a, []);
17038
+ return __generator(this, function (_b) {
17039
+ return [2 /*return*/, listWorkflows(__assign({}, options)).then(function (response) { return (__assign(__assign({}, response), { data: response.data.map(function (automation) { return new AutomationModel(automation); }) })); })];
17040
+ });
17041
+ });
17042
+ };
16894
17043
  return AutomationsFactory;
16895
17044
  }());
16896
17045
 
@@ -18639,4 +18788,4 @@ var UsersFactory = /** @class */ (function () {
18639
18788
  return UsersFactory;
18640
18789
  }());
18641
18790
 
18642
- export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, CopyToClipboard, 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, 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, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createPopup, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deletePopup, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, 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, 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, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listPopups, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, 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, updateCampaign, updatePopup, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
18791
+ 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, CopyToClipboard, 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, 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, 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 };
@@ -0,0 +1,51 @@
1
+ import { TAutomation } from "../../factories/automations/types";
2
+ import { TGenericListParams } from "../../types";
3
+ export declare class AutomationModel {
4
+ readonly id: number;
5
+ name: string;
6
+ description: string;
7
+ status: "active" | "inactive" | "deleted";
8
+ paused: boolean;
9
+ created_on: number;
10
+ updated_on: number;
11
+ committed_on: number | null;
12
+ committed_revision: string | null;
13
+ editor_version: string;
14
+ lineage: string[];
15
+ list_id: number;
16
+ v1?: boolean;
17
+ trigger: Array<{
18
+ name: string;
19
+ args: Record<string, any>;
20
+ }>;
21
+ main: {
22
+ steps: Array<{
23
+ name: string;
24
+ action: string;
25
+ args: Record<string, any>;
26
+ description?: string;
27
+ pausable?: boolean;
28
+ next?: string;
29
+ }>;
30
+ };
31
+ sub_automations: Array<{
32
+ name: string;
33
+ params: string[];
34
+ steps: Array<{
35
+ name: string;
36
+ action: string;
37
+ args: Record<string, any>;
38
+ description?: string;
39
+ pausable?: boolean;
40
+ next?: string;
41
+ }>;
42
+ }>;
43
+ constructor(automation: Partial<TAutomation> & {
44
+ v1?: boolean;
45
+ });
46
+ toJson(): any;
47
+ 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>;
50
+ }
51
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export {};
@@ -11,3 +11,4 @@ export * from "./systemEmails";
11
11
  export * from "./tasks";
12
12
  export * from "./templates";
13
13
  export * from "./user";
14
+ export * from "./automation";
@@ -1,7 +1,31 @@
1
- import { TAutomationStatsParam } from "../../factories/automations/types";
1
+ import { TAutomationStatsParam, TAutomation } from "../../factories/automations/types";
2
2
  import { TGenericListParams } from "../../types";
3
3
  export declare function getAutomationStats({ ...options }: TAutomationStatsParam): Promise<any>;
4
- export declare function list({ ...options }: TGenericListParams): Promise<any>;
4
+ export declare function listAutomations({ ...options }: TGenericListParams): Promise<any>;
5
+ export declare function listWorkflows({ ...options }: TGenericListParams): Promise<any>;
6
+ export declare function deleteAutomation({ id }: {
7
+ id: number;
8
+ }): Promise<any>;
5
9
  export declare function getAutomationExecutionsCount({ id }: {
6
10
  id: string;
7
11
  }): Promise<any>;
12
+ export declare function updateAutomation({ id, data }: {
13
+ id: number;
14
+ data: Partial<TAutomation>;
15
+ }): Promise<any>;
16
+ export declare function deleteWorkflow({ id, ...options }: {
17
+ id: number;
18
+ } & TGenericListParams): Promise<any>;
19
+ export declare function updateWorkflow({ id, data, ...options }: {
20
+ id: number;
21
+ data: Partial<TAutomation>;
22
+ } & TGenericListParams): Promise<any>;
23
+ export declare function deleteAnyAutomation({ id, v1, ...options }: {
24
+ id: number;
25
+ v1?: boolean;
26
+ } & TGenericListParams): Promise<any>;
27
+ export declare function updateAnyAutomation({ id, data, v1, ...options }: {
28
+ id: number;
29
+ data: Partial<TAutomation>;
30
+ v1?: boolean;
31
+ } & TGenericListParams): Promise<any>;
@@ -1,5 +1,6 @@
1
1
  export * from "./accounts";
2
2
  export * from "./auth";
3
+ export * from "./automations";
3
4
  export * from "./billing";
4
5
  export * from "./brands";
5
6
  export * from "./campaigns";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.66",
3
+ "version": "2.1.68",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -11,6 +11,7 @@
11
11
  "scripts": {
12
12
  "prepublishOnly": "npm run build",
13
13
  "build": "rollup -c --bundleConfigAsCjs",
14
+ "dev": "rollup -c --bundleConfigAsCjs --watch",
14
15
  "test": "jest",
15
16
  "storybook": "storybook dev -p 6006",
16
17
  "build-storybook": "storybook build"