@arkyn/server 3.0.1-beta.159 → 3.0.1-beta.166
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/dist/index.js +1026 -1262
- package/dist/modules/http/api/_logRequest.js +55 -68
- package/dist/modules/http/api/_makeRequest.js +69 -68
- package/dist/modules/http/api/deleteRequest.js +12 -12
- package/dist/modules/http/api/getRequest.js +11 -11
- package/dist/modules/http/api/patchRequest.js +11 -11
- package/dist/modules/http/api/postRequest.js +11 -11
- package/dist/modules/http/api/putRequest.js +11 -11
- package/dist/modules/http/badResponses/_badResponse.js +62 -58
- package/dist/modules/http/badResponses/badGateway.js +22 -28
- package/dist/modules/http/badResponses/badRequest.js +22 -28
- package/dist/modules/http/badResponses/conflict.js +22 -28
- package/dist/modules/http/badResponses/forbidden.js +22 -28
- package/dist/modules/http/badResponses/notFound.js +22 -28
- package/dist/modules/http/badResponses/notImplemented.js +22 -28
- package/dist/modules/http/badResponses/serverError.js +22 -28
- package/dist/modules/http/badResponses/unauthorized.js +22 -28
- package/dist/modules/http/badResponses/unprocessableEntity.js +27 -35
- package/dist/modules/http/successResponses/_successResponse.js +61 -68
- package/dist/modules/http/successResponses/created.js +22 -28
- package/dist/modules/http/successResponses/found.js +22 -28
- package/dist/modules/http/successResponses/noContent.js +16 -20
- package/dist/modules/http/successResponses/success.js +22 -28
- package/dist/modules/http/successResponses/updated.js +22 -28
- package/dist/modules/index.js +33 -67
- package/dist/modules/services/apiService.js +108 -128
- package/dist/modules/services/debugService.js +35 -65
- package/dist/modules/services/logMapperService.js +28 -51
- package/dist/modules/services/logService.js +20 -30
- package/dist/modules/utilities/decodeRequestBody.js +19 -21
- package/dist/modules/utilities/decodeRequestErrorMessage.js +5 -6
- package/dist/modules/utilities/errorHandler.js +36 -51
- package/dist/modules/utilities/flushDebugLogs.js +15 -19
- package/dist/modules/utilities/formAsyncParse.js +13 -18
- package/dist/modules/utilities/formParse.js +13 -18
- package/dist/modules/utilities/getScopedParams.js +8 -10
- package/dist/modules/utilities/schemaValidator.js +53 -104
- package/dist/modules/validations/validateCep.js +8 -8
- package/dist/modules/validations/validateCnpj.js +49 -26
- package/dist/modules/validations/validateCpf.js +22 -23
- package/dist/modules/validations/validateDate.js +25 -26
- package/dist/modules/validations/validateEmail.js +54 -53
- package/dist/modules/validations/validatePassword.js +11 -15
- package/dist/modules/validations/validatePhone.js +8 -8
- package/dist/modules/validations/validateRg.js +7 -7
- package/generate-version.ts +74 -0
- package/package.json +17 -9
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as Conflict
|
|
2
|
+
//#region src/http/badResponses/conflict.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "Conflict", this.status = 409, this.statusText = e, this.debugColor = "yellow", this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as Conflict };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as Forbidden
|
|
2
|
+
//#region src/http/badResponses/forbidden.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "Forbidden", this.status = 403, this.statusText = e, this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as Forbidden };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as NotFound
|
|
2
|
+
//#region src/http/badResponses/notFound.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "NotFound", this.status = 404, this.statusText = e, this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as NotFound };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), t);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as NotImplemented
|
|
2
|
+
//#region src/http/badResponses/notImplemented.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "NotImplemented", this.status = 501, this.statusText = e, this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as NotImplemented };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
r as ServerError
|
|
2
|
+
//#region src/http/badResponses/serverError.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "ServerError", this.status = 500, this.statusText = e, this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as ServerError };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.makeBody(), s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as Unauthorized
|
|
2
|
+
//#region src/http/badResponses/unauthorized.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "Unauthorized", this.status = 401, this.statusText = e, this.debugColor = "yellow", this.cause = t ? JSON.stringify(t) : void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.makeBody(), e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as Unauthorized };
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
import { BadResponse as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
toJson() {
|
|
27
|
-
const s = {
|
|
28
|
-
status: this.status,
|
|
29
|
-
statusText: this.statusText
|
|
30
|
-
};
|
|
31
|
-
return Response.json(this.makeBody(), s);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
o as UnprocessableEntity
|
|
1
|
+
import { BadResponse as e } from "./_badResponse.js";
|
|
2
|
+
//#region src/http/badResponses/unprocessableEntity.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
super(), this.name = "UnprocessableEntity", this.status = 422, this.statusText = e.message || "Unprocessable entity", this.debugColor = "yellow", this.cause = {
|
|
6
|
+
data: e.data,
|
|
7
|
+
fieldErrors: e.fieldErrors,
|
|
8
|
+
fields: e.fields
|
|
9
|
+
}, this.onDebug();
|
|
10
|
+
}
|
|
11
|
+
toResponse() {
|
|
12
|
+
let e = {
|
|
13
|
+
headers: { "Content-Type": "application/json" },
|
|
14
|
+
status: this.status,
|
|
15
|
+
statusText: this.statusText
|
|
16
|
+
};
|
|
17
|
+
return new Response(JSON.stringify(this.makeBody()), e);
|
|
18
|
+
}
|
|
19
|
+
toJson() {
|
|
20
|
+
let e = {
|
|
21
|
+
status: this.status,
|
|
22
|
+
statusText: this.statusText
|
|
23
|
+
};
|
|
24
|
+
return Response.json(this.makeBody(), e);
|
|
25
|
+
}
|
|
36
26
|
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { t as UnprocessableEntity };
|
|
@@ -1,69 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
name: this.name,
|
|
62
|
-
message: this.statusText,
|
|
63
|
-
body: this.body
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
m as SuccessResponse
|
|
1
|
+
import { DebugService as e } from "../../services/debugService.js";
|
|
2
|
+
import { flushDebugLogs as t } from "../../utilities/flushDebugLogs.js";
|
|
3
|
+
//#region src/http/successResponses/_successResponse.ts
|
|
4
|
+
var n = class {
|
|
5
|
+
_body = null;
|
|
6
|
+
_name = "SuccessResponse";
|
|
7
|
+
_status = 200;
|
|
8
|
+
_statusText = "OK";
|
|
9
|
+
_debugColor = "green";
|
|
10
|
+
get body() {
|
|
11
|
+
return this._body;
|
|
12
|
+
}
|
|
13
|
+
set body(e) {
|
|
14
|
+
this._body = e ?? null;
|
|
15
|
+
}
|
|
16
|
+
get name() {
|
|
17
|
+
return this._name;
|
|
18
|
+
}
|
|
19
|
+
set name(e) {
|
|
20
|
+
this._name = e;
|
|
21
|
+
}
|
|
22
|
+
get status() {
|
|
23
|
+
return this._status;
|
|
24
|
+
}
|
|
25
|
+
set status(e) {
|
|
26
|
+
this._status = e;
|
|
27
|
+
}
|
|
28
|
+
get statusText() {
|
|
29
|
+
return this._statusText;
|
|
30
|
+
}
|
|
31
|
+
set statusText(e) {
|
|
32
|
+
this._statusText = e;
|
|
33
|
+
}
|
|
34
|
+
get debugColor() {
|
|
35
|
+
return this._debugColor;
|
|
36
|
+
}
|
|
37
|
+
set debugColor(e) {
|
|
38
|
+
[
|
|
39
|
+
"green",
|
|
40
|
+
"yellow",
|
|
41
|
+
"cyan",
|
|
42
|
+
"red"
|
|
43
|
+
].includes(e) && (this._debugColor = e);
|
|
44
|
+
}
|
|
45
|
+
onDebug(n) {
|
|
46
|
+
let r = [], { callerInfo: i, functionName: a } = e.getCaller();
|
|
47
|
+
r.push(`Caller Function: ${a}`), r.push(`Caller Location: ${i}`), this.statusText && r.push(`Message: ${this.statusText}`), n && r.push(`Body: ${JSON.stringify(n)}`), t({
|
|
48
|
+
scheme: this._debugColor,
|
|
49
|
+
name: this.name,
|
|
50
|
+
debugs: r
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
makeBody() {
|
|
54
|
+
return {
|
|
55
|
+
name: this.name,
|
|
56
|
+
message: this.statusText,
|
|
57
|
+
body: this.body
|
|
58
|
+
};
|
|
59
|
+
}
|
|
69
60
|
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { n as SuccessResponse };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { SuccessResponse as e } from "./_successResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.body, s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as Created
|
|
2
|
+
//#region src/http/successResponses/created.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "Created", this.status = 201, this.statusText = e, this.body = t || void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.body), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.body, e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as Created };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { SuccessResponse as e } from "./_successResponse.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
status: this.status,
|
|
23
|
-
statusText: this.statusText
|
|
24
|
-
};
|
|
25
|
-
return Response.json(this.body, s);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
i as Found
|
|
2
|
+
//#region src/http/successResponses/found.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(), this.name = "Found", this.status = 302, this.statusText = e, this.body = t || void 0, this.onDebug();
|
|
6
|
+
}
|
|
7
|
+
toResponse() {
|
|
8
|
+
let e = {
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
status: this.status,
|
|
11
|
+
statusText: this.statusText
|
|
12
|
+
};
|
|
13
|
+
return new Response(JSON.stringify(this.body), e);
|
|
14
|
+
}
|
|
15
|
+
toJson() {
|
|
16
|
+
let e = {
|
|
17
|
+
status: this.status,
|
|
18
|
+
statusText: this.statusText
|
|
19
|
+
};
|
|
20
|
+
return Response.json(this.body, e);
|
|
21
|
+
}
|
|
30
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as Found };
|