@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.
Files changed (187) hide show
  1. package/@tool-box/tests/{entity-builder.util.d.ts → builder.abstract.util.d.ts} +1 -1
  2. package/@tool-box/tests/{entity-builder.util.js → builder.abstract.util.js} +3 -6
  3. package/@tool-box/tests/builders/failures/dummies/failure.edge.dummy.d.ts +3 -0
  4. package/@tool-box/tests/builders/failures/dummies/failure.edge.dummy.js +3 -0
  5. package/@tool-box/tests/builders/failures/failure.edge.builder.d.ts +6 -0
  6. package/@tool-box/tests/builders/failures/failure.edge.builder.js +18 -0
  7. package/@tool-box/tests/builders/user/email.edge.builder.d.ts +6 -0
  8. package/@tool-box/tests/builders/user/email.edge.builder.js +11 -0
  9. package/@tool-box/tests/builders/user/person-name.edge.builder.d.ts +6 -0
  10. package/@tool-box/tests/builders/user/person-name.edge.builder.js +11 -0
  11. package/@tool-box/tests/builders/user/username.edge.builder.d.ts +6 -0
  12. package/@tool-box/tests/builders/user/username.edge.builder.js +11 -0
  13. package/@tool-box/tests/create-fake-command.d.ts +9 -0
  14. package/@tool-box/tests/create-fake-command.js +23 -0
  15. package/@tool-box/tests/faker/faker.js +7 -10
  16. package/@tool-box/utils/datatypes/boolean-utils.d.ts +1 -0
  17. package/@tool-box/utils/datatypes/boolean-utils.js +5 -2
  18. package/@tool-box/utils/datatypes/generic-types.d.ts +1 -1
  19. package/@tool-box/utils/datatypes/generic-types.js +1 -2
  20. package/@tool-box/utils/datatypes/string-utils.d.ts +1 -3
  21. package/@tool-box/utils/datatypes/string-utils.js +1 -10
  22. package/@tool-box/utils/ducts/common.js +7 -11
  23. package/@tool-box/utils/ducts/optional-type.d.ts +0 -1
  24. package/@tool-box/utils/ducts/optional-type.js +19 -22
  25. package/@tool-box/utils/ducts/return-type.d.ts +2 -2
  26. package/@tool-box/utils/ducts/return-type.js +21 -26
  27. package/@tool-box/utils/{arrays/extended-map.d.ts → map/map.abstract.d.ts} +1 -2
  28. package/@tool-box/utils/map/map.abstract.js +13 -0
  29. package/@tool-box/utils/random/random.d.ts +5 -0
  30. package/@tool-box/utils/{randoms/random-value.js → random/random.js} +4 -8
  31. package/@tool-box/utils/type-guard/guardian-exception.js +1 -5
  32. package/@tool-box/utils/type-guard/guardian.d.ts +11 -13
  33. package/@tool-box/utils/type-guard/guardian.js +19 -51
  34. package/@tool-box/utils/type-guard/guardian.type.js +1 -2
  35. package/README.md +0 -8
  36. package/index.d.ts +28 -37
  37. package/index.js +30 -81
  38. package/objects/@common/edges/email.edge.d.ts +6 -0
  39. package/{arch/modules/domain/entities/user/value-objects/email.js → objects/@common/edges/email.edge.js} +3 -6
  40. package/objects/@common/edges/person-name.edge.d.ts +7 -0
  41. package/objects/@common/edges/person-name.edge.js +14 -0
  42. package/objects/@common/edges/url.edge.d.ts +6 -0
  43. package/objects/@common/edges/url.edge.js +17 -0
  44. package/objects/@common/edges/username.edge.d.ts +3 -0
  45. package/objects/@common/edges/username.edge.js +3 -0
  46. package/{arch/modules/domain/entities/uuid.abstract.d.ts → objects/@common/edges/uuid.sketch.edge.d.ts} +2 -2
  47. package/objects/@common/edges/uuid.sketch.edge.js +18 -0
  48. package/{arch/modules/domain/enums → objects/@common/points}/header-token-name.enum.js +2 -5
  49. package/{arch/modules/domain/enums → objects/@common/points}/http-status-codes.enum.js +2 -5
  50. package/{arch/modules/domain/enums → objects/@common/points}/node-envs.enum.js +2 -5
  51. package/objects/datetime/edges/datetime.edge.d.ts +27 -0
  52. package/objects/datetime/edges/datetime.edge.js +133 -0
  53. package/objects/datetime/points/month-name.enum.d.ts +14 -0
  54. package/objects/datetime/points/month-name.enum.js +15 -0
  55. package/objects/datetime/points/week-day.enum.d.ts +9 -0
  56. package/objects/datetime/points/week-day.enum.js +10 -0
  57. package/objects/failure/edges/failure.sketch.edge.d.ts +8 -0
  58. package/objects/failure/edges/failure.sketch.edge.js +23 -0
  59. package/objects/failure/edges/failure.sketch.polygon.d.ts +9 -0
  60. package/objects/failure/edges/failure.sketch.polygon.js +1 -0
  61. package/objects/password/password.edge.d.ts +8 -0
  62. package/objects/password/password.edge.js +38 -0
  63. package/{arch/modules/domain/entities/user/password/password.abstract.type.d.ts → objects/password/password.polygon.d.ts} +1 -1
  64. package/objects/password/password.polygon.js +1 -0
  65. package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-consecutive-chars-step.js +3 -6
  66. package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-date-step.js +3 -6
  67. package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-phone-step.js +3 -6
  68. package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-repeated-chars-step.js +3 -6
  69. package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-string-step.js +3 -6
  70. package/objects/password/steps/not-allowing-these-chars-step.js +14 -0
  71. package/objects/password/steps/numeric-step.js +9 -0
  72. package/objects/password/steps/with-at-least-one-letter-step.js +10 -0
  73. package/objects/password/steps/with-at-least-one-number-digit-step.js +10 -0
  74. package/objects/password/steps/with-at-least-one-special-char-step.js +10 -0
  75. package/{arch/modules/domain/entities/user → objects}/password/steps/with-length-step.js +3 -6
  76. package/objects/password/validation-step.js +5 -0
  77. package/objects/password/validation-step.type.js +1 -0
  78. package/objects/primitives/boolean.edge.sketch.d.ts +7 -0
  79. package/objects/primitives/boolean.edge.sketch.js +18 -0
  80. package/objects/primitives/datetime.edge.sketch.d.ts +3 -0
  81. package/objects/primitives/datetime.edge.sketch.js +3 -0
  82. package/objects/primitives/number.edge.sketch.d.ts +13 -0
  83. package/{arch/modules/domain/entities/$number.abstract.js → objects/primitives/number.edge.sketch.js} +12 -15
  84. package/{arch/modules/domain/entities/$string.abstract.d.ts → objects/primitives/string.edge.sketch.d.ts} +1 -1
  85. package/{arch/modules/domain/entities/$string.abstract.js → objects/primitives/string.edge.sketch.js} +2 -5
  86. package/package.json +6 -11
  87. package/tsconfig.tsbuildinfo +1 -1
  88. package/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +0 -3
  89. package/@tool-box/tests/builders/failures/dummies/failure.dummy.js +0 -7
  90. package/@tool-box/tests/builders/failures/failure.builder.d.ts +0 -6
  91. package/@tool-box/tests/builders/failures/failure.builder.js +0 -21
  92. package/@tool-box/tests/builders/generic/dummies/uuid.dummy.d.ts +0 -3
  93. package/@tool-box/tests/builders/generic/dummies/uuid.dummy.js +0 -7
  94. package/@tool-box/tests/builders/generic/uuid.builder.d.ts +0 -6
  95. package/@tool-box/tests/builders/generic/uuid.builder.js +0 -14
  96. package/@tool-box/tests/builders/user/email.builder.d.ts +0 -6
  97. package/@tool-box/tests/builders/user/email.builder.js +0 -15
  98. package/@tool-box/tests/builders/user/person-name.builder.d.ts +0 -6
  99. package/@tool-box/tests/builders/user/person-name.builder.js +0 -15
  100. package/@tool-box/tests/builders/user/user-id.builder.d.ts +0 -6
  101. package/@tool-box/tests/builders/user/user-id.builder.js +0 -14
  102. package/@tool-box/tests/builders/user/username.builder.d.ts +0 -6
  103. package/@tool-box/tests/builders/user/username.builder.js +0 -15
  104. package/@tool-box/tests/create-fake-usecase.d.ts +0 -9
  105. package/@tool-box/tests/create-fake-usecase.js +0 -26
  106. package/@tool-box/utils/arrays/extended-map.js +0 -22
  107. package/@tool-box/utils/http-client/http-client-exception.d.ts +0 -3
  108. package/@tool-box/utils/http-client/http-client-exception.js +0 -12
  109. package/@tool-box/utils/http-client/http-client-request.d.ts +0 -9
  110. package/@tool-box/utils/http-client/http-client-request.js +0 -2
  111. package/@tool-box/utils/http-client/http-client-response.d.ts +0 -18
  112. package/@tool-box/utils/http-client/http-client-response.get-header.failure.d.ts +0 -4
  113. package/@tool-box/utils/http-client/http-client-response.get-header.failure.js +0 -14
  114. package/@tool-box/utils/http-client/http-client-response.js +0 -39
  115. package/@tool-box/utils/http-client/http-client.d.ts +0 -9
  116. package/@tool-box/utils/http-client/http-client.js +0 -21
  117. package/@tool-box/utils/randoms/random-value.d.ts +0 -5
  118. package/arch/@atlantjs.json +0 -3
  119. package/arch/biome.json +0 -47
  120. package/arch/modules/application/failures/failure.abstract.d.ts +0 -9
  121. package/arch/modules/application/failures/failure.abstract.js +0 -24
  122. package/arch/modules/application/failures/failure.abstract.type.d.ts +0 -9
  123. package/arch/modules/application/failures/failure.abstract.type.js +0 -2
  124. package/arch/modules/application/failures/unknown-failure.d.ts +0 -15
  125. package/arch/modules/application/failures/unknown-failure.js +0 -16
  126. package/arch/modules/domain/entities/$array.abstract.d.ts +0 -2
  127. package/arch/modules/domain/entities/$array.abstract.js +0 -6
  128. package/arch/modules/domain/entities/$boolean.abstract.d.ts +0 -7
  129. package/arch/modules/domain/entities/$boolean.abstract.js +0 -21
  130. package/arch/modules/domain/entities/$date.abstract.d.ts +0 -2
  131. package/arch/modules/domain/entities/$date.abstract.js +0 -6
  132. package/arch/modules/domain/entities/$number.abstract.d.ts +0 -13
  133. package/arch/modules/domain/entities/$object.abstract.d.ts +0 -2
  134. package/arch/modules/domain/entities/$object.abstract.js +0 -6
  135. package/arch/modules/domain/entities/entity-frontend.abstract.d.ts +0 -6
  136. package/arch/modules/domain/entities/entity-frontend.abstract.js +0 -11
  137. package/arch/modules/domain/entities/solid.abstract.d.ts +0 -4
  138. package/arch/modules/domain/entities/solid.abstract.js +0 -6
  139. package/arch/modules/domain/entities/url.abstract.d.ts +0 -3
  140. package/arch/modules/domain/entities/url.abstract.js +0 -7
  141. package/arch/modules/domain/entities/user/password/password.abstract.d.ts +0 -8
  142. package/arch/modules/domain/entities/user/password/password.abstract.js +0 -41
  143. package/arch/modules/domain/entities/user/password/password.abstract.type.js +0 -2
  144. package/arch/modules/domain/entities/user/password/steps/not-allowing-these-chars-step.js +0 -17
  145. package/arch/modules/domain/entities/user/password/steps/numeric-step.js +0 -13
  146. package/arch/modules/domain/entities/user/password/steps/with-at-least-one-letter-step.js +0 -14
  147. package/arch/modules/domain/entities/user/password/steps/with-at-least-one-number-digit-step.js +0 -14
  148. package/arch/modules/domain/entities/user/password/steps/with-at-least-one-special-char-step.js +0 -14
  149. package/arch/modules/domain/entities/user/password/validation-step.js +0 -9
  150. package/arch/modules/domain/entities/user/password/validation-step.type.js +0 -2
  151. package/arch/modules/domain/entities/user/value-objects/email.d.ts +0 -6
  152. package/arch/modules/domain/entities/user/value-objects/person-name.d.ts +0 -7
  153. package/arch/modules/domain/entities/user/value-objects/person-name.js +0 -17
  154. package/arch/modules/domain/entities/user/value-objects/user-id.d.ts +0 -3
  155. package/arch/modules/domain/entities/user/value-objects/user-id.js +0 -7
  156. package/arch/modules/domain/entities/user/value-objects/username.d.ts +0 -3
  157. package/arch/modules/domain/entities/user/value-objects/username.js +0 -7
  158. package/arch/modules/domain/entities/uuid.abstract.js +0 -23
  159. package/arch/modules/domain/entities/value-object.abstract.d.ts +0 -3
  160. package/arch/modules/domain/entities/value-object.abstract.js +0 -7
  161. package/arch/modules/infrastructure/services/http-client.abstract.d.ts +0 -0
  162. package/arch/modules/infrastructure/services/http-client.abstract.js +0 -1
  163. package/arch/modules/infrastructure/services/payloads/service.payload.abstract.d.ts +0 -0
  164. package/arch/modules/infrastructure/services/payloads/service.payload.abstract.js +0 -1
  165. package/arch/modules/infrastructure/services/responses/service.response.abstract.d.ts +0 -0
  166. package/arch/modules/infrastructure/services/responses/service.response.abstract.js +0 -1
  167. package/arch/tsconfig-backend.json +0 -3
  168. package/arch/tsconfig-default.json +0 -45
  169. package/arch/tsconfig-frontend.json +0 -3
  170. package/arch/tsconfig-lib.json +0 -6
  171. package/arch/tsconfig-mobile.json +0 -3
  172. /package/{arch/modules/domain/enums → objects/@common/points}/header-token-name.enum.d.ts +0 -0
  173. /package/{arch/modules/domain/enums → objects/@common/points}/http-status-codes.enum.d.ts +0 -0
  174. /package/{arch/modules/domain/enums → objects/@common/points}/node-envs.enum.d.ts +0 -0
  175. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-consecutive-chars-step.d.ts +0 -0
  176. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-date-step.d.ts +0 -0
  177. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-phone-step.d.ts +0 -0
  178. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-repeated-chars-step.d.ts +0 -0
  179. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-string-step.d.ts +0 -0
  180. /package/{arch/modules/domain/entities/user → objects}/password/steps/not-allowing-these-chars-step.d.ts +0 -0
  181. /package/{arch/modules/domain/entities/user → objects}/password/steps/numeric-step.d.ts +0 -0
  182. /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-letter-step.d.ts +0 -0
  183. /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-number-digit-step.d.ts +0 -0
  184. /package/{arch/modules/domain/entities/user → objects}/password/steps/with-at-least-one-special-char-step.d.ts +0 -0
  185. /package/{arch/modules/domain/entities/user → objects}/password/steps/with-length-step.d.ts +0 -0
  186. /package/{arch/modules/domain/entities/user → objects}/password/validation-step.d.ts +0 -0
  187. /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,3 +0,0 @@
1
- export declare class HttpClientException extends Error {
2
- constructor(message: string, name?: string, stack?: string);
3
- }
@@ -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,9 +0,0 @@
1
- import { ResponseType } from "axios";
2
- export interface HttpClientRequest {
3
- url: string;
4
- method: "get" | "post" | "put" | "patch" | "delete";
5
- params?: unknown;
6
- data?: unknown;
7
- headers?: Record<string, string>;
8
- responseType?: ResponseType;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,4 +0,0 @@
1
- import { FailureAbstract } from "../../../arch/modules/application/failures/failure.abstract";
2
- export declare class HttpClientResponseGetHeaderFailure extends FailureAbstract {
3
- constructor(keyName: string, error?: any);
4
- }
@@ -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
- }
@@ -1,3 +0,0 @@
1
- {
2
- "projectType": "backend"
3
- }
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,9 +0,0 @@
1
- export interface FailurePrimitive {
2
- code: string;
3
- message: string;
4
- }
5
- export interface FailureProps {
6
- className: string;
7
- message: string;
8
- error?: any;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 +0,0 @@
1
- export declare abstract class $array {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$array = void 0;
4
- class $array {
5
- }
6
- exports.$array = $array;
@@ -1,7 +0,0 @@
1
- export declare abstract class $boolean {
2
- private value;
3
- constructor(value: boolean);
4
- toBoolean(): boolean;
5
- isEqual(value: $boolean | boolean): boolean;
6
- isDifferent(value: boolean): boolean;
7
- }
@@ -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,2 +0,0 @@
1
- export declare abstract class $date {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$date = void 0;
4
- class $date {
5
- }
6
- exports.$date = $date;
@@ -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,2 +0,0 @@
1
- export declare abstract class $object {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$object = void 0;
4
- class $object {
5
- }
6
- exports.$object = $object;
@@ -1,6 +0,0 @@
1
- import { SolidAbstract } from "./solid.abstract";
2
- import { UuidAbstract } from "./uuid.abstract";
3
- export declare abstract class EntityFrontendAbstract extends SolidAbstract {
4
- protected _id: UuidAbstract;
5
- constructor(_id: UuidAbstract);
6
- }
@@ -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,4 +0,0 @@
1
- import { ObjectType } from "../../../../@tool-box/utils/datatypes/generic-types";
2
- export declare abstract class SolidAbstract {
3
- abstract toPlain(): ObjectType;
4
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SolidAbstract = void 0;
4
- class SolidAbstract {
5
- }
6
- exports.SolidAbstract = SolidAbstract;
@@ -1,3 +0,0 @@
1
- import { $string } from "./$string.abstract";
2
- export declare class Url extends $string {
3
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Url = void 0;
4
- const _string_abstract_1 = require("./$string.abstract");
5
- class Url extends _string_abstract_1.$string {
6
- }
7
- exports.Url = Url;
@@ -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,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -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;
@@ -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;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationStep = void 0;
4
- class ValidationStep {
5
- get name() {
6
- return this.constructor.name;
7
- }
8
- }
9
- exports.ValidationStep = ValidationStep;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { $string } from "../../$string.abstract";
2
- export declare class Email extends $string {
3
- private readonly email;
4
- constructor(email: string);
5
- protected validation(): void;
6
- }