@cakemail-org/ui-components-v2 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factories/automations/index.d.ts +3 -0
- package/dist/cjs/index.js +72 -14
- package/dist/cjs/models/automation/index.d.ts +8 -3
- package/dist/cjs/models/automation/types.d.ts +21 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/services/automations/index.d.ts +19 -9
- package/dist/esm/factories/automations/index.d.ts +3 -0
- package/dist/esm/index.js +70 -15
- package/dist/esm/models/automation/index.d.ts +8 -3
- package/dist/esm/models/automation/types.d.ts +21 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/services/automations/index.d.ts +19 -9
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
9994
|
+
var id = _a.id, v1 = _a.v1;
|
|
9969
9995
|
if (v1) {
|
|
9970
|
-
return deleteWorkflow(
|
|
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
|
|
10001
|
+
var id = _a.id, data = _a.data, v1 = _a.v1;
|
|
9976
10002
|
if (v1) {
|
|
9977
|
-
return updateWorkflow(
|
|
10003
|
+
return updateWorkflow({ id: id, data: data });
|
|
9978
10004
|
}
|
|
9979
10005
|
return updateAutomation({ id: id, data: data });
|
|
9980
10006
|
}
|
|
@@ -17044,39 +17070,68 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17044
17070
|
AutomationModel.prototype.set = function (property, value) {
|
|
17045
17071
|
modelSet(this, property, value);
|
|
17046
17072
|
};
|
|
17047
|
-
AutomationModel.prototype.save = function (automation
|
|
17073
|
+
AutomationModel.prototype.save = function (automation) {
|
|
17048
17074
|
return __awaiter(this, void 0, void 0, function () {
|
|
17049
17075
|
var dataToUpdate;
|
|
17050
17076
|
return __generator(this, function (_a) {
|
|
17051
17077
|
dataToUpdate = automation || this.toJson();
|
|
17052
|
-
return [2 /*return*/, updateAnyAutomation(
|
|
17078
|
+
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
|
|
17053
17079
|
trackEvent(exports.EEvents.AUTOMATION_UPDATED);
|
|
17054
17080
|
return new AutomationModel(data.data);
|
|
17055
17081
|
})];
|
|
17056
17082
|
});
|
|
17057
17083
|
});
|
|
17058
17084
|
};
|
|
17059
|
-
AutomationModel.prototype.delete = function (
|
|
17085
|
+
AutomationModel.prototype.delete = function () {
|
|
17060
17086
|
return __awaiter(this, void 0, void 0, function () {
|
|
17061
17087
|
return __generator(this, function (_a) {
|
|
17062
|
-
return [2 /*return*/, deleteAnyAutomation(
|
|
17088
|
+
return [2 /*return*/, deleteAnyAutomation({ id: this.id, v1: this.v1 }).then(function (data) {
|
|
17063
17089
|
trackEvent(exports.EEvents.AUTOMATION_DELETED);
|
|
17064
17090
|
return data.data;
|
|
17065
17091
|
})];
|
|
17066
17092
|
});
|
|
17067
17093
|
});
|
|
17068
17094
|
};
|
|
17095
|
+
AutomationModel.prototype.getStats = function (_a) {
|
|
17096
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
17097
|
+
var path = _b.path;
|
|
17098
|
+
return __generator(this, function (_c) {
|
|
17099
|
+
return [2 /*return*/, getAutomationStats({ id: this.id, path: path }).then(function (data) {
|
|
17100
|
+
return data.data;
|
|
17101
|
+
})];
|
|
17102
|
+
});
|
|
17103
|
+
});
|
|
17104
|
+
};
|
|
17105
|
+
AutomationModel.getContent = function (contentId) {
|
|
17106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17107
|
+
return __generator(this, function (_a) {
|
|
17108
|
+
return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
|
|
17109
|
+
return data.data;
|
|
17110
|
+
})];
|
|
17111
|
+
});
|
|
17112
|
+
});
|
|
17113
|
+
};
|
|
17069
17114
|
return AutomationModel;
|
|
17070
17115
|
}());
|
|
17071
17116
|
|
|
17072
17117
|
var AutomationsFactory = /** @class */ (function () {
|
|
17073
17118
|
function AutomationsFactory() {
|
|
17074
17119
|
}
|
|
17120
|
+
AutomationsFactory.get = function (_a) {
|
|
17121
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
17122
|
+
var id = _b.id;
|
|
17123
|
+
return __generator(this, function (_c) {
|
|
17124
|
+
return [2 /*return*/, getAutomation({ id: id }).then(function (data) {
|
|
17125
|
+
return new AutomationModel(data.data);
|
|
17126
|
+
})];
|
|
17127
|
+
});
|
|
17128
|
+
});
|
|
17129
|
+
};
|
|
17075
17130
|
AutomationsFactory.getAutomationStats = function (_a) {
|
|
17076
17131
|
return __awaiter(this, void 0, void 0, function () {
|
|
17077
17132
|
var options = __rest(_a, []);
|
|
17078
17133
|
return __generator(this, function (_b) {
|
|
17079
|
-
return [2 /*return*/,
|
|
17134
|
+
return [2 /*return*/, getAllAutomationStats(__assign({}, options))];
|
|
17080
17135
|
});
|
|
17081
17136
|
});
|
|
17082
17137
|
};
|
|
@@ -19027,6 +19082,9 @@ exports.formatNumber = formatNumber;
|
|
|
19027
19082
|
exports.getAccount = getAccount;
|
|
19028
19083
|
exports.getAccountReport = getAccountReport;
|
|
19029
19084
|
exports.getAdjustedBillingCycle = getAdjustedBillingCycle;
|
|
19085
|
+
exports.getAllAutomationStats = getAllAutomationStats;
|
|
19086
|
+
exports.getAutomation = getAutomation;
|
|
19087
|
+
exports.getAutomationEmailContent = getAutomationEmailContent;
|
|
19030
19088
|
exports.getAutomationExecutionsCount = getAutomationExecutionsCount;
|
|
19031
19089
|
exports.getAutomationStats = getAutomationStats;
|
|
19032
19090
|
exports.getBeeTokenService = getBeeTokenService;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TAutomation } from "../../factories/automations/types";
|
|
2
|
-
import {
|
|
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
|
|
49
|
-
delete(
|
|
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
|
|
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
|
|
19
|
+
export declare function deleteWorkflow({ id }: {
|
|
17
20
|
id: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function updateWorkflow({ id, data
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
export declare function updateWorkflow({ id, data }: {
|
|
20
23
|
id: number;
|
|
21
24
|
data: Partial<TAutomation>;
|
|
22
|
-
}
|
|
23
|
-
export declare function
|
|
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
|
-
}
|
|
27
|
-
export declare function updateAnyAutomation({ id, data, v1
|
|
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
|
-
}
|
|
41
|
+
}): Promise<any>;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
9974
|
+
var id = _a.id, v1 = _a.v1;
|
|
9949
9975
|
if (v1) {
|
|
9950
|
-
return deleteWorkflow(
|
|
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
|
|
9981
|
+
var id = _a.id, data = _a.data, v1 = _a.v1;
|
|
9956
9982
|
if (v1) {
|
|
9957
|
-
return updateWorkflow(
|
|
9983
|
+
return updateWorkflow({ id: id, data: data });
|
|
9958
9984
|
}
|
|
9959
9985
|
return updateAutomation({ id: id, data: data });
|
|
9960
9986
|
}
|
|
@@ -17024,39 +17050,68 @@ var AutomationModel = /** @class */ (function () {
|
|
|
17024
17050
|
AutomationModel.prototype.set = function (property, value) {
|
|
17025
17051
|
modelSet(this, property, value);
|
|
17026
17052
|
};
|
|
17027
|
-
AutomationModel.prototype.save = function (automation
|
|
17053
|
+
AutomationModel.prototype.save = function (automation) {
|
|
17028
17054
|
return __awaiter(this, void 0, void 0, function () {
|
|
17029
17055
|
var dataToUpdate;
|
|
17030
17056
|
return __generator(this, function (_a) {
|
|
17031
17057
|
dataToUpdate = automation || this.toJson();
|
|
17032
|
-
return [2 /*return*/, updateAnyAutomation(
|
|
17058
|
+
return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
|
|
17033
17059
|
trackEvent(EEvents.AUTOMATION_UPDATED);
|
|
17034
17060
|
return new AutomationModel(data.data);
|
|
17035
17061
|
})];
|
|
17036
17062
|
});
|
|
17037
17063
|
});
|
|
17038
17064
|
};
|
|
17039
|
-
AutomationModel.prototype.delete = function (
|
|
17065
|
+
AutomationModel.prototype.delete = function () {
|
|
17040
17066
|
return __awaiter(this, void 0, void 0, function () {
|
|
17041
17067
|
return __generator(this, function (_a) {
|
|
17042
|
-
return [2 /*return*/, deleteAnyAutomation(
|
|
17068
|
+
return [2 /*return*/, deleteAnyAutomation({ id: this.id, v1: this.v1 }).then(function (data) {
|
|
17043
17069
|
trackEvent(EEvents.AUTOMATION_DELETED);
|
|
17044
17070
|
return data.data;
|
|
17045
17071
|
})];
|
|
17046
17072
|
});
|
|
17047
17073
|
});
|
|
17048
17074
|
};
|
|
17075
|
+
AutomationModel.prototype.getStats = function (_a) {
|
|
17076
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
17077
|
+
var path = _b.path;
|
|
17078
|
+
return __generator(this, function (_c) {
|
|
17079
|
+
return [2 /*return*/, getAutomationStats({ id: this.id, path: path }).then(function (data) {
|
|
17080
|
+
return data.data;
|
|
17081
|
+
})];
|
|
17082
|
+
});
|
|
17083
|
+
});
|
|
17084
|
+
};
|
|
17085
|
+
AutomationModel.getContent = function (contentId) {
|
|
17086
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17087
|
+
return __generator(this, function (_a) {
|
|
17088
|
+
return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
|
|
17089
|
+
return data.data;
|
|
17090
|
+
})];
|
|
17091
|
+
});
|
|
17092
|
+
});
|
|
17093
|
+
};
|
|
17049
17094
|
return AutomationModel;
|
|
17050
17095
|
}());
|
|
17051
17096
|
|
|
17052
17097
|
var AutomationsFactory = /** @class */ (function () {
|
|
17053
17098
|
function AutomationsFactory() {
|
|
17054
17099
|
}
|
|
17100
|
+
AutomationsFactory.get = function (_a) {
|
|
17101
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
17102
|
+
var id = _b.id;
|
|
17103
|
+
return __generator(this, function (_c) {
|
|
17104
|
+
return [2 /*return*/, getAutomation({ id: id }).then(function (data) {
|
|
17105
|
+
return new AutomationModel(data.data);
|
|
17106
|
+
})];
|
|
17107
|
+
});
|
|
17108
|
+
});
|
|
17109
|
+
};
|
|
17055
17110
|
AutomationsFactory.getAutomationStats = function (_a) {
|
|
17056
17111
|
return __awaiter(this, void 0, void 0, function () {
|
|
17057
17112
|
var options = __rest(_a, []);
|
|
17058
17113
|
return __generator(this, function (_b) {
|
|
17059
|
-
return [2 /*return*/,
|
|
17114
|
+
return [2 /*return*/, getAllAutomationStats(__assign({}, options))];
|
|
17060
17115
|
});
|
|
17061
17116
|
});
|
|
17062
17117
|
};
|
|
@@ -18833,4 +18888,4 @@ var UsersFactory = /** @class */ (function () {
|
|
|
18833
18888
|
return UsersFactory;
|
|
18834
18889
|
}());
|
|
18835
18890
|
|
|
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 };
|
|
18891
|
+
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 {
|
|
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
|
|
49
|
-
delete(
|
|
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
|
|
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
|
|
19
|
+
export declare function deleteWorkflow({ id }: {
|
|
17
20
|
id: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function updateWorkflow({ id, data
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
export declare function updateWorkflow({ id, data }: {
|
|
20
23
|
id: number;
|
|
21
24
|
data: Partial<TAutomation>;
|
|
22
|
-
}
|
|
23
|
-
export declare function
|
|
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
|
-
}
|
|
27
|
-
export declare function updateAnyAutomation({ id, data, v1
|
|
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
|
-
}
|
|
41
|
+
}): Promise<any>;
|