@thisisagile/easy 17.23.0 → 17.24.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-HAEVUETQ.mjs → chunk-2C5WHSM5.mjs} +2 -2
- package/dist/{chunk-4BC26J7U.mjs → chunk-4WLPMNMB.mjs} +9 -9
- package/dist/{chunk-DUMDOMES.mjs → chunk-6ATDEGSU.mjs} +3 -3
- package/dist/{chunk-P4MEAARF.mjs → chunk-6ENYJKOF.mjs} +42 -35
- package/dist/chunk-6ENYJKOF.mjs.map +1 -0
- package/dist/{chunk-ZLU26SR3.mjs → chunk-6RSOVRW4.mjs} +4 -4
- package/dist/{chunk-6O3TSROI.mjs → chunk-73VXBPTL.mjs} +14 -14
- package/dist/{chunk-CHV6RMJL.mjs → chunk-7OEH5Q3V.mjs} +2 -2
- package/dist/{chunk-UQTNYF53.mjs → chunk-AWT4XDU7.mjs} +4 -4
- package/dist/{chunk-QL3DRPMM.mjs → chunk-BDKRR6H2.mjs} +2 -2
- package/dist/{chunk-VI57VONC.mjs → chunk-CHLVZFAR.mjs} +2 -2
- package/dist/{chunk-RTVVXROA.mjs → chunk-CMMMDBTK.mjs} +3 -3
- package/dist/{chunk-WUHEP5NJ.mjs → chunk-D4EFIKFU.mjs} +4 -4
- package/dist/chunk-D4EFIKFU.mjs.map +1 -0
- package/dist/{chunk-3ZX4YFOK.mjs → chunk-EOIG654K.mjs} +4 -4
- package/dist/{chunk-LMVFKEDS.mjs → chunk-F2SLQDR2.mjs} +2 -2
- package/dist/{chunk-5UUY67VD.mjs → chunk-F7MQZLCR.mjs} +3 -3
- package/dist/{chunk-3LWQJAEJ.mjs → chunk-FLJXHLSM.mjs} +3 -3
- package/dist/{chunk-7WCAHERW.mjs → chunk-GA7BBYC2.mjs} +3 -3
- package/dist/{chunk-WO4R5EYQ.mjs → chunk-GSAKK3JN.mjs} +3 -3
- package/dist/{chunk-A42HFDBS.mjs → chunk-HFBHENMJ.mjs} +3 -3
- package/dist/{chunk-A42HFDBS.mjs.map → chunk-HFBHENMJ.mjs.map} +1 -1
- package/dist/{chunk-Q7FJUYZT.mjs → chunk-HO3IEF5S.mjs} +14 -3
- package/dist/chunk-HO3IEF5S.mjs.map +1 -0
- package/dist/{chunk-PIW6QNIG.mjs → chunk-HWYUYPBI.mjs} +8 -8
- package/dist/{chunk-J7FACY7Y.mjs → chunk-I4HFLLRR.mjs} +3 -3
- package/dist/{chunk-YAB5YLHI.mjs → chunk-J5AZL5T6.mjs} +2 -2
- package/dist/{chunk-F4JCURDN.mjs → chunk-JABPZGOG.mjs} +2 -2
- package/dist/{chunk-4BH22HLY.mjs → chunk-JJQAGAQN.mjs} +3 -3
- package/dist/{chunk-5UXTE3WM.mjs → chunk-KBB2WGTO.mjs} +2 -2
- package/dist/{chunk-QH2LF3L3.mjs → chunk-LIDMZELG.mjs} +3 -3
- package/dist/{chunk-3CSSJCVP.mjs → chunk-N5B6HSHV.mjs} +7 -7
- package/dist/{chunk-IS675X5Z.mjs → chunk-NUA7EUWX.mjs} +9 -9
- package/dist/{chunk-DAG7KGVL.mjs → chunk-O4CJ7NSN.mjs} +2 -2
- package/dist/{chunk-TG7T4QPS.mjs → chunk-ONWMWJ43.mjs} +2 -2
- package/dist/chunk-ONWMWJ43.mjs.map +1 -0
- package/dist/{chunk-HL7ITJJT.mjs → chunk-OVORFG3O.mjs} +2 -2
- package/dist/{chunk-NWQTAKAM.mjs → chunk-PB6SCADS.mjs} +4 -4
- package/dist/{chunk-RGO5KVRQ.mjs → chunk-QNE24TSJ.mjs} +2 -2
- package/dist/{chunk-BI3DP4QA.mjs → chunk-S2VNBE5K.mjs} +3 -3
- package/dist/{chunk-7W67IZE4.mjs → chunk-ST3P6VWM.mjs} +2 -2
- package/dist/{chunk-AMIP3FS5.mjs → chunk-TLYJ2G3X.mjs} +9 -3
- package/dist/chunk-TLYJ2G3X.mjs.map +1 -0
- package/dist/{chunk-SDGUXNY3.mjs → chunk-TMAB63X5.mjs} +2 -2
- package/dist/{chunk-BE474ULY.mjs → chunk-UCNB24EO.mjs} +2 -2
- package/dist/{chunk-YODYDO2U.mjs → chunk-W53U3D4O.mjs} +2 -2
- package/dist/{chunk-UHP56ITH.mjs → chunk-WBL4BT3I.mjs} +2 -2
- package/dist/{chunk-4K6SPD7T.mjs → chunk-WDC45I5H.mjs} +4 -4
- package/dist/{chunk-KWE3VWIW.mjs → chunk-Y5NBOPDI.mjs} +5 -5
- package/dist/chunk-Y5NBOPDI.mjs.map +1 -0
- package/dist/{chunk-VKBEWDLL.mjs → chunk-YMJ43VFE.mjs} +4 -4
- package/dist/{chunk-OWZ5I5IV.mjs → chunk-YYIIQGLL.mjs} +13 -10
- package/dist/chunk-YYIIQGLL.mjs.map +1 -0
- package/dist/{chunk-I32HDHLS.mjs → chunk-ZNUHRHPU.mjs} +2 -2
- package/dist/data/Condition.mjs +5 -4
- package/dist/data/Database.mjs +6 -5
- package/dist/data/Field.mjs +5 -4
- package/dist/data/Field.mjs.map +1 -1
- package/dist/data/InMemoryGateway.mjs +14 -13
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/domain/Audit.mjs +18 -17
- package/dist/domain/Child.mjs +17 -16
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/DateTime.mjs +14 -13
- package/dist/domain/Entity.mjs +22 -21
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.mjs +14 -13
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.mjs +14 -13
- package/dist/domain/Typo.mjs +14 -13
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/http/CacheControl.mjs +14 -13
- package/dist/http/CacheControl.mjs.map +1 -1
- package/dist/http/ContentType.mjs +6 -5
- package/dist/http/HttpStatus.mjs +6 -5
- package/dist/http/HttpVerb.mjs +6 -5
- package/dist/http/LocalRequestStore.mjs +5 -4
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/RequestOptions.mjs +10 -9
- package/dist/http/RestResult.mjs +14 -13
- package/dist/http/toResponse.mjs +15 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +48 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/process/App.mjs +7 -6
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.mjs +14 -13
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.mjs +7 -6
- package/dist/process/Search.mjs +14 -13
- package/dist/process/UseCase.d.ts +1 -1
- package/dist/process/UseCase.mjs +9 -8
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/Req.mjs +13 -12
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/services/Api.mjs +23 -22
- package/dist/services/ApiGateway.mjs +26 -25
- package/dist/services/AxiosProvider.mjs +21 -20
- package/dist/services/MappedRouteGateway.mjs +29 -28
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.mjs +27 -26
- package/dist/services/ViewRouteGateway.mjs +30 -30
- package/dist/sql/Column.mjs +13 -12
- package/dist/sql/Count.mjs +5 -4
- package/dist/sql/Delete.mjs +4 -3
- package/dist/sql/Insert.mjs +4 -3
- package/dist/sql/Select.mjs +4 -3
- package/dist/sql/SqlQuery.mjs +3 -2
- package/dist/sql/Table.mjs +22 -21
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.mjs +14 -13
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/sql/Update.mjs +4 -3
- package/dist/types/AnyKey.d.ts +2 -2
- package/dist/types/Cache.mjs +4 -3
- package/dist/types/Cache.mjs.map +1 -1
- package/dist/types/CacheAge.mjs +14 -13
- package/dist/types/Case.mjs +12 -11
- package/dist/types/Context.d.ts +1 -1
- package/dist/types/Context.mjs +5 -4
- package/dist/types/Enum.mjs +5 -4
- package/dist/types/Environment.mjs +5 -4
- package/dist/types/Environment.mjs.map +1 -1
- package/dist/types/Exception.mjs +7 -6
- package/dist/types/Gateway.mjs +9 -8
- package/dist/types/IsEqual.mjs +13 -12
- package/dist/types/Json.mjs +4 -3
- package/dist/types/List.d.ts +12 -9
- package/dist/types/List.mjs +2 -1
- package/dist/types/Meta.mjs +4 -3
- package/dist/types/Number.mjs +13 -12
- package/dist/types/Object.mjs +3 -2
- package/dist/types/PageList.mjs +13 -12
- package/dist/types/Parser.mjs +12 -11
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Repository.mjs +9 -8
- package/dist/types/Result.mjs +6 -5
- package/dist/types/Results.mjs +7 -6
- package/dist/types/Tag.mjs +4 -3
- package/dist/types/Tag.mjs.map +1 -1
- package/dist/types/Template.d.ts +0 -43
- package/dist/types/Template.mjs +6 -11
- package/dist/types/ToText.d.ts +45 -0
- package/dist/types/ToText.mjs +23 -0
- package/dist/types/ToText.mjs.map +1 -0
- package/dist/types/Try.mjs +12 -11
- package/dist/types/Uri.mjs +12 -11
- package/dist/types/Uri.mjs.map +1 -1
- package/dist/utils/If.mjs +2 -1
- package/dist/utils/Mapper.mjs +6 -5
- package/dist/utils/Promise.d.ts +2 -0
- package/dist/utils/Promise.mjs +8 -4
- package/dist/utils/Seconds.mjs +3 -2
- package/dist/utils/Sentence.mjs +4 -3
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/View.mjs +16 -16
- package/dist/validation/Contraints.mjs +13 -12
- package/dist/validation/Validate.mjs +12 -11
- package/dist/validation/When.mjs +12 -11
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/process/Scope.ts +1 -1
- package/src/process/UseCase.ts +5 -5
- package/src/types/AnyKey.ts +10 -2
- package/src/types/Context.ts +6 -2
- package/src/types/Exception.ts +2 -1
- package/src/types/List.ts +17 -11
- package/src/types/Template.ts +2 -152
- package/src/types/ToText.ts +167 -0
- package/src/types/Uri.ts +1 -1
- package/src/utils/Promise.ts +5 -0
- package/src/utils/Sentence.ts +1 -1
- package/src/validation/Contraints.ts +1 -1
- package/src/validation/Validate.ts +10 -3
- package/dist/chunk-AMIP3FS5.mjs.map +0 -1
- package/dist/chunk-KWE3VWIW.mjs.map +0 -1
- package/dist/chunk-OWZ5I5IV.mjs.map +0 -1
- package/dist/chunk-P4MEAARF.mjs.map +0 -1
- package/dist/chunk-Q7FJUYZT.mjs.map +0 -1
- package/dist/chunk-TG7T4QPS.mjs.map +0 -1
- package/dist/chunk-WUHEP5NJ.mjs.map +0 -1
- /package/dist/{chunk-HAEVUETQ.mjs.map → chunk-2C5WHSM5.mjs.map} +0 -0
- /package/dist/{chunk-4BC26J7U.mjs.map → chunk-4WLPMNMB.mjs.map} +0 -0
- /package/dist/{chunk-DUMDOMES.mjs.map → chunk-6ATDEGSU.mjs.map} +0 -0
- /package/dist/{chunk-ZLU26SR3.mjs.map → chunk-6RSOVRW4.mjs.map} +0 -0
- /package/dist/{chunk-6O3TSROI.mjs.map → chunk-73VXBPTL.mjs.map} +0 -0
- /package/dist/{chunk-CHV6RMJL.mjs.map → chunk-7OEH5Q3V.mjs.map} +0 -0
- /package/dist/{chunk-UQTNYF53.mjs.map → chunk-AWT4XDU7.mjs.map} +0 -0
- /package/dist/{chunk-QL3DRPMM.mjs.map → chunk-BDKRR6H2.mjs.map} +0 -0
- /package/dist/{chunk-VI57VONC.mjs.map → chunk-CHLVZFAR.mjs.map} +0 -0
- /package/dist/{chunk-RTVVXROA.mjs.map → chunk-CMMMDBTK.mjs.map} +0 -0
- /package/dist/{chunk-3ZX4YFOK.mjs.map → chunk-EOIG654K.mjs.map} +0 -0
- /package/dist/{chunk-LMVFKEDS.mjs.map → chunk-F2SLQDR2.mjs.map} +0 -0
- /package/dist/{chunk-5UUY67VD.mjs.map → chunk-F7MQZLCR.mjs.map} +0 -0
- /package/dist/{chunk-3LWQJAEJ.mjs.map → chunk-FLJXHLSM.mjs.map} +0 -0
- /package/dist/{chunk-7WCAHERW.mjs.map → chunk-GA7BBYC2.mjs.map} +0 -0
- /package/dist/{chunk-WO4R5EYQ.mjs.map → chunk-GSAKK3JN.mjs.map} +0 -0
- /package/dist/{chunk-PIW6QNIG.mjs.map → chunk-HWYUYPBI.mjs.map} +0 -0
- /package/dist/{chunk-J7FACY7Y.mjs.map → chunk-I4HFLLRR.mjs.map} +0 -0
- /package/dist/{chunk-YAB5YLHI.mjs.map → chunk-J5AZL5T6.mjs.map} +0 -0
- /package/dist/{chunk-F4JCURDN.mjs.map → chunk-JABPZGOG.mjs.map} +0 -0
- /package/dist/{chunk-4BH22HLY.mjs.map → chunk-JJQAGAQN.mjs.map} +0 -0
- /package/dist/{chunk-5UXTE3WM.mjs.map → chunk-KBB2WGTO.mjs.map} +0 -0
- /package/dist/{chunk-QH2LF3L3.mjs.map → chunk-LIDMZELG.mjs.map} +0 -0
- /package/dist/{chunk-3CSSJCVP.mjs.map → chunk-N5B6HSHV.mjs.map} +0 -0
- /package/dist/{chunk-IS675X5Z.mjs.map → chunk-NUA7EUWX.mjs.map} +0 -0
- /package/dist/{chunk-DAG7KGVL.mjs.map → chunk-O4CJ7NSN.mjs.map} +0 -0
- /package/dist/{chunk-HL7ITJJT.mjs.map → chunk-OVORFG3O.mjs.map} +0 -0
- /package/dist/{chunk-NWQTAKAM.mjs.map → chunk-PB6SCADS.mjs.map} +0 -0
- /package/dist/{chunk-RGO5KVRQ.mjs.map → chunk-QNE24TSJ.mjs.map} +0 -0
- /package/dist/{chunk-BI3DP4QA.mjs.map → chunk-S2VNBE5K.mjs.map} +0 -0
- /package/dist/{chunk-7W67IZE4.mjs.map → chunk-ST3P6VWM.mjs.map} +0 -0
- /package/dist/{chunk-SDGUXNY3.mjs.map → chunk-TMAB63X5.mjs.map} +0 -0
- /package/dist/{chunk-BE474ULY.mjs.map → chunk-UCNB24EO.mjs.map} +0 -0
- /package/dist/{chunk-YODYDO2U.mjs.map → chunk-W53U3D4O.mjs.map} +0 -0
- /package/dist/{chunk-UHP56ITH.mjs.map → chunk-WBL4BT3I.mjs.map} +0 -0
- /package/dist/{chunk-4K6SPD7T.mjs.map → chunk-WDC45I5H.mjs.map} +0 -0
- /package/dist/{chunk-VKBEWDLL.mjs.map → chunk-YMJ43VFE.mjs.map} +0 -0
- /package/dist/{chunk-I32HDHLS.mjs.map → chunk-ZNUHRHPU.mjs.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-GCY5A63A.mjs";
|
|
7
7
|
import {
|
|
8
8
|
tryTo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YYIIQGLL.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-ZNUHRHPU.mjs.map
|
package/dist/data/Condition.mjs
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
SortCondition,
|
|
5
5
|
isSortCondition,
|
|
6
6
|
toCondition
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TMAB63X5.mjs";
|
|
8
8
|
import "../chunk-MDXL65W4.mjs";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
11
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
12
13
|
import "../chunk-CO2AFYVD.mjs";
|
|
13
14
|
import "../chunk-BDA5LB4S.mjs";
|
|
14
15
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/data/Database.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Database,
|
|
3
3
|
DefaultProvider
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-2C5WHSM5.mjs";
|
|
5
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
6
|
+
import "../chunk-LIDMZELG.mjs";
|
|
7
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
8
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
9
|
+
import "../chunk-SSROJBD5.mjs";
|
|
9
10
|
import "../chunk-CO2AFYVD.mjs";
|
|
10
11
|
import "../chunk-BDA5LB4S.mjs";
|
|
11
12
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/data/Field.mjs
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
SortCondition,
|
|
6
6
|
toCondition
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TMAB63X5.mjs";
|
|
8
8
|
import "../chunk-MDXL65W4.mjs";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
11
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
12
13
|
import {
|
|
13
14
|
toArray
|
|
14
15
|
} from "../chunk-CO2AFYVD.mjs";
|
package/dist/data/Field.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/Field.ts"],"sourcesContent":["import { Condition, SortCondition, toCondition } from './Condition';\nimport { Property } from '../utils/Property';\nimport { toArray } from '../types/Array';\nimport { isDefined } from '../types/Is';\n\nexport class Field extends Property {\n is = (value: unknown): Condition => this.condition('eq', value);\n\n isNot = (value: unknown): Condition => this.condition('ne', value);\n\n isIn = (...value: unknown[]): Condition => this.condition('in', toArray(value));\n\n notIn = (...value: unknown[]): Condition => this.condition('nin', toArray(value));\n\n exists = (does: boolean): Condition => this.condition('exists', does);\n\n greater = (value: unknown): Condition => this.condition('gt', value);\n\n greaterEqual = (value: unknown): Condition => this.condition('gte', value);\n\n less = (value: unknown): Condition => this.condition('lt', value);\n\n lessEqual = (value: unknown): Condition => this.condition('lte', value);\n\n asc = (): SortCondition => new SortCondition(this.property, 1);\n\n desc = (): SortCondition => new SortCondition(this.property, -1);\n\n protected condition = (operator: string, value: unknown): Condition => toCondition(this.property, operator, value, this.options?.convert);\n}\n\nexport const isField = (f?: unknown): f is Field => isDefined(f) && f instanceof Field;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/data/Field.ts"],"sourcesContent":["import { Condition, SortCondition, toCondition } from './Condition';\nimport { Property } from '../utils/Property';\nimport { toArray } from '../types/Array';\nimport { isDefined } from '../types/Is';\n\nexport class Field extends Property {\n is = (value: unknown): Condition => this.condition('eq', value);\n\n isNot = (value: unknown): Condition => this.condition('ne', value);\n\n isIn = (...value: unknown[]): Condition => this.condition('in', toArray(value));\n\n notIn = (...value: unknown[]): Condition => this.condition('nin', toArray(value));\n\n exists = (does: boolean): Condition => this.condition('exists', does);\n\n greater = (value: unknown): Condition => this.condition('gt', value);\n\n greaterEqual = (value: unknown): Condition => this.condition('gte', value);\n\n less = (value: unknown): Condition => this.condition('lt', value);\n\n lessEqual = (value: unknown): Condition => this.condition('lte', value);\n\n asc = (): SortCondition => new SortCondition(this.property, 1);\n\n desc = (): SortCondition => new SortCondition(this.property, -1);\n\n protected condition = (operator: string, value: unknown): Condition => toCondition(this.property, operator, value, this.options?.convert);\n}\n\nexport const isField = (f?: unknown): f is Field => isDefined(f) && f instanceof Field;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,QAAN,cAAoB,SAAS;AAAA,EAClC,KAAK,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAE9D,QAAQ,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEjE,OAAO,IAAI,UAAgC,KAAK,UAAU,MAAM,QAAQ,KAAK,CAAC;AAAA,EAE9E,QAAQ,IAAI,UAAgC,KAAK,UAAU,OAAO,QAAQ,KAAK,CAAC;AAAA,EAEhF,SAAS,CAAC,SAA6B,KAAK,UAAU,UAAU,IAAI;AAAA,EAEpE,UAAU,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEnE,eAAe,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEzE,OAAO,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEhE,YAAY,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEtE,MAAM,MAAqB,IAAI,cAAc,KAAK,UAAU,CAAC;AAAA,EAE7D,OAAO,MAAqB,IAAI,cAAc,KAAK,UAAU,EAAE;AAAA,EAErD,YAAY,CAAC,UAAkB,UAA8B,YAAY,KAAK,UAAU,UAAU,OAAO,KAAK,SAAS,OAAO;AAC1I;AAEO,IAAM,UAAU,CAAC,MAA4B,UAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Gateway
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-I4HFLLRR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toPageList
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JJQAGAQN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import "../chunk-OFGI5FLG.mjs";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
12
|
+
import "../chunk-OVORFG3O.mjs";
|
|
13
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Exception
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
17
17
|
import "../chunk-WSBULPUZ.mjs";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
19
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
20
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
21
|
+
import "../chunk-LIDMZELG.mjs";
|
|
22
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
23
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
24
|
+
import "../chunk-SSROJBD5.mjs";
|
|
24
25
|
import "../chunk-CO2AFYVD.mjs";
|
|
25
26
|
import "../chunk-BDA5LB4S.mjs";
|
|
26
27
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/InMemoryGateway.ts"],"sourcesContent":["import { FetchOptions, Gateway } from '../types/Gateway';\nimport { PageList, toPageList } from '../types/PageList';\nimport { Json, JsonValue } from '../types/Json';\nimport { Id } from '../types/Id';\nimport { Optional } from '../types/Types';\nimport { isDefined } from '../types/Is';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\n\nexport class InMemoryGateway extends Gateway {\n constructor(private readonly data: Promise<PageList<Json>>) {\n super();\n }\n\n all(options?: FetchOptions): Promise<PageList<Json>> {\n return this.data.then(d => toPageList(d, d));\n }\n\n byId(id: Id): Promise<Optional<Json>> {\n return this.data.then(d => d.byId(id)).then(d => (d ? { ...d } : undefined));\n }\n\n by = (key: string, value: JsonValue): Promise<PageList<Json>> => {\n return this.data.then(d => d.filter(i => i[key] === value));\n };\n\n exists(id: Id): Promise<boolean> {\n return this.byId(id).then(d => isDefined(d));\n }\n\n add(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.exists(i.id as Id))\n .then(ex => when(ex).isTrue.reject(Exception.AlreadyExists))\n .then(() => this.data.then(d => d.add(item)))\n .then(() => ({ ...item }));\n }\n\n remove(id: Id): Promise<true> {\n return this.data\n .then(d =>\n when(d.findIndex(i => i.id === id))\n .with(i => i < 0)\n .reject(Exception.DoesNotExist)\n .then(i => d.splice(i, 1))\n )\n .then(() => true);\n }\n\n update(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.remove(i.id as Id).then(() => this.add(i)));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/data/InMemoryGateway.ts"],"sourcesContent":["import { FetchOptions, Gateway } from '../types/Gateway';\nimport { PageList, toPageList } from '../types/PageList';\nimport { Json, JsonValue } from '../types/Json';\nimport { Id } from '../types/Id';\nimport { Optional } from '../types/Types';\nimport { isDefined } from '../types/Is';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\n\nexport class InMemoryGateway extends Gateway {\n constructor(private readonly data: Promise<PageList<Json>>) {\n super();\n }\n\n all(options?: FetchOptions): Promise<PageList<Json>> {\n return this.data.then(d => toPageList(d, d));\n }\n\n byId(id: Id): Promise<Optional<Json>> {\n return this.data.then(d => d.byId(id)).then(d => (d ? { ...d } : undefined));\n }\n\n by = (key: string, value: JsonValue): Promise<PageList<Json>> => {\n return this.data.then(d => d.filter(i => i[key] === value));\n };\n\n exists(id: Id): Promise<boolean> {\n return this.byId(id).then(d => isDefined(d));\n }\n\n add(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.exists(i.id as Id))\n .then(ex => when(ex).isTrue.reject(Exception.AlreadyExists))\n .then(() => this.data.then(d => d.add(item)))\n .then(() => ({ ...item }));\n }\n\n remove(id: Id): Promise<true> {\n return this.data\n .then(d =>\n when(d.findIndex(i => i.id === id))\n .with(i => i < 0)\n .reject(Exception.DoesNotExist)\n .then(i => d.splice(i, 1))\n )\n .then(() => true);\n }\n\n update(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.remove(i.id as Id).then(() => this.add(i)));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,IAAM,kBAAN,cAA8B,QAAQ;AAAA,EAC3C,YAA6B,MAA+B;AAC1D,UAAM;AADqB;AAAA,EAE7B;AAAA,EAEA,IAAI,SAAiD;AACnD,WAAO,KAAK,KAAK,KAAK,OAAK,WAAW,GAAG,CAAC,CAAC;AAAA,EAC7C;AAAA,EAEA,KAAK,IAAiC;AACpC,WAAO,KAAK,KAAK,KAAK,OAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAM,IAAI,EAAE,GAAG,EAAE,IAAI,MAAU;AAAA,EAC7E;AAAA,EAEA,KAAK,CAAC,KAAa,UAA8C;AAC/D,WAAO,KAAK,KAAK,KAAK,OAAK,EAAE,OAAO,OAAK,EAAE,GAAG,MAAM,KAAK,CAAC;AAAA,EAC5D;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,KAAK,EAAE,EAAE,KAAK,OAAK,UAAU,CAAC,CAAC;AAAA,EAC7C;AAAA,EAEA,IAAI,MAA2B;AAC7B,WAAO,KAAK,IAAI,EACb,IAAI,SAAS,OAAK,EAAE,EAAE,EACtB,OAAO,UAAU,WAAW,EAC5B,KAAK,OAAK,KAAK,OAAO,EAAE,EAAQ,CAAC,EACjC,KAAK,QAAM,KAAK,EAAE,EAAE,OAAO,OAAO,UAAU,aAAa,CAAC,EAC1D,KAAK,MAAM,KAAK,KAAK,KAAK,OAAK,EAAE,IAAI,IAAI,CAAC,CAAC,EAC3C,KAAK,OAAO,EAAE,GAAG,KAAK,EAAE;AAAA,EAC7B;AAAA,EAEA,OAAO,IAAuB;AAC5B,WAAO,KAAK,KACT;AAAA,MAAK,OACJ,KAAK,EAAE,UAAU,OAAK,EAAE,OAAO,EAAE,CAAC,EAC/B,KAAK,OAAK,IAAI,CAAC,EACf,OAAO,UAAU,YAAY,EAC7B,KAAK,OAAK,EAAE,OAAO,GAAG,CAAC,CAAC;AAAA,IAC7B,EACC,KAAK,MAAM,IAAI;AAAA,EACpB;AAAA,EAEA,OAAO,MAA2B;AAChC,WAAO,KAAK,IAAI,EACb,IAAI,SAAS,OAAK,EAAE,EAAE,EACtB,OAAO,UAAU,WAAW,EAC5B,KAAK,OAAK,KAAK,OAAO,EAAE,EAAQ,EAAE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC;AAAA,EAC9D;AACF;","names":[]}
|
package/dist/domain/Audit.mjs
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Audit
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-DAG7KGVL.mjs";
|
|
3
|
+
} from "../chunk-HWYUYPBI.mjs";
|
|
4
|
+
import "../chunk-Y5NBOPDI.mjs";
|
|
5
|
+
import "../chunk-YMJ43VFE.mjs";
|
|
6
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
8
7
|
import "../chunk-ADJAEGCT.mjs";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-CMMMDBTK.mjs";
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
11
11
|
import "../chunk-OFGI5FLG.mjs";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
13
|
+
import "../chunk-OVORFG3O.mjs";
|
|
14
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
15
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
16
16
|
import "../chunk-WSBULPUZ.mjs";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
18
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
19
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
20
|
+
import "../chunk-LIDMZELG.mjs";
|
|
21
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
22
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
23
|
+
import "../chunk-SSROJBD5.mjs";
|
|
23
24
|
import "../chunk-CO2AFYVD.mjs";
|
|
24
25
|
import "../chunk-BDA5LB4S.mjs";
|
|
25
26
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Child.mjs
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toId
|
|
3
3
|
} from "../chunk-AGTB4HMP.mjs";
|
|
4
|
+
import "../chunk-SJ4YFZKO.mjs";
|
|
4
5
|
import {
|
|
5
6
|
required
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-Y5NBOPDI.mjs";
|
|
8
|
+
import "../chunk-ADJAEGCT.mjs";
|
|
7
9
|
import {
|
|
8
10
|
Struct
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-ADJAEGCT.mjs";
|
|
11
|
-
import "../chunk-SJ4YFZKO.mjs";
|
|
11
|
+
} from "../chunk-CMMMDBTK.mjs";
|
|
12
12
|
import {
|
|
13
13
|
json
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
15
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
16
16
|
import "../chunk-OFGI5FLG.mjs";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
18
|
+
import "../chunk-OVORFG3O.mjs";
|
|
19
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
20
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
21
21
|
import "../chunk-WSBULPUZ.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
23
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
24
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
25
|
+
import "../chunk-LIDMZELG.mjs";
|
|
26
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
27
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
28
|
+
import "../chunk-SSROJBD5.mjs";
|
|
28
29
|
import "../chunk-CO2AFYVD.mjs";
|
|
29
30
|
import "../chunk-BDA5LB4S.mjs";
|
|
30
31
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Child.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Child extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, { id: this.id });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Child.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Child extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, { id: this.id });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAe,QAAf,cAA6B,OAAO;AAAA,EACpB,KAAS,KAAK,MAAM,MAAM,KAAK;AAAA,EAE1C,MAAM,GAAkB;AAChC,WAAO,KAAK,MAAM,MAAM,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC;AAAA,EAC5C;AACF;AALuB;AAAA,EAApB,SAAS;AAAA,GADU,MACC;","names":[]}
|
package/dist/domain/DateTime.mjs
CHANGED
|
@@ -2,22 +2,23 @@ import {
|
|
|
2
2
|
DateTime,
|
|
3
3
|
dt,
|
|
4
4
|
isDateTime
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-YMJ43VFE.mjs";
|
|
6
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
7
7
|
import "../chunk-ADJAEGCT.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
9
9
|
import "../chunk-OFGI5FLG.mjs";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
11
|
+
import "../chunk-OVORFG3O.mjs";
|
|
12
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
13
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
14
14
|
import "../chunk-WSBULPUZ.mjs";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
16
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
17
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
18
|
+
import "../chunk-LIDMZELG.mjs";
|
|
19
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
20
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
21
|
+
import "../chunk-SSROJBD5.mjs";
|
|
21
22
|
import "../chunk-CO2AFYVD.mjs";
|
|
22
23
|
import "../chunk-BDA5LB4S.mjs";
|
|
23
24
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Entity.mjs
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Audit
|
|
3
|
-
} from "../chunk-PIW6QNIG.mjs";
|
|
4
1
|
import {
|
|
5
2
|
toId
|
|
6
3
|
} from "../chunk-AGTB4HMP.mjs";
|
|
4
|
+
import "../chunk-SJ4YFZKO.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Audit
|
|
7
|
+
} from "../chunk-HWYUYPBI.mjs";
|
|
7
8
|
import {
|
|
8
9
|
required
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-Y5NBOPDI.mjs";
|
|
11
|
+
import "../chunk-YMJ43VFE.mjs";
|
|
12
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
13
|
+
import "../chunk-ADJAEGCT.mjs";
|
|
10
14
|
import {
|
|
11
15
|
Struct
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-VKBEWDLL.mjs";
|
|
14
|
-
import "../chunk-DAG7KGVL.mjs";
|
|
15
|
-
import "../chunk-ADJAEGCT.mjs";
|
|
16
|
-
import "../chunk-SJ4YFZKO.mjs";
|
|
16
|
+
} from "../chunk-CMMMDBTK.mjs";
|
|
17
17
|
import {
|
|
18
18
|
json
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
20
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
21
21
|
import "../chunk-OFGI5FLG.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
23
|
+
import "../chunk-OVORFG3O.mjs";
|
|
24
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
25
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
26
26
|
import "../chunk-WSBULPUZ.mjs";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
28
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
29
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
30
|
+
import "../chunk-LIDMZELG.mjs";
|
|
31
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
32
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
33
|
+
import "../chunk-SSROJBD5.mjs";
|
|
33
34
|
import "../chunk-CO2AFYVD.mjs";
|
|
34
35
|
import "../chunk-BDA5LB4S.mjs";
|
|
35
36
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Entity.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { Audit } from './Audit';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Entity extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n @required() readonly created: Audit = new Audit(this.state.created);\n @required() readonly lastModified: Audit = new Audit(this.state.lastModified);\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, {\n id: this.id,\n created: this.created,\n lastModified: new Audit(),\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Entity.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { Audit } from './Audit';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Entity extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n @required() readonly created: Audit = new Audit(this.state.created);\n @required() readonly lastModified: Audit = new Audit(this.state.lastModified);\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, {\n id: this.id,\n created: this.created,\n lastModified: new Audit(),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAe,SAAf,cAA8B,OAAO;AAAA,EACrB,KAAS,KAAK,MAAM,MAAM,KAAK;AAAA,EAC/B,UAAiB,IAAI,MAAM,KAAK,MAAM,OAAO;AAAA,EAC7C,eAAsB,IAAI,MAAM,KAAK,MAAM,YAAY;AAAA,EAElE,MAAM,GAAkB;AAChC,WAAO,KAAK,MAAM,MAAM,GAAG;AAAA,MACzB,IAAI,KAAK;AAAA,MACT,SAAS,KAAK;AAAA,MACd,cAAc,IAAI,MAAM;AAAA,IAC1B,CAAC;AAAA,EACH;AACF;AAXuB;AAAA,EAApB,SAAS;AAAA,GADU,OACC;AACA;AAAA,EAApB,SAAS;AAAA,GAFU,OAEC;AACA;AAAA,EAApB,SAAS;AAAA,GAHU,OAGC;","names":[]}
|
package/dist/domain/Repo.mjs
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-S2VNBE5K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
isValidatable
|
|
12
12
|
} from "../chunk-OFGI5FLG.mjs";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
14
|
+
import "../chunk-OVORFG3O.mjs";
|
|
15
15
|
import {
|
|
16
16
|
reject,
|
|
17
17
|
resolve
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-HO3IEF5S.mjs";
|
|
19
19
|
import {
|
|
20
20
|
Exception
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
22
22
|
import "../chunk-WSBULPUZ.mjs";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
24
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
25
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
26
|
+
import "../chunk-LIDMZELG.mjs";
|
|
27
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
28
28
|
import {
|
|
29
29
|
asList
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-TLYJ2G3X.mjs";
|
|
31
|
+
import "../chunk-SSROJBD5.mjs";
|
|
31
32
|
import "../chunk-CO2AFYVD.mjs";
|
|
32
33
|
import "../chunk-BDA5LB4S.mjs";
|
|
33
34
|
import "../chunk-SJGQU3OG.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,IAAI,OAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC;AAAA,EAC3E;AAAA,EAEA,KAAK,IAAoB;AACvB,WAAO,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js";
|
|
6
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
7
7
|
import "../chunk-OFGI5FLG.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
9
|
+
import "../chunk-OVORFG3O.mjs";
|
|
10
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
11
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
12
12
|
import "../chunk-WSBULPUZ.mjs";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
14
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
15
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
16
|
+
import "../chunk-LIDMZELG.mjs";
|
|
17
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
18
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
19
|
+
import "../chunk-SSROJBD5.mjs";
|
|
19
20
|
import "../chunk-CO2AFYVD.mjs";
|
|
20
21
|
import "../chunk-BDA5LB4S.mjs";
|
|
21
22
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Typo.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-S2VNBE5K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import "../chunk-OFGI5FLG.mjs";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
12
|
+
import "../chunk-OVORFG3O.mjs";
|
|
13
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Exception
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
17
17
|
import "../chunk-WSBULPUZ.mjs";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
19
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
20
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
21
|
+
import "../chunk-LIDMZELG.mjs";
|
|
22
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
23
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
24
|
+
import "../chunk-SSROJBD5.mjs";
|
|
24
25
|
import "../chunk-CO2AFYVD.mjs";
|
|
25
26
|
import "../chunk-BDA5LB4S.mjs";
|
|
26
27
|
import "../chunk-SJGQU3OG.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,EAE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";
|
|
5
|
+
import "../chunk-W53U3D4O.mjs";
|
|
6
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
7
7
|
import "../chunk-OFGI5FLG.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
9
|
+
import "../chunk-OVORFG3O.mjs";
|
|
10
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
11
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
12
12
|
import "../chunk-WSBULPUZ.mjs";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
14
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
15
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
16
|
+
import "../chunk-LIDMZELG.mjs";
|
|
17
17
|
import {
|
|
18
18
|
entries
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-KBB2WGTO.mjs";
|
|
20
20
|
import {
|
|
21
21
|
ifDefined
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-TLYJ2G3X.mjs";
|
|
23
|
+
import "../chunk-SSROJBD5.mjs";
|
|
23
24
|
import "../chunk-CO2AFYVD.mjs";
|
|
24
25
|
import "../chunk-BDA5LB4S.mjs";
|
|
25
26
|
import "../chunk-SJGQU3OG.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,MAA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AI,SAAS,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,EACxF,KAAK,GAAG;AAAA,EACb;AACF;","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContentType
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-QNE24TSJ.mjs";
|
|
4
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
5
|
+
import "../chunk-LIDMZELG.mjs";
|
|
6
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
7
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
8
|
+
import "../chunk-SSROJBD5.mjs";
|
|
8
9
|
import "../chunk-CO2AFYVD.mjs";
|
|
9
10
|
import "../chunk-BDA5LB4S.mjs";
|
|
10
11
|
import "../chunk-SJGQU3OG.mjs";
|