@cakemail-org/ui-components-v2 2.1.48 → 2.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +106 -63
- package/dist/cjs/models/account/index.d.ts +2 -1
- package/dist/cjs/models/account/types.d.ts +4 -0
- package/dist/cjs/models/user/index.d.ts +3 -1
- package/dist/cjs/models/user/types.d.ts +9 -0
- package/dist/cjs/services/users/index.d.ts +6 -0
- package/dist/esm/index.js +105 -64
- package/dist/esm/models/account/index.d.ts +2 -1
- package/dist/esm/models/account/types.d.ts +4 -0
- package/dist/esm/models/user/index.d.ts +3 -1
- package/dist/esm/models/user/types.d.ts +9 -0
- package/dist/esm/services/users/index.d.ts +6 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -9567,6 +9567,7 @@ var AccountModel = /** @class */ (function () {
|
|
|
9567
9567
|
this.stripe_customer_id = params.stripe_customer_id || "";
|
|
9568
9568
|
this.metadata = params.metadata || {};
|
|
9569
9569
|
this.usage = params.usage || undefined;
|
|
9570
|
+
this.account_owner = params.account_owner || { user_id: 0 };
|
|
9570
9571
|
if (params.isMainAccount) {
|
|
9571
9572
|
this.getUsageReport();
|
|
9572
9573
|
}
|
|
@@ -9712,6 +9713,109 @@ var AccountModel = /** @class */ (function () {
|
|
|
9712
9713
|
return AccountModel;
|
|
9713
9714
|
}());
|
|
9714
9715
|
|
|
9716
|
+
function listUsers(_a) {
|
|
9717
|
+
var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
|
|
9718
|
+
return callApi({
|
|
9719
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users",
|
|
9720
|
+
query: camelCase(options),
|
|
9721
|
+
fetchOptions: {
|
|
9722
|
+
method: exports.EMethods.get
|
|
9723
|
+
},
|
|
9724
|
+
useImpersonationTree: useImpersonationTree
|
|
9725
|
+
});
|
|
9726
|
+
}
|
|
9727
|
+
function getUser(_a) {
|
|
9728
|
+
var id = _a.id;
|
|
9729
|
+
return callApi({
|
|
9730
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9731
|
+
fetchOptions: {
|
|
9732
|
+
method: exports.EMethods.get
|
|
9733
|
+
}
|
|
9734
|
+
});
|
|
9735
|
+
}
|
|
9736
|
+
function updateUser(_a) {
|
|
9737
|
+
var id = _a.id, data = _a.data;
|
|
9738
|
+
return callApi({
|
|
9739
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9740
|
+
fetchOptions: {
|
|
9741
|
+
method: exports.EMethods.patch,
|
|
9742
|
+
body: data
|
|
9743
|
+
}
|
|
9744
|
+
});
|
|
9745
|
+
}
|
|
9746
|
+
function deleteUser(_a) {
|
|
9747
|
+
var id = _a.id;
|
|
9748
|
+
return callApi({
|
|
9749
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9750
|
+
fetchOptions: {
|
|
9751
|
+
method: exports.EMethods.delete
|
|
9752
|
+
}
|
|
9753
|
+
});
|
|
9754
|
+
}
|
|
9755
|
+
function resendVerificationEmail(_a) {
|
|
9756
|
+
var id = _a.id;
|
|
9757
|
+
return callApi({
|
|
9758
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id + "/resend-verification-email",
|
|
9759
|
+
fetchOptions: {
|
|
9760
|
+
method: exports.EMethods.post
|
|
9761
|
+
}
|
|
9762
|
+
});
|
|
9763
|
+
}
|
|
9764
|
+
|
|
9765
|
+
var UserModel = /** @class */ (function () {
|
|
9766
|
+
function UserModel(_a) {
|
|
9767
|
+
var id = _a.id, email = _a.email, status = _a.status, created_on = _a.created_on, last_activity_on = _a.last_activity_on, expires_on = _a.expires_on, first_name = _a.first_name, last_name = _a.last_name, title = _a.title, language = _a.language, timezone = _a.timezone, office_phone = _a.office_phone, mobile_phone = _a.mobile_phone;
|
|
9768
|
+
this.id = id || 0;
|
|
9769
|
+
this.email = email || "";
|
|
9770
|
+
this.status = status || "";
|
|
9771
|
+
this.created_on = created_on || 0;
|
|
9772
|
+
this.last_activity_on = last_activity_on || 0;
|
|
9773
|
+
this.expires_on = expires_on || 0;
|
|
9774
|
+
this.first_name = first_name || "";
|
|
9775
|
+
this.last_name = last_name || "";
|
|
9776
|
+
this.title = title || "";
|
|
9777
|
+
this.language = language || "en_US";
|
|
9778
|
+
this.timezone = timezone || "";
|
|
9779
|
+
this.office_phone = office_phone || "";
|
|
9780
|
+
this.mobile_phone = mobile_phone || "";
|
|
9781
|
+
}
|
|
9782
|
+
UserModel.prototype.toJson = function () {
|
|
9783
|
+
return modelToJson(this);
|
|
9784
|
+
};
|
|
9785
|
+
UserModel.prototype.set = function (property, value) {
|
|
9786
|
+
modelSet(this, property, value);
|
|
9787
|
+
};
|
|
9788
|
+
UserModel.prototype.update = function (user) {
|
|
9789
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9790
|
+
return __generator(this, function (_a) {
|
|
9791
|
+
return [2 /*return*/, updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
9792
|
+
trackEvent(exports.EEvents.USER_UPDATED);
|
|
9793
|
+
return new UserModel(data.data);
|
|
9794
|
+
})];
|
|
9795
|
+
});
|
|
9796
|
+
});
|
|
9797
|
+
};
|
|
9798
|
+
UserModel.prototype.delete = function () {
|
|
9799
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9800
|
+
return __generator(this, function (_a) {
|
|
9801
|
+
return [2 /*return*/, deleteUser({ id: this.id }).then(function (data) {
|
|
9802
|
+
return data.data;
|
|
9803
|
+
})];
|
|
9804
|
+
});
|
|
9805
|
+
});
|
|
9806
|
+
};
|
|
9807
|
+
UserModel.prototype.resendVerificationEmail = function () {
|
|
9808
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9809
|
+
return __generator(this, function (_a) {
|
|
9810
|
+
return [2 /*return*/, resendVerificationEmail({ id: this.id }).then(function (data) {
|
|
9811
|
+
return data.data;
|
|
9812
|
+
})];
|
|
9813
|
+
});
|
|
9814
|
+
});
|
|
9815
|
+
};
|
|
9816
|
+
return UserModel;
|
|
9817
|
+
}());
|
|
9818
|
+
|
|
9715
9819
|
function amILoggedInService() {
|
|
9716
9820
|
return callApi({
|
|
9717
9821
|
url: uiKitConfig.GATEWAY_PROXY + "/amiloggedin",
|
|
@@ -10642,69 +10746,6 @@ function unshareTemplate(_a) {
|
|
|
10642
10746
|
});
|
|
10643
10747
|
}
|
|
10644
10748
|
|
|
10645
|
-
function listUsers(_a) {
|
|
10646
|
-
var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
|
|
10647
|
-
return callApi({
|
|
10648
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users",
|
|
10649
|
-
query: camelCase(options),
|
|
10650
|
-
fetchOptions: {
|
|
10651
|
-
method: exports.EMethods.get
|
|
10652
|
-
},
|
|
10653
|
-
useImpersonationTree: useImpersonationTree
|
|
10654
|
-
});
|
|
10655
|
-
}
|
|
10656
|
-
function getUser(_a) {
|
|
10657
|
-
var id = _a.id;
|
|
10658
|
-
return callApi({
|
|
10659
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
10660
|
-
fetchOptions: {
|
|
10661
|
-
method: exports.EMethods.get
|
|
10662
|
-
}
|
|
10663
|
-
});
|
|
10664
|
-
}
|
|
10665
|
-
function updateUser(_a) {
|
|
10666
|
-
var id = _a.id, data = _a.data;
|
|
10667
|
-
return callApi({
|
|
10668
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
10669
|
-
fetchOptions: {
|
|
10670
|
-
method: exports.EMethods.patch,
|
|
10671
|
-
body: data
|
|
10672
|
-
}
|
|
10673
|
-
});
|
|
10674
|
-
}
|
|
10675
|
-
|
|
10676
|
-
var UserModel = /** @class */ (function () {
|
|
10677
|
-
function UserModel(_a) {
|
|
10678
|
-
var id = _a.id, email = _a.email, status = _a.status, created_on = _a.created_on, last_activity_on = _a.last_activity_on, expires_on = _a.expires_on, first_name = _a.first_name, last_name = _a.last_name, title = _a.title, language = _a.language, timezone = _a.timezone, office_phone = _a.office_phone, mobile_phone = _a.mobile_phone;
|
|
10679
|
-
this.id = id || 0;
|
|
10680
|
-
this.email = email || "";
|
|
10681
|
-
this.status = status || "";
|
|
10682
|
-
this.created_on = created_on || 0;
|
|
10683
|
-
this.last_activity_on = last_activity_on || 0;
|
|
10684
|
-
this.expires_on = expires_on || 0;
|
|
10685
|
-
this.first_name = first_name || "";
|
|
10686
|
-
this.last_name = last_name || "";
|
|
10687
|
-
this.title = title || "";
|
|
10688
|
-
this.language = language || "en_US";
|
|
10689
|
-
this.timezone = timezone || "";
|
|
10690
|
-
this.office_phone = office_phone || "";
|
|
10691
|
-
this.mobile_phone = mobile_phone || "";
|
|
10692
|
-
}
|
|
10693
|
-
UserModel.prototype.toJson = function () {
|
|
10694
|
-
return modelToJson(this);
|
|
10695
|
-
};
|
|
10696
|
-
UserModel.prototype.set = function (property, value) {
|
|
10697
|
-
modelSet(this, property, value);
|
|
10698
|
-
};
|
|
10699
|
-
UserModel.prototype.update = function (user) {
|
|
10700
|
-
return updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
10701
|
-
trackEvent(exports.EEvents.USER_UPDATED);
|
|
10702
|
-
return new UserModel(data.data);
|
|
10703
|
-
});
|
|
10704
|
-
};
|
|
10705
|
-
return UserModel;
|
|
10706
|
-
}());
|
|
10707
|
-
|
|
10708
10749
|
var GenericWrapperContext = React.createContext({
|
|
10709
10750
|
partnerBrand: {},
|
|
10710
10751
|
userBrand: undefined,
|
|
@@ -18427,6 +18468,7 @@ exports.deleteStorageItem = deleteStorageItem;
|
|
|
18427
18468
|
exports.deleteSuppressedEmail = deleteSuppressedEmail;
|
|
18428
18469
|
exports.deleteTaskService = deleteTaskService;
|
|
18429
18470
|
exports.deleteTemplate = deleteTemplate;
|
|
18471
|
+
exports.deleteUser = deleteUser;
|
|
18430
18472
|
exports.descendingComparator = descendingComparator;
|
|
18431
18473
|
exports.disableForm = disableForm;
|
|
18432
18474
|
exports.downloadCampaignLogExport = downloadCampaignLogExport;
|
|
@@ -18539,6 +18581,7 @@ exports.renderForm = renderForm;
|
|
|
18539
18581
|
exports.renderPublicHtmlForm = renderPublicHtmlForm;
|
|
18540
18582
|
exports.renderTemplate = renderTemplate;
|
|
18541
18583
|
exports.requestSupportService = requestSupportService;
|
|
18584
|
+
exports.resendVerificationEmail = resendVerificationEmail;
|
|
18542
18585
|
exports.resumeCampaign = resumeCampaign;
|
|
18543
18586
|
exports.saveList = saveList;
|
|
18544
18587
|
exports.scheduleCampaign = scheduleCampaign;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBrand } from "../../factories";
|
|
2
|
-
import { TAccountAddress, TAccountDomains, TAccountLimits, TAccountModel, TAccountReport, TGetAccountReport } from "./types";
|
|
2
|
+
import { TAccountAddress, TAccountDomains, TAccountLimits, TAccountModel, TAccountOwner, TAccountReport, TGetAccountReport } from "./types";
|
|
3
3
|
export declare class AccountModel {
|
|
4
4
|
readonly id: number;
|
|
5
5
|
readonly lineage: string;
|
|
@@ -19,6 +19,7 @@ export declare class AccountModel {
|
|
|
19
19
|
stripe_customer_id: string;
|
|
20
20
|
metadata: any;
|
|
21
21
|
usage?: TAccountReport;
|
|
22
|
+
account_owner: TAccountOwner;
|
|
22
23
|
constructor(params: Partial<TAccountModel> & {
|
|
23
24
|
isMainAccount?: boolean;
|
|
24
25
|
usage?: TAccountReport;
|
|
@@ -16,6 +16,7 @@ export interface TAccountModel {
|
|
|
16
16
|
stripe_customer_id: string;
|
|
17
17
|
organization: boolean;
|
|
18
18
|
metadata: any;
|
|
19
|
+
account_owner: TAccountOwner;
|
|
19
20
|
}
|
|
20
21
|
export interface TCreateAccount {
|
|
21
22
|
name: string;
|
|
@@ -107,3 +108,6 @@ export type TAccountDomains = {
|
|
|
107
108
|
dkim: "string";
|
|
108
109
|
tracking: "string";
|
|
109
110
|
};
|
|
111
|
+
export type TAccountOwner = {
|
|
112
|
+
user_id: number;
|
|
113
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUserModel, TUserModelUpdate } from "./types";
|
|
1
|
+
import { TDeleteUserResponse, TResendVerificationEmailResponse, TUserModel, TUserModelUpdate } from "./types";
|
|
2
2
|
export declare class UserModel {
|
|
3
3
|
readonly id: number;
|
|
4
4
|
readonly email: string;
|
|
@@ -17,5 +17,7 @@ export declare class UserModel {
|
|
|
17
17
|
toJson(): any;
|
|
18
18
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
19
19
|
update(user?: Partial<TUserModelUpdate>): Promise<UserModel>;
|
|
20
|
+
delete(): Promise<TDeleteUserResponse>;
|
|
21
|
+
resendVerificationEmail(): Promise<TResendVerificationEmailResponse>;
|
|
20
22
|
}
|
|
21
23
|
export * from "./types";
|
|
@@ -20,3 +20,12 @@ export type TUserModelUpdate = TUserModel & {
|
|
|
20
20
|
password_strength_requirement: "VERY_WEAK" | "WEAK" | "MODERATE" | "STRONG" | "VERY_STRONG";
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export type TDeleteUserResponse = {
|
|
24
|
+
id: string;
|
|
25
|
+
object: string;
|
|
26
|
+
deleted: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type TResendVerificationEmailResponse = {
|
|
29
|
+
object: string;
|
|
30
|
+
confirmation_resent: boolean;
|
|
31
|
+
};
|
|
@@ -8,4 +8,10 @@ export declare function updateUser({ id, data }: {
|
|
|
8
8
|
id: number;
|
|
9
9
|
data: TUserModelUpdate;
|
|
10
10
|
}): Promise<any>;
|
|
11
|
+
export declare function deleteUser({ id }: {
|
|
12
|
+
id: number;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
export declare function resendVerificationEmail({ id }: {
|
|
15
|
+
id: number;
|
|
16
|
+
}): Promise<any>;
|
|
11
17
|
export * from "./types";
|
package/dist/esm/index.js
CHANGED
|
@@ -9547,6 +9547,7 @@ var AccountModel = /** @class */ (function () {
|
|
|
9547
9547
|
this.stripe_customer_id = params.stripe_customer_id || "";
|
|
9548
9548
|
this.metadata = params.metadata || {};
|
|
9549
9549
|
this.usage = params.usage || undefined;
|
|
9550
|
+
this.account_owner = params.account_owner || { user_id: 0 };
|
|
9550
9551
|
if (params.isMainAccount) {
|
|
9551
9552
|
this.getUsageReport();
|
|
9552
9553
|
}
|
|
@@ -9692,6 +9693,109 @@ var AccountModel = /** @class */ (function () {
|
|
|
9692
9693
|
return AccountModel;
|
|
9693
9694
|
}());
|
|
9694
9695
|
|
|
9696
|
+
function listUsers(_a) {
|
|
9697
|
+
var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
|
|
9698
|
+
return callApi({
|
|
9699
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users",
|
|
9700
|
+
query: camelCase(options),
|
|
9701
|
+
fetchOptions: {
|
|
9702
|
+
method: EMethods.get
|
|
9703
|
+
},
|
|
9704
|
+
useImpersonationTree: useImpersonationTree
|
|
9705
|
+
});
|
|
9706
|
+
}
|
|
9707
|
+
function getUser(_a) {
|
|
9708
|
+
var id = _a.id;
|
|
9709
|
+
return callApi({
|
|
9710
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9711
|
+
fetchOptions: {
|
|
9712
|
+
method: EMethods.get
|
|
9713
|
+
}
|
|
9714
|
+
});
|
|
9715
|
+
}
|
|
9716
|
+
function updateUser(_a) {
|
|
9717
|
+
var id = _a.id, data = _a.data;
|
|
9718
|
+
return callApi({
|
|
9719
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9720
|
+
fetchOptions: {
|
|
9721
|
+
method: EMethods.patch,
|
|
9722
|
+
body: data
|
|
9723
|
+
}
|
|
9724
|
+
});
|
|
9725
|
+
}
|
|
9726
|
+
function deleteUser(_a) {
|
|
9727
|
+
var id = _a.id;
|
|
9728
|
+
return callApi({
|
|
9729
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
9730
|
+
fetchOptions: {
|
|
9731
|
+
method: EMethods.delete
|
|
9732
|
+
}
|
|
9733
|
+
});
|
|
9734
|
+
}
|
|
9735
|
+
function resendVerificationEmail(_a) {
|
|
9736
|
+
var id = _a.id;
|
|
9737
|
+
return callApi({
|
|
9738
|
+
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id + "/resend-verification-email",
|
|
9739
|
+
fetchOptions: {
|
|
9740
|
+
method: EMethods.post
|
|
9741
|
+
}
|
|
9742
|
+
});
|
|
9743
|
+
}
|
|
9744
|
+
|
|
9745
|
+
var UserModel = /** @class */ (function () {
|
|
9746
|
+
function UserModel(_a) {
|
|
9747
|
+
var id = _a.id, email = _a.email, status = _a.status, created_on = _a.created_on, last_activity_on = _a.last_activity_on, expires_on = _a.expires_on, first_name = _a.first_name, last_name = _a.last_name, title = _a.title, language = _a.language, timezone = _a.timezone, office_phone = _a.office_phone, mobile_phone = _a.mobile_phone;
|
|
9748
|
+
this.id = id || 0;
|
|
9749
|
+
this.email = email || "";
|
|
9750
|
+
this.status = status || "";
|
|
9751
|
+
this.created_on = created_on || 0;
|
|
9752
|
+
this.last_activity_on = last_activity_on || 0;
|
|
9753
|
+
this.expires_on = expires_on || 0;
|
|
9754
|
+
this.first_name = first_name || "";
|
|
9755
|
+
this.last_name = last_name || "";
|
|
9756
|
+
this.title = title || "";
|
|
9757
|
+
this.language = language || "en_US";
|
|
9758
|
+
this.timezone = timezone || "";
|
|
9759
|
+
this.office_phone = office_phone || "";
|
|
9760
|
+
this.mobile_phone = mobile_phone || "";
|
|
9761
|
+
}
|
|
9762
|
+
UserModel.prototype.toJson = function () {
|
|
9763
|
+
return modelToJson(this);
|
|
9764
|
+
};
|
|
9765
|
+
UserModel.prototype.set = function (property, value) {
|
|
9766
|
+
modelSet(this, property, value);
|
|
9767
|
+
};
|
|
9768
|
+
UserModel.prototype.update = function (user) {
|
|
9769
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9770
|
+
return __generator(this, function (_a) {
|
|
9771
|
+
return [2 /*return*/, updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
9772
|
+
trackEvent(EEvents.USER_UPDATED);
|
|
9773
|
+
return new UserModel(data.data);
|
|
9774
|
+
})];
|
|
9775
|
+
});
|
|
9776
|
+
});
|
|
9777
|
+
};
|
|
9778
|
+
UserModel.prototype.delete = function () {
|
|
9779
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9780
|
+
return __generator(this, function (_a) {
|
|
9781
|
+
return [2 /*return*/, deleteUser({ id: this.id }).then(function (data) {
|
|
9782
|
+
return data.data;
|
|
9783
|
+
})];
|
|
9784
|
+
});
|
|
9785
|
+
});
|
|
9786
|
+
};
|
|
9787
|
+
UserModel.prototype.resendVerificationEmail = function () {
|
|
9788
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9789
|
+
return __generator(this, function (_a) {
|
|
9790
|
+
return [2 /*return*/, resendVerificationEmail({ id: this.id }).then(function (data) {
|
|
9791
|
+
return data.data;
|
|
9792
|
+
})];
|
|
9793
|
+
});
|
|
9794
|
+
});
|
|
9795
|
+
};
|
|
9796
|
+
return UserModel;
|
|
9797
|
+
}());
|
|
9798
|
+
|
|
9695
9799
|
function amILoggedInService() {
|
|
9696
9800
|
return callApi({
|
|
9697
9801
|
url: uiKitConfig.GATEWAY_PROXY + "/amiloggedin",
|
|
@@ -10622,69 +10726,6 @@ function unshareTemplate(_a) {
|
|
|
10622
10726
|
});
|
|
10623
10727
|
}
|
|
10624
10728
|
|
|
10625
|
-
function listUsers(_a) {
|
|
10626
|
-
var useImpersonationTree = _a.useImpersonationTree, options = __rest(_a, ["useImpersonationTree"]);
|
|
10627
|
-
return callApi({
|
|
10628
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users",
|
|
10629
|
-
query: camelCase(options),
|
|
10630
|
-
fetchOptions: {
|
|
10631
|
-
method: EMethods.get
|
|
10632
|
-
},
|
|
10633
|
-
useImpersonationTree: useImpersonationTree
|
|
10634
|
-
});
|
|
10635
|
-
}
|
|
10636
|
-
function getUser(_a) {
|
|
10637
|
-
var id = _a.id;
|
|
10638
|
-
return callApi({
|
|
10639
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
10640
|
-
fetchOptions: {
|
|
10641
|
-
method: EMethods.get
|
|
10642
|
-
}
|
|
10643
|
-
});
|
|
10644
|
-
}
|
|
10645
|
-
function updateUser(_a) {
|
|
10646
|
-
var id = _a.id, data = _a.data;
|
|
10647
|
-
return callApi({
|
|
10648
|
-
url: uiKitConfig.GATEWAY_PROXY + "/users/" + id,
|
|
10649
|
-
fetchOptions: {
|
|
10650
|
-
method: EMethods.patch,
|
|
10651
|
-
body: data
|
|
10652
|
-
}
|
|
10653
|
-
});
|
|
10654
|
-
}
|
|
10655
|
-
|
|
10656
|
-
var UserModel = /** @class */ (function () {
|
|
10657
|
-
function UserModel(_a) {
|
|
10658
|
-
var id = _a.id, email = _a.email, status = _a.status, created_on = _a.created_on, last_activity_on = _a.last_activity_on, expires_on = _a.expires_on, first_name = _a.first_name, last_name = _a.last_name, title = _a.title, language = _a.language, timezone = _a.timezone, office_phone = _a.office_phone, mobile_phone = _a.mobile_phone;
|
|
10659
|
-
this.id = id || 0;
|
|
10660
|
-
this.email = email || "";
|
|
10661
|
-
this.status = status || "";
|
|
10662
|
-
this.created_on = created_on || 0;
|
|
10663
|
-
this.last_activity_on = last_activity_on || 0;
|
|
10664
|
-
this.expires_on = expires_on || 0;
|
|
10665
|
-
this.first_name = first_name || "";
|
|
10666
|
-
this.last_name = last_name || "";
|
|
10667
|
-
this.title = title || "";
|
|
10668
|
-
this.language = language || "en_US";
|
|
10669
|
-
this.timezone = timezone || "";
|
|
10670
|
-
this.office_phone = office_phone || "";
|
|
10671
|
-
this.mobile_phone = mobile_phone || "";
|
|
10672
|
-
}
|
|
10673
|
-
UserModel.prototype.toJson = function () {
|
|
10674
|
-
return modelToJson(this);
|
|
10675
|
-
};
|
|
10676
|
-
UserModel.prototype.set = function (property, value) {
|
|
10677
|
-
modelSet(this, property, value);
|
|
10678
|
-
};
|
|
10679
|
-
UserModel.prototype.update = function (user) {
|
|
10680
|
-
return updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
10681
|
-
trackEvent(EEvents.USER_UPDATED);
|
|
10682
|
-
return new UserModel(data.data);
|
|
10683
|
-
});
|
|
10684
|
-
};
|
|
10685
|
-
return UserModel;
|
|
10686
|
-
}());
|
|
10687
|
-
|
|
10688
10729
|
var GenericWrapperContext = createContext({
|
|
10689
10730
|
partnerBrand: {},
|
|
10690
10731
|
userBrand: undefined,
|
|
@@ -18268,4 +18309,4 @@ var UsersFactory = /** @class */ (function () {
|
|
|
18268
18309
|
return UsersFactory;
|
|
18269
18310
|
}());
|
|
18270
18311
|
|
|
18271
|
-
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, EStorageType, ETaskType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, 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, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, descendingComparator, disableForm, downloadCampaignLogExport, downloadCampaignsReportsExport, downloadContactsExport, downloadListLogExport, downloadSuppressedEmailExport, emptyAccountAddress, emptyAccountLimits, enableForm, 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, 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, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, renderPublicHtmlForm, renderTemplate, requestSupportService, resumeCampaign, saveList, scheduleCampaign, searchCustomerProfiles, sendCampaignTest, setBrandHeadElements, setStorage, shareTemplate, splitArray, splitObject, stableSort, startPromisePool, suspendCampaign, trackEvent, truncateEmail, truncateText, uiKitConfig, unArchiveCampaign, unScheduleCampaign, unshareTemplate, updateAccount, updateAndClearUrlParams, updateCampaign, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
|
|
18312
|
+
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, EStorageType, ETaskType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, 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, createSuppressedEmailExport, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deleteList, deletePartialInformation, deleteStorageItem, deleteSuppressedEmail, deleteTaskService, deleteTemplate, deleteUser, descendingComparator, disableForm, downloadCampaignLogExport, downloadCampaignsReportsExport, downloadContactsExport, downloadListLogExport, downloadSuppressedEmailExport, emptyAccountAddress, emptyAccountLimits, enableForm, 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, 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, listSenders, listSuppressedEmails, listSystemEmails, listTasksService, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, 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, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBrand } from "../../factories";
|
|
2
|
-
import { TAccountAddress, TAccountDomains, TAccountLimits, TAccountModel, TAccountReport, TGetAccountReport } from "./types";
|
|
2
|
+
import { TAccountAddress, TAccountDomains, TAccountLimits, TAccountModel, TAccountOwner, TAccountReport, TGetAccountReport } from "./types";
|
|
3
3
|
export declare class AccountModel {
|
|
4
4
|
readonly id: number;
|
|
5
5
|
readonly lineage: string;
|
|
@@ -19,6 +19,7 @@ export declare class AccountModel {
|
|
|
19
19
|
stripe_customer_id: string;
|
|
20
20
|
metadata: any;
|
|
21
21
|
usage?: TAccountReport;
|
|
22
|
+
account_owner: TAccountOwner;
|
|
22
23
|
constructor(params: Partial<TAccountModel> & {
|
|
23
24
|
isMainAccount?: boolean;
|
|
24
25
|
usage?: TAccountReport;
|
|
@@ -16,6 +16,7 @@ export interface TAccountModel {
|
|
|
16
16
|
stripe_customer_id: string;
|
|
17
17
|
organization: boolean;
|
|
18
18
|
metadata: any;
|
|
19
|
+
account_owner: TAccountOwner;
|
|
19
20
|
}
|
|
20
21
|
export interface TCreateAccount {
|
|
21
22
|
name: string;
|
|
@@ -107,3 +108,6 @@ export type TAccountDomains = {
|
|
|
107
108
|
dkim: "string";
|
|
108
109
|
tracking: "string";
|
|
109
110
|
};
|
|
111
|
+
export type TAccountOwner = {
|
|
112
|
+
user_id: number;
|
|
113
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUserModel, TUserModelUpdate } from "./types";
|
|
1
|
+
import { TDeleteUserResponse, TResendVerificationEmailResponse, TUserModel, TUserModelUpdate } from "./types";
|
|
2
2
|
export declare class UserModel {
|
|
3
3
|
readonly id: number;
|
|
4
4
|
readonly email: string;
|
|
@@ -17,5 +17,7 @@ export declare class UserModel {
|
|
|
17
17
|
toJson(): any;
|
|
18
18
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
19
19
|
update(user?: Partial<TUserModelUpdate>): Promise<UserModel>;
|
|
20
|
+
delete(): Promise<TDeleteUserResponse>;
|
|
21
|
+
resendVerificationEmail(): Promise<TResendVerificationEmailResponse>;
|
|
20
22
|
}
|
|
21
23
|
export * from "./types";
|
|
@@ -20,3 +20,12 @@ export type TUserModelUpdate = TUserModel & {
|
|
|
20
20
|
password_strength_requirement: "VERY_WEAK" | "WEAK" | "MODERATE" | "STRONG" | "VERY_STRONG";
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export type TDeleteUserResponse = {
|
|
24
|
+
id: string;
|
|
25
|
+
object: string;
|
|
26
|
+
deleted: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type TResendVerificationEmailResponse = {
|
|
29
|
+
object: string;
|
|
30
|
+
confirmation_resent: boolean;
|
|
31
|
+
};
|
|
@@ -8,4 +8,10 @@ export declare function updateUser({ id, data }: {
|
|
|
8
8
|
id: number;
|
|
9
9
|
data: TUserModelUpdate;
|
|
10
10
|
}): Promise<any>;
|
|
11
|
+
export declare function deleteUser({ id }: {
|
|
12
|
+
id: number;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
export declare function resendVerificationEmail({ id }: {
|
|
15
|
+
id: number;
|
|
16
|
+
}): Promise<any>;
|
|
11
17
|
export * from "./types";
|