@atlantjs/arch 10.0.9 → 10.0.11
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/@tool-box/tests/builder.abstract.util.js +6 -3
- package/@tool-box/tests/builders/failures/dummies/failure.dummy.js +6 -2
- package/@tool-box/tests/builders/failures/failure.builder.js +10 -7
- package/@tool-box/tests/builders/user/email.edge.builder.js +9 -5
- package/@tool-box/tests/builders/user/person-name.edge.builder.js +9 -5
- package/@tool-box/tests/builders/user/username.edge.builder.js +9 -5
- package/@tool-box/tests/create-fake-command.js +12 -9
- package/@tool-box/tests/faker/faker.js +10 -7
- package/@tool-box/utils/datatypes/generic-types.js +2 -1
- package/@tool-box/utils/datetime/mappers/month.mapper.js +53 -49
- package/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.js +5 -2
- package/@tool-box/utils/datetime/mappers/points/month-number.enum.js +5 -2
- package/@tool-box/utils/ducts/common.js +11 -7
- package/@tool-box/utils/ducts/optional-type.js +21 -19
- package/@tool-box/utils/ducts/return-type.js +26 -21
- package/@tool-box/utils/map/map.abstract.js +7 -3
- package/@tool-box/utils/random/random.js +5 -1
- package/@tool-box/utils/type-guard/guardian-exception.js +5 -1
- package/@tool-box/utils/type-guard/guardian.js +10 -7
- package/@tool-box/utils/type-guard/guardian.type.js +2 -1
- package/index.d.ts +8 -0
- package/index.js +86 -34
- package/objects/@common/edges/email.edge.js +6 -3
- package/objects/@common/edges/person-name.edge.js +6 -3
- package/objects/@common/edges/url.edge.js +6 -3
- package/objects/@common/edges/username.edge.js +6 -2
- package/objects/@common/edges/uuid.sketch.edge.js +13 -7
- package/objects/@common/points/header-token-name.enum.js +5 -2
- package/objects/@common/points/http-status-codes.enum.js +5 -2
- package/objects/@common/points/node-envs.enum.js +5 -2
- package/objects/datetime/edges/datetime.edge.js +39 -34
- package/objects/datetime/points/month-name.enum.js +5 -2
- package/objects/datetime/points/week-day.enum.js +5 -2
- package/objects/failure/edges/failure.abstract.js +8 -7
- package/objects/failure/edges/failure.abstract.polygon.js +2 -1
- package/objects/password/password.edge.js +17 -14
- package/objects/password/password.polygon.js +2 -1
- package/objects/password/steps/not-allowing-consecutive-chars-step.js +6 -3
- package/objects/password/steps/not-allowing-date-step.js +6 -3
- package/objects/password/steps/not-allowing-phone-step.js +6 -3
- package/objects/password/steps/not-allowing-repeated-chars-step.js +6 -3
- package/objects/password/steps/not-allowing-string-step.js +6 -3
- package/objects/password/steps/not-allowing-these-chars-step.js +6 -3
- package/objects/password/steps/numeric-step.js +6 -2
- package/objects/password/steps/with-at-least-one-letter-step.js +6 -2
- package/objects/password/steps/with-at-least-one-number-digit-step.js +6 -2
- package/objects/password/steps/with-at-least-one-special-char-step.js +6 -2
- package/objects/password/steps/with-length-step.js +6 -3
- package/objects/password/validation-step.js +5 -1
- package/objects/password/validation-step.type.js +2 -1
- package/objects/primitives/boolean.edge.sketch.js +5 -2
- package/objects/primitives/datetime.edge.sketch.js +6 -2
- package/objects/primitives/number.edge.sketch.js +7 -4
- package/objects/primitives/string.edge.sketch.js +5 -2
- package/objects-interface/edges/edge.abstract.d.ts +4 -0
- package/objects-interface/edges/edge.abstract.js +6 -0
- package/objects-interface/edges/metadata.edge.d.ts +11 -0
- package/objects-interface/edges/metadata.edge.js +25 -0
- package/objects-interface/edges/metadata.polygon.d.ts +4 -0
- package/objects-interface/edges/metadata.polygon.js +2 -0
- package/objects-interface/edges/metadata.uv.d.ts +6 -0
- package/objects-interface/edges/metadata.uv.js +29 -0
- package/objects-interface/face.abstract.d.ts +9 -0
- package/objects-interface/face.abstract.js +6 -0
- package/objects-interface/solid.abstract.d.ts +13 -0
- package/objects-interface/solid.abstract.js +11 -0
- package/objects-interface/uv.abstract.d.ts +8 -0
- package/objects-interface/uv.abstract.js +6 -0
- package/objects-interface/vertices/vertex.abstract.d.ts +11 -0
- package/objects-interface/vertices/vertex.abstract.js +11 -0
- package/package.json +1 -1
- package/tsconfig-default.json +2 -5
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotAllowingTheseCharsStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class NotAllowingTheseCharsStep extends validation_step_1.ValidationStep {
|
|
4
6
|
constructor(options) {
|
|
5
7
|
super();
|
|
6
8
|
this.options = options;
|
|
@@ -12,3 +14,4 @@ export class NotAllowingTheseCharsStep extends ValidationStep {
|
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
16
|
}
|
|
17
|
+
exports.NotAllowingTheseCharsStep = NotAllowingTheseCharsStep;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NumericStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class NumericStep extends validation_step_1.ValidationStep {
|
|
3
6
|
validate(password) {
|
|
4
7
|
return {
|
|
5
8
|
valid: /^\d+$/.test(password),
|
|
@@ -7,3 +10,4 @@ export class NumericStep extends ValidationStep {
|
|
|
7
10
|
};
|
|
8
11
|
}
|
|
9
12
|
}
|
|
13
|
+
exports.NumericStep = NumericStep;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithAtLeastOneLetterStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class WithAtLeastOneLetterStep extends validation_step_1.ValidationStep {
|
|
3
6
|
validate(password) {
|
|
4
7
|
const regex = /[a-zA-Z]/;
|
|
5
8
|
return {
|
|
@@ -8,3 +11,4 @@ export class WithAtLeastOneLetterStep extends ValidationStep {
|
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
exports.WithAtLeastOneLetterStep = WithAtLeastOneLetterStep;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithAtLeastOneNumberDigitStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class WithAtLeastOneNumberDigitStep extends validation_step_1.ValidationStep {
|
|
3
6
|
validate(password) {
|
|
4
7
|
const regex = /\d/;
|
|
5
8
|
return {
|
|
@@ -8,3 +11,4 @@ export class WithAtLeastOneNumberDigitStep extends ValidationStep {
|
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
exports.WithAtLeastOneNumberDigitStep = WithAtLeastOneNumberDigitStep;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithAtLeastOneSpecialCharStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class WithAtLeastOneSpecialCharStep extends validation_step_1.ValidationStep {
|
|
3
6
|
validate(password) {
|
|
4
7
|
const regex = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
5
8
|
return {
|
|
@@ -8,3 +11,4 @@ export class WithAtLeastOneSpecialCharStep extends ValidationStep {
|
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
exports.WithAtLeastOneSpecialCharStep = WithAtLeastOneSpecialCharStep;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithLengthStep = void 0;
|
|
4
|
+
const validation_step_1 = require("../validation-step");
|
|
5
|
+
class WithLengthStep extends validation_step_1.ValidationStep {
|
|
4
6
|
constructor(options) {
|
|
5
7
|
super();
|
|
6
8
|
this.options = options;
|
|
@@ -13,3 +15,4 @@ export class WithLengthStep extends ValidationStep {
|
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
}
|
|
18
|
+
exports.WithLengthStep = WithLengthStep;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationStep = void 0;
|
|
4
|
+
class ValidationStep {
|
|
2
5
|
get name() {
|
|
3
6
|
return this.constructor.name;
|
|
4
7
|
}
|
|
5
8
|
}
|
|
9
|
+
exports.ValidationStep = ValidationStep;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanEdgeSketch = void 0;
|
|
4
|
+
class BooleanEdgeSketch {
|
|
3
5
|
constructor(value) {
|
|
4
6
|
this.value = value;
|
|
5
7
|
}
|
|
@@ -16,3 +18,4 @@ export class BooleanEdgeSketch {
|
|
|
16
18
|
return this.value !== value;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
21
|
+
exports.BooleanEdgeSketch = BooleanEdgeSketch;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatetimeEdgeSketch = void 0;
|
|
4
|
+
const datetime_edge_1 = require("../datetime/edges/datetime.edge");
|
|
5
|
+
class DatetimeEdgeSketch extends datetime_edge_1.DatetimeEdge {
|
|
3
6
|
}
|
|
7
|
+
exports.DatetimeEdgeSketch = DatetimeEdgeSketch;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NumberEdgeSketch = void 0;
|
|
4
|
+
const guardian_1 = require("../../@tool-box/utils/type-guard/guardian");
|
|
5
|
+
class NumberEdgeSketch {
|
|
4
6
|
constructor(value) {
|
|
5
7
|
this.value = value;
|
|
6
8
|
this.validate(value);
|
|
@@ -47,7 +49,7 @@ export class NumberEdgeSketch {
|
|
|
47
49
|
isBetween(min, max) {
|
|
48
50
|
const minimus = min instanceof NumberEdgeSketch ? min.toNumber() : min;
|
|
49
51
|
const maximus = max instanceof NumberEdgeSketch ? max.toNumber() : max;
|
|
50
|
-
return _.isBetween(this.value, minimus, maximus);
|
|
52
|
+
return guardian_1._.isBetween(this.value, minimus, maximus);
|
|
51
53
|
}
|
|
52
54
|
validate(value) {
|
|
53
55
|
if (Number.isNaN(value)) {
|
|
@@ -55,3 +57,4 @@ export class NumberEdgeSketch {
|
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
}
|
|
60
|
+
exports.NumberEdgeSketch = NumberEdgeSketch;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringEdgeSketch = void 0;
|
|
4
|
+
class StringEdgeSketch {
|
|
3
5
|
constructor(value) {
|
|
4
6
|
this.value = value;
|
|
5
7
|
this.sanitize();
|
|
@@ -29,3 +31,4 @@ export class StringEdgeSketch {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
exports.StringEdgeSketch = StringEdgeSketch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EdgeAbstract } from "./edge.abstract";
|
|
2
|
+
import { MetadataPolygon } from "./metadata.polygon";
|
|
3
|
+
import { DatetimeEdge } from "../../objects/datetime/edges/datetime.edge";
|
|
4
|
+
export declare class MetadataEdge extends EdgeAbstract {
|
|
5
|
+
protected _createdAt: DatetimeEdge;
|
|
6
|
+
protected _updatedAt: DatetimeEdge;
|
|
7
|
+
constructor(_createdAt?: DatetimeEdge, _updatedAt?: DatetimeEdge);
|
|
8
|
+
get createdAt(): DatetimeEdge;
|
|
9
|
+
get updatedAt(): DatetimeEdge;
|
|
10
|
+
toPolygon(): MetadataPolygon;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetadataEdge = void 0;
|
|
4
|
+
const edge_abstract_1 = require("./edge.abstract");
|
|
5
|
+
const datetime_edge_1 = require("../../objects/datetime/edges/datetime.edge");
|
|
6
|
+
class MetadataEdge extends edge_abstract_1.EdgeAbstract {
|
|
7
|
+
constructor(_createdAt = new datetime_edge_1.DatetimeEdge(), _updatedAt = new datetime_edge_1.DatetimeEdge()) {
|
|
8
|
+
super();
|
|
9
|
+
this._createdAt = _createdAt;
|
|
10
|
+
this._updatedAt = _updatedAt;
|
|
11
|
+
}
|
|
12
|
+
get createdAt() {
|
|
13
|
+
return this._createdAt;
|
|
14
|
+
}
|
|
15
|
+
get updatedAt() {
|
|
16
|
+
return this._updatedAt;
|
|
17
|
+
}
|
|
18
|
+
toPolygon() {
|
|
19
|
+
return {
|
|
20
|
+
createdAt: this._createdAt.toISOStringPoint(),
|
|
21
|
+
updatedAt: this._updatedAt.toISOStringPoint(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.MetadataEdge = MetadataEdge;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MetadataUv = void 0;
|
|
13
|
+
const metadata_edge_1 = require("./metadata.edge");
|
|
14
|
+
const datetime_edge_1 = require("../../objects/datetime/edges/datetime.edge");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class MetadataUv {
|
|
17
|
+
toEntity() {
|
|
18
|
+
return new metadata_edge_1.MetadataEdge(new datetime_edge_1.DatetimeEdge(this.createdAt), new datetime_edge_1.DatetimeEdge(this.updatedAt));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.MetadataUv = MetadataUv;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsDateString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], MetadataUv.prototype, "createdAt", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsDateString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], MetadataUv.prototype, "updatedAt", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SolidAbstract } from "./solid.abstract";
|
|
2
|
+
import { VertexAbstract } from "./vertices/vertex.abstract";
|
|
3
|
+
export declare abstract class FaceAbstract {
|
|
4
|
+
abstract id: string;
|
|
5
|
+
abstract deleted: boolean;
|
|
6
|
+
abstract createdAt: string;
|
|
7
|
+
abstract updatedAt: string;
|
|
8
|
+
abstract toEntity(): SolidAbstract | VertexAbstract;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ObjectType } from "../@tool-box/utils/datatypes/generic-types";
|
|
2
|
+
import { MetadataEdge } from "./edges/metadata.edge";
|
|
3
|
+
import { FaceAbstract } from "./face.abstract";
|
|
4
|
+
import { UuidSketchEdge } from "../objects/@common/edges/uuid.sketch.edge";
|
|
5
|
+
export declare abstract class SolidAbstract {
|
|
6
|
+
protected _id: UuidSketchEdge;
|
|
7
|
+
protected _metadata: MetadataEdge;
|
|
8
|
+
constructor(_id: UuidSketchEdge, _metadata?: MetadataEdge);
|
|
9
|
+
abstract get id(): UuidSketchEdge;
|
|
10
|
+
abstract get metadata(): MetadataEdge;
|
|
11
|
+
abstract toPersist(...args: unknown[]): FaceAbstract;
|
|
12
|
+
abstract toPolygon(): ObjectType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidAbstract = void 0;
|
|
4
|
+
const metadata_edge_1 = require("./edges/metadata.edge");
|
|
5
|
+
class SolidAbstract {
|
|
6
|
+
constructor(_id, _metadata = new metadata_edge_1.MetadataEdge()) {
|
|
7
|
+
this._id = _id;
|
|
8
|
+
this._metadata = _metadata;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SolidAbstract = SolidAbstract;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EdgeAbstract } from "./edges/edge.abstract";
|
|
2
|
+
import { MetadataUv } from "./edges/metadata.uv";
|
|
3
|
+
import { SolidAbstract } from "./solid.abstract";
|
|
4
|
+
import { VertexAbstract } from "./vertices/vertex.abstract";
|
|
5
|
+
export declare abstract class UvAbstract {
|
|
6
|
+
abstract metadata: MetadataUv;
|
|
7
|
+
abstract toEntity(...args: unknown[]): SolidAbstract | VertexAbstract | EdgeAbstract;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MetadataEdge } from "../edges/metadata.edge";
|
|
2
|
+
import { FaceAbstract } from "../face.abstract";
|
|
3
|
+
import { UuidSketchEdge } from "../../objects/@common/edges/uuid.sketch.edge";
|
|
4
|
+
export declare abstract class VertexAbstract {
|
|
5
|
+
protected _id: UuidSketchEdge;
|
|
6
|
+
protected _metadata: MetadataEdge;
|
|
7
|
+
constructor(_id: UuidSketchEdge, _metadata?: MetadataEdge);
|
|
8
|
+
abstract get id(): UuidSketchEdge;
|
|
9
|
+
abstract get metadata(): MetadataEdge;
|
|
10
|
+
abstract toPersist(...args: unknown[]): FaceAbstract;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VertexAbstract = void 0;
|
|
4
|
+
const metadata_edge_1 = require("../edges/metadata.edge");
|
|
5
|
+
class VertexAbstract {
|
|
6
|
+
constructor(_id, _metadata = new metadata_edge_1.MetadataEdge()) {
|
|
7
|
+
this._id = _id;
|
|
8
|
+
this._metadata = _metadata;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.VertexAbstract = VertexAbstract;
|
package/package.json
CHANGED
package/tsconfig-default.json
CHANGED
|
@@ -18,11 +18,8 @@
|
|
|
18
18
|
"experimentalDecorators": true,
|
|
19
19
|
"emitDecoratorMetadata": true,
|
|
20
20
|
"allowJs": true,
|
|
21
|
-
"target": "
|
|
22
|
-
"module": "
|
|
23
|
-
"lib": [
|
|
24
|
-
"esnext"
|
|
25
|
-
],
|
|
21
|
+
"target": "es2021",
|
|
22
|
+
"module": "commonjs",
|
|
26
23
|
"skipLibCheck": true,
|
|
27
24
|
"declaration": true,
|
|
28
25
|
"forceConsistentCasingInFileNames": true,
|