@atlantjs/arch 15.6.7 → 15.7.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/index.js +60 -0
- package/package.json +5 -3
- package/tsconfig-lib.json +1 -0
- package/{tsconfig.tsbuildinfo → tsconfig.build.tsbuildinfo} +1 -1
- package/src/@tool-box/tests/builder.abstract.util.js +0 -39
- package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.js +0 -15
- package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.js +0 -13
- package/src/@tool-box/tests/builders/failures/failure.builder.js +0 -17
- package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.js +0 -18
- package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.js +0 -15
- package/src/@tool-box/tests/builders/user/email.edge.builder.js +0 -15
- package/src/@tool-box/tests/builders/user/username.edge.builder.js +0 -15
- package/src/@tool-box/tests/faker/faker.js +0 -208
- package/src/@tool-box/utils/convert-units/convert-units.js +0 -154
- package/src/@tool-box/utils/datatypes/boolean-utils.js +0 -155
- package/src/@tool-box/utils/datatypes/generic-types.js +0 -3
- package/src/@tool-box/utils/datatypes/plainify.js +0 -2
- package/src/@tool-box/utils/datatypes/string-utils.js +0 -292
- package/src/@tool-box/utils/datetime/mappers/month.mapper.js +0 -58
- package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.js +0 -18
- package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.js +0 -18
- package/src/@tool-box/utils/ducts/common.js +0 -47
- package/src/@tool-box/utils/ducts/optional-type.js +0 -128
- package/src/@tool-box/utils/ducts/return-type.js +0 -67
- package/src/@tool-box/utils/http-provider/http-provider-failure-response.js +0 -19
- package/src/@tool-box/utils/http-provider/http-provider-success-response.js +0 -20
- package/src/@tool-box/utils/http-provider/http-provider.js +0 -85
- package/src/@tool-box/utils/logger/index.js +0 -31
- package/src/@tool-box/utils/map/map.abstract.js +0 -84
- package/src/@tool-box/utils/random/random.js +0 -260
- package/src/@tool-box/utils/type-guard/guardian-exception.js +0 -6
- package/src/@tool-box/utils/type-guard/guardian.js +0 -625
- package/src/@tool-box/utils/type-guard/guardian.type.js +0 -2
- package/src/@tool-box/utils/validators/is-cron-expression.js +0 -39
- package/src/@tool-box/utils/validators/is-date-string.js +0 -42
- package/src/@tool-box/utils/validators/is-password-match.js +0 -27
- package/src/@tool-box/utils/validators/is-password-policy.validator.js +0 -30
- package/src/@tool-box/utils/validators/is-schedule.js +0 -43
- package/src/@tool-box/utils/validators/is-time-string.js +0 -39
- package/src/@tool-box/utils/validators/is-ulid.js +0 -39
- package/src/index.js +0 -179
- package/src/objects/@common/edges/email.edge.js +0 -94
- package/src/objects/@common/edges/ulid.sketch.edge.js +0 -91
- package/src/objects/@common/edges/url.edge.js +0 -269
- package/src/objects/@common/edges/username.edge.js +0 -41
- package/src/objects/@common/edges/uuid.sketch.edge.js +0 -145
- package/src/objects/@common/points/environment.point.js +0 -10
- package/src/objects/@common/points/header-token-name.point.js +0 -10
- package/src/objects/@common/points/http-status-codes.point.js +0 -244
- package/src/objects/amount/amount-value.edge.js +0 -76
- package/src/objects/amount/amount.edge.js +0 -626
- package/src/objects/amount/amount.polygon.js +0 -2
- package/src/objects/amount/amount.uv.js +0 -29
- package/src/objects/amount/points/duration-unit.point.js +0 -15
- package/src/objects/amount/points/energy-unit.point.js +0 -10
- package/src/objects/amount/points/length-unit.point.js +0 -10
- package/src/objects/amount/points/mass-unit.point.js +0 -11
- package/src/objects/amount/points/month-name.point.js +0 -18
- package/src/objects/amount/points/object-unit.point.js +0 -7
- package/src/objects/amount/points/units.point.js +0 -2
- package/src/objects/amount/points/volume-unit.point.js +0 -8
- package/src/objects/amount/points/week-day.point.js +0 -13
- package/src/objects/datetime/edges/datetime.edge.js +0 -672
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.js +0 -19
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.js +0 -19
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.js +0 -15
- package/src/objects/datetime/edges/locale/holidays-country.type.js +0 -2
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.js +0 -24
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.js +0 -24
- package/src/objects/datetime/points/month-name.enum.js +0 -18
- package/src/objects/datetime/points/week-day.enum.js +0 -13
- package/src/objects/failure/edges/failure.abstract.js +0 -24
- package/src/objects/failure/edges/failure.abstract.polygon.js +0 -2
- package/src/objects/language/points/language.point.js +0 -135
- package/src/objects/metadata/metadata.edge.js +0 -25
- package/src/objects/metadata/metadata.polygon.js +0 -2
- package/src/objects/metadata/metadata.uv.js +0 -29
- package/src/objects/password/password.edge.js +0 -175
- package/src/objects/password/password.polygon.js +0 -2
- package/src/objects/password/steps/not-allowing-consecutive-chars-step.js +0 -34
- package/src/objects/password/steps/not-allowing-date-step.js +0 -61
- package/src/objects/password/steps/not-allowing-phone-step.js +0 -27
- package/src/objects/password/steps/not-allowing-repeated-chars-step.js +0 -34
- package/src/objects/password/steps/not-allowing-string-step.js +0 -19
- package/src/objects/password/steps/not-allowing-these-chars-step.js +0 -17
- package/src/objects/password/steps/numeric-step.js +0 -13
- package/src/objects/password/steps/with-at-least-one-letter-step.js +0 -14
- package/src/objects/password/steps/with-at-least-one-number-digit-step.js +0 -14
- package/src/objects/password/steps/with-at-least-one-special-char-step.js +0 -14
- package/src/objects/password/steps/with-length-step.js +0 -18
- package/src/objects/password/validation-step.js +0 -9
- package/src/objects/password/validation-step.type.js +0 -2
- package/src/objects/primitives/boolean.edge.sketch.js +0 -147
- package/src/objects/primitives/datetime.edge.sketch.js +0 -7
- package/src/objects/primitives/number.edge.sketch.js +0 -346
- package/src/objects/primitives/string.edge.sketch.js +0 -218
- package/src/objects/scheduling/scheduling.edge.failure.js +0 -14
- package/src/objects/scheduling/scheduling.edge.js +0 -280
- package/src/objects/time/time.edge.js +0 -447
- package/src/objects-interface/edges/edge.abstract.js +0 -6
- package/src/objects-interface/face.abstract.js +0 -6
- package/src/objects-interface/solid.abstract.js +0 -11
- package/src/objects-interface/uv.abstract.js +0 -6
- package/src/objects-interface/vertices/vertex.abstract.js +0 -11
- package/src/shared/payload.abstract.js +0 -6
- package/src/shared/request.abstract.js +0 -3
- package/src/shared/response.abstract.js +0 -6
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IsDateString = IsDateString;
|
|
10
|
-
/*
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
function isValidDateFormat(value) {
|
|
15
|
-
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
16
|
-
return regex.test(value);
|
|
17
|
-
}
|
|
18
|
-
let IsDateStringConstraint = class IsDateStringConstraint {
|
|
19
|
-
validate(value, _args) {
|
|
20
|
-
if (typeof value !== "string") {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return isValidDateFormat(value);
|
|
24
|
-
}
|
|
25
|
-
defaultMessage(_args) {
|
|
26
|
-
return "Please provide date in 'YYYY-MM-DDTHH:MM:SS.MSZ' format.";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
IsDateStringConstraint = __decorate([
|
|
30
|
-
(0, class_validator_1.ValidatorConstraint)({ name: "isDateString", async: false })
|
|
31
|
-
], IsDateStringConstraint);
|
|
32
|
-
function IsDateString(validationOptions) {
|
|
33
|
-
return (object, propertyName) => {
|
|
34
|
-
(0, class_validator_1.registerDecorator)({
|
|
35
|
-
target: object.constructor,
|
|
36
|
-
propertyName,
|
|
37
|
-
options: validationOptions,
|
|
38
|
-
constraints: [],
|
|
39
|
-
validator: IsDateStringConstraint,
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsPasswordsMatch = IsPasswordsMatch;
|
|
4
|
-
const guardian_1 = require("#/@tool-box/utils/type-guard/guardian");
|
|
5
|
-
const class_validator_1 = require("class-validator");
|
|
6
|
-
function IsPasswordsMatch(property, validationOptions) {
|
|
7
|
-
return (object, propertyName) => {
|
|
8
|
-
(0, class_validator_1.registerDecorator)({
|
|
9
|
-
name: "matchPasswords",
|
|
10
|
-
target: object.constructor,
|
|
11
|
-
propertyName,
|
|
12
|
-
options: validationOptions,
|
|
13
|
-
constraints: [property],
|
|
14
|
-
validator: {
|
|
15
|
-
validate(value, args) {
|
|
16
|
-
const [relatedPropertyName] = args.constraints;
|
|
17
|
-
const relatedValue = args.object[relatedPropertyName];
|
|
18
|
-
return guardian_1._.isEqual(value, relatedValue);
|
|
19
|
-
},
|
|
20
|
-
defaultMessage(args) {
|
|
21
|
-
const [relatedPropertyName] = args.constraints;
|
|
22
|
-
return `${args.property} must match ${relatedPropertyName}`;
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsPasswordPolicy = IsPasswordPolicy;
|
|
4
|
-
const password_edge_1 = require("#/objects/password/password.edge");
|
|
5
|
-
const class_validator_1 = require("class-validator");
|
|
6
|
-
function IsPasswordPolicy(validationOptions) {
|
|
7
|
-
return (object, propertyName) => {
|
|
8
|
-
(0, class_validator_1.registerDecorator)({
|
|
9
|
-
name: "matchPasswords",
|
|
10
|
-
target: object.constructor,
|
|
11
|
-
propertyName,
|
|
12
|
-
options: validationOptions,
|
|
13
|
-
constraints: [],
|
|
14
|
-
validator: {
|
|
15
|
-
validate(value) {
|
|
16
|
-
try {
|
|
17
|
-
const isValid = Boolean(new password_edge_1.PasswordEdge(value));
|
|
18
|
-
return isValid;
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
defaultMessage() {
|
|
25
|
-
return "The password does not comply with the password policy";
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IsScheduling = IsScheduling;
|
|
10
|
-
const class_validator_1 = require("class-validator");
|
|
11
|
-
function isValidScheduleFormat(value) {
|
|
12
|
-
const cron5Regex = /^(\*|([0-5]?\d)(\/\d+)?|([0-5]?\d)-([0-5]?\d)(\/\d+)?)(,(\*|([0-5]?\d)(\/\d+)?|([0-5]?\d)-([0-5]?\d)(\/\d+)?))*\s+(\*|([01]?\d|2[0-3])(\/\d+)?|([01]?\d|2[0-3])-([01]?\d|2[0-3])(\/\d+)?)(,(\*|([01]?\d|2[0-3])(\/\d+)?|([01]?\d|2[0-3])-([01]?\d|2[0-3])(\/\d+)?))*\s+(\*|([1-9]|[12]\d|3[01])(\/\d+)?|([1-9]|[12]\d|3[01])-([1-9]|[12]\d|3[01])(\/\d+)?)(,(\*|([1-9]|[12]\d|3[01])(\/\d+)?|([1-9]|[12]\d|3[01])-([1-9]|[12]\d|3[01])(\/\d+)?))*\s+(\*|(1[0-2]|[1-9])(\/\d+)?|(1[0-2]|[1-9])-(1[0-2]|[1-9])(\/\d+)?)(,(\*|(1[0-2]|[1-9])(\/\d+)?|(1[0-2]|[1-2]|[1-9])-(1[0-2]|[1-9])(\/\d+)?))*\s+(\*|([0-7])(\/\d+)?|([0-7])-([0-7])(\/\d+)?)(,(\*|([0-7])(\/\d+)?|([0-7])-([0-7])(\/\d+)?))*$/;
|
|
13
|
-
const cron5RegexResult = cron5Regex.test(value);
|
|
14
|
-
if (cron5RegexResult.truthy())
|
|
15
|
-
return true;
|
|
16
|
-
const dateStringRegexResult = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
17
|
-
return dateStringRegexResult.test(value);
|
|
18
|
-
}
|
|
19
|
-
let IsScheduleConstraint = class IsScheduleConstraint {
|
|
20
|
-
validate(value, _args) {
|
|
21
|
-
if (typeof value !== "string") {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return isValidScheduleFormat(value);
|
|
25
|
-
}
|
|
26
|
-
defaultMessage(_args) {
|
|
27
|
-
return "Please provide schedule in time format 'HH:mm', or in Cron Expression '* * * * *'.";
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
IsScheduleConstraint = __decorate([
|
|
31
|
-
(0, class_validator_1.ValidatorConstraint)({ name: "isSchedule", async: false })
|
|
32
|
-
], IsScheduleConstraint);
|
|
33
|
-
function IsScheduling(validationOptions) {
|
|
34
|
-
return (object, propertyName) => {
|
|
35
|
-
(0, class_validator_1.registerDecorator)({
|
|
36
|
-
target: object.constructor,
|
|
37
|
-
propertyName,
|
|
38
|
-
options: validationOptions,
|
|
39
|
-
constraints: [],
|
|
40
|
-
validator: IsScheduleConstraint,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IsTimeString = IsTimeString;
|
|
10
|
-
const class_validator_1 = require("class-validator");
|
|
11
|
-
function isValidTimeFormat(value) {
|
|
12
|
-
const regex = /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;
|
|
13
|
-
return regex.test(value);
|
|
14
|
-
}
|
|
15
|
-
let IsTimeStringConstraint = class IsTimeStringConstraint {
|
|
16
|
-
validate(value, _args) {
|
|
17
|
-
if (typeof value !== "string") {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return isValidTimeFormat(value);
|
|
21
|
-
}
|
|
22
|
-
defaultMessage(_args) {
|
|
23
|
-
return "Invalid time format. Please provide time in 'HH:mm' format.";
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
IsTimeStringConstraint = __decorate([
|
|
27
|
-
(0, class_validator_1.ValidatorConstraint)({ name: "isTimeString", async: false })
|
|
28
|
-
], IsTimeStringConstraint);
|
|
29
|
-
function IsTimeString(validationOptions) {
|
|
30
|
-
return (object, propertyName) => {
|
|
31
|
-
(0, class_validator_1.registerDecorator)({
|
|
32
|
-
target: object.constructor,
|
|
33
|
-
propertyName,
|
|
34
|
-
options: validationOptions,
|
|
35
|
-
constraints: [],
|
|
36
|
-
validator: IsTimeStringConstraint,
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IsULID = IsULID;
|
|
10
|
-
const class_validator_1 = require("class-validator");
|
|
11
|
-
const ulid_1 = require("ulid");
|
|
12
|
-
function isValidULIDFormat(value) {
|
|
13
|
-
return (0, ulid_1.isValid)(value);
|
|
14
|
-
}
|
|
15
|
-
let IsULIDConstraint = class IsULIDConstraint {
|
|
16
|
-
validate(value, _args) {
|
|
17
|
-
if (typeof value !== "string") {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return isValidULIDFormat(value);
|
|
21
|
-
}
|
|
22
|
-
defaultMessage(_args) {
|
|
23
|
-
return "Invalid ULID format.";
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
IsULIDConstraint = __decorate([
|
|
27
|
-
(0, class_validator_1.ValidatorConstraint)({ name: "isULID", async: false })
|
|
28
|
-
], IsULIDConstraint);
|
|
29
|
-
function IsULID(validationOptions) {
|
|
30
|
-
return (object, propertyName) => {
|
|
31
|
-
(0, class_validator_1.registerDecorator)({
|
|
32
|
-
target: object.constructor,
|
|
33
|
-
propertyName,
|
|
34
|
-
options: validationOptions,
|
|
35
|
-
constraints: [],
|
|
36
|
-
validator: IsULIDConstraint,
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
package/src/index.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Optional = exports.Nothing = exports.MonthNumberEnum = exports.MonthAbbreviationEnum = exports.MonthMapper = exports.ConvertUnit = exports.faker = exports.UsernameEdgeBuilder = exports.EmailEdgeBuilder = exports.MetadataUvBuilder = exports.MetadataEdgeBuilder = exports.FailureBuilder = exports.FailureDummy = exports.DatetimeEdgeBuilder = exports.BuilderAbstract = exports.ValidateInner = exports.registerDecorator = exports.MinDate = exports.Min = exports.MaxDate = exports.Max = exports.IsUUID = exports.IsUrl = exports.IsString = exports.IsPositive = exports.IsPort = exports.IsOptional = exports.IsObject = exports.IsNumberString = exports.IsNumber = exports.IsNotEmptyObject = exports.IsNotEmpty = exports.IsNegative = exports.IsLongitude = exports.IsLatLong = exports.IsLatitude = exports.IsJWT = exports.IsJSON = exports.IsIP = exports.IsInt = exports.IsEnum = exports.IsEmpty = exports.IsEmail = exports.IsDecimal = exports.IsDate = exports.IsCurrency = exports.IsBoolean = exports.IsBase64 = exports.IsArray = exports.IsUv = void 0;
|
|
4
|
-
exports.SolidAbstract = exports.FaceAbstract = exports.EdgeAbstract = exports.TimeEdge = exports.SchedulingEdge = exports.StringEdgeSketch = exports.NumberEdgeSketch = exports.DatetimeEdgeSketch = exports.BooleanEdgeSketch = exports.PasswordEdge = exports.MetadataUv = exports.MetadataEdge = exports.LanguagePoint = exports.FailureAbstract = exports.WeekDayEnum = exports.MonthNameEnum = exports.DatetimeEdge = exports.WeekDayPoint = exports.VolumeUnitPoint = exports.ObjectUnitPoint = exports.MonthNamePoint = exports.MassUnitPoint = exports.LengthUnitPoint = exports.EnergyUnitPoint = exports.DurationUnitPoint = exports.AmountUv = exports.AmountEdge = exports.HttpStatusCodes = exports.HeaderTokenNamePoint = exports.EnvironmentPoint = exports.UuidSketchEdge = exports.UsernameEdge = exports.UrlEdge = exports.UlidSketchEdge = exports.EmailEdge = exports.IsULID = exports.IsTimeString = exports.IsScheduling = exports.IsPasswordPolicy = exports.IsPasswordsMatch = exports.IsDateString = exports.IsCronExpression = exports._ = exports.Random = exports.MapAbstract = exports.c = exports.HttpProvider = exports.Success = exports.Return = exports.Failure = void 0;
|
|
5
|
-
exports.ResponseAbstract = exports.PayloadAbstract = exports.VertexAbstract = exports.UvAbstract = void 0;
|
|
6
|
-
require("#/@tool-box/utils/datatypes/string-utils");
|
|
7
|
-
require("#/@tool-box/utils/datatypes/boolean-utils");
|
|
8
|
-
var class_transformer_1 = require("class-transformer");
|
|
9
|
-
Object.defineProperty(exports, "IsUv", { enumerable: true, get: function () { return class_transformer_1.Type; } });
|
|
10
|
-
var class_validator_1 = require("class-validator");
|
|
11
|
-
Object.defineProperty(exports, "IsArray", { enumerable: true, get: function () { return class_validator_1.IsArray; } });
|
|
12
|
-
Object.defineProperty(exports, "IsBase64", { enumerable: true, get: function () { return class_validator_1.IsBase64; } });
|
|
13
|
-
Object.defineProperty(exports, "IsBoolean", { enumerable: true, get: function () { return class_validator_1.IsBoolean; } });
|
|
14
|
-
Object.defineProperty(exports, "IsCurrency", { enumerable: true, get: function () { return class_validator_1.IsCurrency; } });
|
|
15
|
-
Object.defineProperty(exports, "IsDate", { enumerable: true, get: function () { return class_validator_1.IsDate; } });
|
|
16
|
-
Object.defineProperty(exports, "IsDecimal", { enumerable: true, get: function () { return class_validator_1.IsDecimal; } });
|
|
17
|
-
Object.defineProperty(exports, "IsEmail", { enumerable: true, get: function () { return class_validator_1.IsEmail; } });
|
|
18
|
-
Object.defineProperty(exports, "IsEmpty", { enumerable: true, get: function () { return class_validator_1.IsEmpty; } });
|
|
19
|
-
Object.defineProperty(exports, "IsEnum", { enumerable: true, get: function () { return class_validator_1.IsEnum; } });
|
|
20
|
-
Object.defineProperty(exports, "IsInt", { enumerable: true, get: function () { return class_validator_1.IsInt; } });
|
|
21
|
-
Object.defineProperty(exports, "IsIP", { enumerable: true, get: function () { return class_validator_1.IsIP; } });
|
|
22
|
-
Object.defineProperty(exports, "IsJSON", { enumerable: true, get: function () { return class_validator_1.IsJSON; } });
|
|
23
|
-
Object.defineProperty(exports, "IsJWT", { enumerable: true, get: function () { return class_validator_1.IsJWT; } });
|
|
24
|
-
Object.defineProperty(exports, "IsLatitude", { enumerable: true, get: function () { return class_validator_1.IsLatitude; } });
|
|
25
|
-
Object.defineProperty(exports, "IsLatLong", { enumerable: true, get: function () { return class_validator_1.IsLatLong; } });
|
|
26
|
-
Object.defineProperty(exports, "IsLongitude", { enumerable: true, get: function () { return class_validator_1.IsLongitude; } });
|
|
27
|
-
Object.defineProperty(exports, "IsNegative", { enumerable: true, get: function () { return class_validator_1.IsNegative; } });
|
|
28
|
-
Object.defineProperty(exports, "IsNotEmpty", { enumerable: true, get: function () { return class_validator_1.IsNotEmpty; } });
|
|
29
|
-
Object.defineProperty(exports, "IsNotEmptyObject", { enumerable: true, get: function () { return class_validator_1.IsNotEmptyObject; } });
|
|
30
|
-
Object.defineProperty(exports, "IsNumber", { enumerable: true, get: function () { return class_validator_1.IsNumber; } });
|
|
31
|
-
Object.defineProperty(exports, "IsNumberString", { enumerable: true, get: function () { return class_validator_1.IsNumberString; } });
|
|
32
|
-
Object.defineProperty(exports, "IsObject", { enumerable: true, get: function () { return class_validator_1.IsObject; } });
|
|
33
|
-
Object.defineProperty(exports, "IsOptional", { enumerable: true, get: function () { return class_validator_1.IsOptional; } });
|
|
34
|
-
Object.defineProperty(exports, "IsPort", { enumerable: true, get: function () { return class_validator_1.IsPort; } });
|
|
35
|
-
Object.defineProperty(exports, "IsPositive", { enumerable: true, get: function () { return class_validator_1.IsPositive; } });
|
|
36
|
-
Object.defineProperty(exports, "IsString", { enumerable: true, get: function () { return class_validator_1.IsString; } });
|
|
37
|
-
Object.defineProperty(exports, "IsUrl", { enumerable: true, get: function () { return class_validator_1.IsUrl; } });
|
|
38
|
-
Object.defineProperty(exports, "IsUUID", { enumerable: true, get: function () { return class_validator_1.IsUUID; } });
|
|
39
|
-
Object.defineProperty(exports, "Max", { enumerable: true, get: function () { return class_validator_1.Max; } });
|
|
40
|
-
Object.defineProperty(exports, "MaxDate", { enumerable: true, get: function () { return class_validator_1.MaxDate; } });
|
|
41
|
-
Object.defineProperty(exports, "Min", { enumerable: true, get: function () { return class_validator_1.Min; } });
|
|
42
|
-
Object.defineProperty(exports, "MinDate", { enumerable: true, get: function () { return class_validator_1.MinDate; } });
|
|
43
|
-
Object.defineProperty(exports, "registerDecorator", { enumerable: true, get: function () { return class_validator_1.registerDecorator; } });
|
|
44
|
-
Object.defineProperty(exports, "ValidateInner", { enumerable: true, get: function () { return class_validator_1.ValidateNested; } });
|
|
45
|
-
var builder_abstract_util_1 = require("#/@tool-box/tests/builder.abstract.util");
|
|
46
|
-
Object.defineProperty(exports, "BuilderAbstract", { enumerable: true, get: function () { return builder_abstract_util_1.BuilderAbstract; } });
|
|
47
|
-
var datetime_edge_builder_1 = require("#/@tool-box/tests/builders/datetime/datetime.edge.builder");
|
|
48
|
-
Object.defineProperty(exports, "DatetimeEdgeBuilder", { enumerable: true, get: function () { return datetime_edge_builder_1.DatetimeEdgeBuilder; } });
|
|
49
|
-
var failure_dummy_1 = require("#/@tool-box/tests/builders/failures/dummies/failure.dummy");
|
|
50
|
-
Object.defineProperty(exports, "FailureDummy", { enumerable: true, get: function () { return failure_dummy_1.FailureDummy; } });
|
|
51
|
-
var failure_builder_1 = require("#/@tool-box/tests/builders/failures/failure.builder");
|
|
52
|
-
Object.defineProperty(exports, "FailureBuilder", { enumerable: true, get: function () { return failure_builder_1.FailureBuilder; } });
|
|
53
|
-
var metadata_edge_builder_1 = require("#/@tool-box/tests/builders/metadata/metadata.edge.builder");
|
|
54
|
-
Object.defineProperty(exports, "MetadataEdgeBuilder", { enumerable: true, get: function () { return metadata_edge_builder_1.MetadataEdgeBuilder; } });
|
|
55
|
-
var metadata_uv_builder_1 = require("#/@tool-box/tests/builders/metadata/metadata-uv.builder");
|
|
56
|
-
Object.defineProperty(exports, "MetadataUvBuilder", { enumerable: true, get: function () { return metadata_uv_builder_1.MetadataUvBuilder; } });
|
|
57
|
-
var email_edge_builder_1 = require("#/@tool-box/tests/builders/user/email.edge.builder");
|
|
58
|
-
Object.defineProperty(exports, "EmailEdgeBuilder", { enumerable: true, get: function () { return email_edge_builder_1.EmailEdgeBuilder; } });
|
|
59
|
-
var username_edge_builder_1 = require("#/@tool-box/tests/builders/user/username.edge.builder");
|
|
60
|
-
Object.defineProperty(exports, "UsernameEdgeBuilder", { enumerable: true, get: function () { return username_edge_builder_1.UsernameEdgeBuilder; } });
|
|
61
|
-
var faker_1 = require("#/@tool-box/tests/faker/faker");
|
|
62
|
-
Object.defineProperty(exports, "faker", { enumerable: true, get: function () { return faker_1.faker; } });
|
|
63
|
-
var convert_units_1 = require("#/@tool-box/utils/convert-units/convert-units");
|
|
64
|
-
Object.defineProperty(exports, "ConvertUnit", { enumerable: true, get: function () { return convert_units_1.ConvertUnit; } });
|
|
65
|
-
var month_mapper_1 = require("#/@tool-box/utils/datetime/mappers/month.mapper");
|
|
66
|
-
Object.defineProperty(exports, "MonthMapper", { enumerable: true, get: function () { return month_mapper_1.MonthMapper; } });
|
|
67
|
-
var month_abbreviation_enum_1 = require("#/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum");
|
|
68
|
-
Object.defineProperty(exports, "MonthAbbreviationEnum", { enumerable: true, get: function () { return month_abbreviation_enum_1.MonthAbbreviationEnum; } });
|
|
69
|
-
var month_number_enum_1 = require("#/@tool-box/utils/datetime/mappers/points/month-number.enum");
|
|
70
|
-
Object.defineProperty(exports, "MonthNumberEnum", { enumerable: true, get: function () { return month_number_enum_1.MonthNumberEnum; } });
|
|
71
|
-
var optional_type_1 = require("#/@tool-box/utils/ducts/optional-type");
|
|
72
|
-
Object.defineProperty(exports, "Nothing", { enumerable: true, get: function () { return optional_type_1.Nothing; } });
|
|
73
|
-
Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return optional_type_1.Optional; } });
|
|
74
|
-
var return_type_1 = require("#/@tool-box/utils/ducts/return-type");
|
|
75
|
-
Object.defineProperty(exports, "Failure", { enumerable: true, get: function () { return return_type_1.Failure; } });
|
|
76
|
-
Object.defineProperty(exports, "Return", { enumerable: true, get: function () { return return_type_1.Return; } });
|
|
77
|
-
Object.defineProperty(exports, "Success", { enumerable: true, get: function () { return return_type_1.Success; } });
|
|
78
|
-
var http_provider_1 = require("#/@tool-box/utils/http-provider/http-provider");
|
|
79
|
-
Object.defineProperty(exports, "HttpProvider", { enumerable: true, get: function () { return http_provider_1.HttpProvider; } });
|
|
80
|
-
var logger_1 = require("#/@tool-box/utils/logger");
|
|
81
|
-
Object.defineProperty(exports, "c", { enumerable: true, get: function () { return logger_1.c; } });
|
|
82
|
-
var map_abstract_1 = require("#/@tool-box/utils/map/map.abstract");
|
|
83
|
-
Object.defineProperty(exports, "MapAbstract", { enumerable: true, get: function () { return map_abstract_1.MapAbstract; } });
|
|
84
|
-
var random_1 = require("#/@tool-box/utils/random/random");
|
|
85
|
-
Object.defineProperty(exports, "Random", { enumerable: true, get: function () { return random_1.Random; } });
|
|
86
|
-
var guardian_1 = require("#/@tool-box/utils/type-guard/guardian");
|
|
87
|
-
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return guardian_1._; } });
|
|
88
|
-
var is_cron_expression_1 = require("#/@tool-box/utils/validators/is-cron-expression");
|
|
89
|
-
Object.defineProperty(exports, "IsCronExpression", { enumerable: true, get: function () { return is_cron_expression_1.IsCronExpression; } });
|
|
90
|
-
var is_date_string_1 = require("#/@tool-box/utils/validators/is-date-string");
|
|
91
|
-
Object.defineProperty(exports, "IsDateString", { enumerable: true, get: function () { return is_date_string_1.IsDateString; } });
|
|
92
|
-
var is_password_match_1 = require("#/@tool-box/utils/validators/is-password-match");
|
|
93
|
-
Object.defineProperty(exports, "IsPasswordsMatch", { enumerable: true, get: function () { return is_password_match_1.IsPasswordsMatch; } });
|
|
94
|
-
var is_password_policy_validator_1 = require("#/@tool-box/utils/validators/is-password-policy.validator");
|
|
95
|
-
Object.defineProperty(exports, "IsPasswordPolicy", { enumerable: true, get: function () { return is_password_policy_validator_1.IsPasswordPolicy; } });
|
|
96
|
-
var is_schedule_1 = require("#/@tool-box/utils/validators/is-schedule");
|
|
97
|
-
Object.defineProperty(exports, "IsScheduling", { enumerable: true, get: function () { return is_schedule_1.IsScheduling; } });
|
|
98
|
-
var is_time_string_1 = require("#/@tool-box/utils/validators/is-time-string");
|
|
99
|
-
Object.defineProperty(exports, "IsTimeString", { enumerable: true, get: function () { return is_time_string_1.IsTimeString; } });
|
|
100
|
-
var is_ulid_1 = require("#/@tool-box/utils/validators/is-ulid");
|
|
101
|
-
Object.defineProperty(exports, "IsULID", { enumerable: true, get: function () { return is_ulid_1.IsULID; } });
|
|
102
|
-
var email_edge_1 = require("#/objects/@common/edges/email.edge");
|
|
103
|
-
Object.defineProperty(exports, "EmailEdge", { enumerable: true, get: function () { return email_edge_1.EmailEdge; } });
|
|
104
|
-
var ulid_sketch_edge_1 = require("#/objects/@common/edges/ulid.sketch.edge");
|
|
105
|
-
Object.defineProperty(exports, "UlidSketchEdge", { enumerable: true, get: function () { return ulid_sketch_edge_1.UlidSketchEdge; } });
|
|
106
|
-
var url_edge_1 = require("#/objects/@common/edges/url.edge");
|
|
107
|
-
Object.defineProperty(exports, "UrlEdge", { enumerable: true, get: function () { return url_edge_1.UrlEdge; } });
|
|
108
|
-
var username_edge_1 = require("#/objects/@common/edges/username.edge");
|
|
109
|
-
Object.defineProperty(exports, "UsernameEdge", { enumerable: true, get: function () { return username_edge_1.UsernameEdge; } });
|
|
110
|
-
var uuid_sketch_edge_1 = require("#/objects/@common/edges/uuid.sketch.edge");
|
|
111
|
-
Object.defineProperty(exports, "UuidSketchEdge", { enumerable: true, get: function () { return uuid_sketch_edge_1.UuidSketchEdge; } });
|
|
112
|
-
var environment_point_1 = require("#/objects/@common/points/environment.point");
|
|
113
|
-
Object.defineProperty(exports, "EnvironmentPoint", { enumerable: true, get: function () { return environment_point_1.EnvironmentPoint; } });
|
|
114
|
-
var header_token_name_point_1 = require("#/objects/@common/points/header-token-name.point");
|
|
115
|
-
Object.defineProperty(exports, "HeaderTokenNamePoint", { enumerable: true, get: function () { return header_token_name_point_1.HeaderTokenNamePoint; } });
|
|
116
|
-
var http_status_codes_point_1 = require("#/objects/@common/points/http-status-codes.point");
|
|
117
|
-
Object.defineProperty(exports, "HttpStatusCodes", { enumerable: true, get: function () { return http_status_codes_point_1.HttpStatusCodes; } });
|
|
118
|
-
var amount_edge_1 = require("#/objects/amount/amount.edge");
|
|
119
|
-
Object.defineProperty(exports, "AmountEdge", { enumerable: true, get: function () { return amount_edge_1.AmountEdge; } });
|
|
120
|
-
var amount_uv_1 = require("#/objects/amount/amount.uv");
|
|
121
|
-
Object.defineProperty(exports, "AmountUv", { enumerable: true, get: function () { return amount_uv_1.AmountUv; } });
|
|
122
|
-
var duration_unit_point_1 = require("#/objects/amount/points/duration-unit.point");
|
|
123
|
-
Object.defineProperty(exports, "DurationUnitPoint", { enumerable: true, get: function () { return duration_unit_point_1.DurationUnitPoint; } });
|
|
124
|
-
var energy_unit_point_1 = require("#/objects/amount/points/energy-unit.point");
|
|
125
|
-
Object.defineProperty(exports, "EnergyUnitPoint", { enumerable: true, get: function () { return energy_unit_point_1.EnergyUnitPoint; } });
|
|
126
|
-
var length_unit_point_1 = require("#/objects/amount/points/length-unit.point");
|
|
127
|
-
Object.defineProperty(exports, "LengthUnitPoint", { enumerable: true, get: function () { return length_unit_point_1.LengthUnitPoint; } });
|
|
128
|
-
var mass_unit_point_1 = require("#/objects/amount/points/mass-unit.point");
|
|
129
|
-
Object.defineProperty(exports, "MassUnitPoint", { enumerable: true, get: function () { return mass_unit_point_1.MassUnitPoint; } });
|
|
130
|
-
var month_name_point_1 = require("#/objects/amount/points/month-name.point");
|
|
131
|
-
Object.defineProperty(exports, "MonthNamePoint", { enumerable: true, get: function () { return month_name_point_1.MonthNamePoint; } });
|
|
132
|
-
var object_unit_point_1 = require("#/objects/amount/points/object-unit.point");
|
|
133
|
-
Object.defineProperty(exports, "ObjectUnitPoint", { enumerable: true, get: function () { return object_unit_point_1.ObjectUnitPoint; } });
|
|
134
|
-
var volume_unit_point_1 = require("#/objects/amount/points/volume-unit.point");
|
|
135
|
-
Object.defineProperty(exports, "VolumeUnitPoint", { enumerable: true, get: function () { return volume_unit_point_1.VolumeUnitPoint; } });
|
|
136
|
-
var week_day_point_1 = require("#/objects/amount/points/week-day.point");
|
|
137
|
-
Object.defineProperty(exports, "WeekDayPoint", { enumerable: true, get: function () { return week_day_point_1.WeekDayPoint; } });
|
|
138
|
-
var datetime_edge_1 = require("#/objects/datetime/edges/datetime.edge");
|
|
139
|
-
Object.defineProperty(exports, "DatetimeEdge", { enumerable: true, get: function () { return datetime_edge_1.DatetimeEdge; } });
|
|
140
|
-
var month_name_enum_1 = require("#/objects/datetime/points/month-name.enum");
|
|
141
|
-
Object.defineProperty(exports, "MonthNameEnum", { enumerable: true, get: function () { return month_name_enum_1.MonthNameEnum; } });
|
|
142
|
-
var week_day_enum_1 = require("#/objects/datetime/points/week-day.enum");
|
|
143
|
-
Object.defineProperty(exports, "WeekDayEnum", { enumerable: true, get: function () { return week_day_enum_1.WeekDayEnum; } });
|
|
144
|
-
var failure_abstract_1 = require("#/objects/failure/edges/failure.abstract");
|
|
145
|
-
Object.defineProperty(exports, "FailureAbstract", { enumerable: true, get: function () { return failure_abstract_1.FailureAbstract; } });
|
|
146
|
-
var language_point_1 = require("#/objects/language/points/language.point");
|
|
147
|
-
Object.defineProperty(exports, "LanguagePoint", { enumerable: true, get: function () { return language_point_1.LanguagePoint; } });
|
|
148
|
-
var metadata_edge_1 = require("#/objects/metadata/metadata.edge");
|
|
149
|
-
Object.defineProperty(exports, "MetadataEdge", { enumerable: true, get: function () { return metadata_edge_1.MetadataEdge; } });
|
|
150
|
-
var metadata_uv_1 = require("#/objects/metadata/metadata.uv");
|
|
151
|
-
Object.defineProperty(exports, "MetadataUv", { enumerable: true, get: function () { return metadata_uv_1.MetadataUv; } });
|
|
152
|
-
var password_edge_1 = require("#/objects/password/password.edge");
|
|
153
|
-
Object.defineProperty(exports, "PasswordEdge", { enumerable: true, get: function () { return password_edge_1.PasswordEdge; } });
|
|
154
|
-
var boolean_edge_sketch_1 = require("#/objects/primitives/boolean.edge.sketch");
|
|
155
|
-
Object.defineProperty(exports, "BooleanEdgeSketch", { enumerable: true, get: function () { return boolean_edge_sketch_1.BooleanEdgeSketch; } });
|
|
156
|
-
var datetime_edge_sketch_1 = require("#/objects/primitives/datetime.edge.sketch");
|
|
157
|
-
Object.defineProperty(exports, "DatetimeEdgeSketch", { enumerable: true, get: function () { return datetime_edge_sketch_1.DatetimeEdgeSketch; } });
|
|
158
|
-
var number_edge_sketch_1 = require("#/objects/primitives/number.edge.sketch");
|
|
159
|
-
Object.defineProperty(exports, "NumberEdgeSketch", { enumerable: true, get: function () { return number_edge_sketch_1.NumberEdgeSketch; } });
|
|
160
|
-
var string_edge_sketch_1 = require("#/objects/primitives/string.edge.sketch");
|
|
161
|
-
Object.defineProperty(exports, "StringEdgeSketch", { enumerable: true, get: function () { return string_edge_sketch_1.StringEdgeSketch; } });
|
|
162
|
-
var scheduling_edge_1 = require("#/objects/scheduling/scheduling.edge");
|
|
163
|
-
Object.defineProperty(exports, "SchedulingEdge", { enumerable: true, get: function () { return scheduling_edge_1.SchedulingEdge; } });
|
|
164
|
-
var time_edge_1 = require("#/objects/time/time.edge");
|
|
165
|
-
Object.defineProperty(exports, "TimeEdge", { enumerable: true, get: function () { return time_edge_1.TimeEdge; } });
|
|
166
|
-
var edge_abstract_1 = require("#/objects-interface/edges/edge.abstract");
|
|
167
|
-
Object.defineProperty(exports, "EdgeAbstract", { enumerable: true, get: function () { return edge_abstract_1.EdgeAbstract; } });
|
|
168
|
-
var face_abstract_1 = require("#/objects-interface/face.abstract");
|
|
169
|
-
Object.defineProperty(exports, "FaceAbstract", { enumerable: true, get: function () { return face_abstract_1.FaceAbstract; } });
|
|
170
|
-
var solid_abstract_1 = require("#/objects-interface/solid.abstract");
|
|
171
|
-
Object.defineProperty(exports, "SolidAbstract", { enumerable: true, get: function () { return solid_abstract_1.SolidAbstract; } });
|
|
172
|
-
var uv_abstract_1 = require("#/objects-interface/uv.abstract");
|
|
173
|
-
Object.defineProperty(exports, "UvAbstract", { enumerable: true, get: function () { return uv_abstract_1.UvAbstract; } });
|
|
174
|
-
var vertex_abstract_1 = require("#/objects-interface/vertices/vertex.abstract");
|
|
175
|
-
Object.defineProperty(exports, "VertexAbstract", { enumerable: true, get: function () { return vertex_abstract_1.VertexAbstract; } });
|
|
176
|
-
var payload_abstract_1 = require("#/shared/payload.abstract");
|
|
177
|
-
Object.defineProperty(exports, "PayloadAbstract", { enumerable: true, get: function () { return payload_abstract_1.PayloadAbstract; } });
|
|
178
|
-
var response_abstract_1 = require("#/shared/response.abstract");
|
|
179
|
-
Object.defineProperty(exports, "ResponseAbstract", { enumerable: true, get: function () { return response_abstract_1.ResponseAbstract; } });
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmailEdge = void 0;
|
|
4
|
-
const string_edge_sketch_1 = require("#/objects/primitives/string.edge.sketch");
|
|
5
|
-
class EmailEdge extends string_edge_sketch_1.StringEdgeSketch {
|
|
6
|
-
constructor(email) {
|
|
7
|
-
super(email);
|
|
8
|
-
this.validation();
|
|
9
|
-
}
|
|
10
|
-
validation() {
|
|
11
|
-
if (!EmailEdge.pattern.test(this.toString())) {
|
|
12
|
-
throw new TypeError(`${this.constructor.name} should be valid.`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
// ==================== Getters ====================
|
|
16
|
-
/**
|
|
17
|
-
* Retorna o e-mail como string.
|
|
18
|
-
*/
|
|
19
|
-
toString() {
|
|
20
|
-
return super.toString();
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Retorna o e-mail normalizado (lowercase + trim já aplicado no super).
|
|
24
|
-
*/
|
|
25
|
-
toNormalized() {
|
|
26
|
-
return this.toString().toLowerCase();
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Retorna a parte local (antes do @).
|
|
30
|
-
*/
|
|
31
|
-
getLocalPart() {
|
|
32
|
-
return this.toString().split("@")[0];
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Retorna o domínio completo (após o @).
|
|
36
|
-
*/
|
|
37
|
-
getDomain() {
|
|
38
|
-
return this.toString().split("@")[1];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Retorna o TLD (ex: "com", "com.br" -> "br").
|
|
42
|
-
*/
|
|
43
|
-
getTld() {
|
|
44
|
-
const domain = this.getDomain();
|
|
45
|
-
const parts = domain.split(".");
|
|
46
|
-
return parts[parts.length - 1];
|
|
47
|
-
}
|
|
48
|
-
// ==================== Verificações ====================
|
|
49
|
-
/**
|
|
50
|
-
* Verifica se o e-mail pertence a um domínio.
|
|
51
|
-
*/
|
|
52
|
-
isFromDomain(domain) {
|
|
53
|
-
return this.getDomain().toLowerCase() === domain.toLowerCase();
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Compara este e-mail com outro (string ou EmailEdge).
|
|
57
|
-
* Por padrão, ignora case.
|
|
58
|
-
*/
|
|
59
|
-
isEqual(other, ignoreCase = true) {
|
|
60
|
-
const comparand = other instanceof EmailEdge ? other.toString() : other;
|
|
61
|
-
if (ignoreCase) {
|
|
62
|
-
return this.toString().toLowerCase() === comparand.trim().toLowerCase();
|
|
63
|
-
}
|
|
64
|
-
return this.toString() === comparand.trim();
|
|
65
|
-
}
|
|
66
|
-
// ==================== Transformação ====================
|
|
67
|
-
/**
|
|
68
|
-
* Mascara a parte local do e-mail.
|
|
69
|
-
* Ex: "john.doe@mail.com" -> "j******e@mail.com"
|
|
70
|
-
*/
|
|
71
|
-
mask() {
|
|
72
|
-
const local = this.getLocalPart();
|
|
73
|
-
const domain = this.getDomain();
|
|
74
|
-
if (local.length <= 2) {
|
|
75
|
-
return `${"*".repeat(local.length)}@${domain}`;
|
|
76
|
-
}
|
|
77
|
-
return `${local[0]}${"*".repeat(local.length - 2)}${local[local.length - 1]}@${domain}`;
|
|
78
|
-
}
|
|
79
|
-
// ==================== Métodos Estáticos ====================
|
|
80
|
-
/**
|
|
81
|
-
* Verifica se uma string é um e-mail válido sem lançar exceção.
|
|
82
|
-
*/
|
|
83
|
-
static isValid(value) {
|
|
84
|
-
try {
|
|
85
|
-
const sanitized = value.trim();
|
|
86
|
-
return EmailEdge.pattern.test(sanitized);
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.EmailEdge = EmailEdge;
|
|
94
|
-
EmailEdge.pattern = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UlidSketchEdge = void 0;
|
|
4
|
-
const ulid_1 = require("ulid");
|
|
5
|
-
const index_1 = require("#/index");
|
|
6
|
-
class UlidSketchEdge {
|
|
7
|
-
constructor(value = (0, ulid_1.ulid)()) {
|
|
8
|
-
this.value = value;
|
|
9
|
-
// 🐛 fix: isValid retorna boolean, não possui .falsy()
|
|
10
|
-
if (!(0, ulid_1.isValid)(this.value)) {
|
|
11
|
-
throw new TypeError("The provided ULID is invalid. Please ensure it is in the correct format");
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
// ==================== Getters ====================
|
|
15
|
-
/**
|
|
16
|
-
* Retorna o ULID como string.
|
|
17
|
-
*/
|
|
18
|
-
toString() {
|
|
19
|
-
return this.value;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Retorna o ULID em minúsculas.
|
|
23
|
-
*/
|
|
24
|
-
toLowerCase() {
|
|
25
|
-
return this.value.toLowerCase();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Retorna o ULID em maiúsculas.
|
|
29
|
-
*/
|
|
30
|
-
toUpperCase() {
|
|
31
|
-
return this.value.toUpperCase();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Retorna o timestamp embutido no ULID em ms.
|
|
35
|
-
*/
|
|
36
|
-
getTimestamp() {
|
|
37
|
-
return (0, ulid_1.decodeTime)(this.value);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Retorna a data do timestamp embutido no ULID.
|
|
41
|
-
*/
|
|
42
|
-
toDate() {
|
|
43
|
-
return new Date(this.getTimestamp());
|
|
44
|
-
}
|
|
45
|
-
// ==================== Comparações ====================
|
|
46
|
-
/**
|
|
47
|
-
* Compara igualdade com outro ULID.
|
|
48
|
-
*/
|
|
49
|
-
isEqual(otherUlid) {
|
|
50
|
-
return index_1._.isEqual(this.toString(), otherUlid.toString());
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Compara diferença com outro ULID.
|
|
54
|
-
*/
|
|
55
|
-
isDifferent(otherUlid) {
|
|
56
|
-
return !this.isEqual(otherUlid);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated Use isEqual.
|
|
60
|
-
*/
|
|
61
|
-
equals(otherUlid) {
|
|
62
|
-
return this.isEqual(otherUlid);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Verifica se este ULID foi gerado antes de outro.
|
|
66
|
-
* (ULID é ordenável lexicograficamente por tempo)
|
|
67
|
-
*/
|
|
68
|
-
isBefore(otherUlid) {
|
|
69
|
-
return this.toString() < otherUlid.toString();
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Verifica se este ULID foi gerado depois de outro.
|
|
73
|
-
*/
|
|
74
|
-
isAfter(otherUlid) {
|
|
75
|
-
return this.toString() > otherUlid.toString();
|
|
76
|
-
}
|
|
77
|
-
// ==================== Métodos Estáticos ====================
|
|
78
|
-
/**
|
|
79
|
-
* Gera um novo ULID.
|
|
80
|
-
*/
|
|
81
|
-
static generate() {
|
|
82
|
-
return (0, ulid_1.ulid)();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Verifica se uma string é ULID válido.
|
|
86
|
-
*/
|
|
87
|
-
static isUlid(value) {
|
|
88
|
-
return (0, ulid_1.isValid)(value);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.UlidSketchEdge = UlidSketchEdge;
|