@thisisagile/easy 17.31.0 → 17.32.0
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/{chunk-NIWK2A5T.mjs → chunk-2RHBJLH7.mjs} +8 -12
- package/dist/{chunk-NIWK2A5T.mjs.map → chunk-2RHBJLH7.mjs.map} +1 -1
- package/dist/{chunk-OOWOFPDC.mjs → chunk-4TGUPVQN.mjs} +2 -2
- package/dist/{chunk-GQ7XGATB.mjs → chunk-AMBSWR6J.mjs} +7 -9
- package/dist/{chunk-GQ7XGATB.mjs.map → chunk-AMBSWR6J.mjs.map} +1 -1
- package/dist/{chunk-DY33LKDP.mjs → chunk-BZNMKX6O.mjs} +2 -2
- package/dist/{chunk-6RSZTLCP.mjs → chunk-ESECEXXM.mjs} +4 -4
- package/dist/{chunk-PZFHPGDR.mjs → chunk-FCJ4TDW7.mjs} +2 -2
- package/dist/{chunk-6PR3OZQP.mjs → chunk-H7NA23T6.mjs} +3 -3
- package/dist/{chunk-UNU355PL.mjs → chunk-I5VS3NUO.mjs} +5 -5
- package/dist/{chunk-DV7PHOM6.mjs → chunk-JSALAKCR.mjs} +3 -3
- package/dist/{chunk-QSB4QYYE.mjs → chunk-KTK2V5FC.mjs} +2 -2
- package/dist/{chunk-LKBFD66J.mjs → chunk-KX7RRPEZ.mjs} +3 -5
- package/dist/{chunk-LKBFD66J.mjs.map → chunk-KX7RRPEZ.mjs.map} +1 -1
- package/dist/{chunk-5O2BGB5V.mjs → chunk-LAY4XDIL.mjs} +3 -3
- package/dist/{chunk-PIZ7IORV.mjs → chunk-LP2MEIWU.mjs} +2 -2
- package/dist/{chunk-X24AKSPO.mjs → chunk-PCKGK5AF.mjs} +2 -2
- package/dist/{chunk-3BJH75JQ.mjs → chunk-PQTYEEZC.mjs} +2 -2
- package/dist/{chunk-PKA5XEUC.mjs → chunk-R6UXMGTJ.mjs} +3 -3
- package/dist/{chunk-TYH6CVJL.mjs → chunk-RBGF26S7.mjs} +4 -4
- package/dist/{chunk-IYFZMJYO.mjs → chunk-TNPMWL7Y.mjs} +7 -11
- package/dist/{chunk-IYFZMJYO.mjs.map → chunk-TNPMWL7Y.mjs.map} +1 -1
- package/dist/{chunk-GJL7E2EJ.mjs → chunk-TPGAM536.mjs} +4 -4
- package/dist/{chunk-2MNT7B4T.mjs → chunk-UYBPL7PM.mjs} +7 -7
- package/dist/{chunk-HI2JE5PJ.mjs → chunk-XAIZBTVQ.mjs} +2 -2
- package/dist/chunk-ZBS4A3QI.mjs +614 -0
- package/dist/chunk-ZBS4A3QI.mjs.map +1 -0
- package/dist/data/InMemoryGateway.mjs +5 -11
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/domain/Audit.mjs +6 -11
- package/dist/domain/Child.mjs +6 -11
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/DateTime.mjs +3 -8
- package/dist/domain/Entity.mjs +11 -16
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.mjs +5 -11
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.mjs +3 -8
- package/dist/domain/Typo.mjs +4 -10
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/http/CacheControl.mjs +4 -9
- package/dist/http/CacheControl.mjs.map +1 -1
- package/dist/http/LocalRequestStore.mjs +6 -2
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/RequestOptions.mjs +6 -4
- package/dist/http/RestResult.mjs +4 -9
- package/dist/http/toResponse.mjs +5 -10
- package/dist/index.js +317 -306
- package/dist/index.js.map +1 -1
- package/dist/process/App.mjs +5 -2
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.mjs +4 -9
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.mjs +5 -2
- package/dist/process/Search.mjs +4 -9
- package/dist/process/UseCase.mjs +4 -1
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/Req.mjs +3 -8
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/services/Api.mjs +11 -16
- package/dist/services/ApiGateway.mjs +14 -19
- package/dist/services/AxiosProvider.mjs +10 -15
- package/dist/services/MappedRouteGateway.mjs +15 -20
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.mjs +15 -20
- package/dist/services/ViewRouteGateway.mjs +17 -22
- package/dist/services/ViewRouteGateway.mjs.map +1 -1
- package/dist/sql/Column.mjs +3 -8
- package/dist/sql/Table.mjs +3 -8
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.mjs +4 -9
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/types/CacheAge.mjs +4 -9
- package/dist/types/Case.d.ts +16 -0
- package/dist/types/Case.mjs +2 -7
- package/dist/types/Context.mjs +6 -2
- package/dist/types/Exception.mjs +4 -2
- package/dist/types/Gateway.mjs +4 -3
- package/dist/types/IsEqual.mjs +3 -8
- package/dist/types/Number.mjs +3 -8
- package/dist/types/PageList.mjs +3 -8
- package/dist/types/Parser.mjs +2 -7
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Repository.mjs +4 -3
- package/dist/types/Result.mjs +6 -3
- package/dist/types/Results.mjs +6 -4
- package/dist/types/Template.d.ts +1 -0
- package/dist/types/Template.mjs +6 -1
- package/dist/types/ToText.mjs +6 -1
- package/dist/types/Try.mjs +2 -7
- package/dist/types/Uri.mjs +3 -9
- package/dist/types/Uri.mjs.map +1 -1
- package/dist/utils/Sentence.mjs +6 -1
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/View.mjs +5 -10
- package/dist/validation/Contraints.mjs +3 -8
- package/dist/validation/Validate.mjs +2 -7
- package/dist/validation/When.mjs +2 -7
- package/package.json +1 -1
- package/src/types/Case.ts +12 -0
- package/src/types/Template.ts +7 -3
- package/src/types/ToText.ts +1 -1
- package/dist/chunk-6JA2EI2T.mjs +0 -20
- package/dist/chunk-6JA2EI2T.mjs.map +0 -1
- package/dist/chunk-HTHNHACU.mjs +0 -94
- package/dist/chunk-HTHNHACU.mjs.map +0 -1
- package/dist/chunk-MIYBZDW6.mjs +0 -35
- package/dist/chunk-MIYBZDW6.mjs.map +0 -1
- package/dist/chunk-SOUOSMQ6.mjs +0 -165
- package/dist/chunk-SOUOSMQ6.mjs.map +0 -1
- package/dist/chunk-VTEGCABM.mjs +0 -40
- package/dist/chunk-VTEGCABM.mjs.map +0 -1
- package/dist/chunk-WIQKEALP.mjs +0 -324
- package/dist/chunk-WIQKEALP.mjs.map +0 -1
- /package/dist/{chunk-OOWOFPDC.mjs.map → chunk-4TGUPVQN.mjs.map} +0 -0
- /package/dist/{chunk-DY33LKDP.mjs.map → chunk-BZNMKX6O.mjs.map} +0 -0
- /package/dist/{chunk-6RSZTLCP.mjs.map → chunk-ESECEXXM.mjs.map} +0 -0
- /package/dist/{chunk-PZFHPGDR.mjs.map → chunk-FCJ4TDW7.mjs.map} +0 -0
- /package/dist/{chunk-6PR3OZQP.mjs.map → chunk-H7NA23T6.mjs.map} +0 -0
- /package/dist/{chunk-UNU355PL.mjs.map → chunk-I5VS3NUO.mjs.map} +0 -0
- /package/dist/{chunk-DV7PHOM6.mjs.map → chunk-JSALAKCR.mjs.map} +0 -0
- /package/dist/{chunk-QSB4QYYE.mjs.map → chunk-KTK2V5FC.mjs.map} +0 -0
- /package/dist/{chunk-5O2BGB5V.mjs.map → chunk-LAY4XDIL.mjs.map} +0 -0
- /package/dist/{chunk-PIZ7IORV.mjs.map → chunk-LP2MEIWU.mjs.map} +0 -0
- /package/dist/{chunk-X24AKSPO.mjs.map → chunk-PCKGK5AF.mjs.map} +0 -0
- /package/dist/{chunk-3BJH75JQ.mjs.map → chunk-PQTYEEZC.mjs.map} +0 -0
- /package/dist/{chunk-PKA5XEUC.mjs.map → chunk-R6UXMGTJ.mjs.map} +0 -0
- /package/dist/{chunk-TYH6CVJL.mjs.map → chunk-RBGF26S7.mjs.map} +0 -0
- /package/dist/{chunk-GJL7E2EJ.mjs.map → chunk-TPGAM536.mjs.map} +0 -0
- /package/dist/{chunk-2MNT7B4T.mjs.map → chunk-UYBPL7PM.mjs.map} +0 -0
- /package/dist/{chunk-HI2JE5PJ.mjs.map → chunk-XAIZBTVQ.mjs.map} +0 -0
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PCKGK5AF.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isRestResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TNPMWL7Y.mjs";
|
|
7
7
|
import {
|
|
8
8
|
HttpStatus
|
|
9
9
|
} from "./chunk-LNNALU5F.mjs";
|
|
10
10
|
import {
|
|
11
11
|
RequestOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I5VS3NUO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
cacheAge
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
choose
|
|
18
|
-
} from "./chunk-WIQKEALP.mjs";
|
|
15
|
+
} from "./chunk-LAY4XDIL.mjs";
|
|
19
16
|
import {
|
|
17
|
+
choose,
|
|
18
|
+
ctx,
|
|
20
19
|
toResult
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
ctx
|
|
24
|
-
} from "./chunk-HTHNHACU.mjs";
|
|
20
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
25
21
|
import {
|
|
26
22
|
isDefined,
|
|
27
23
|
isEmpty
|
|
@@ -53,4 +49,4 @@ var AxiosProvider = class {
|
|
|
53
49
|
export {
|
|
54
50
|
AxiosProvider
|
|
55
51
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-2RHBJLH7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/services/AxiosProvider.ts"],"sourcesContent":["import axios, { AxiosError, AxiosInstance, AxiosResponse, Method } from 'axios';\nimport { toResponse } from '../http/toResponse';\nimport { isDefined, isEmpty } from '../types/Is';\nimport { Uri } from '../types/Uri';\nimport { HttpVerb } from '../http/HttpVerb';\nimport { choose } from '../types/Case';\nimport { isRestResult } from '../http/RestResult';\nimport { toResult } from '../types/Result';\nimport { HttpStatus } from '../http/HttpStatus';\nimport { RequestProvider } from '../http/RequestProvider';\nimport { RequestOptions } from '../http/RequestOptions';\nimport { ctx } from '../types/Context';\nimport { cacheAge } from '../types/CacheAge';\nimport { Response } from '../http/Response';\nimport { Request } from '../http/Request';\n\nconst isResponse = (a: unknown): a is { response: AxiosResponse } => isDefined((a as any)?.response);\nconst isRequest = (a: unknown): a is { request: any } => isDefined((a as any)?.request);\n\nconst asResponse = (uri: Uri, verb: HttpVerb, error: AxiosError): Response =>\n choose(error)\n .type(isResponse, r =>\n toResponse(r.response.status, isRestResult(r.response.data) ? r.response.data : toResult(r.response.statusText, uri.path, uri), r.response.headers)\n )\n .type(isRequest, r => toResponse(r.request.status, toResult(r.request.message, uri.path, uri)))\n .else(e => toResponse(HttpStatus.InternalServerError, toResult(e.message, uri.path, uri)));\n\nexport class AxiosProvider implements RequestProvider {\n constructor(readonly ai: AxiosInstance = axios) {}\n\n execute = ({ uri, verb, body, transform = (r: any) => r, transformError = (r: any) => r, options = RequestOptions.Json }: Request): Promise<Response> =>\n this.ai\n .request({\n url: uri.toString(),\n method: verb.toString() as Method,\n headers: uri.isInternal && isEmpty(options.headers.Authorization) ? options.bearer(ctx.request.jwt).headers : options.headers,\n data: options.type.encode(body),\n maxRedirects: options.requestOptions.maxRedirects,\n ...(options.requestOptions.timeout && { timeout: cacheAge.toMilliseconds(options?.requestOptions.timeout) }),\n ...(options.requestOptions.validateStatus && { validateStatus: options.requestOptions.validateStatus }),\n })\n .then(r => toResponse(r.status, transform(r.data), r.headers))\n .catch(e => Promise.reject(asResponse(uri, verb, transformError(e))));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/services/AxiosProvider.ts"],"sourcesContent":["import axios, { AxiosError, AxiosInstance, AxiosResponse, Method } from 'axios';\nimport { toResponse } from '../http/toResponse';\nimport { isDefined, isEmpty } from '../types/Is';\nimport { Uri } from '../types/Uri';\nimport { HttpVerb } from '../http/HttpVerb';\nimport { choose } from '../types/Case';\nimport { isRestResult } from '../http/RestResult';\nimport { toResult } from '../types/Result';\nimport { HttpStatus } from '../http/HttpStatus';\nimport { RequestProvider } from '../http/RequestProvider';\nimport { RequestOptions } from '../http/RequestOptions';\nimport { ctx } from '../types/Context';\nimport { cacheAge } from '../types/CacheAge';\nimport { Response } from '../http/Response';\nimport { Request } from '../http/Request';\n\nconst isResponse = (a: unknown): a is { response: AxiosResponse } => isDefined((a as any)?.response);\nconst isRequest = (a: unknown): a is { request: any } => isDefined((a as any)?.request);\n\nconst asResponse = (uri: Uri, verb: HttpVerb, error: AxiosError): Response =>\n choose(error)\n .type(isResponse, r =>\n toResponse(r.response.status, isRestResult(r.response.data) ? r.response.data : toResult(r.response.statusText, uri.path, uri), r.response.headers)\n )\n .type(isRequest, r => toResponse(r.request.status, toResult(r.request.message, uri.path, uri)))\n .else(e => toResponse(HttpStatus.InternalServerError, toResult(e.message, uri.path, uri)));\n\nexport class AxiosProvider implements RequestProvider {\n constructor(readonly ai: AxiosInstance = axios) {}\n\n execute = ({ uri, verb, body, transform = (r: any) => r, transformError = (r: any) => r, options = RequestOptions.Json }: Request): Promise<Response> =>\n this.ai\n .request({\n url: uri.toString(),\n method: verb.toString() as Method,\n headers: uri.isInternal && isEmpty(options.headers.Authorization) ? options.bearer(ctx.request.jwt).headers : options.headers,\n data: options.type.encode(body),\n maxRedirects: options.requestOptions.maxRedirects,\n ...(options.requestOptions.timeout && { timeout: cacheAge.toMilliseconds(options?.requestOptions.timeout) }),\n ...(options.requestOptions.validateStatus && { validateStatus: options.requestOptions.validateStatus }),\n })\n .then(r => toResponse(r.status, transform(r.data), r.headers))\n .catch(e => Promise.reject(asResponse(uri, verb, transformError(e))));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAiE;AAgBxE,IAAM,aAAa,CAAC,MAAiD,UAAW,GAAW,QAAQ;AACnG,IAAM,YAAY,CAAC,MAAsC,UAAW,GAAW,OAAO;AAEtF,IAAM,aAAa,CAAC,KAAU,MAAgB,UAC5C,OAAO,KAAK,EACT;AAAA,EAAK;AAAA,EAAY,OAChB,WAAW,EAAE,SAAS,QAAQ,aAAa,EAAE,SAAS,IAAI,IAAI,EAAE,SAAS,OAAO,SAAS,EAAE,SAAS,YAAY,IAAI,MAAM,GAAG,GAAG,EAAE,SAAS,OAAO;AACpJ,EACC,KAAK,WAAW,OAAK,WAAW,EAAE,QAAQ,QAAQ,SAAS,EAAE,QAAQ,SAAS,IAAI,MAAM,GAAG,CAAC,CAAC,EAC7F,KAAK,OAAK,WAAW,WAAW,qBAAqB,SAAS,EAAE,SAAS,IAAI,MAAM,GAAG,CAAC,CAAC;AAEtF,IAAM,gBAAN,MAA+C;AAAA,EACpD,YAAqB,KAAoB,OAAO;AAA3B;AAAA,EAA4B;AAAA,EAEjD,UAAU,CAAC,EAAE,KAAK,MAAM,MAAM,YAAY,CAAC,MAAW,GAAG,iBAAiB,CAAC,MAAW,GAAG,UAAU,eAAe,KAAK,MACrH,KAAK,GACF,QAAQ;AAAA,IACP,KAAK,IAAI,SAAS;AAAA,IAClB,QAAQ,KAAK,SAAS;AAAA,IACtB,SAAS,IAAI,cAAc,QAAQ,QAAQ,QAAQ,aAAa,IAAI,QAAQ,OAAO,IAAI,QAAQ,GAAG,EAAE,UAAU,QAAQ;AAAA,IACtH,MAAM,QAAQ,KAAK,OAAO,IAAI;AAAA,IAC9B,cAAc,QAAQ,eAAe;AAAA,IACrC,GAAI,QAAQ,eAAe,WAAW,EAAE,SAAS,SAAS,eAAe,SAAS,eAAe,OAAO,EAAE;AAAA,IAC1G,GAAI,QAAQ,eAAe,kBAAkB,EAAE,gBAAgB,QAAQ,eAAe,eAAe;AAAA,EACvG,CAAC,EACA,KAAK,OAAK,WAAW,EAAE,QAAQ,UAAU,EAAE,IAAI,GAAG,EAAE,OAAO,CAAC,EAC5D,MAAM,OAAK,QAAQ,OAAO,WAAW,KAAK,MAAM,eAAe,CAAC,CAAC,CAAC,CAAC;AAC1E;","names":[]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
choose,
|
|
9
9
|
tryTo
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Value
|
|
13
13
|
} from "./chunk-WSBULPUZ.mjs";
|
|
@@ -139,4 +139,4 @@ export {
|
|
|
139
139
|
isDateTime,
|
|
140
140
|
dt
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
142
|
+
//# sourceMappingURL=chunk-4TGUPVQN.mjs.map
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
required,
|
|
3
3
|
valid
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
DateTime
|
|
7
|
-
} from "./chunk-OOWOFPDC.mjs";
|
|
4
|
+
} from "./chunk-KX7RRPEZ.mjs";
|
|
8
5
|
import {
|
|
9
6
|
Struct
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LP2MEIWU.mjs";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
DateTime
|
|
10
|
+
} from "./chunk-4TGUPVQN.mjs";
|
|
14
11
|
import {
|
|
12
|
+
choose,
|
|
15
13
|
ctx
|
|
16
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
17
15
|
import {
|
|
18
16
|
isIdentity
|
|
19
17
|
} from "./chunk-ZHXKBOK2.mjs";
|
|
@@ -47,4 +45,4 @@ __decorateClass([
|
|
|
47
45
|
export {
|
|
48
46
|
Audit
|
|
49
47
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-AMBSWR6J.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/domain/Audit.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { DateTime } from './DateTime';\nimport { required, valid } from '../validation/Contraints';\nimport { Identity } from '../types/Identity';\nimport { Json } from '../types/Json';\nimport { choose } from '../types/Case';\nimport { isIdentity } from '../types/IsA';\nimport { ctx } from '../types/Context';\n\nexport class Audit extends Struct {\n @required() readonly by: Identity = { id: this.state.by?.id, user: this.state.by?.user };\n @valid() readonly when: DateTime = new DateTime(this.state.when);\n\n constructor(json?: Json) {\n super(\n choose(json)\n .is.defined(\n j => j,\n j => j\n )\n .else({\n by: isIdentity(ctx.request?.identity) ? ctx.request?.identity : { id: 0, user: 'easy' },\n when: DateTime.now.toJSON(),\n })\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/domain/Audit.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { DateTime } from './DateTime';\nimport { required, valid } from '../validation/Contraints';\nimport { Identity } from '../types/Identity';\nimport { Json } from '../types/Json';\nimport { choose } from '../types/Case';\nimport { isIdentity } from '../types/IsA';\nimport { ctx } from '../types/Context';\n\nexport class Audit extends Struct {\n @required() readonly by: Identity = { id: this.state.by?.id, user: this.state.by?.user };\n @valid() readonly when: DateTime = new DateTime(this.state.when);\n\n constructor(json?: Json) {\n super(\n choose(json)\n .is.defined(\n j => j,\n j => j\n )\n .else({\n by: isIdentity(ctx.request?.identity) ? ctx.request?.identity : { id: 0, user: 'easy' },\n when: DateTime.now.toJSON(),\n })\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASO,IAAM,QAAN,cAAoB,OAAO;AAAA,EACX,KAAe,EAAE,IAAI,KAAK,MAAM,IAAI,IAAI,MAAM,KAAK,MAAM,IAAI,KAAK;AAAA,EACrE,OAAiB,IAAI,SAAS,KAAK,MAAM,IAAI;AAAA,EAE/D,YAAY,MAAa;AACvB;AAAA,MACE,OAAO,IAAI,EACR,GAAG;AAAA,QACF,OAAK;AAAA,QACL,OAAK;AAAA,MACP,EACC,KAAK;AAAA,QACJ,IAAI,WAAW,IAAI,SAAS,QAAQ,IAAI,IAAI,SAAS,WAAW,EAAE,IAAI,GAAG,MAAM,OAAO;AAAA,QACtF,MAAM,SAAS,IAAI,OAAO;AAAA,MAC5B,CAAC;AAAA,IACL;AAAA,EACF;AACF;AAhBuB;AAAA,EAApB,SAAS;AAAA,GADC,MACU;AACH;AAAA,EAAjB,MAAM;AAAA,GAFI,MAEO;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-GCY5A63A.mjs";
|
|
7
7
|
import {
|
|
8
8
|
tryTo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ofGet
|
|
12
12
|
} from "./chunk-SJGQU3OG.mjs";
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
PatternColumn,
|
|
80
80
|
OrderColumn
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-BZNMKX6O.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Exception
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
1
4
|
import {
|
|
2
5
|
reject
|
|
3
6
|
} from "./chunk-2EJYJ4HI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Exception
|
|
6
|
-
} from "./chunk-VTEGCABM.mjs";
|
|
7
7
|
|
|
8
8
|
// src/types/Gateway.ts
|
|
9
9
|
var Gateway = class {
|
|
@@ -42,4 +42,4 @@ var Gateway = class {
|
|
|
42
42
|
export {
|
|
43
43
|
Gateway
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-ESECEXXM.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
choose
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isArray,
|
|
6
6
|
isObject
|
|
@@ -20,4 +20,4 @@ var isEqual = (one, another) => choose([one, another]).case(([o, a]) => o === a,
|
|
|
20
20
|
export {
|
|
21
21
|
isEqual
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-FCJ4TDW7.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toPageList
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PQTYEEZC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
choose
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
resolve
|
|
9
9
|
} from "./chunk-2EJYJ4HI.mjs";
|
|
@@ -45,4 +45,4 @@ var Search = class {
|
|
|
45
45
|
export {
|
|
46
46
|
Search
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-H7NA23T6.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HttpHeader
|
|
3
|
-
} from "./chunk-SW2OCUH3.mjs";
|
|
4
1
|
import {
|
|
5
2
|
toUuid
|
|
6
3
|
} from "./chunk-SJ4YFZKO.mjs";
|
|
7
4
|
import {
|
|
8
5
|
ContentType
|
|
9
6
|
} from "./chunk-GBZ36SQE.mjs";
|
|
7
|
+
import {
|
|
8
|
+
HttpHeader
|
|
9
|
+
} from "./chunk-SW2OCUH3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ctx
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Enum
|
|
15
15
|
} from "./chunk-AG3P2RCU.mjs";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
RequestOptions,
|
|
88
88
|
isRequestOptions
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-I5VS3NUO.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ApiGateway
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RBGF26S7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Api
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-R6UXMGTJ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
HttpStatus
|
|
9
9
|
} from "./chunk-LNNALU5F.mjs";
|
|
@@ -57,4 +57,4 @@ var RouteGateway = class extends ApiGateway {
|
|
|
57
57
|
export {
|
|
58
58
|
RouteGateway
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
60
|
+
//# sourceMappingURL=chunk-JSALAKCR.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
text
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Enum
|
|
6
6
|
} from "./chunk-AG3P2RCU.mjs";
|
|
@@ -36,4 +36,4 @@ var Scope = class _Scope extends Enum {
|
|
|
36
36
|
export {
|
|
37
37
|
Scope
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-KTK2V5FC.mjs.map
|
|
@@ -3,12 +3,10 @@ import {
|
|
|
3
3
|
inPast
|
|
4
4
|
} from "./chunk-ADJAEGCT.mjs";
|
|
5
5
|
import {
|
|
6
|
+
text,
|
|
6
7
|
tryTo,
|
|
7
8
|
validate
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
text
|
|
11
|
-
} from "./chunk-SOUOSMQ6.mjs";
|
|
9
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
12
10
|
import {
|
|
13
11
|
meta
|
|
14
12
|
} from "./chunk-MK2UX4IH.mjs";
|
|
@@ -73,4 +71,4 @@ export {
|
|
|
73
71
|
maxLength,
|
|
74
72
|
rule
|
|
75
73
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-KX7RRPEZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/validation/Contraints.ts"],"sourcesContent":["import { validate, Validator } from './Validate';\nimport { Func } from '../types/Func';\nimport { Results } from '../types/Results';\nimport { meta } from '../types/Meta';\nimport { List, toList } from '../types/List';\nimport { isBoolean, isDefined, isFunction, isIn, isNotEmpty, isString } from '../types/Is';\nimport { tryTo } from '../types/Try';\nimport { inFuture, inPast } from '../types/IsDate';\nimport type { Text } from '../types/Text';\nimport { text } from '../types/ToText';\n\nexport type Constraint = Func<boolean | Results, any>;\n\nexport const constraint =\n <T>(c: Constraint, message: Text): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n const cs = meta(subject).property(property).get<List<Validator>>('constraint') ?? toList<Validator>();\n meta(subject)\n .property(property)\n .set('constraint', cs.add({ property, constraint: c, text: message }));\n };\n\nexport const defined = (message?: Text): PropertyDecorator => constraint(v => isDefined(v), message ?? 'Property {property} must be defined.');\n\nexport const required = (message?: Text): PropertyDecorator =>\n constraint(v => isNotEmpty(v), message ?? 'Property {property} is required, and may not be empty.');\n\nexport const notEmpty = (message?: Text): PropertyDecorator => constraint(v => isNotEmpty(v), message ?? 'Property {property} may not be empty.');\n\nexport const valid = (): PropertyDecorator => constraint(v => validate(v), '');\n\nexport const optional = (): PropertyDecorator => constraint(v => !isDefined(v) || validate(v), '');\n\nexport const includes = (sub: string, message?: string): PropertyDecorator =>\n constraint(s => isDefined(s) && isString(s) && s.includes(sub), message ?? `Value {actual} must include '${sub}'.`);\n\nexport const inList = (values: unknown[], message?: Text): PropertyDecorator =>\n constraint(v => isDefined(v) && isIn(v, values), message ?? 'Value {actual} must appear in list.');\n\nexport const inOptionalList = (values: unknown[], message?: Text): PropertyDecorator =>\n constraint(v => !isDefined(v) || isIn(v, values), message ?? 'Value {actual} must appear in list.');\n\nexport const gt = (limit: number, message?: Text): PropertyDecorator => constraint(v => v > limit, message ?? `Value {actual} must be larger than '${limit}'.`);\n\nexport const gte = (limit: number, message?: Text): PropertyDecorator =>\n constraint(v => v >= limit, message ?? `Value {actual} must be larger than or equal to ${limit}.`);\n\nexport const lt = (limit: number, message?: Text): PropertyDecorator => constraint(v => v < limit, message ?? `Value {actual} must be smaller than ${limit}.`);\n\nexport const lte = (limit: number, message?: Text): PropertyDecorator =>\n constraint(v => v <= limit, message ?? `Value {actual} must be smaller than or equal to ${limit}.`);\n\nexport const past = (message?: Text): PropertyDecorator => constraint(v => inPast(v), message ?? 'Value {actual} must lay in the past.');\n\nexport const future = (message?: Text): PropertyDecorator => constraint(v => inFuture(v), message ?? 'Value {actual} must lay in the future.');\n\nexport const minLength = (length: number, message?: Text): PropertyDecorator =>\n constraint(\n v =>\n tryTo(() => v)\n .is.defined()\n .map(v => text(v).toString().length >= length)\n .orElse(true) as boolean,\n message ?? `Value {actual} must be at least '${length}' characters long.`\n );\n\nexport const maxLength = (length: number, message?: Text): PropertyDecorator =>\n constraint(\n v =>\n tryTo(() => v)\n .is.defined()\n .map(v => text(v).toString().length <= length)\n .orElse(true) as boolean,\n message ?? `Value {actual} cannot be longer than '${length}' characters.`\n );\n\nexport const rule = (message?: Text): PropertyDecorator =>\n constraint(v => (isFunction(v) ? (v() as boolean | Results) : isBoolean(v) ? v : false), message ?? `Value {actual} must be true`);\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/validation/Contraints.ts"],"sourcesContent":["import { validate, Validator } from './Validate';\nimport { Func } from '../types/Func';\nimport { Results } from '../types/Results';\nimport { meta } from '../types/Meta';\nimport { List, toList } from '../types/List';\nimport { isBoolean, isDefined, isFunction, isIn, isNotEmpty, isString } from '../types/Is';\nimport { tryTo } from '../types/Try';\nimport { inFuture, inPast } from '../types/IsDate';\nimport type { Text } from '../types/Text';\nimport { text } from '../types/ToText';\n\nexport type Constraint = Func<boolean | Results, any>;\n\nexport const constraint =\n <T>(c: Constraint, message: Text): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n const cs = meta(subject).property(property).get<List<Validator>>('constraint') ?? toList<Validator>();\n meta(subject)\n .property(property)\n .set('constraint', cs.add({ property, constraint: c, text: message }));\n };\n\nexport const defined = (message?: Text): PropertyDecorator => constraint(v => isDefined(v), message ?? 'Property {property} must be defined.');\n\nexport const required = (message?: Text): PropertyDecorator =>\n constraint(v => isNotEmpty(v), message ?? 'Property {property} is required, and may not be empty.');\n\nexport const notEmpty = (message?: Text): PropertyDecorator => constraint(v => isNotEmpty(v), message ?? 'Property {property} may not be empty.');\n\nexport const valid = (): PropertyDecorator => constraint(v => validate(v), '');\n\nexport const optional = (): PropertyDecorator => constraint(v => !isDefined(v) || validate(v), '');\n\nexport const includes = (sub: string, message?: string): PropertyDecorator =>\n constraint(s => isDefined(s) && isString(s) && s.includes(sub), message ?? `Value {actual} must include '${sub}'.`);\n\nexport const inList = (values: unknown[], message?: Text): PropertyDecorator =>\n constraint(v => isDefined(v) && isIn(v, values), message ?? 'Value {actual} must appear in list.');\n\nexport const inOptionalList = (values: unknown[], message?: Text): PropertyDecorator =>\n constraint(v => !isDefined(v) || isIn(v, values), message ?? 'Value {actual} must appear in list.');\n\nexport const gt = (limit: number, message?: Text): PropertyDecorator => constraint(v => v > limit, message ?? `Value {actual} must be larger than '${limit}'.`);\n\nexport const gte = (limit: number, message?: Text): PropertyDecorator =>\n constraint(v => v >= limit, message ?? `Value {actual} must be larger than or equal to ${limit}.`);\n\nexport const lt = (limit: number, message?: Text): PropertyDecorator => constraint(v => v < limit, message ?? `Value {actual} must be smaller than ${limit}.`);\n\nexport const lte = (limit: number, message?: Text): PropertyDecorator =>\n constraint(v => v <= limit, message ?? `Value {actual} must be smaller than or equal to ${limit}.`);\n\nexport const past = (message?: Text): PropertyDecorator => constraint(v => inPast(v), message ?? 'Value {actual} must lay in the past.');\n\nexport const future = (message?: Text): PropertyDecorator => constraint(v => inFuture(v), message ?? 'Value {actual} must lay in the future.');\n\nexport const minLength = (length: number, message?: Text): PropertyDecorator =>\n constraint(\n v =>\n tryTo(() => v)\n .is.defined()\n .map(v => text(v).toString().length >= length)\n .orElse(true) as boolean,\n message ?? `Value {actual} must be at least '${length}' characters long.`\n );\n\nexport const maxLength = (length: number, message?: Text): PropertyDecorator =>\n constraint(\n v =>\n tryTo(() => v)\n .is.defined()\n .map(v => text(v).toString().length <= length)\n .orElse(true) as boolean,\n message ?? `Value {actual} cannot be longer than '${length}' characters.`\n );\n\nexport const rule = (message?: Text): PropertyDecorator =>\n constraint(v => (isFunction(v) ? (v() as boolean | Results) : isBoolean(v) ? v : false), message ?? `Value {actual} must be true`);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,aACX,CAAI,GAAe,YACnB,CAAC,SAAkB,aAAoC;AACrD,QAAM,KAAK,KAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAqB,YAAY,KAAK,OAAkB;AACpG,OAAK,OAAO,EACT,SAAS,QAAQ,EACjB,IAAI,cAAc,GAAG,IAAI,EAAE,UAAU,YAAY,GAAG,MAAM,QAAQ,CAAC,CAAC;AACzE;AAEK,IAAM,UAAU,CAAC,YAAsC,WAAW,OAAK,UAAU,CAAC,GAAG,WAAW,sCAAsC;AAEtI,IAAM,WAAW,CAAC,YACvB,WAAW,OAAK,WAAW,CAAC,GAAG,WAAW,wDAAwD;AAE7F,IAAM,WAAW,CAAC,YAAsC,WAAW,OAAK,WAAW,CAAC,GAAG,WAAW,uCAAuC;AAEzI,IAAM,QAAQ,MAAyB,WAAW,OAAK,SAAS,CAAC,GAAG,EAAE;AAEtE,IAAM,WAAW,MAAyB,WAAW,OAAK,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,GAAG,EAAE;AAE1F,IAAM,WAAW,CAAC,KAAa,YACpC,WAAW,OAAK,UAAU,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,WAAW,gCAAgC,GAAG,IAAI;AAE7G,IAAM,SAAS,CAAC,QAAmB,YACxC,WAAW,OAAK,UAAU,CAAC,KAAK,KAAK,GAAG,MAAM,GAAG,WAAW,qCAAqC;AAE5F,IAAM,iBAAiB,CAAC,QAAmB,YAChD,WAAW,OAAK,CAAC,UAAU,CAAC,KAAK,KAAK,GAAG,MAAM,GAAG,WAAW,qCAAqC;AAE7F,IAAM,KAAK,CAAC,OAAe,YAAsC,WAAW,OAAK,IAAI,OAAO,WAAW,uCAAuC,KAAK,IAAI;AAEvJ,IAAM,MAAM,CAAC,OAAe,YACjC,WAAW,OAAK,KAAK,OAAO,WAAW,kDAAkD,KAAK,GAAG;AAE5F,IAAM,KAAK,CAAC,OAAe,YAAsC,WAAW,OAAK,IAAI,OAAO,WAAW,uCAAuC,KAAK,GAAG;AAEtJ,IAAM,MAAM,CAAC,OAAe,YACjC,WAAW,OAAK,KAAK,OAAO,WAAW,mDAAmD,KAAK,GAAG;AAE7F,IAAM,OAAO,CAAC,YAAsC,WAAW,OAAK,OAAO,CAAC,GAAG,WAAW,sCAAsC;AAEhI,IAAM,SAAS,CAAC,YAAsC,WAAW,OAAK,SAAS,CAAC,GAAG,WAAW,wCAAwC;AAEtI,IAAM,YAAY,CAAC,QAAgB,YACxC;AAAA,EACE,OACE,MAAM,MAAM,CAAC,EACV,GAAG,QAAQ,EACX,IAAI,CAAAA,OAAK,KAAKA,EAAC,EAAE,SAAS,EAAE,UAAU,MAAM,EAC5C,OAAO,IAAI;AAAA,EAChB,WAAW,oCAAoC,MAAM;AACvD;AAEK,IAAM,YAAY,CAAC,QAAgB,YACxC;AAAA,EACE,OACE,MAAM,MAAM,CAAC,EACV,GAAG,QAAQ,EACX,IAAI,CAAAA,OAAK,KAAKA,EAAC,EAAE,SAAS,EAAE,UAAU,MAAM,EAC5C,OAAO,IAAI;AAAA,EAChB,WAAW,yCAAyC,MAAM;AAC5D;AAEK,IAAM,OAAO,CAAC,YACnB,WAAW,OAAM,WAAW,CAAC,IAAK,EAAE,IAA0B,UAAU,CAAC,IAAI,IAAI,OAAQ,WAAW,6BAA6B;","names":["v"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asNumber
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XAIZBTVQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
choose
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
asString
|
|
9
9
|
} from "./chunk-BDA5LB4S.mjs";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
cacheAge,
|
|
55
55
|
isCacheAge
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-LAY4XDIL.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-YQC25ZQ4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
validate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isDefined
|
|
9
9
|
} from "./chunk-DEJ7A5PY.mjs";
|
|
@@ -37,4 +37,4 @@ export {
|
|
|
37
37
|
Struct,
|
|
38
38
|
isStruct
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-LP2MEIWU.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TNPMWL7Y.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toHttpStatus
|
|
6
6
|
} from "./chunk-LNNALU5F.mjs";
|
|
@@ -17,4 +17,4 @@ function toResponse(status, body, headers) {
|
|
|
17
17
|
export {
|
|
18
18
|
toResponse
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-PCKGK5AF.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
choose
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
List,
|
|
6
6
|
isList,
|
|
@@ -172,4 +172,4 @@ export {
|
|
|
172
172
|
toPageList,
|
|
173
173
|
asPageList
|
|
174
174
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-PQTYEEZC.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AxiosProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2RHBJLH7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
HttpVerb
|
|
6
6
|
} from "./chunk-TM2NCQN5.mjs";
|
|
7
7
|
import {
|
|
8
8
|
RequestOptions,
|
|
9
9
|
toPageOptions
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I5VS3NUO.mjs";
|
|
11
11
|
|
|
12
12
|
// src/services/Api.ts
|
|
13
13
|
var Api = class {
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
Api,
|
|
77
77
|
api
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-R6UXMGTJ.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R6UXMGTJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Gateway
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ESECEXXM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
toPageList
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PQTYEEZC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
use
|
|
12
12
|
} from "./chunk-ZPNFXK7Y.mjs";
|
|
@@ -43,4 +43,4 @@ var ApiGateway = class extends Gateway {
|
|
|
43
43
|
export {
|
|
44
44
|
ApiGateway
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-RBGF26S7.mjs.map
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HttpStatus,
|
|
3
|
-
isHttpStatus
|
|
4
|
-
} from "./chunk-LNNALU5F.mjs";
|
|
5
1
|
import {
|
|
6
2
|
isResponse
|
|
7
3
|
} from "./chunk-UYDZZAEK.mjs";
|
|
8
4
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isResults
|
|
13
|
-
} from "./chunk-MIYBZDW6.mjs";
|
|
5
|
+
HttpStatus,
|
|
6
|
+
isHttpStatus
|
|
7
|
+
} from "./chunk-LNNALU5F.mjs";
|
|
14
8
|
import {
|
|
9
|
+
choose,
|
|
15
10
|
isResult,
|
|
11
|
+
isResults,
|
|
16
12
|
toResult
|
|
17
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
18
14
|
import {
|
|
19
15
|
toList
|
|
20
16
|
} from "./chunk-HOVTNDHS.mjs";
|
|
@@ -52,4 +48,4 @@ export {
|
|
|
52
48
|
rest,
|
|
53
49
|
isRestResult
|
|
54
50
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-TNPMWL7Y.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/http/RestResult.ts"],"sourcesContent":["import { HttpStatus, isHttpStatus } from './HttpStatus';\nimport { isResponse } from './Response';\nimport { List, toList } from '../types/List';\nimport { Json } from '../types/Json';\nimport { isResult, Result, toResult } from '../types/Result';\nimport { isDefined, isError } from '../types/Is';\nimport { choose } from '../types/Case';\nimport { isResults } from '../types/Results';\nimport { Id } from '../types/Id';\n\nexport type RestResult = {\n data?: { code: number; items: List<Json>; itemCount: number; totalItems?: number; meta?: Json };\n error?: { code: number; message: string; errorCount: number; errors: List<Result> };\n};\n\nconst hasErrors = (a: any): a is { error: { code: number; errors: List<Result> } } => isDefined(a?.error?.errors);\nconst hasItems = (a: any): a is { data: { code: number; items: List<Json>; totalItems?: number; meta?: Json } } => isDefined(a?.data.items);\n\nexport const rest = {\n toData: (status: HttpStatus, items: Json[] = [], totalItems?: number, meta?: Json): RestResult => ({\n data: {\n code: status.status,\n items: toList(items),\n itemCount: items.length,\n totalItems,\n meta,\n },\n }),\n toError: (status: HttpStatus, errors: Result[] = [toResult(status.name)]): RestResult => ({\n error: {\n code: status.status,\n message: status.name ?? errors[0].message ?? 'Unknown',\n errors: toList(errors),\n errorCount: errors.length,\n },\n }),\n to: (payload?: any | any[], status?: HttpStatus): RestResult =>\n choose(payload)\n .is.not.defined(p => p, undefined as unknown as RestResult)\n .type(isHttpStatus, h => rest.toError(h ?? status ?? HttpStatus.InternalServerError, [toResult(h.name)]))\n .type(isResult, r => rest.toError(status ?? HttpStatus.BadRequest, [r]))\n .type(isError, e => rest.toError(status ?? HttpStatus.BadRequest, [e]))\n .type(isResults, r => rest.toError(status ?? HttpStatus.BadRequest, r.results))\n .type(isResponse, r => rest.toError(status ?? HttpStatus.byId(r.body.error?.code as Id), r.body.error?.errors))\n .type(hasErrors, e => rest.toError(status ?? HttpStatus.byId(e.error.code, HttpStatus.BadRequest), e.error.errors))\n .type(hasItems, d => rest.toData(status ?? HttpStatus.byId(d.data.code, HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta))\n .else(p => rest.toData(status ?? HttpStatus.Ok, toList(p))),\n};\n\nexport const isRestResult = (r: unknown): r is RestResult => isDefined(r) && (isDefined((r as RestResult).data) || isDefined((r as RestResult).error));\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/http/RestResult.ts"],"sourcesContent":["import { HttpStatus, isHttpStatus } from './HttpStatus';\nimport { isResponse } from './Response';\nimport { List, toList } from '../types/List';\nimport { Json } from '../types/Json';\nimport { isResult, Result, toResult } from '../types/Result';\nimport { isDefined, isError } from '../types/Is';\nimport { choose } from '../types/Case';\nimport { isResults } from '../types/Results';\nimport { Id } from '../types/Id';\n\nexport type RestResult = {\n data?: { code: number; items: List<Json>; itemCount: number; totalItems?: number; meta?: Json };\n error?: { code: number; message: string; errorCount: number; errors: List<Result> };\n};\n\nconst hasErrors = (a: any): a is { error: { code: number; errors: List<Result> } } => isDefined(a?.error?.errors);\nconst hasItems = (a: any): a is { data: { code: number; items: List<Json>; totalItems?: number; meta?: Json } } => isDefined(a?.data.items);\n\nexport const rest = {\n toData: (status: HttpStatus, items: Json[] = [], totalItems?: number, meta?: Json): RestResult => ({\n data: {\n code: status.status,\n items: toList(items),\n itemCount: items.length,\n totalItems,\n meta,\n },\n }),\n toError: (status: HttpStatus, errors: Result[] = [toResult(status.name)]): RestResult => ({\n error: {\n code: status.status,\n message: status.name ?? errors[0].message ?? 'Unknown',\n errors: toList(errors),\n errorCount: errors.length,\n },\n }),\n to: (payload?: any | any[], status?: HttpStatus): RestResult =>\n choose(payload)\n .is.not.defined(p => p, undefined as unknown as RestResult)\n .type(isHttpStatus, h => rest.toError(h ?? status ?? HttpStatus.InternalServerError, [toResult(h.name)]))\n .type(isResult, r => rest.toError(status ?? HttpStatus.BadRequest, [r]))\n .type(isError, e => rest.toError(status ?? HttpStatus.BadRequest, [e]))\n .type(isResults, r => rest.toError(status ?? HttpStatus.BadRequest, r.results))\n .type(isResponse, r => rest.toError(status ?? HttpStatus.byId(r.body.error?.code as Id), r.body.error?.errors))\n .type(hasErrors, e => rest.toError(status ?? HttpStatus.byId(e.error.code, HttpStatus.BadRequest), e.error.errors))\n .type(hasItems, d => rest.toData(status ?? HttpStatus.byId(d.data.code, HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta))\n .else(p => rest.toData(status ?? HttpStatus.Ok, toList(p))),\n};\n\nexport const isRestResult = (r: unknown): r is RestResult => isDefined(r) && (isDefined((r as RestResult).data) || isDefined((r as RestResult).error));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAeA,IAAM,YAAY,CAAC,MAAmE,UAAU,GAAG,OAAO,MAAM;AAChH,IAAM,WAAW,CAAC,MAAiG,UAAU,GAAG,KAAK,KAAK;AAEnI,IAAM,OAAO;AAAA,EAClB,QAAQ,CAAC,QAAoB,QAAgB,CAAC,GAAG,YAAqB,UAA6B;AAAA,IACjG,MAAM;AAAA,MACJ,MAAM,OAAO;AAAA,MACb,OAAO,OAAO,KAAK;AAAA,MACnB,WAAW,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS,CAAC,QAAoB,SAAmB,CAAC,SAAS,OAAO,IAAI,CAAC,OAAmB;AAAA,IACxF,OAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,SAAS,OAAO,QAAQ,OAAO,CAAC,EAAE,WAAW;AAAA,MAC7C,QAAQ,OAAO,MAAM;AAAA,MACrB,YAAY,OAAO;AAAA,IACrB;AAAA,EACF;AAAA,EACA,IAAI,CAAC,SAAuB,WAC1B,OAAO,OAAO,EACX,GAAG,IAAI,QAAQ,OAAK,GAAG,MAAkC,EACzD,KAAK,cAAc,OAAK,KAAK,QAAQ,KAAK,UAAU,WAAW,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EACvG,KAAK,UAAU,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACtE,KAAK,SAAS,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACrE,KAAK,WAAW,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,EAAE,OAAO,CAAC,EAC7E,KAAK,YAAY,OAAK,KAAK,QAAQ,UAAU,WAAW,KAAK,EAAE,KAAK,OAAO,IAAU,GAAG,EAAE,KAAK,OAAO,MAAM,CAAC,EAC7G,KAAK,WAAW,OAAK,KAAK,QAAQ,UAAU,WAAW,KAAK,EAAE,MAAM,MAAM,WAAW,UAAU,GAAG,EAAE,MAAM,MAAM,CAAC,EACjH,KAAK,UAAU,OAAK,KAAK,OAAO,UAAU,WAAW,KAAK,EAAE,KAAK,MAAM,WAAW,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,CAAC,EACpI,KAAK,OAAK,KAAK,OAAO,UAAU,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC;AAChE;AAEO,IAAM,eAAe,CAAC,MAAgC,UAAU,CAAC,MAAM,UAAW,EAAiB,IAAI,KAAK,UAAW,EAAiB,KAAK;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Exception
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
1
4
|
import {
|
|
2
5
|
reject
|
|
3
6
|
} from "./chunk-2EJYJ4HI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Exception
|
|
6
|
-
} from "./chunk-VTEGCABM.mjs";
|
|
7
7
|
|
|
8
8
|
// src/types/Repository.ts
|
|
9
9
|
var Repository = class {
|
|
@@ -48,4 +48,4 @@ var Repository = class {
|
|
|
48
48
|
export {
|
|
49
49
|
Repository
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-TPGAM536.mjs.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isEqual
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
isPageList,
|
|
6
|
-
toPageList
|
|
7
|
-
} from "./chunk-3BJH75JQ.mjs";
|
|
3
|
+
} from "./chunk-FCJ4TDW7.mjs";
|
|
8
4
|
import {
|
|
9
5
|
asJson,
|
|
10
6
|
json
|
|
11
7
|
} from "./chunk-YQC25ZQ4.mjs";
|
|
8
|
+
import {
|
|
9
|
+
isPageList,
|
|
10
|
+
toPageList
|
|
11
|
+
} from "./chunk-PQTYEEZC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
choose
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
15
15
|
import {
|
|
16
16
|
isEnumConstructor
|
|
17
17
|
} from "./chunk-AG3P2RCU.mjs";
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
view,
|
|
114
114
|
views
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-UYBPL7PM.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryTo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZBS4A3QI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
asString
|
|
6
6
|
} from "./chunk-BDA5LB4S.mjs";
|
|
@@ -17,4 +17,4 @@ var asNumber = (n, alt) => tryTo(() => asString(n)).map((s) => parseInt(s)).filt
|
|
|
17
17
|
export {
|
|
18
18
|
asNumber
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-XAIZBTVQ.mjs.map
|