@arkyn/server 3.0.1-beta.166 → 3.0.1-beta.170
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/package.json +4 -3
- package/dist/http/api/_logRequest.d.ts +0 -58
- package/dist/http/api/_logRequest.d.ts.map +0 -1
- package/dist/http/api/_makeRequest.d.ts +0 -61
- package/dist/http/api/_makeRequest.d.ts.map +0 -1
- package/dist/http/api/deleteRequest.d.ts +0 -17
- package/dist/http/api/deleteRequest.d.ts.map +0 -1
- package/dist/http/api/getRequest.d.ts +0 -16
- package/dist/http/api/getRequest.d.ts.map +0 -1
- package/dist/http/api/patchRequest.d.ts +0 -17
- package/dist/http/api/patchRequest.d.ts.map +0 -1
- package/dist/http/api/postRequest.d.ts +0 -17
- package/dist/http/api/postRequest.d.ts.map +0 -1
- package/dist/http/api/putRequest.d.ts +0 -17
- package/dist/http/api/putRequest.d.ts.map +0 -1
- package/dist/http/badResponses/_badResponse.d.ts +0 -25
- package/dist/http/badResponses/_badResponse.d.ts.map +0 -1
- package/dist/http/badResponses/badGateway.d.ts +0 -24
- package/dist/http/badResponses/badGateway.d.ts.map +0 -1
- package/dist/http/badResponses/badRequest.d.ts +0 -22
- package/dist/http/badResponses/badRequest.d.ts.map +0 -1
- package/dist/http/badResponses/conflict.d.ts +0 -22
- package/dist/http/badResponses/conflict.d.ts.map +0 -1
- package/dist/http/badResponses/forbidden.d.ts +0 -22
- package/dist/http/badResponses/forbidden.d.ts.map +0 -1
- package/dist/http/badResponses/notFound.d.ts +0 -22
- package/dist/http/badResponses/notFound.d.ts.map +0 -1
- package/dist/http/badResponses/notImplemented.d.ts +0 -22
- package/dist/http/badResponses/notImplemented.d.ts.map +0 -1
- package/dist/http/badResponses/serverError.d.ts +0 -22
- package/dist/http/badResponses/serverError.d.ts.map +0 -1
- package/dist/http/badResponses/unauthorized.d.ts +0 -22
- package/dist/http/badResponses/unauthorized.d.ts.map +0 -1
- package/dist/http/badResponses/unprocessableEntity.d.ts +0 -34
- package/dist/http/badResponses/unprocessableEntity.d.ts.map +0 -1
- package/dist/http/successResponses/_successResponse.d.ts +0 -36
- package/dist/http/successResponses/_successResponse.d.ts.map +0 -1
- package/dist/http/successResponses/created.d.ts +0 -22
- package/dist/http/successResponses/created.d.ts.map +0 -1
- package/dist/http/successResponses/found.d.ts +0 -22
- package/dist/http/successResponses/found.d.ts.map +0 -1
- package/dist/http/successResponses/noContent.d.ts +0 -20
- package/dist/http/successResponses/noContent.d.ts.map +0 -1
- package/dist/http/successResponses/success.d.ts +0 -22
- package/dist/http/successResponses/success.d.ts.map +0 -1
- package/dist/http/successResponses/updated.d.ts +0 -23
- package/dist/http/successResponses/updated.d.ts.map +0 -1
- package/dist/index.d.ts +0 -34
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1065
- package/dist/modules/http/api/_logRequest.js +0 -56
- package/dist/modules/http/api/_makeRequest.js +0 -70
- package/dist/modules/http/api/deleteRequest.js +0 -13
- package/dist/modules/http/api/getRequest.js +0 -12
- package/dist/modules/http/api/patchRequest.js +0 -13
- package/dist/modules/http/api/postRequest.js +0 -13
- package/dist/modules/http/api/putRequest.js +0 -13
- package/dist/modules/http/badResponses/_badResponse.js +0 -63
- package/dist/modules/http/badResponses/badGateway.js +0 -24
- package/dist/modules/http/badResponses/badRequest.js +0 -24
- package/dist/modules/http/badResponses/conflict.js +0 -24
- package/dist/modules/http/badResponses/forbidden.js +0 -24
- package/dist/modules/http/badResponses/notFound.js +0 -24
- package/dist/modules/http/badResponses/notImplemented.js +0 -24
- package/dist/modules/http/badResponses/serverError.js +0 -24
- package/dist/modules/http/badResponses/unauthorized.js +0 -24
- package/dist/modules/http/badResponses/unprocessableEntity.js +0 -28
- package/dist/modules/http/successResponses/_successResponse.js +0 -62
- package/dist/modules/http/successResponses/created.js +0 -24
- package/dist/modules/http/successResponses/found.js +0 -24
- package/dist/modules/http/successResponses/noContent.js +0 -17
- package/dist/modules/http/successResponses/success.js +0 -24
- package/dist/modules/http/successResponses/updated.js +0 -24
- package/dist/modules/index.js +0 -34
- package/dist/modules/services/apiService.js +0 -109
- package/dist/modules/services/debugService.js +0 -36
- package/dist/modules/services/logMapperService.js +0 -29
- package/dist/modules/services/logService.js +0 -21
- package/dist/modules/utilities/decodeRequestBody.js +0 -20
- package/dist/modules/utilities/decodeRequestErrorMessage.js +0 -6
- package/dist/modules/utilities/errorHandler.js +0 -39
- package/dist/modules/utilities/flushDebugLogs.js +0 -16
- package/dist/modules/utilities/formAsyncParse.js +0 -14
- package/dist/modules/utilities/formParse.js +0 -14
- package/dist/modules/utilities/getScopedParams.js +0 -9
- package/dist/modules/utilities/schemaValidator.js +0 -55
- package/dist/modules/validations/validateCep.js +0 -9
- package/dist/modules/validations/validateCnpj.js +0 -54
- package/dist/modules/validations/validateCpf.js +0 -27
- package/dist/modules/validations/validateDate.js +0 -26
- package/dist/modules/validations/validateEmail.js +0 -54
- package/dist/modules/validations/validatePassword.js +0 -12
- package/dist/modules/validations/validatePhone.js +0 -10
- package/dist/modules/validations/validateRg.js +0 -8
- package/dist/services/apiService.d.ts +0 -83
- package/dist/services/apiService.d.ts.map +0 -1
- package/dist/services/debugService.d.ts +0 -37
- package/dist/services/debugService.d.ts.map +0 -1
- package/dist/services/logMapperService.d.ts +0 -86
- package/dist/services/logMapperService.d.ts.map +0 -1
- package/dist/services/logService.d.ts +0 -33
- package/dist/services/logService.d.ts.map +0 -1
- package/dist/utilities/decodeRequestBody.d.ts +0 -18
- package/dist/utilities/decodeRequestBody.d.ts.map +0 -1
- package/dist/utilities/decodeRequestErrorMessage.d.ts +0 -19
- package/dist/utilities/decodeRequestErrorMessage.d.ts.map +0 -1
- package/dist/utilities/errorHandler.d.ts +0 -25
- package/dist/utilities/errorHandler.d.ts.map +0 -1
- package/dist/utilities/flushDebugLogs.d.ts +0 -24
- package/dist/utilities/flushDebugLogs.d.ts.map +0 -1
- package/dist/utilities/formAsyncParse.d.ts +0 -38
- package/dist/utilities/formAsyncParse.d.ts.map +0 -1
- package/dist/utilities/formParse.d.ts +0 -38
- package/dist/utilities/formParse.d.ts.map +0 -1
- package/dist/utilities/getScopedParams.d.ts +0 -19
- package/dist/utilities/getScopedParams.d.ts.map +0 -1
- package/dist/utilities/schemaValidator.d.ts +0 -75
- package/dist/utilities/schemaValidator.d.ts.map +0 -1
- package/dist/validations/validateCep.d.ts +0 -19
- package/dist/validations/validateCep.d.ts.map +0 -1
- package/dist/validations/validateCnpj.d.ts +0 -21
- package/dist/validations/validateCnpj.d.ts.map +0 -1
- package/dist/validations/validateCpf.d.ts +0 -16
- package/dist/validations/validateCpf.d.ts.map +0 -1
- package/dist/validations/validateDate.d.ts +0 -23
- package/dist/validations/validateDate.d.ts.map +0 -1
- package/dist/validations/validateEmail.d.ts +0 -21
- package/dist/validations/validateEmail.d.ts.map +0 -1
- package/dist/validations/validatePassword.d.ts +0 -20
- package/dist/validations/validatePassword.d.ts.map +0 -1
- package/dist/validations/validatePhone.d.ts +0 -16
- package/dist/validations/validatePhone.d.ts.map +0 -1
- package/dist/validations/validateRg.d.ts +0 -21
- package/dist/validations/validateRg.d.ts.map +0 -1
- package/generate-version.ts +0 -74
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateDate.d.ts","sourceRoot":"","sources":["../../src/validations/validateDate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,iBAAS,YAAY,CACnB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE;IACP,WAAW,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,WAAW,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAiCT;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates if an email address is valid in all possible ways, including DNS validation.
|
|
3
|
-
*
|
|
4
|
-
* This function performs comprehensive email validation by:
|
|
5
|
-
* - Checking basic email format and syntax
|
|
6
|
-
* - Validating advanced RFC 5322 compliance rules
|
|
7
|
-
* - Verifying that the domain has valid MX or A records in DNS
|
|
8
|
-
*
|
|
9
|
-
* @param rawEmail - The email address to validate.
|
|
10
|
-
* @returns `true` if the email passes format checks and its domain resolves in DNS, otherwise `false`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* await validateEmail("user@gmail.com"); // true
|
|
15
|
-
* await validateEmail("user@gmil.com"); // false (invalid domain)
|
|
16
|
-
* await validateEmail("invalid-email"); // false (invalid format)
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function validateEmail(rawEmail: string): Promise<boolean>;
|
|
20
|
-
export { validateEmail };
|
|
21
|
-
//# sourceMappingURL=validateEmail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateEmail.d.ts","sourceRoot":"","sources":["../../src/validations/validateEmail.ts"],"names":[],"mappings":"AAwFA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iBAAe,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW/D;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates a password based on the following rules:
|
|
3
|
-
* - At least 8 characters
|
|
4
|
-
* - At least 1 uppercase letter
|
|
5
|
-
* - At least 1 letter (any case)
|
|
6
|
-
* - At least 1 number
|
|
7
|
-
* - At least 1 special character
|
|
8
|
-
*
|
|
9
|
-
* @param rawPassword - The password string to validate.
|
|
10
|
-
* @returns `true` if the password meets all rules, otherwise `false`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* validatePassword("Senha@123"); // true
|
|
15
|
-
* validatePassword("senha123"); // false (no uppercase, no special char)
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
declare function validatePassword(rawPassword: string): boolean;
|
|
19
|
-
export { validatePassword };
|
|
20
|
-
//# sourceMappingURL=validatePassword.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validatePassword.d.ts","sourceRoot":"","sources":["../../src/validations/validatePassword.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAS,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAkBtD;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates an international phone number using `libphonenumber-js`, then confirms
|
|
3
|
-
* the parsed country code is present in the supported countries list.
|
|
4
|
-
*
|
|
5
|
-
* @param rawPhone - Phone number in E.164 format (e.g. `"+5532912345678"`).
|
|
6
|
-
* @returns `true` if the number is valid and the country is supported, otherwise `false`.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* validatePhone("+5532912345678"); // true (Brazil)
|
|
11
|
-
* validatePhone("+55329123456178"); // false (invalid)
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
declare function validatePhone(rawPhone: string): boolean;
|
|
15
|
-
export { validatePhone };
|
|
16
|
-
//# sourceMappingURL=validatePhone.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validatePhone.d.ts","sourceRoot":"","sources":["../../src/validations/validatePhone.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AAEH,iBAAS,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAYhD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validates a Brazilian RG (Registro Geral) in a generic way.
|
|
3
|
-
*
|
|
4
|
-
* This function does a basic structure validation:
|
|
5
|
-
* - Removes non-alphanumeric characters.
|
|
6
|
-
* - Ensures length is reasonable (7–9 digits).
|
|
7
|
-
* - Optionally allows for a final letter (verifier).
|
|
8
|
-
*
|
|
9
|
-
* @param rawRg - RG string, possibly formatted.
|
|
10
|
-
* @returns `true` if format seems valid, otherwise `false`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* validateRg("12.345.678-9"); // true
|
|
15
|
-
* validateRg("MG-12.345.678"); // false (not supported)
|
|
16
|
-
* validateRg("12345678X"); // true
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function validateRg(rawRg: string): boolean;
|
|
20
|
-
export { validateRg };
|
|
21
|
-
//# sourceMappingURL=validateRg.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateRg.d.ts","sourceRoot":"","sources":["../../src/validations/validateRg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAa1C;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/generate-version.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
|
|
4
|
-
type ReleaseType = "beta" | "patch" | "minor" | "major";
|
|
5
|
-
|
|
6
|
-
interface PackageJson {
|
|
7
|
-
version: string;
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const release = process.argv[2] as ReleaseType;
|
|
12
|
-
|
|
13
|
-
const VALID_RELEASES: ReleaseType[] = ["beta", "patch", "minor", "major"];
|
|
14
|
-
|
|
15
|
-
if (!VALID_RELEASES.includes(release)) {
|
|
16
|
-
console.error("Usage: bun generate-version.ts [beta|patch|minor|major]");
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const PACKAGE_JSON = join(process.cwd(), "package.json");
|
|
21
|
-
|
|
22
|
-
function parseVersion(version: string) {
|
|
23
|
-
const match = version.match(/^(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?$/);
|
|
24
|
-
|
|
25
|
-
if (!match) {
|
|
26
|
-
throw new Error(`Invalid version: ${version}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
major: Number(match[1]),
|
|
31
|
-
minor: Number(match[2]),
|
|
32
|
-
patch: Number(match[3]),
|
|
33
|
-
beta: match[4] ? Number(match[4]) : null,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function nextVersion(version: string, release: ReleaseType): string {
|
|
38
|
-
const parsed = parseVersion(version);
|
|
39
|
-
|
|
40
|
-
switch (release) {
|
|
41
|
-
case "beta":
|
|
42
|
-
return `${parsed.major}.${parsed.minor}.${parsed.patch}-beta.${
|
|
43
|
-
parsed.beta === null ? 0 : parsed.beta + 1
|
|
44
|
-
}`;
|
|
45
|
-
|
|
46
|
-
case "patch":
|
|
47
|
-
return `${parsed.major}.${parsed.minor}.${parsed.patch + 1}`;
|
|
48
|
-
|
|
49
|
-
case "minor":
|
|
50
|
-
return `${parsed.major}.${parsed.minor + 1}.0`;
|
|
51
|
-
|
|
52
|
-
case "major":
|
|
53
|
-
return `${parsed.major + 1}.0.0`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function main() {
|
|
58
|
-
const pkg = JSON.parse(await readFile(PACKAGE_JSON, "utf8")) as PackageJson;
|
|
59
|
-
|
|
60
|
-
const current = pkg.version;
|
|
61
|
-
const next = nextVersion(current, release);
|
|
62
|
-
|
|
63
|
-
pkg.version = next;
|
|
64
|
-
|
|
65
|
-
await writeFile(PACKAGE_JSON, JSON.stringify(pkg, null, 2) + "\n");
|
|
66
|
-
|
|
67
|
-
console.log(`Version updated`);
|
|
68
|
-
console.log(`${current} -> ${next}`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
main().catch((error) => {
|
|
72
|
-
console.error(error);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
});
|