@thisisagile/easy 18.5.0 → 18.7.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-WGDPSWDJ.mjs → chunk-5N6Q7OXJ.mjs} +3 -3
- package/dist/{chunk-32JNUNPT.mjs → chunk-63DTRTSC.mjs} +4 -8
- package/dist/{chunk-32JNUNPT.mjs.map → chunk-63DTRTSC.mjs.map} +1 -1
- package/dist/{chunk-TRHTO2EW.mjs → chunk-6PMTGQVO.mjs} +3 -3
- package/dist/{chunk-6BH22YKR.mjs → chunk-6YTIRHPN.mjs} +4 -6
- package/dist/{chunk-6BH22YKR.mjs.map → chunk-6YTIRHPN.mjs.map} +1 -1
- package/dist/{chunk-QFOUEEXU.mjs → chunk-7TW4TBFN.mjs} +8 -16
- package/dist/{chunk-QFOUEEXU.mjs.map → chunk-7TW4TBFN.mjs.map} +1 -1
- package/dist/{chunk-PYDTZUGI.mjs → chunk-AYR4US3Z.mjs} +2 -2
- package/dist/{chunk-A4BT3ONR.mjs → chunk-B37NZCNW.mjs} +2 -2
- package/dist/{chunk-5KIMOU2T.mjs → chunk-FF3BNZ4H.mjs} +3 -5
- package/dist/{chunk-5KIMOU2T.mjs.map → chunk-FF3BNZ4H.mjs.map} +1 -1
- package/dist/{chunk-YYLTSI5X.mjs → chunk-FFD2T6YV.mjs} +2 -2
- package/dist/{chunk-FM3C7UJ5.mjs → chunk-FSWASMJZ.mjs} +2 -2
- package/dist/{chunk-TZMIA2P4.mjs → chunk-GF7JYGJU.mjs} +4 -8
- package/dist/{chunk-TZMIA2P4.mjs.map → chunk-GF7JYGJU.mjs.map} +1 -1
- package/dist/{chunk-XCE2MDKJ.mjs → chunk-GKQMIKIY.mjs} +2 -2
- package/dist/{chunk-NDOE57NV.mjs → chunk-IESVFCB3.mjs} +3 -3
- package/dist/{chunk-S5ROAZ73.mjs → chunk-IYUYA5OX.mjs} +5 -5
- package/dist/{chunk-G2NE3X2O.mjs → chunk-J5PB7ZVO.mjs} +4 -6
- package/dist/{chunk-G2NE3X2O.mjs.map → chunk-J5PB7ZVO.mjs.map} +1 -1
- package/dist/{chunk-YH6IWZDQ.mjs → chunk-JI7MC5EA.mjs} +2 -2
- package/dist/{chunk-6L2QT25T.mjs → chunk-JM6NAJQ3.mjs} +4 -6
- package/dist/{chunk-6L2QT25T.mjs.map → chunk-JM6NAJQ3.mjs.map} +1 -1
- package/dist/{chunk-7HAFUM6F.mjs → chunk-JNZUGKMO.mjs} +2 -2
- package/dist/{chunk-7JZYEQC2.mjs → chunk-KPXOQFEB.mjs} +4 -6
- package/dist/{chunk-7JZYEQC2.mjs.map → chunk-KPXOQFEB.mjs.map} +1 -1
- package/dist/{chunk-UK7JEY65.mjs → chunk-LHDTOERW.mjs} +3 -5
- package/dist/{chunk-UK7JEY65.mjs.map → chunk-LHDTOERW.mjs.map} +1 -1
- package/dist/{chunk-ZA3RBSEC.mjs → chunk-M2S4OLVZ.mjs} +2 -2
- package/dist/{chunk-WIBO6IZF.mjs → chunk-O4RWZGFC.mjs} +4 -6
- package/dist/{chunk-WIBO6IZF.mjs.map → chunk-O4RWZGFC.mjs.map} +1 -1
- package/dist/{chunk-GSRE7B6A.mjs → chunk-QBPSI5NM.mjs} +4 -4
- package/dist/{chunk-75E6U7F3.mjs → chunk-QLEGIYVU.mjs} +3 -5
- package/dist/{chunk-75E6U7F3.mjs.map → chunk-QLEGIYVU.mjs.map} +1 -1
- package/dist/{chunk-YP6UP7XS.mjs → chunk-QZPBFVZL.mjs} +2 -2
- package/dist/{chunk-DBQGZ42Q.mjs → chunk-RBJBAJOK.mjs} +2 -2
- package/dist/{chunk-3QWILJ53.mjs → chunk-RW4AKBCN.mjs} +3 -3
- package/dist/{chunk-M2YNFJCR.mjs → chunk-SBT3WGBP.mjs} +7 -7
- package/dist/{chunk-WSSDODHS.mjs → chunk-TNIG6FU2.mjs} +2 -2
- package/dist/{chunk-UL2QXFW5.mjs → chunk-TUO7ZPSP.mjs} +541 -105
- package/dist/chunk-TUO7ZPSP.mjs.map +1 -0
- package/dist/{chunk-KMYWEWV2.mjs → chunk-WOUH6UVC.mjs} +3 -5
- package/dist/{chunk-KMYWEWV2.mjs.map → chunk-WOUH6UVC.mjs.map} +1 -1
- package/dist/{chunk-CUA35DFA.mjs → chunk-XQJ5LQEQ.mjs} +2 -2
- package/dist/{chunk-NTNX63YD.mjs → chunk-ZBOGLMG2.mjs} +4 -4
- package/dist/{chunk-DRKXISJA.mjs → chunk-ZRH6FGUK.mjs} +4 -4
- package/dist/{chunk-LHBXZT7D.mjs → chunk-ZZ73Z5CU.mjs} +2 -2
- package/dist/data/Condition.mjs +6 -5
- package/dist/data/Database.mjs +5 -6
- package/dist/data/Field.mjs +6 -5
- package/dist/data/Field.mjs.map +1 -1
- package/dist/data/InMemoryGateway.mjs +5 -10
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/domain/Audit.mjs +9 -14
- package/dist/domain/Child.mjs +6 -11
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/DateTime.mjs +5 -10
- package/dist/domain/Entity.mjs +9 -14
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.mjs +8 -15
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.mjs +5 -10
- package/dist/domain/Typo.mjs +5 -10
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/http/CacheControl.mjs +7 -13
- package/dist/http/CacheControl.mjs.map +1 -1
- package/dist/http/ContentType.mjs +5 -6
- package/dist/http/HttpStatus.mjs +5 -6
- package/dist/http/HttpVerb.mjs +5 -6
- package/dist/http/LocalRequestStore.mjs +3 -8
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/RequestOptions.mjs +5 -10
- package/dist/http/RestResult.mjs +5 -10
- package/dist/http/toResponse.mjs +6 -11
- package/dist/index.js +528 -523
- package/dist/index.js.map +1 -1
- package/dist/process/App.mjs +4 -9
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.mjs +5 -10
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.mjs +4 -9
- package/dist/process/Search.mjs +5 -10
- package/dist/process/UseCase.mjs +6 -13
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/Req.mjs +5 -10
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/services/Api.mjs +13 -18
- package/dist/services/ApiGateway.mjs +16 -21
- package/dist/services/AxiosProvider.mjs +11 -16
- package/dist/services/MappedRouteGateway.mjs +19 -24
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.mjs +17 -22
- package/dist/services/ViewRouteGateway.mjs +19 -25
- package/dist/services/ViewRouteGateway.mjs.map +1 -1
- package/dist/sql/Column.mjs +4 -9
- package/dist/sql/Count.mjs +7 -5
- package/dist/sql/Delete.mjs +6 -4
- package/dist/sql/Insert.mjs +6 -4
- package/dist/sql/Select.mjs +6 -4
- package/dist/sql/SqlQuery.mjs +5 -3
- package/dist/sql/Table.mjs +14 -19
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.mjs +6 -12
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/sql/Update.mjs +6 -4
- package/dist/types/Cache.mjs +4 -4
- package/dist/types/CacheAge.mjs +5 -10
- package/dist/types/Case.mjs +3 -8
- package/dist/types/Context.mjs +3 -8
- package/dist/types/Enum.mjs +4 -5
- package/dist/types/Environment.mjs +4 -5
- package/dist/types/Environment.mjs.map +1 -1
- package/dist/types/Exception.mjs +3 -8
- package/dist/types/Gateway.mjs +4 -9
- package/dist/types/IsEqual.mjs +3 -9
- package/dist/types/Json.mjs +5 -4
- package/dist/types/List.mjs +4 -2
- package/dist/types/Meta.mjs +4 -4
- package/dist/types/Number.mjs +4 -9
- package/dist/types/Object.mjs +4 -3
- package/dist/types/PageList.mjs +4 -9
- package/dist/types/Parser.mjs +3 -8
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Repository.mjs +4 -9
- package/dist/types/Result.mjs +3 -8
- package/dist/types/Results.mjs +3 -8
- package/dist/types/Tag.mjs +4 -4
- package/dist/types/Template.mjs +3 -8
- package/dist/types/ToText.mjs +3 -8
- package/dist/types/Try.mjs +3 -8
- package/dist/types/Uri.mjs +6 -14
- package/dist/types/Uri.mjs.map +1 -1
- package/dist/utils/If.d.ts +2 -0
- package/dist/utils/If.mjs +6 -2
- package/dist/utils/Mapper.mjs +6 -6
- package/dist/utils/Period.mjs +5 -10
- package/dist/utils/Period.mjs.map +1 -1
- package/dist/utils/Promise.mjs +4 -4
- package/dist/utils/Seconds.mjs +5 -3
- package/dist/utils/Sentence.mjs +3 -8
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/View.mjs +6 -12
- package/dist/validation/Contraints.mjs +4 -9
- package/dist/validation/Validate.mjs +3 -8
- package/dist/validation/When.mjs +3 -8
- package/package.json +1 -1
- package/src/utils/If.ts +7 -0
- package/dist/chunk-FECVT2OY.mjs +0 -58
- package/dist/chunk-FECVT2OY.mjs.map +0 -1
- package/dist/chunk-GRMWYEPU.mjs +0 -37
- package/dist/chunk-GRMWYEPU.mjs.map +0 -1
- package/dist/chunk-HNW64DUZ.mjs +0 -54
- package/dist/chunk-HNW64DUZ.mjs.map +0 -1
- package/dist/chunk-MQ6KZAFL.mjs +0 -310
- package/dist/chunk-MQ6KZAFL.mjs.map +0 -1
- package/dist/chunk-NYKMQY5N.mjs +0 -23
- package/dist/chunk-NYKMQY5N.mjs.map +0 -1
- package/dist/chunk-UL2QXFW5.mjs.map +0 -1
- package/dist/chunk-VN4JL4JB.mjs +0 -68
- package/dist/chunk-VN4JL4JB.mjs.map +0 -1
- /package/dist/{chunk-WGDPSWDJ.mjs.map → chunk-5N6Q7OXJ.mjs.map} +0 -0
- /package/dist/{chunk-TRHTO2EW.mjs.map → chunk-6PMTGQVO.mjs.map} +0 -0
- /package/dist/{chunk-PYDTZUGI.mjs.map → chunk-AYR4US3Z.mjs.map} +0 -0
- /package/dist/{chunk-A4BT3ONR.mjs.map → chunk-B37NZCNW.mjs.map} +0 -0
- /package/dist/{chunk-YYLTSI5X.mjs.map → chunk-FFD2T6YV.mjs.map} +0 -0
- /package/dist/{chunk-FM3C7UJ5.mjs.map → chunk-FSWASMJZ.mjs.map} +0 -0
- /package/dist/{chunk-XCE2MDKJ.mjs.map → chunk-GKQMIKIY.mjs.map} +0 -0
- /package/dist/{chunk-NDOE57NV.mjs.map → chunk-IESVFCB3.mjs.map} +0 -0
- /package/dist/{chunk-S5ROAZ73.mjs.map → chunk-IYUYA5OX.mjs.map} +0 -0
- /package/dist/{chunk-YH6IWZDQ.mjs.map → chunk-JI7MC5EA.mjs.map} +0 -0
- /package/dist/{chunk-7HAFUM6F.mjs.map → chunk-JNZUGKMO.mjs.map} +0 -0
- /package/dist/{chunk-ZA3RBSEC.mjs.map → chunk-M2S4OLVZ.mjs.map} +0 -0
- /package/dist/{chunk-GSRE7B6A.mjs.map → chunk-QBPSI5NM.mjs.map} +0 -0
- /package/dist/{chunk-YP6UP7XS.mjs.map → chunk-QZPBFVZL.mjs.map} +0 -0
- /package/dist/{chunk-DBQGZ42Q.mjs.map → chunk-RBJBAJOK.mjs.map} +0 -0
- /package/dist/{chunk-3QWILJ53.mjs.map → chunk-RW4AKBCN.mjs.map} +0 -0
- /package/dist/{chunk-M2YNFJCR.mjs.map → chunk-SBT3WGBP.mjs.map} +0 -0
- /package/dist/{chunk-WSSDODHS.mjs.map → chunk-TNIG6FU2.mjs.map} +0 -0
- /package/dist/{chunk-CUA35DFA.mjs.map → chunk-XQJ5LQEQ.mjs.map} +0 -0
- /package/dist/{chunk-NTNX63YD.mjs.map → chunk-ZBOGLMG2.mjs.map} +0 -0
- /package/dist/{chunk-DRKXISJA.mjs.map → chunk-ZRH6FGUK.mjs.map} +0 -0
- /package/dist/{chunk-LHBXZT7D.mjs.map → chunk-ZZ73Z5CU.mjs.map} +0 -0
package/dist/domain/Repo.mjs
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-LHDTOERW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WOUH6UVC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Exception,
|
|
9
|
-
|
|
10
|
-
} from "../chunk-UL2QXFW5.mjs";
|
|
11
|
-
import {
|
|
9
|
+
asList,
|
|
12
10
|
reject,
|
|
13
|
-
resolve
|
|
14
|
-
|
|
11
|
+
resolve,
|
|
12
|
+
when
|
|
13
|
+
} from "../chunk-TUO7ZPSP.mjs";
|
|
15
14
|
import {
|
|
16
15
|
isValidatable
|
|
17
16
|
} from "../chunk-GPNPXSOF.mjs";
|
|
18
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
19
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
20
|
-
import "../chunk-FECVT2OY.mjs";
|
|
21
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
22
|
-
import {
|
|
23
|
-
asList
|
|
24
|
-
} from "../chunk-MQ6KZAFL.mjs";
|
|
25
|
-
import "../chunk-SSROJBD5.mjs";
|
|
26
17
|
import "../chunk-QCPWEAAJ.mjs";
|
|
18
|
+
import "../chunk-SSROJBD5.mjs";
|
|
19
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
27
20
|
import "../chunk-4Q6IHSAU.mjs";
|
|
28
21
|
import "../chunk-SJGQU3OG.mjs";
|
|
29
22
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/domain/Repo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Repo.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Constructor } from '../types/Constructor';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { isValidatable } from '../types/Validatable';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { asList, List } from '../types/List';\nimport { reject, resolve } from '../utils/Promise';\n\nexport type RepoAction = 'add' | 'update' | 'remove';\n\nexport class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {\n constructor(\n protected ctor: Constructor<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (item: T | Json): T => (isValidatable(item) ? item : new this.ctor(item));\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(j => asList(this.ctor, j));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: T | Json): Promise<T> {\n return this.extend(this.create(t), 'add')\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'add'))\n .then(i => this.gateway.add(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n update(id: Id, json: Json): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j).update(json) as T)\n .then(i => this.extend(i, 'update'))\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'update'))\n .then(i => this.gateway.update(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n\n extend(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n validate(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n upsert(id: Id, item: Json): Promise<T> {\n return this.update(id, item).catch(e => (Exception.DoesNotExist.equals(e) ? this.add(item) : reject(e)));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Repo.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Constructor } from '../types/Constructor';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { isValidatable } from '../types/Validatable';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { asList, List } from '../types/List';\nimport { reject, resolve } from '../utils/Promise';\n\nexport type RepoAction = 'add' | 'update' | 'remove';\n\nexport class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {\n constructor(\n protected ctor: Constructor<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (item: T | Json): T => (isValidatable(item) ? item : new this.ctor(item));\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(j => asList(this.ctor, j));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: T | Json): Promise<T> {\n return this.extend(this.create(t), 'add')\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'add'))\n .then(i => this.gateway.add(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n update(id: Id, json: Json): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j).update(json) as T)\n .then(i => this.extend(i, 'update'))\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'update'))\n .then(i => this.gateway.update(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n\n extend(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n validate(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n upsert(id: Id, item: Json): Promise<T> {\n return this.update(id, item).catch(e => (Exception.DoesNotExist.equals(e) ? this.add(item) : reject(e)));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,OAAN,cAA6D,WAAuB;AAAA,EACzF,YACY,MACO,SACjB;AACA,UAAM;AAHI;AACO;AAAA,EAGnB;AAAA,EAEA,SAAS,CAAC,SAAuB,cAAc,IAAI,IAAI,OAAO,IAAI,KAAK,KAAK,IAAI;AAAA,EAEhF,IAAI,SAAyC;AAC3C,WAAO,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAM,GAAG,IA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k-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
4
|
+
} from "../chunk-RW4AKBCN.mjs";
|
|
5
|
+
import "../chunk-WOUH6UVC.mjs";
|
|
6
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
8
7
|
import "../chunk-GPNPXSOF.mjs";
|
|
9
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
10
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
11
|
-
import "../chunk-FECVT2OY.mjs";
|
|
12
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
13
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
14
|
-
import "../chunk-SSROJBD5.mjs";
|
|
15
8
|
import "../chunk-QCPWEAAJ.mjs";
|
|
9
|
+
import "../chunk-SSROJBD5.mjs";
|
|
10
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
16
11
|
import "../chunk-4Q6IHSAU.mjs";
|
|
17
12
|
import "../chunk-SJGQU3OG.mjs";
|
|
18
13
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/domain/Typo.mjs
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-LHDTOERW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WOUH6UVC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Exception,
|
|
9
9
|
when
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
10
|
+
} from "../chunk-TUO7ZPSP.mjs";
|
|
12
11
|
import "../chunk-GPNPXSOF.mjs";
|
|
13
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
14
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
15
|
-
import "../chunk-FECVT2OY.mjs";
|
|
16
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
17
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
18
|
-
import "../chunk-SSROJBD5.mjs";
|
|
19
12
|
import "../chunk-QCPWEAAJ.mjs";
|
|
13
|
+
import "../chunk-SSROJBD5.mjs";
|
|
14
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
20
15
|
import "../chunk-4Q6IHSAU.mjs";
|
|
21
16
|
import "../chunk-SJGQU3OG.mjs";
|
|
22
17
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/domain/Typo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Typo.ts"],"sourcesContent":["import { View } from '../utils/View';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { List } from '../types/List';\nimport { RouteGateway } from '../services/RouteGateway';\nimport { RouteOptions } from '../services/Api';\n\nexport class Typo<T, Options extends RouteOptions = RouteOptions> extends Repository<T, Options> {\n constructor(\n protected view: View<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (j: Json): T => this.view.from(j);\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(this.create));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => this.create(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(js => js.map(this.create));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(this.create));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(this.create));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(this.create));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(j => this.create(j)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n}\n\nexport class Agent<T, Options extends FetchOptions = FetchOptions> extends Repository<T, Options> {\n constructor(private gateway: RouteGateway) {\n super();\n }\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options) as Promise<PageList<T>>;\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway.byId(id) as Promise<T>;\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids) as Promise<List<T>>;\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options) as Promise<PageList<T>>;\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options) as Promise<PageList<T>>;\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options) as Promise<PageList<T>>;\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options) as Promise<PageList<T>>;\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: Partial<T>): Promise<T> {\n return this.gateway.add(toJson(t)) as Promise<T>;\n }\n\n update(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.update({ ...toJson(t), id }) as Promise<T>;\n }\n\n upsert(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.upsert({ ...toJson(t), id }) as Promise<T>;\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Typo.ts"],"sourcesContent":["import { View } from '../utils/View';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { List } from '../types/List';\nimport { RouteGateway } from '../services/RouteGateway';\nimport { RouteOptions } from '../services/Api';\n\nexport class Typo<T, Options extends RouteOptions = RouteOptions> extends Repository<T, Options> {\n constructor(\n protected view: View<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (j: Json): T => this.view.from(j);\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(this.create));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => this.create(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(js => js.map(this.create));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(this.create));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(this.create));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(this.create));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(j => this.create(j)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n}\n\nexport class Agent<T, Options extends FetchOptions = FetchOptions> extends Repository<T, Options> {\n constructor(private gateway: RouteGateway) {\n super();\n }\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options) as Promise<PageList<T>>;\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway.byId(id) as Promise<T>;\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids) as Promise<List<T>>;\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options) as Promise<PageList<T>>;\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options) as Promise<PageList<T>>;\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options) as Promise<PageList<T>>;\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options) as Promise<PageList<T>>;\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: Partial<T>): Promise<T> {\n return this.gateway.add(toJson(t)) as Promise<T>;\n }\n\n update(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.update({ ...toJson(t), id }) as Promise<T>;\n }\n\n upsert(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.upsert({ ...toJson(t), id }) as Promise<T>;\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,OAAN,cAAmE,WAAuB;AAAA,EAC/F,YACY,MACO,SACjB;AACA,UAAM;AAHI;AACO;AAAA,EAGnB;AAAA,EAEA,SAAS,CAAC,MAAe,KAAK,KAAK,KAAK,CAAC;AAAA,EAEzC,IAAI,SAAyC;AAC3C,WAAO,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AAAA,EACjE;AAAA,EAEA,KAAK,IAAoB;AACvB,WAAO,KAAK,QACT,KAAK,EAAE,EACP,KAAK,OAAK,KAAK,CAAC,EAAE,IAAI,UAAU,OAAO,UAAU,YAAY,CAAC,EAC9D,KAAK,OAAK,KAAK,OAAO,CAAC,CAAC;AAAA,EAC7B;AAAA,EAEA,SAAS,KAA6B;AACpC,WAAO,KAAK,QAAQ,MAAM,GAAG,GAAG,EAAE,KAAK,QAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AAAA,EAClE;AAAA,EAEA,MAAM,KAAU,SAAyC;AACvD,WAAO,KAAK,QAAQ,GAAG,OAAO,KAAK,OAA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C,WAAO,KAAK,QAAQ,OAAO,OAAO;AAAA,EACpC;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,QAAQ,OAAO,EAAE;AAAA,EAC/B;AAAA,EAEA,IAAI,GAA2B;AAC7B,WAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC;AAAA,EACnC;AAAA,EAEA,OAAO,IAAQ,GAA2B;AACxC,WAAO,KAAK,QAAQ,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;AAAA,EACjD;AAAA,EAEA,OAAO,IAAQ,GAA2B;AACxC,WAAO,KAAK,QAAQ,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;AAAA,EACjD;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,QAAQ,OAAO,EAAE;AAAA,EAC/B;AACF;","names":[]}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cacheAge,
|
|
3
3
|
isCacheAge
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-UL2QXFW5.mjs";
|
|
7
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
8
|
-
import "../chunk-GPNPXSOF.mjs";
|
|
9
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
10
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
11
|
-
import "../chunk-FECVT2OY.mjs";
|
|
12
|
-
import {
|
|
13
|
-
entries
|
|
14
|
-
} from "../chunk-GRMWYEPU.mjs";
|
|
4
|
+
} from "../chunk-IESVFCB3.mjs";
|
|
5
|
+
import "../chunk-XQJ5LQEQ.mjs";
|
|
15
6
|
import {
|
|
7
|
+
entries,
|
|
16
8
|
ifDefined
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-TUO7ZPSP.mjs";
|
|
10
|
+
import "../chunk-GPNPXSOF.mjs";
|
|
19
11
|
import "../chunk-QCPWEAAJ.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
13
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
20
14
|
import "../chunk-4Q6IHSAU.mjs";
|
|
21
15
|
import "../chunk-SJGQU3OG.mjs";
|
|
22
16
|
import "../chunk-MDIO6K2O.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/http/CacheControl.ts"],"sourcesContent":["import { cacheAge, CacheAge, isCacheAge } from '../types/CacheAge';\nimport { on } from '../types/Constructor';\nimport { entries } from '../types/Object';\nimport { ifDefined } from '../utils/If';\n\nexport class CacheControl {\n name = 'Cache-Control';\n\n protected constructor(\n readonly enabled = true,\n private directives: Record<string, boolean | CacheAge | undefined> = {}\n ) {}\n\n static disabled = () => new CacheControl(false);\n\n static OneSecond = () => new CacheControl().maxAge(1).staleWhileRevalidate(1);\n\n static fiveSeconds = () => new CacheControl().maxAge(5).staleWhileRevalidate(5);\n\n static tenSeconds = () => new CacheControl().maxAge(10).staleWhileRevalidate(10);\n\n static thirtySeconds = () => new CacheControl().maxAge(30).staleWhileRevalidate(30);\n\n static sixtySeconds = () => new CacheControl().maxAge(60).staleWhileRevalidate(60);\n\n static custom = (maxAge?: CacheAge, staleWhileRevalidate?: CacheAge) => new CacheControl().maxAge(maxAge).staleWhileRevalidate(staleWhileRevalidate);\n\n readonly maxAge = (ca?: CacheAge): this => on(this, t => (t.directives['max-age'] = ca));\n\n readonly sharedMaxAge = (ca?: CacheAge): this => on(this, t => (t.directives['s-maxage'] = ca));\n\n readonly noCache = (a?: boolean): this => on(this, t => (t.directives['no-cache'] = a));\n\n readonly mustRevalidate = (a?: boolean): this => on(this, t => (t.directives['must-revalidate'] = a));\n\n readonly private = (a?: boolean): this => on(this, t => (t.directives['private'] = a));\n\n readonly public = (a?: boolean): this => on(this, t => (t.directives['public'] = a));\n\n readonly immutable = (a?: boolean): this => on(this, t => (t.directives['immutable'] = a));\n\n readonly staleWhileRevalidate = (ca?: CacheAge): this => on(this, t => (t.directives['stale-while-revalidate'] = ca));\n\n value = (): string => this.toString();\n\n toString(): string {\n return entries(this.directives)\n .mapDefined(([k, v]) => ifDefined(v, isCacheAge(v) ? `${k}=${cacheAge.toSeconds(v)}` : k))\n .join(',');\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/http/CacheControl.ts"],"sourcesContent":["import { cacheAge, CacheAge, isCacheAge } from '../types/CacheAge';\nimport { on } from '../types/Constructor';\nimport { entries } from '../types/Object';\nimport { ifDefined } from '../utils/If';\n\nexport class CacheControl {\n name = 'Cache-Control';\n\n protected constructor(\n readonly enabled = true,\n private directives: Record<string, boolean | CacheAge | undefined> = {}\n ) {}\n\n static disabled = () => new CacheControl(false);\n\n static OneSecond = () => new CacheControl().maxAge(1).staleWhileRevalidate(1);\n\n static fiveSeconds = () => new CacheControl().maxAge(5).staleWhileRevalidate(5);\n\n static tenSeconds = () => new CacheControl().maxAge(10).staleWhileRevalidate(10);\n\n static thirtySeconds = () => new CacheControl().maxAge(30).staleWhileRevalidate(30);\n\n static sixtySeconds = () => new CacheControl().maxAge(60).staleWhileRevalidate(60);\n\n static custom = (maxAge?: CacheAge, staleWhileRevalidate?: CacheAge) => new CacheControl().maxAge(maxAge).staleWhileRevalidate(staleWhileRevalidate);\n\n readonly maxAge = (ca?: CacheAge): this => on(this, t => (t.directives['max-age'] = ca));\n\n readonly sharedMaxAge = (ca?: CacheAge): this => on(this, t => (t.directives['s-maxage'] = ca));\n\n readonly noCache = (a?: boolean): this => on(this, t => (t.directives['no-cache'] = a));\n\n readonly mustRevalidate = (a?: boolean): this => on(this, t => (t.directives['must-revalidate'] = a));\n\n readonly private = (a?: boolean): this => on(this, t => (t.directives['private'] = a));\n\n readonly public = (a?: boolean): this => on(this, t => (t.directives['public'] = a));\n\n readonly immutable = (a?: boolean): this => on(this, t => (t.directives['immutable'] = a));\n\n readonly staleWhileRevalidate = (ca?: CacheAge): this => on(this, t => (t.directives['stale-while-revalidate'] = ca));\n\n value = (): string => this.toString();\n\n toString(): string {\n return entries(this.directives)\n .mapDefined(([k, v]) => ifDefined(v, isCacheAge(v) ? `${k}=${cacheAge.toSeconds(v)}` : k))\n .join(',');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,eAAN,MAAM,cAAa;AAAA,EAGd,YACC,UAAU,MACX,aAA6D,CAAC,GACtE;AAFS;AACD;AAAA,EACP;AAAA,EALH,OAAO;AAAA,EAOP,OAAO,WAAW,MAAM,IAAI,cAAa,KAAK;AAAA,EAE9C,OAAO,YAAY,MAAM,IAAI,cAAa,EAAE,OAAO,CAAC,EAAE,qBAAqB,CAAC;AAAA,EAE5E,OAAO,cAAc,MAAM,IAAI,cAAa,EAAE,OAAO,CAAC,EAAE,qBAAqB,CAAC;AAAA,EAE9E,OAAO,aAAa,MAAM,IAAI,cAAa,EAAE,OAAO,EAAE,EAAE,qBAAqB,EAAE;AAAA,EAE/E,OAAO,gBAAgB,MAAM,IAAI,cAAa,EAAE,OAAO,EAAE,EAAE,qBAAqB,EAAE;AAAA,EAElF,OAAO,eAAe,MAAM,IAAI,cAAa,EAAE,OAAO,EAAE,EAAE,qBAAqB,EAAE;AAAA,EAEjF,OAAO,SAAS,CAAC,QAAmB,yBAAoC,IAAI,cAAa,EAAE,OAAO,MAAM,EAAE,qBAAqB,oBAAoB;AAAA,EAE1I,SAAS,CAAC,OAAwB,GAAG,MAAM,OAAM,EAAE,WAAW,SAAS,IAAI,EAAG;AAAA,EAE9E,eAAe,CAAC,OAAwB,GAAG,MAAM,OAAM,EAAE,WAAW,UAAU,IAAI,EAAG;AAAA,EAErF,UAAU,CAAC,MAAsB,GAAG,MAAM,OAAM,EAAE,WAAW,UAAU,IAAI,CAAE;AAAA,EAE7E,iBAAiB,CAAC,MAAsB,GAAG,MAAM,OAAM,EAAE,WAAW,iBAAiB,IAAI,CAAE;AAAA,EAE3F,UAAU,CAAC,MAAsB,GAAG,MAAM,OAAM,EAAE,WAAW,SAAS,IAAI,CAAE;AAAA,EAE5E,SAAS,CAAC,MAAsB,GAAG,MAAM,OAAM,EAAE,WAAW,QAAQ,IAAI,CAAE;AAAA,EAE1E,YAAY,CAAC,MAAsB,GAAG,MAAM,OAAM,EAAE,WAAW,WAAW,IAAI,CAAE;AAAA,EAEhF,uBAAuB,CAAC,OAAwB,GAAG,MAAM,OAAM,EAAE,WAAW,wBAAwB,IAAI,EAAG;AAAA,EAEpH,QAAQ,MAAc,KAAK,SAAS;AAAA,EAEpC,WAAmB;AACjB,WAAO,QAAQ,KAAK,UAAU,EAC3B,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,IAAI,SAAS,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,EACxF,KAAK,GAAG;AAAA,EACb;AACF;","names":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContentType
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
7
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
8
|
-
import "../chunk-SSROJBD5.mjs";
|
|
3
|
+
} from "../chunk-FFD2T6YV.mjs";
|
|
4
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
5
|
+
import "../chunk-GPNPXSOF.mjs";
|
|
9
6
|
import "../chunk-QCPWEAAJ.mjs";
|
|
7
|
+
import "../chunk-SSROJBD5.mjs";
|
|
8
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
10
9
|
import "../chunk-4Q6IHSAU.mjs";
|
|
11
10
|
import "../chunk-SJGQU3OG.mjs";
|
|
12
11
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/http/HttpStatus.mjs
CHANGED
|
@@ -2,13 +2,12 @@ import {
|
|
|
2
2
|
HttpStatus,
|
|
3
3
|
isHttpStatus,
|
|
4
4
|
toHttpStatus
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
9
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
10
|
-
import "../chunk-SSROJBD5.mjs";
|
|
5
|
+
} from "../chunk-FSWASMJZ.mjs";
|
|
6
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
7
|
+
import "../chunk-GPNPXSOF.mjs";
|
|
11
8
|
import "../chunk-QCPWEAAJ.mjs";
|
|
9
|
+
import "../chunk-SSROJBD5.mjs";
|
|
10
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
12
11
|
import "../chunk-4Q6IHSAU.mjs";
|
|
13
12
|
import "../chunk-SJGQU3OG.mjs";
|
|
14
13
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/http/HttpVerb.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HttpVerb
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
7
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
8
|
-
import "../chunk-SSROJBD5.mjs";
|
|
3
|
+
} from "../chunk-JI7MC5EA.mjs";
|
|
4
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
5
|
+
import "../chunk-GPNPXSOF.mjs";
|
|
9
6
|
import "../chunk-QCPWEAAJ.mjs";
|
|
7
|
+
import "../chunk-SSROJBD5.mjs";
|
|
8
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
10
9
|
import "../chunk-4Q6IHSAU.mjs";
|
|
11
10
|
import "../chunk-SJGQU3OG.mjs";
|
|
12
11
|
import "../chunk-MDIO6K2O.mjs";
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ctx
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
3
|
+
} from "../chunk-TUO7ZPSP.mjs";
|
|
5
4
|
import "../chunk-GPNPXSOF.mjs";
|
|
6
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
7
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
8
|
-
import "../chunk-FECVT2OY.mjs";
|
|
9
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
10
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
11
|
-
import "../chunk-SSROJBD5.mjs";
|
|
12
5
|
import "../chunk-QCPWEAAJ.mjs";
|
|
6
|
+
import "../chunk-SSROJBD5.mjs";
|
|
7
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
13
8
|
import "../chunk-4Q6IHSAU.mjs";
|
|
14
9
|
import "../chunk-SJGQU3OG.mjs";
|
|
15
10
|
import "../chunk-MDIO6K2O.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/http/LocalRequestStore.ts"],"sourcesContent":["import { Response } from './Response';\nimport { Request } from './Request';\nimport { Store } from '../types/Cache';\nimport { Func } from '../types/Func';\nimport { ctx } from '../types/Context';\n\nexport class LocalRequestStore implements Store<Response, Request> {\n key = (_req: Request): string => '';\n\n execute(req: Request, f: Func<Promise<Response>, Request>): Promise<Response> {\n const key = this.key(req);\n return ctx.request.get(key) ?? ctx.request.set(key, f(req));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/http/LocalRequestStore.ts"],"sourcesContent":["import { Response } from './Response';\nimport { Request } from './Request';\nimport { Store } from '../types/Cache';\nimport { Func } from '../types/Func';\nimport { ctx } from '../types/Context';\n\nexport class LocalRequestStore implements Store<Response, Request> {\n key = (_req: Request): string => '';\n\n execute(req: Request, f: Func<Promise<Response>, Request>): Promise<Response> {\n const key = this.key(req);\n return ctx.request.get(key) ?? ctx.request.set(key, f(req));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAMO,IAAM,oBAAN,MAA4D;AAAA,EACjE,MAAM,CAAC,SAA0B;AAAA,EAEjC,QAAQ,KAAc,GAAwD;AAC5E,UAAM,MAAM,KAAK,IAAI,GAAG;AACxB,WAAO,IAAI,QAAQ,IAAI,GAAG,KAAK,IAAI,QAAQ,IAAI,KAAK,EAAE,GAAG,CAAC;AAAA,EAC5D;AACF;","names":[]}
|
|
@@ -2,20 +2,15 @@ import {
|
|
|
2
2
|
RequestOptions,
|
|
3
3
|
isRequestOptions,
|
|
4
4
|
toPageOptions
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-O4RWZGFC.mjs";
|
|
6
6
|
import "../chunk-SW2OCUH3.mjs";
|
|
7
7
|
import "../chunk-KL75JJTY.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
8
|
+
import "../chunk-FFD2T6YV.mjs";
|
|
9
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
11
10
|
import "../chunk-GPNPXSOF.mjs";
|
|
12
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
13
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
14
|
-
import "../chunk-FECVT2OY.mjs";
|
|
15
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
16
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
17
|
-
import "../chunk-SSROJBD5.mjs";
|
|
18
11
|
import "../chunk-QCPWEAAJ.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
13
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
19
14
|
import "../chunk-4Q6IHSAU.mjs";
|
|
20
15
|
import "../chunk-SJGQU3OG.mjs";
|
|
21
16
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/http/RestResult.mjs
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isRestResult,
|
|
3
3
|
rest
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6YTIRHPN.mjs";
|
|
5
|
+
import "../chunk-FSWASMJZ.mjs";
|
|
6
6
|
import "../chunk-WYLKFMFD.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
7
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
9
8
|
import "../chunk-GPNPXSOF.mjs";
|
|
10
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
11
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
12
|
-
import "../chunk-FECVT2OY.mjs";
|
|
13
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
14
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
15
|
-
import "../chunk-SSROJBD5.mjs";
|
|
16
9
|
import "../chunk-QCPWEAAJ.mjs";
|
|
10
|
+
import "../chunk-SSROJBD5.mjs";
|
|
11
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
17
12
|
import "../chunk-4Q6IHSAU.mjs";
|
|
18
13
|
import "../chunk-SJGQU3OG.mjs";
|
|
19
14
|
import "../chunk-MDIO6K2O.mjs";
|
package/dist/http/toResponse.mjs
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toResponse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-5N6Q7OXJ.mjs";
|
|
4
|
+
import "../chunk-6YTIRHPN.mjs";
|
|
5
|
+
import "../chunk-FSWASMJZ.mjs";
|
|
6
6
|
import "../chunk-WYLKFMFD.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-HNW64DUZ.mjs";
|
|
7
|
+
import "../chunk-TUO7ZPSP.mjs";
|
|
9
8
|
import "../chunk-GPNPXSOF.mjs";
|
|
10
|
-
import "../chunk-AMS2ELWR.mjs";
|
|
11
|
-
import "../chunk-VN4JL4JB.mjs";
|
|
12
|
-
import "../chunk-FECVT2OY.mjs";
|
|
13
|
-
import "../chunk-GRMWYEPU.mjs";
|
|
14
|
-
import "../chunk-MQ6KZAFL.mjs";
|
|
15
|
-
import "../chunk-SSROJBD5.mjs";
|
|
16
9
|
import "../chunk-QCPWEAAJ.mjs";
|
|
10
|
+
import "../chunk-SSROJBD5.mjs";
|
|
11
|
+
import "../chunk-AMS2ELWR.mjs";
|
|
17
12
|
import "../chunk-4Q6IHSAU.mjs";
|
|
18
13
|
import "../chunk-SJGQU3OG.mjs";
|
|
19
14
|
import "../chunk-MDIO6K2O.mjs";
|