@cakemail-org/ui-components-v2 2.1.33 → 2.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -2423,7 +2423,7 @@ function capitalizeFirstLetter(str) {
|
|
|
2423
2423
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2424
2424
|
}
|
|
2425
2425
|
function isValidEmail(email) {
|
|
2426
|
-
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))
|
|
2426
|
+
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))(@\d+\)|@)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email)) {
|
|
2427
2427
|
return true;
|
|
2428
2428
|
}
|
|
2429
2429
|
return false;
|
|
@@ -10595,8 +10595,8 @@ var UserModel = /** @class */ (function () {
|
|
|
10595
10595
|
UserModel.prototype.set = function (property, value) {
|
|
10596
10596
|
modelSet(this, property, value);
|
|
10597
10597
|
};
|
|
10598
|
-
UserModel.prototype.update = function () {
|
|
10599
|
-
return updateUser({ id: this.id, data: this.toJson() }).then(function (data) {
|
|
10598
|
+
UserModel.prototype.update = function (user) {
|
|
10599
|
+
return updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
10600
10600
|
return new UserModel(data.data);
|
|
10601
10601
|
});
|
|
10602
10602
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUserModel } from "./types";
|
|
1
|
+
import { TUserModel, TUserModelUpdate } from "./types";
|
|
2
2
|
export declare class UserModel {
|
|
3
3
|
readonly id: number;
|
|
4
4
|
readonly email: string;
|
|
@@ -16,6 +16,6 @@ export declare class UserModel {
|
|
|
16
16
|
constructor({ id, email, status, created_on, last_activity_on, expires_on, first_name, last_name, title, language, timezone, office_phone, mobile_phone }: Partial<TUserModel>);
|
|
17
17
|
toJson(): any;
|
|
18
18
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
19
|
-
update(): Promise<UserModel>;
|
|
19
|
+
update(user?: Partial<TUserModelUpdate>): Promise<UserModel>;
|
|
20
20
|
}
|
|
21
21
|
export * from "./types";
|
package/dist/esm/index.js
CHANGED
|
@@ -2403,7 +2403,7 @@ function capitalizeFirstLetter(str) {
|
|
|
2403
2403
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2404
2404
|
}
|
|
2405
2405
|
function isValidEmail(email) {
|
|
2406
|
-
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))
|
|
2406
|
+
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))(@\d+\)|@)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email)) {
|
|
2407
2407
|
return true;
|
|
2408
2408
|
}
|
|
2409
2409
|
return false;
|
|
@@ -10575,8 +10575,8 @@ var UserModel = /** @class */ (function () {
|
|
|
10575
10575
|
UserModel.prototype.set = function (property, value) {
|
|
10576
10576
|
modelSet(this, property, value);
|
|
10577
10577
|
};
|
|
10578
|
-
UserModel.prototype.update = function () {
|
|
10579
|
-
return updateUser({ id: this.id, data: this.toJson() }).then(function (data) {
|
|
10578
|
+
UserModel.prototype.update = function (user) {
|
|
10579
|
+
return updateUser({ id: this.id, data: user || this.toJson() }).then(function (data) {
|
|
10580
10580
|
return new UserModel(data.data);
|
|
10581
10581
|
});
|
|
10582
10582
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUserModel } from "./types";
|
|
1
|
+
import { TUserModel, TUserModelUpdate } from "./types";
|
|
2
2
|
export declare class UserModel {
|
|
3
3
|
readonly id: number;
|
|
4
4
|
readonly email: string;
|
|
@@ -16,6 +16,6 @@ export declare class UserModel {
|
|
|
16
16
|
constructor({ id, email, status, created_on, last_activity_on, expires_on, first_name, last_name, title, language, timezone, office_phone, mobile_phone }: Partial<TUserModel>);
|
|
17
17
|
toJson(): any;
|
|
18
18
|
set<T extends keyof this>(property: T, value: this[T]): void;
|
|
19
|
-
update(): Promise<UserModel>;
|
|
19
|
+
update(user?: Partial<TUserModelUpdate>): Promise<UserModel>;
|
|
20
20
|
}
|
|
21
21
|
export * from "./types";
|