@atlantjs/arch 9.1.2 → 10.0.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/@tool-box/tests/{entity-builder.util.d.ts → builder.abstract.util.d.ts} +1 -1
- package/@tool-box/tests/{entity-builder.util.js → builder.abstract.util.js} +3 -6
- package/@tool-box/tests/builders/failures/dummies/failure.edge.dummy.d.ts +3 -0
- package/@tool-box/tests/builders/failures/dummies/failure.edge.dummy.js +3 -0
- package/@tool-box/tests/builders/failures/failure.edge.builder.d.ts +6 -0
- package/@tool-box/tests/builders/failures/failure.edge.builder.js +18 -0
- package/@tool-box/tests/builders/user/email.edge.builder.d.ts +6 -0
- package/@tool-box/tests/builders/user/email.edge.builder.js +11 -0
- package/@tool-box/tests/builders/user/person-name.edge.builder.d.ts +6 -0
- package/@tool-box/tests/builders/user/person-name.edge.builder.js +11 -0
- package/@tool-box/tests/builders/user/username.edge.builder.d.ts +6 -0
- package/@tool-box/tests/builders/user/username.edge.builder.js +11 -0
- package/@tool-box/tests/create-fake-command.d.ts +9 -0
- package/@tool-box/tests/create-fake-command.js +23 -0
- package/@tool-box/tests/faker/faker.js +7 -10
- package/@tool-box/utils/datatypes/boolean-utils.d.ts +1 -0
- package/@tool-box/utils/datatypes/boolean-utils.js +5 -2
- package/@tool-box/utils/datatypes/generic-types.d.ts +1 -1
- package/@tool-box/utils/datatypes/generic-types.js +1 -2
- package/@tool-box/utils/datatypes/string-utils.d.ts +1 -3
- package/@tool-box/utils/datatypes/string-utils.js +1 -10
- package/@tool-box/utils/ducts/common.js +7 -11
- package/@tool-box/utils/ducts/optional-type.d.ts +0 -1
- package/@tool-box/utils/ducts/optional-type.js +19 -22
- package/@tool-box/utils/ducts/return-type.d.ts +2 -2
- package/@tool-box/utils/ducts/return-type.js +21 -26
- package/@tool-box/utils/{arrays/extended-map.d.ts → map/map.abstract.d.ts} +1 -2
- package/@tool-box/utils/map/map.abstract.js +13 -0
- package/@tool-box/utils/random/random.d.ts +5 -0
- package/@tool-box/utils/{randoms/random-value.js → random/random.js} +4 -8
- package/@tool-box/utils/type-guard/guardian-exception.js +1 -5
- package/@tool-box/utils/type-guard/guardian.d.ts +11 -13
- package/@tool-box/utils/type-guard/guardian.js +19 -51
- package/@tool-box/utils/type-guard/guardian.type.js +1 -2
- package/README.md +0 -8
- package/index.d.ts +28 -37
- package/index.js +30 -81
- package/objects/@common/edges/email.edge.d.ts +6 -0
- package/{arch/modules/domain/entities/user/value-objects/email.js → objects/@common/edges/email.edge.js} +3 -6
- package/objects/@common/edges/person-name.edge.d.ts +7 -0
- package/objects/@common/edges/person-name.edge.js +14 -0
- package/objects/@common/edges/url.edge.d.ts +6 -0
- package/objects/@common/edges/url.edge.js +17 -0
- package/objects/@common/edges/username.edge.d.ts +3 -0
- package/objects/@common/edges/username.edge.js +3 -0
- package/{arch/modules/domain/entities/uuid.abstract.d.ts → objects/@common/edges/uuid.sketch.edge.d.ts} +2 -2
- package/objects/@common/edges/uuid.sketch.edge.js +18 -0
- package/{arch/modules/domain/enums → objects/@common/points}/header-token-name.enum.js +2 -5
- package/{arch/modules/domain/enums → objects/@common/points}/http-status-codes.enum.js +2 -5
- package/{arch/modules/domain/enums → objects/@common/points}/node-envs.enum.js +2 -5
- package/objects/datetime/edges/datetime.edge.d.ts +27 -0
- package/objects/datetime/edges/datetime.edge.js +133 -0
- package/objects/datetime/points/month-name.enum.d.ts +14 -0
- package/objects/datetime/points/month-name.enum.js +15 -0
- package/objects/datetime/points/week-day.enum.d.ts +9 -0
- package/objects/datetime/points/week-day.enum.js +10 -0
- package/objects/failure/edges/failure.sketch.edge.d.ts +8 -0
- package/objects/failure/edges/failure.sketch.edge.js +23 -0
- package/objects/failure/edges/failure.sketch.polygon.d.ts +9 -0
- package/objects/failure/edges/failure.sketch.polygon.js +1 -0
- package/objects/password/password.edge.d.ts +8 -0
- package/objects/password/password.edge.js +38 -0
- package/{arch/modules/domain/entities/user/password/password.abstract.type.d.ts → objects/password/password.polygon.d.ts} +1 -1
- package/objects/password/password.polygon.js +1 -0
- package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-consecutive-chars-step.js +3 -6
- package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-date-step.js +3 -6
- package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-phone-step.js +3 -6
- package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-repeated-chars-step.js +3 -6
- package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-string-step.js +3 -6
- package/objects/password/steps/not-allowing-these-chars-step.js +14 -0
- package/objects/password/steps/numeric-step.js +9 -0
- package/objects/password/steps/with-at-least-one-letter-step.js +10 -0
- package/objects/password/steps/with-at-least-one-number-digit-step.js +10 -0
- package/objects/password/steps/with-at-least-one-special-char-step.js +10 -0
- package/{arch/modules/domain/entities/user → objects}/password/steps/with-length-step.js +3 -6
- package/objects/password/validation-step.js +5 -0
- package/objects/password/validation-step.type.js +1 -0
- package/objects/primitives/boolean.edge.sketch.d.ts +7 -0
- package/objects/primitives/boolean.edge.sketch.js +18 -0
- package/objects/primitives/datetime.edge.sketch.d.ts +3 -0
- package/objects/primitives/datetime.edge.sketch.js +3 -0
- package/objects/primitives/number.edge.sketch.d.ts +13 -0
- package/{arch/modules/domain/entities/$number.abstract.js → objects/primitives/number.edge.sketch.js} +12 -15
- package/{arch/modules/domain/entities/$string.abstract.d.ts → objects/primitives/string.edge.sketch.d.ts} +1 -1
- package/{arch/modules/domain/entities/$string.abstract.js → objects/primitives/string.edge.sketch.js} +2 -5
- package/package.json +6 -11
- package/tsconfig.tsbuildinfo +1 -1
- package/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +0 -3
- package/@tool-box/tests/builders/failures/dummies/failure.dummy.js +0 -7
- package/@tool-box/tests/builders/failures/failure.builder.d.ts +0 -6
- package/@tool-box/tests/builders/failures/failure.builder.js +0 -21
- package/@tool-box/tests/builders/generic/dummies/uuid.dummy.d.ts +0 -3
- package/@tool-box/tests/builders/generic/dummies/uuid.dummy.js +0 -7
- package/@tool-box/tests/builders/generic/uuid.builder.d.ts +0 -6
- package/@tool-box/tests/builders/generic/uuid.builder.js +0 -14
- package/@tool-box/tests/builders/user/email.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/email.builder.js +0 -15
- package/@tool-box/tests/builders/user/person-name.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/person-name.builder.js +0 -15
- package/@tool-box/tests/builders/user/user-id.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/user-id.builder.js +0 -14
- package/@tool-box/tests/builders/user/username.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/username.builder.js +0 -15
- package/@tool-box/tests/create-fake-usecase.d.ts +0 -9
- package/@tool-box/tests/create-fake-usecase.js +0 -26
- package/@tool-box/utils/arrays/extended-map.js +0 -22
- package/@tool-box/utils/http-client/http-client-exception.d.ts +0 -3
- package/@tool-box/utils/http-client/http-client-exception.js +0 -12
- package/@tool-box/utils/http-client/http-client-request.d.ts +0 -9
- package/@tool-box/utils/http-client/http-client-request.js +0 -2
- package/@tool-box/utils/http-client/http-client-response.d.ts +0 -18
- package/@tool-box/utils/http-client/http-client-response.get-header.failure.d.ts +0 -4
- package/@tool-box/utils/http-client/http-client-response.get-header.failure.js +0 -14
- package/@tool-box/utils/http-client/http-client-response.js +0 -39
- package/@tool-box/utils/http-client/http-client.d.ts +0 -9
- package/@tool-box/utils/http-client/http-client.js +0 -21
- package/@tool-box/utils/randoms/random-value.d.ts +0 -5
- package/arch/@atlantjs.json +0 -3
- package/arch/biome.json +0 -47
- package/arch/modules/application/failures/failure.abstract.d.ts +0 -9
- package/arch/modules/application/failures/failure.abstract.js +0 -24
- package/arch/modules/application/failures/failure.abstract.type.d.ts +0 -9
- package/arch/modules/application/failures/failure.abstract.type.js +0 -2
- package/arch/modules/application/failures/unknown-failure.d.ts +0 -15
- package/arch/modules/application/failures/unknown-failure.js +0 -16
- package/arch/modules/domain/entities/$array.abstract.d.ts +0 -2
- package/arch/modules/domain/entities/$array.abstract.js +0 -6
- package/arch/modules/domain/entities/$boolean.abstract.d.ts +0 -7
- package/arch/modules/domain/entities/$boolean.abstract.js +0 -21
- package/arch/modules/domain/entities/$date.abstract.d.ts +0 -2
- package/arch/modules/domain/entities/$date.abstract.js +0 -6
- package/arch/modules/domain/entities/$number.abstract.d.ts +0 -13
- package/arch/modules/domain/entities/$object.abstract.d.ts +0 -2
- package/arch/modules/domain/entities/$object.abstract.js +0 -6
- package/arch/modules/domain/entities/entity-frontend.abstract.d.ts +0 -6
- package/arch/modules/domain/entities/entity-frontend.abstract.js +0 -11
- package/arch/modules/domain/entities/solid.abstract.d.ts +0 -4
- package/arch/modules/domain/entities/solid.abstract.js +0 -6
- package/arch/modules/domain/entities/url.abstract.d.ts +0 -3
- package/arch/modules/domain/entities/url.abstract.js +0 -7
- package/arch/modules/domain/entities/user/password/password.abstract.d.ts +0 -8
- package/arch/modules/domain/entities/user/password/password.abstract.js +0 -41
- package/arch/modules/domain/entities/user/password/password.abstract.type.js +0 -2
- package/arch/modules/domain/entities/user/password/steps/not-allowing-these-chars-step.js +0 -17
- package/arch/modules/domain/entities/user/password/steps/numeric-step.js +0 -13
- package/arch/modules/domain/entities/user/password/steps/with-at-least-one-letter-step.js +0 -14
- package/arch/modules/domain/entities/user/password/steps/with-at-least-one-number-digit-step.js +0 -14
- package/arch/modules/domain/entities/user/password/steps/with-at-least-one-special-char-step.js +0 -14
- package/arch/modules/domain/entities/user/password/validation-step.js +0 -9
- package/arch/modules/domain/entities/user/password/validation-step.type.js +0 -2
- package/arch/modules/domain/entities/user/value-objects/email.d.ts +0 -6
- package/arch/modules/domain/entities/user/value-objects/person-name.d.ts +0 -7
- package/arch/modules/domain/entities/user/value-objects/person-name.js +0 -17
- package/arch/modules/domain/entities/user/value-objects/user-id.d.ts +0 -3
- package/arch/modules/domain/entities/user/value-objects/user-id.js +0 -7
- package/arch/modules/domain/entities/user/value-objects/username.d.ts +0 -3
- package/arch/modules/domain/entities/user/value-objects/username.js +0 -7
- package/arch/modules/domain/entities/uuid.abstract.js +0 -23
- package/arch/modules/domain/entities/value-object.abstract.d.ts +0 -3
- package/arch/modules/domain/entities/value-object.abstract.js +0 -7
- package/arch/modules/infrastructure/services/http-client.abstract.d.ts +0 -0
- package/arch/modules/infrastructure/services/http-client.abstract.js +0 -1
- package/arch/modules/infrastructure/services/payloads/service.payload.abstract.d.ts +0 -0
- package/arch/modules/infrastructure/services/payloads/service.payload.abstract.js +0 -1
- package/arch/modules/infrastructure/services/responses/service.response.abstract.d.ts +0 -0
- package/arch/modules/infrastructure/services/responses/service.response.abstract.js +0 -1
- package/arch/tsconfig-backend.json +0 -3
- package/arch/tsconfig-default.json +0 -45
- package/arch/tsconfig-frontend.json +0 -3
- package/arch/tsconfig-lib.json +0 -6
- package/arch/tsconfig-mobile.json +0 -3
- /package/{arch/modules/domain/enums → objects/@common/points}/header-token-name.enum.d.ts +0 -0
- /package/{arch/modules/domain/enums → objects/@common/points}/http-status-codes.enum.d.ts +0 -0
- /package/{arch/modules/domain/enums → objects/@common/points}/node-envs.enum.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-consecutive-chars-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-date-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-phone-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-repeated-chars-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-string-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-these-chars-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/numeric-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-letter-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-number-digit-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-special-char-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/steps/with-length-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/validation-step.d.ts +0 -0
- /package/{arch/modules/domain/entities/user → objects}/password/validation-step.type.d.ts +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Return } from "../utils/ducts/return-type";
|
|
2
|
-
import { FailureAbstract } from "../../arch/modules/application/failures/failure.abstract";
|
|
3
|
-
export declare class CreateFakeUsecase {
|
|
4
|
-
private _response;
|
|
5
|
-
static new<UsecaseStub>(): UsecaseStub & CreateFakeUsecase;
|
|
6
|
-
protected execute(): Promise<Return<unknown, unknown>>;
|
|
7
|
-
withSuccess(response: unknown): this;
|
|
8
|
-
withFailure(response?: FailureAbstract): this;
|
|
9
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateFakeUsecase = void 0;
|
|
4
|
-
const failure_dummy_1 = require("./builders/failures/dummies/failure.dummy");
|
|
5
|
-
const failure_builder_1 = require("./builders/failures/failure.builder");
|
|
6
|
-
const return_type_1 = require("../utils/ducts/return-type");
|
|
7
|
-
class CreateFakeUsecase {
|
|
8
|
-
static new() {
|
|
9
|
-
const instance = new CreateFakeUsecase();
|
|
10
|
-
return instance;
|
|
11
|
-
}
|
|
12
|
-
async execute() {
|
|
13
|
-
if (this._response.hasFailure())
|
|
14
|
-
return (0, return_type_1.Failure)(this._response.unwrapFail());
|
|
15
|
-
return (0, return_type_1.Success)(this._response.unwrap());
|
|
16
|
-
}
|
|
17
|
-
withSuccess(response) {
|
|
18
|
-
this._response = (0, return_type_1.Success)(response);
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
withFailure(response) {
|
|
22
|
-
this._response = (0, return_type_1.Failure)(response ?? new failure_builder_1.FailureBuilder(failure_dummy_1.FailureDummy).build());
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.CreateFakeUsecase = CreateFakeUsecase;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExtendedMap = void 0;
|
|
4
|
-
const guardian_1 = require("../type-guard/guardian");
|
|
5
|
-
class ExtendedMap extends Map {
|
|
6
|
-
getOrDefault(key, defaultValue) {
|
|
7
|
-
return this.get(key) ?? defaultValue;
|
|
8
|
-
}
|
|
9
|
-
getOrThrow(key, errorMessage = "Key not mapped") {
|
|
10
|
-
const value = this.get(key);
|
|
11
|
-
if (guardian_1.Guardian.isUndefined(value)) {
|
|
12
|
-
throw Error(errorMessage);
|
|
13
|
-
}
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
invert() {
|
|
17
|
-
const inverted = new ExtendedMap();
|
|
18
|
-
this.forEach((value, key) => inverted.set(value, key));
|
|
19
|
-
return inverted;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.ExtendedMap = ExtendedMap;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpClientException = void 0;
|
|
4
|
-
class HttpClientException extends Error {
|
|
5
|
-
constructor(message, name, stack) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.stack = stack;
|
|
8
|
-
this.name = name ?? HttpClientException.name;
|
|
9
|
-
this.message = message;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.HttpClientException = HttpClientException;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AxiosResponseHeaders, RawAxiosResponseHeaders } from "axios";
|
|
2
|
-
import { Newable, ObjectType } from "../datatypes/generic-types";
|
|
3
|
-
import { Optional } from "../ducts/optional-type";
|
|
4
|
-
import { Return } from "../ducts/return-type";
|
|
5
|
-
import { FailureAbstract } from "../../../arch/modules/application/failures/failure.abstract";
|
|
6
|
-
type Header = RawAxiosResponseHeaders | AxiosResponseHeaders;
|
|
7
|
-
export declare class HttpClientResponse {
|
|
8
|
-
readonly statusCode: number;
|
|
9
|
-
private readonly data;
|
|
10
|
-
private readonly headers?;
|
|
11
|
-
constructor(statusCode: number, data: unknown, headers?: Header | undefined);
|
|
12
|
-
hasFailure(): boolean;
|
|
13
|
-
hasSuccess(): boolean;
|
|
14
|
-
hasStatus(status: number): boolean;
|
|
15
|
-
getData<T extends ObjectType>(dataType: Newable<T>): Promise<T>;
|
|
16
|
-
getHeader(key: string): Return<Optional<string>, FailureAbstract>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpClientResponseGetHeaderFailure = void 0;
|
|
4
|
-
const failure_abstract_1 = require("../../../arch/modules/application/failures/failure.abstract");
|
|
5
|
-
class HttpClientResponseGetHeaderFailure extends failure_abstract_1.FailureAbstract {
|
|
6
|
-
constructor(keyName, error) {
|
|
7
|
-
super({
|
|
8
|
-
className: HttpClientResponseGetHeaderFailure.name,
|
|
9
|
-
message: `Header does not contain defined ${keyName} key`,
|
|
10
|
-
error,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.HttpClientResponseGetHeaderFailure = HttpClientResponseGetHeaderFailure;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpClientResponse = void 0;
|
|
4
|
-
const class_transformer_1 = require("class-transformer");
|
|
5
|
-
const class_validator_1 = require("class-validator");
|
|
6
|
-
const optional_type_1 = require("../ducts/optional-type");
|
|
7
|
-
const return_type_1 = require("../ducts/return-type");
|
|
8
|
-
const http_client_response_get_header_failure_1 = require("./http-client-response.get-header.failure");
|
|
9
|
-
const guardian_1 = require("../type-guard/guardian");
|
|
10
|
-
const http_status_codes_enum_1 = require("../../../arch/modules/domain/enums/http-status-codes.enum");
|
|
11
|
-
class HttpClientResponse {
|
|
12
|
-
constructor(statusCode, data, headers) {
|
|
13
|
-
this.statusCode = statusCode;
|
|
14
|
-
this.data = data;
|
|
15
|
-
this.headers = headers;
|
|
16
|
-
}
|
|
17
|
-
hasFailure() {
|
|
18
|
-
return (this.statusCode >= http_status_codes_enum_1.HttpStatusCodes.BAD_REQUEST &&
|
|
19
|
-
this.statusCode < http_status_codes_enum_1.HttpStatusCodes.INTERNAL_SERVER_ERROR);
|
|
20
|
-
}
|
|
21
|
-
hasSuccess() {
|
|
22
|
-
return guardian_1.Guardian.isFalsy(this.hasFailure());
|
|
23
|
-
}
|
|
24
|
-
hasStatus(status) {
|
|
25
|
-
return this.statusCode === status;
|
|
26
|
-
}
|
|
27
|
-
async getData(dataType) {
|
|
28
|
-
const data = (0, class_transformer_1.plainToClass)(dataType, this.data);
|
|
29
|
-
await (0, class_validator_1.validateOrReject)(data);
|
|
30
|
-
return data;
|
|
31
|
-
}
|
|
32
|
-
getHeader(key) {
|
|
33
|
-
if (guardian_1.Guardian.isUndefined(this.headers))
|
|
34
|
-
return (0, return_type_1.Failure)(new http_client_response_get_header_failure_1.HttpClientResponseGetHeaderFailure(key));
|
|
35
|
-
const header = this.headers[key];
|
|
36
|
-
return (0, return_type_1.Success)((0, optional_type_1.Optional)(header));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.HttpClientResponse = HttpClientResponse;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { HttpClientRequest } from "./http-client-request";
|
|
2
|
-
import { HttpClientResponse } from "./http-client-response";
|
|
3
|
-
import { AxiosInstance } from "axios";
|
|
4
|
-
export declare class HttpClient {
|
|
5
|
-
readonly baseUrl: string;
|
|
6
|
-
protected readonly axios: AxiosInstance;
|
|
7
|
-
constructor(baseUrl: string);
|
|
8
|
-
request(request: HttpClientRequest): Promise<HttpClientResponse>;
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HttpClient = void 0;
|
|
7
|
-
const http_client_response_1 = require("./http-client-response");
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
class HttpClient {
|
|
10
|
-
constructor(baseUrl) {
|
|
11
|
-
this.baseUrl = baseUrl;
|
|
12
|
-
this.axios = axios_1.default.create({
|
|
13
|
-
baseURL: baseUrl,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async request(request) {
|
|
17
|
-
const response = await this.axios.request(request);
|
|
18
|
-
return new http_client_response_1.HttpClientResponse(response.status, response.data, response.headers);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.HttpClient = HttpClient;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare class RandomValue {
|
|
2
|
-
static randomNumber(min: number, max: number): number;
|
|
3
|
-
static randomEnumValue<T extends Record<string, unknown>>(anEnum: T): T[keyof T];
|
|
4
|
-
static randomEnumValueExcept<T extends Record<string, unknown>>(anEnum: T, excepts: Array<T[keyof T]>): T[keyof T];
|
|
5
|
-
}
|
package/arch/@atlantjs.json
DELETED
package/arch/biome.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
|
3
|
-
"organizeImports": {
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
6
|
-
"formatter": {
|
|
7
|
-
"lineEnding": "cr"
|
|
8
|
-
},
|
|
9
|
-
"files": {
|
|
10
|
-
"ignore": [".dev", "dist"]
|
|
11
|
-
},
|
|
12
|
-
"javascript": {
|
|
13
|
-
"parser": {
|
|
14
|
-
"unsafeParameterDecoratorsEnabled": true
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"linter": {
|
|
18
|
-
"enabled": true,
|
|
19
|
-
"rules": {
|
|
20
|
-
"style": {
|
|
21
|
-
"useImportType": {
|
|
22
|
-
"level": "off"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"recommended": true,
|
|
26
|
-
"complexity": {
|
|
27
|
-
"noForEach": {
|
|
28
|
-
"level": "off"
|
|
29
|
-
},
|
|
30
|
-
"noStaticOnlyClass": {
|
|
31
|
-
"level": "off"
|
|
32
|
-
},
|
|
33
|
-
"noBannedTypes": {
|
|
34
|
-
"level": "off"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"suspicious": {
|
|
38
|
-
"noExplicitAny": {
|
|
39
|
-
"level": "off"
|
|
40
|
-
},
|
|
41
|
-
"noMisleadingInstantiator": {
|
|
42
|
-
"level": "off"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FailurePrimitive, FailureProps } from "./failure.abstract.type";
|
|
2
|
-
import { SolidAbstract } from "../../domain/entities/solid.abstract";
|
|
3
|
-
export declare abstract class FailureAbstract implements SolidAbstract {
|
|
4
|
-
private readonly props;
|
|
5
|
-
protected readonly _code: string;
|
|
6
|
-
protected readonly _message: string;
|
|
7
|
-
constructor(props: FailureProps);
|
|
8
|
-
toPlain(): FailurePrimitive;
|
|
9
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FailureAbstract = void 0;
|
|
4
|
-
const guardian_1 = require("../../../../@tool-box/utils/type-guard/guardian");
|
|
5
|
-
const node_envs_enum_1 = require("../../domain/enums/node-envs.enum");
|
|
6
|
-
class FailureAbstract {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
this.props = props;
|
|
9
|
-
this._code = this.props.className.toKebabCase();
|
|
10
|
-
if (guardian_1.Guardian.and(guardian_1.Guardian.isEqual(process.env.ENVIRONMENT, node_envs_enum_1.NodeEnvs.development), guardian_1.Guardian.isNotEmpty(this.props.error))) {
|
|
11
|
-
this._message = `${this.props.message} - ${this.props.error.toString()}`;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
this._message = this.props.message;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
toPlain() {
|
|
18
|
-
return {
|
|
19
|
-
code: this._code,
|
|
20
|
-
message: this._message,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.FailureAbstract = FailureAbstract;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface UnknownFailurePrimitive {
|
|
2
|
-
code: string;
|
|
3
|
-
message: string;
|
|
4
|
-
}
|
|
5
|
-
interface UnknownFailureProps {
|
|
6
|
-
className: string;
|
|
7
|
-
failure: UnknownFailurePrimitive;
|
|
8
|
-
}
|
|
9
|
-
export declare class UnknownFailure {
|
|
10
|
-
protected readonly unknownCode: string;
|
|
11
|
-
protected readonly unknownMessage: string;
|
|
12
|
-
constructor({ className, failure }: UnknownFailureProps);
|
|
13
|
-
toPlain(): UnknownFailurePrimitive;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnknownFailure = void 0;
|
|
4
|
-
class UnknownFailure {
|
|
5
|
-
constructor({ className, failure }) {
|
|
6
|
-
this.unknownCode = className.toKebabCase();
|
|
7
|
-
this.unknownMessage = failure.message;
|
|
8
|
-
}
|
|
9
|
-
toPlain() {
|
|
10
|
-
return {
|
|
11
|
-
code: this.unknownCode,
|
|
12
|
-
message: this.unknownMessage,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.UnknownFailure = UnknownFailure;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.$boolean = void 0;
|
|
4
|
-
class $boolean {
|
|
5
|
-
constructor(value) {
|
|
6
|
-
this.value = value;
|
|
7
|
-
}
|
|
8
|
-
toBoolean() {
|
|
9
|
-
return this.value;
|
|
10
|
-
}
|
|
11
|
-
isEqual(value) {
|
|
12
|
-
if (value instanceof $boolean) {
|
|
13
|
-
return value.toBoolean() === this.value;
|
|
14
|
-
}
|
|
15
|
-
return this.value === value;
|
|
16
|
-
}
|
|
17
|
-
isDifferent(value) {
|
|
18
|
-
return this.value !== value;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.$boolean = $boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare abstract class $number {
|
|
2
|
-
private value;
|
|
3
|
-
constructor(value: number);
|
|
4
|
-
toNumber(): number;
|
|
5
|
-
isEqual(value: number | $number): boolean;
|
|
6
|
-
isDifferent(value: number | $number): boolean;
|
|
7
|
-
isBiggerThan(value: number | $number): boolean;
|
|
8
|
-
isSmallerThan(value: number | $number): boolean;
|
|
9
|
-
isEqualOrBiggerThan(value: number | $number): boolean;
|
|
10
|
-
isEqualOrSmallerThan(value: number | $number): boolean;
|
|
11
|
-
isBetween(min: number | $number, max: number | $number): boolean;
|
|
12
|
-
private validate;
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityFrontendAbstract = void 0;
|
|
4
|
-
const solid_abstract_1 = require("./solid.abstract");
|
|
5
|
-
class EntityFrontendAbstract extends solid_abstract_1.SolidAbstract {
|
|
6
|
-
constructor(_id) {
|
|
7
|
-
super();
|
|
8
|
-
this._id = _id;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.EntityFrontendAbstract = EntityFrontendAbstract;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PasswordPolicyResult } from "./password.abstract.type";
|
|
2
|
-
export declare abstract class PasswordAbstract {
|
|
3
|
-
private readonly password;
|
|
4
|
-
private readonly validationSteps;
|
|
5
|
-
constructor(password: string);
|
|
6
|
-
protected validate(password: string): PasswordPolicyResult;
|
|
7
|
-
toString(): string;
|
|
8
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PasswordAbstract = void 0;
|
|
4
|
-
const guardian_1 = require("../../../../../../@tool-box/utils/type-guard/guardian");
|
|
5
|
-
const with_at_least_one_letter_step_1 = require("./steps/with-at-least-one-letter-step");
|
|
6
|
-
const with_at_least_one_number_digit_step_1 = require("./steps/with-at-least-one-number-digit-step");
|
|
7
|
-
const with_at_least_one_special_char_step_1 = require("./steps/with-at-least-one-special-char-step");
|
|
8
|
-
const with_length_step_1 = require("./steps/with-length-step");
|
|
9
|
-
class PasswordAbstract {
|
|
10
|
-
constructor(password) {
|
|
11
|
-
this.password = password;
|
|
12
|
-
this.validationSteps = [
|
|
13
|
-
new with_at_least_one_letter_step_1.WithAtLeastOneLetterStep(),
|
|
14
|
-
new with_at_least_one_number_digit_step_1.WithAtLeastOneNumberDigitStep(),
|
|
15
|
-
new with_at_least_one_special_char_step_1.WithAtLeastOneSpecialCharStep(),
|
|
16
|
-
new with_length_step_1.WithLengthStep({ min: 6, max: 999 }),
|
|
17
|
-
];
|
|
18
|
-
const { valid, validationStepsResults } = this.validate(this.password);
|
|
19
|
-
if (guardian_1.Guardian.isFalsy(valid)) {
|
|
20
|
-
throw new TypeError(`Password is invalid: ${validationStepsResults.map((result) => result.name)}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
validate(password) {
|
|
24
|
-
if (guardian_1.Guardian.isEqual(this.validationSteps.length, 0)) {
|
|
25
|
-
throw new TypeError("No validations found");
|
|
26
|
-
}
|
|
27
|
-
const validationStepsResults = [];
|
|
28
|
-
for (const step of this.validationSteps) {
|
|
29
|
-
validationStepsResults.push(step.validate(password));
|
|
30
|
-
}
|
|
31
|
-
const valid = validationStepsResults.every((result) => result.valid);
|
|
32
|
-
return {
|
|
33
|
-
valid,
|
|
34
|
-
validationStepsResults,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
toString() {
|
|
38
|
-
return this.password;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.PasswordAbstract = PasswordAbstract;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
super();
|
|
8
|
-
this.options = options;
|
|
9
|
-
}
|
|
10
|
-
validate(password) {
|
|
11
|
-
return {
|
|
12
|
-
valid: this.options.notAllowedCharsList.every((char) => !password.toLowerCase().includes(char.toLowerCase())),
|
|
13
|
-
name: this.name,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.NotAllowingTheseCharsStep = NotAllowingTheseCharsStep;
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {
|
|
6
|
-
validate(password) {
|
|
7
|
-
return {
|
|
8
|
-
valid: /^\d+$/.test(password),
|
|
9
|
-
name: this.name,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.NumericStep = NumericStep;
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {
|
|
6
|
-
validate(password) {
|
|
7
|
-
const regex = /[a-zA-Z]/;
|
|
8
|
-
return {
|
|
9
|
-
valid: regex.test(password),
|
|
10
|
-
name: this.name,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.WithAtLeastOneLetterStep = WithAtLeastOneLetterStep;
|
package/arch/modules/domain/entities/user/password/steps/with-at-least-one-number-digit-step.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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 {
|
|
6
|
-
validate(password) {
|
|
7
|
-
const regex = /\d/;
|
|
8
|
-
return {
|
|
9
|
-
valid: regex.test(password),
|
|
10
|
-
name: this.name,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.WithAtLeastOneNumberDigitStep = WithAtLeastOneNumberDigitStep;
|
package/arch/modules/domain/entities/user/password/steps/with-at-least-one-special-char-step.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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 {
|
|
6
|
-
validate(password) {
|
|
7
|
-
const regex = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
8
|
-
return {
|
|
9
|
-
valid: regex.test(password),
|
|
10
|
-
name: this.name,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.WithAtLeastOneSpecialCharStep = WithAtLeastOneSpecialCharStep;
|