@thisisagile/easy 17.18.9 → 17.20.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.
Files changed (113) hide show
  1. package/dist/{chunk-EL4LXAN7.mjs → chunk-3B4UXDOZ.mjs} +2 -2
  2. package/dist/{chunk-744LD44R.mjs → chunk-3MDXTFJG.mjs} +4 -4
  3. package/dist/{chunk-QZUUK6PI.mjs → chunk-4JBE26FB.mjs} +1 -1
  4. package/dist/chunk-4JBE26FB.mjs.map +1 -0
  5. package/dist/{chunk-3E3YJR6L.mjs → chunk-4U4PPZWS.mjs} +2 -2
  6. package/dist/{chunk-56HLMAA4.mjs → chunk-5RL5STCD.mjs} +2 -2
  7. package/dist/{chunk-3TI2Y4HN.mjs → chunk-AYPE2G3T.mjs} +2 -2
  8. package/dist/{chunk-4REZO4ZW.mjs → chunk-BQ2N2Y7O.mjs} +3 -3
  9. package/dist/{chunk-YH4CTU3I.mjs → chunk-DXXBPAXT.mjs} +2 -2
  10. package/dist/{chunk-SCNDLTL6.mjs → chunk-FI3X2XXY.mjs} +6 -6
  11. package/dist/{chunk-DK6TQHF3.mjs → chunk-K7NZINEX.mjs} +2 -2
  12. package/dist/{chunk-SOXQOCCH.mjs → chunk-LXJTNB3X.mjs} +5 -5
  13. package/dist/{chunk-FT66ANA7.mjs → chunk-M456CJK4.mjs} +2 -2
  14. package/dist/{chunk-COJ6DGFZ.mjs → chunk-PVWD7L7K.mjs} +2 -2
  15. package/dist/{chunk-YDEAOY7R.mjs → chunk-Q5LRJWPK.mjs} +2 -2
  16. package/dist/{chunk-DLJOM2QT.mjs → chunk-RTTVCEWR.mjs} +2 -2
  17. package/dist/chunk-S5I6XCJK.mjs +60 -0
  18. package/dist/chunk-S5I6XCJK.mjs.map +1 -0
  19. package/dist/{chunk-5HLBJ56K.mjs → chunk-TRIKRGDF.mjs} +4 -4
  20. package/dist/{chunk-DIJQ6NKV.mjs → chunk-VZYOBAK7.mjs} +3 -3
  21. package/dist/{chunk-4IH3OE4Y.mjs → chunk-WVYZIPWC.mjs} +4 -4
  22. package/dist/chunk-WVYZIPWC.mjs.map +1 -0
  23. package/dist/{chunk-2VL6B3UJ.mjs → chunk-XH47BBYI.mjs} +5 -5
  24. package/dist/{chunk-LXCI7XE5.mjs → chunk-ZDGQPZ6G.mjs} +4 -4
  25. package/dist/data/InMemoryGateway.mjs +4 -4
  26. package/dist/domain/Audit.mjs +6 -6
  27. package/dist/domain/Child.mjs +4 -4
  28. package/dist/domain/DateTime.mjs +3 -3
  29. package/dist/domain/Entity.mjs +6 -6
  30. package/dist/domain/Repo.mjs +5 -5
  31. package/dist/domain/Struct.mjs +3 -3
  32. package/dist/domain/Typo.d.ts +19 -1
  33. package/dist/domain/Typo.mjs +49 -3
  34. package/dist/domain/Typo.mjs.map +1 -1
  35. package/dist/http/CacheControl.mjs +4 -4
  36. package/dist/http/RestResult.mjs +3 -3
  37. package/dist/http/toResponse.mjs +4 -4
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +58 -14
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +5 -0
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/process/App.mjs +1 -1
  44. package/dist/process/Manage.mjs +4 -4
  45. package/dist/process/Scope.d.ts +2 -2
  46. package/dist/process/Scope.mjs +1 -1
  47. package/dist/process/Search.mjs +4 -4
  48. package/dist/process/UseCase.d.ts +2 -2
  49. package/dist/process/UseCase.mjs.map +1 -1
  50. package/dist/resources/Req.mjs +3 -3
  51. package/dist/services/Api.mjs +8 -8
  52. package/dist/services/ApiGateway.mjs +11 -11
  53. package/dist/services/AxiosProvider.mjs +7 -7
  54. package/dist/services/MappedRouteGateway.mjs +12 -12
  55. package/dist/services/RouteGateway.d.ts +15 -15
  56. package/dist/services/RouteGateway.mjs +12 -12
  57. package/dist/services/ViewRouteGateway.mjs +14 -14
  58. package/dist/sql/Column.mjs +3 -3
  59. package/dist/sql/Table.mjs +3 -3
  60. package/dist/sql/TableGateway.mjs +4 -4
  61. package/dist/types/CacheAge.mjs +4 -4
  62. package/dist/types/Case.mjs +2 -2
  63. package/dist/types/Gateway.mjs +2 -2
  64. package/dist/types/IdName.d.ts +8 -0
  65. package/dist/types/IdName.mjs +1 -0
  66. package/dist/types/IdName.mjs.map +1 -0
  67. package/dist/types/Identity.d.ts +0 -5
  68. package/dist/types/IsEqual.mjs +3 -3
  69. package/dist/types/Number.mjs +3 -3
  70. package/dist/types/PageList.mjs +3 -3
  71. package/dist/types/Parser.mjs +2 -2
  72. package/dist/types/Repository.d.ts +3 -3
  73. package/dist/types/Repository.mjs +2 -2
  74. package/dist/types/Try.mjs +2 -2
  75. package/dist/types/Uri.d.ts +14 -11
  76. package/dist/types/Uri.mjs +2 -2
  77. package/dist/types/Uri.mjs.map +1 -1
  78. package/dist/utils/View.mjs +5 -5
  79. package/dist/validation/Contraints.mjs +3 -3
  80. package/dist/validation/Validate.mjs +2 -2
  81. package/dist/validation/When.mjs +2 -2
  82. package/package.json +1 -1
  83. package/src/domain/Typo.ts +58 -2
  84. package/src/index.ts +2 -0
  85. package/src/process/Scope.ts +3 -3
  86. package/src/process/UseCase.ts +2 -2
  87. package/src/services/RouteGateway.ts +26 -25
  88. package/src/types/IdName.ts +4 -0
  89. package/src/types/Identity.ts +0 -2
  90. package/src/types/Repository.ts +3 -3
  91. package/src/types/Uri.ts +12 -11
  92. package/dist/chunk-4IH3OE4Y.mjs.map +0 -1
  93. package/dist/chunk-M6LRND3Z.mjs +0 -57
  94. package/dist/chunk-M6LRND3Z.mjs.map +0 -1
  95. package/dist/chunk-QZUUK6PI.mjs.map +0 -1
  96. /package/dist/{chunk-EL4LXAN7.mjs.map → chunk-3B4UXDOZ.mjs.map} +0 -0
  97. /package/dist/{chunk-744LD44R.mjs.map → chunk-3MDXTFJG.mjs.map} +0 -0
  98. /package/dist/{chunk-3E3YJR6L.mjs.map → chunk-4U4PPZWS.mjs.map} +0 -0
  99. /package/dist/{chunk-56HLMAA4.mjs.map → chunk-5RL5STCD.mjs.map} +0 -0
  100. /package/dist/{chunk-3TI2Y4HN.mjs.map → chunk-AYPE2G3T.mjs.map} +0 -0
  101. /package/dist/{chunk-4REZO4ZW.mjs.map → chunk-BQ2N2Y7O.mjs.map} +0 -0
  102. /package/dist/{chunk-YH4CTU3I.mjs.map → chunk-DXXBPAXT.mjs.map} +0 -0
  103. /package/dist/{chunk-SCNDLTL6.mjs.map → chunk-FI3X2XXY.mjs.map} +0 -0
  104. /package/dist/{chunk-DK6TQHF3.mjs.map → chunk-K7NZINEX.mjs.map} +0 -0
  105. /package/dist/{chunk-SOXQOCCH.mjs.map → chunk-LXJTNB3X.mjs.map} +0 -0
  106. /package/dist/{chunk-FT66ANA7.mjs.map → chunk-M456CJK4.mjs.map} +0 -0
  107. /package/dist/{chunk-COJ6DGFZ.mjs.map → chunk-PVWD7L7K.mjs.map} +0 -0
  108. /package/dist/{chunk-YDEAOY7R.mjs.map → chunk-Q5LRJWPK.mjs.map} +0 -0
  109. /package/dist/{chunk-DLJOM2QT.mjs.map → chunk-RTTVCEWR.mjs.map} +0 -0
  110. /package/dist/{chunk-5HLBJ56K.mjs.map → chunk-TRIKRGDF.mjs.map} +0 -0
  111. /package/dist/{chunk-DIJQ6NKV.mjs.map → chunk-VZYOBAK7.mjs.map} +0 -0
  112. /package/dist/{chunk-2VL6B3UJ.mjs.map → chunk-XH47BBYI.mjs.map} +0 -0
  113. /package/dist/{chunk-LXCI7XE5.mjs.map → chunk-ZDGQPZ6G.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rest
3
- } from "./chunk-FT66ANA7.mjs";
3
+ } from "./chunk-M456CJK4.mjs";
4
4
  import {
5
5
  toHttpStatus
6
6
  } from "./chunk-H27UMLDT.mjs";
@@ -17,4 +17,4 @@ function toResponse(status, body, headers) {
17
17
  export {
18
18
  toResponse
19
19
  };
20
- //# sourceMappingURL=chunk-EL4LXAN7.mjs.map
20
+ //# sourceMappingURL=chunk-3B4UXDOZ.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Api
3
- } from "./chunk-DLJOM2QT.mjs";
3
+ } from "./chunk-RTTVCEWR.mjs";
4
4
  import {
5
5
  Gateway
6
- } from "./chunk-LXCI7XE5.mjs";
6
+ } from "./chunk-ZDGQPZ6G.mjs";
7
7
  import {
8
8
  toPageList
9
- } from "./chunk-YH4CTU3I.mjs";
9
+ } from "./chunk-DXXBPAXT.mjs";
10
10
  import {
11
11
  use
12
12
  } from "./chunk-ZPNFXK7Y.mjs";
@@ -43,4 +43,4 @@ var ApiGateway = class extends Gateway {
43
43
  export {
44
44
  ApiGateway
45
45
  };
46
- //# sourceMappingURL=chunk-744LD44R.mjs.map
46
+ //# sourceMappingURL=chunk-3MDXTFJG.mjs.map
@@ -36,4 +36,4 @@ var Scope = class _Scope extends Enum {
36
36
  export {
37
37
  Scope
38
38
  };
39
- //# sourceMappingURL=chunk-QZUUK6PI.mjs.map
39
+ //# sourceMappingURL=chunk-4JBE26FB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/process/Scope.ts"],"sourcesContent":["import { Enum } from '../types/Enum';\nimport { text } from '../types/Template';\nimport type { Text } from '../types/Text';\nimport { kebab } from '../types/Text';\nimport { List, toList } from '../types/List';\nimport { isString } from '../types/Is';\nimport { IdNamePlain } from '../types/IdName';\n\nexport class Scope extends Enum {\n protected constructor(\n readonly name: string,\n id: Text = text(name).kebab,\n readonly subs: List<Scope> = toList()\n ) {\n super(name, id.toString());\n }\n\n for(item: string | IdNamePlain): Scope {\n return new Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));\n }\n\n combines(...scopes: Scope[]): this {\n this.subs.add(scopes);\n return this;\n }\n\n expand(): List<Scope> {\n return this.subs\n .flatMap(s => s.expand())\n .add(this)\n .distinct();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAQO,IAAM,QAAN,MAAM,eAAc,KAAK;AAAA,EACpB,YACC,MACT,KAAW,KAAK,IAAI,EAAE,OACb,OAAoB,OAAO,GACpC;AACA,UAAM,MAAM,GAAG,SAAS,CAAC;AAJhB;AAEA;AAAA,EAGX;AAAA,EAEA,IAAI,MAAmC;AACrC,WAAO,IAAI,OAAM,GAAG,KAAK,IAAI,IAAI,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,IAAI,MAAM,GAAG,KAAK,EAAE,IAAI,SAAS,IAAI,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;AAAA,EAC1I;AAAA,EAEA,YAAY,QAAuB;AACjC,SAAK,KAAK,IAAI,MAAM;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,SAAsB;AACpB,WAAO,KAAK,KACT,QAAQ,OAAK,EAAE,OAAO,CAAC,EACvB,IAAI,IAAI,EACR,SAAS;AAAA,EACd;AACF;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  tryTo,
7
7
  validate
8
- } from "./chunk-5HLBJ56K.mjs";
8
+ } from "./chunk-TRIKRGDF.mjs";
9
9
  import {
10
10
  text
11
11
  } from "./chunk-3Y7X2UQ6.mjs";
@@ -73,4 +73,4 @@ export {
73
73
  maxLength,
74
74
  rule
75
75
  };
76
- //# sourceMappingURL=chunk-3E3YJR6L.mjs.map
76
+ //# sourceMappingURL=chunk-4U4PPZWS.mjs.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  choose,
9
9
  tryTo
10
- } from "./chunk-5HLBJ56K.mjs";
10
+ } from "./chunk-TRIKRGDF.mjs";
11
11
  import {
12
12
  Value
13
13
  } from "./chunk-WSBULPUZ.mjs";
@@ -139,4 +139,4 @@ export {
139
139
  isDateTime,
140
140
  dt
141
141
  };
142
- //# sourceMappingURL=chunk-56HLMAA4.mjs.map
142
+ //# sourceMappingURL=chunk-5RL5STCD.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryTo
3
- } from "./chunk-5HLBJ56K.mjs";
3
+ } from "./chunk-TRIKRGDF.mjs";
4
4
  import {
5
5
  asString
6
6
  } from "./chunk-BDA5LB4S.mjs";
@@ -17,4 +17,4 @@ var asNumber = (n, alt) => tryTo(() => asString(n)).map((s) => parseInt(s)).filt
17
17
  export {
18
18
  asNumber
19
19
  };
20
- //# sourceMappingURL=chunk-3TI2Y4HN.mjs.map
20
+ //# sourceMappingURL=chunk-AYPE2G3T.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  asNumber
3
- } from "./chunk-3TI2Y4HN.mjs";
3
+ } from "./chunk-AYPE2G3T.mjs";
4
4
  import {
5
5
  choose
6
- } from "./chunk-5HLBJ56K.mjs";
6
+ } from "./chunk-TRIKRGDF.mjs";
7
7
  import {
8
8
  asString
9
9
  } from "./chunk-BDA5LB4S.mjs";
@@ -54,4 +54,4 @@ export {
54
54
  cacheAge,
55
55
  isCacheAge
56
56
  };
57
- //# sourceMappingURL=chunk-4REZO4ZW.mjs.map
57
+ //# sourceMappingURL=chunk-BQ2N2Y7O.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  choose
3
- } from "./chunk-5HLBJ56K.mjs";
3
+ } from "./chunk-TRIKRGDF.mjs";
4
4
  import {
5
5
  List,
6
6
  isList,
@@ -170,4 +170,4 @@ export {
170
170
  toPageList,
171
171
  asPageList
172
172
  };
173
- //# sourceMappingURL=chunk-YH4CTU3I.mjs.map
173
+ //# sourceMappingURL=chunk-DXXBPAXT.mjs.map
@@ -1,20 +1,20 @@
1
+ import {
2
+ isEqual
3
+ } from "./chunk-PVWD7L7K.mjs";
1
4
  import {
2
5
  traverse
3
6
  } from "./chunk-SSROJBD5.mjs";
4
- import {
5
- isEqual
6
- } from "./chunk-COJ6DGFZ.mjs";
7
7
  import {
8
8
  isPageList,
9
9
  toPageList
10
- } from "./chunk-YH4CTU3I.mjs";
10
+ } from "./chunk-DXXBPAXT.mjs";
11
11
  import {
12
12
  asJson,
13
13
  json
14
14
  } from "./chunk-IANSP3JJ.mjs";
15
15
  import {
16
16
  choose
17
- } from "./chunk-5HLBJ56K.mjs";
17
+ } from "./chunk-TRIKRGDF.mjs";
18
18
  import {
19
19
  isEnumConstructor
20
20
  } from "./chunk-HCIL5KUZ.mjs";
@@ -102,4 +102,4 @@ export {
102
102
  view,
103
103
  views
104
104
  };
105
- //# sourceMappingURL=chunk-SCNDLTL6.mjs.map
105
+ //# sourceMappingURL=chunk-FI3X2XXY.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-IANSP3JJ.mjs";
4
4
  import {
5
5
  validate
6
- } from "./chunk-5HLBJ56K.mjs";
6
+ } from "./chunk-TRIKRGDF.mjs";
7
7
  import {
8
8
  isDefined
9
9
  } from "./chunk-DEJ7A5PY.mjs";
@@ -37,4 +37,4 @@ export {
37
37
  Struct,
38
38
  isStruct
39
39
  };
40
- //# sourceMappingURL=chunk-DK6TQHF3.mjs.map
40
+ //# sourceMappingURL=chunk-K7NZINEX.mjs.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  required,
3
3
  valid
4
- } from "./chunk-3E3YJR6L.mjs";
4
+ } from "./chunk-4U4PPZWS.mjs";
5
5
  import {
6
6
  DateTime
7
- } from "./chunk-56HLMAA4.mjs";
7
+ } from "./chunk-5RL5STCD.mjs";
8
8
  import {
9
9
  Struct
10
- } from "./chunk-DK6TQHF3.mjs";
10
+ } from "./chunk-K7NZINEX.mjs";
11
11
  import {
12
12
  choose
13
- } from "./chunk-5HLBJ56K.mjs";
13
+ } from "./chunk-TRIKRGDF.mjs";
14
14
  import {
15
15
  ctx
16
16
  } from "./chunk-YGKMN5UC.mjs";
@@ -47,4 +47,4 @@ __decorateClass([
47
47
  export {
48
48
  Audit
49
49
  };
50
- //# sourceMappingURL=chunk-SOXQOCCH.mjs.map
50
+ //# sourceMappingURL=chunk-LXJTNB3X.mjs.map
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-UYDZZAEK.mjs";
8
8
  import {
9
9
  choose
10
- } from "./chunk-5HLBJ56K.mjs";
10
+ } from "./chunk-TRIKRGDF.mjs";
11
11
  import {
12
12
  isResults
13
13
  } from "./chunk-KYQULNU4.mjs";
@@ -52,4 +52,4 @@ export {
52
52
  rest,
53
53
  isRestResult
54
54
  };
55
- //# sourceMappingURL=chunk-FT66ANA7.mjs.map
55
+ //# sourceMappingURL=chunk-M456CJK4.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  choose
3
- } from "./chunk-5HLBJ56K.mjs";
3
+ } from "./chunk-TRIKRGDF.mjs";
4
4
  import {
5
5
  isArray,
6
6
  isObject
@@ -20,4 +20,4 @@ var isEqual = (one, another) => choose([one, another]).case(([o, a]) => o === a,
20
20
  export {
21
21
  isEqual
22
22
  };
23
- //# sourceMappingURL=chunk-COJ6DGFZ.mjs.map
23
+ //# sourceMappingURL=chunk-PVWD7L7K.mjs.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-GCY5A63A.mjs";
7
7
  import {
8
8
  tryTo
9
- } from "./chunk-5HLBJ56K.mjs";
9
+ } from "./chunk-TRIKRGDF.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-YDEAOY7R.mjs.map
82
+ //# sourceMappingURL=chunk-Q5LRJWPK.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AxiosProvider
3
- } from "./chunk-2VL6B3UJ.mjs";
3
+ } from "./chunk-XH47BBYI.mjs";
4
4
  import {
5
5
  HttpVerb
6
6
  } from "./chunk-KFSHBLFI.mjs";
@@ -76,4 +76,4 @@ export {
76
76
  Api,
77
77
  api
78
78
  };
79
- //# sourceMappingURL=chunk-DLJOM2QT.mjs.map
79
+ //# sourceMappingURL=chunk-RTTVCEWR.mjs.map
@@ -0,0 +1,60 @@
1
+ import {
2
+ ApiGateway
3
+ } from "./chunk-3MDXTFJG.mjs";
4
+ import {
5
+ Api
6
+ } from "./chunk-RTTVCEWR.mjs";
7
+ import {
8
+ HttpStatus
9
+ } from "./chunk-H27UMLDT.mjs";
10
+ import {
11
+ toArray
12
+ } from "./chunk-CO2AFYVD.mjs";
13
+ import {
14
+ isDefined
15
+ } from "./chunk-DEJ7A5PY.mjs";
16
+
17
+ // src/services/RouteGateway.ts
18
+ var RouteGateway = class extends ApiGateway {
19
+ constructor(route, routeId, api = new Api()) {
20
+ super(api);
21
+ this.route = route;
22
+ this.routeId = routeId;
23
+ this.api = api;
24
+ }
25
+ all(options) {
26
+ return this.get(this.route().expand(options ?? {}), options);
27
+ }
28
+ byId(id) {
29
+ return this.getOne(this.routeId().id(id));
30
+ }
31
+ byIds(...ids) {
32
+ return this.get(this.route().ids(toArray(...ids)));
33
+ }
34
+ search(q, options) {
35
+ return this.get(this.route().expand({ ...options, q }));
36
+ }
37
+ exists(id) {
38
+ return this.byId(id).then((r) => isDefined(r)).catch((r) => HttpStatus.NotFound.equals(r.status) ? false : Promise.reject(r));
39
+ }
40
+ add(item) {
41
+ return this.post(this.route(), item);
42
+ }
43
+ filter(options) {
44
+ return this.postSearch(this.route().expand(options ?? {}));
45
+ }
46
+ update(item) {
47
+ return this.patch(this.routeId().id(item.id), item);
48
+ }
49
+ upsert(item) {
50
+ return this.put(this.routeId().id(item.id), item);
51
+ }
52
+ remove(id) {
53
+ return this.delete(this.routeId().id(id));
54
+ }
55
+ };
56
+
57
+ export {
58
+ RouteGateway
59
+ };
60
+ //# sourceMappingURL=chunk-S5I6XCJK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/RouteGateway.ts"],"sourcesContent":["import { Api } from './Api';\nimport { ApiGateway } from './ApiGateway';\nimport { Func } from '../types/Func';\nimport { Uri, UriExpandProps } from '../types/Uri';\nimport { PageList } from '../types/PageList';\nimport { Json, JsonValue } from '../types/Json';\nimport { Id } from '../types/Id';\nimport { Optional } from '../types/Types';\nimport { List } from '../types/List';\nimport { toArray } from '../types/Array';\nimport { HttpStatus } from '../http/HttpStatus';\nimport { isDefined } from '../types/Is';\n\nexport class RouteGateway<Props extends UriExpandProps = UriExpandProps> extends ApiGateway {\n constructor(\n readonly route: Func<Uri<Props>>,\n readonly routeId: Func<Uri<Props>>,\n readonly api: Api = new Api()\n ) {\n super(api);\n }\n\n all(options?: Props): Promise<PageList<Json>> {\n return this.get(this.route().expand(options ?? {}) as Uri, options);\n }\n\n byId(id: Id): Promise<Optional<Json>> {\n return this.getOne(this.routeId().id(id) as Uri);\n }\n\n byIds(...ids: Id[]): Promise<List<Json>> {\n return this.get(this.route().ids(toArray(...ids)) as Uri);\n }\n\n search(q: JsonValue, options?: Props): Promise<PageList<Json>> {\n return this.get(this.route().expand({ ...options, q } as Props) as Uri);\n }\n\n exists(id: Id): Promise<boolean> {\n return this.byId(id)\n .then(r => isDefined(r))\n .catch(r => (HttpStatus.NotFound.equals(r.status) ? false : Promise.reject(r)));\n }\n\n add(item: Json): Promise<Json> {\n return this.post(this.route() as Uri, item);\n }\n\n filter(options?: Props): Promise<PageList<Json>> {\n return this.postSearch(this.route().expand(options ?? {}) as Uri);\n }\n\n update(item: Json): Promise<Json> {\n return this.patch(this.routeId().id(item.id) as Uri, item);\n }\n\n upsert(item: Json): Promise<Json> {\n return this.put(this.routeId().id(item.id) as Uri, item);\n }\n\n remove(id: Id): Promise<boolean> {\n return this.delete(this.routeId().id(id) as Uri);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAaO,IAAM,eAAN,cAA0E,WAAW;AAAA,EAC1F,YACW,OACA,SACA,MAAW,IAAI,IAAI,GAC5B;AACA,UAAM,GAAG;AAJA;AACA;AACA;AAAA,EAGX;AAAA,EAEA,IAAI,SAA0C;AAC5C,WAAO,KAAK,IAAI,KAAK,MAAM,EAAE,OAAO,WAAW,CAAC,CAAC,GAAU,OAAO;AAAA,EACpE;AAAA,EAEA,KAAK,IAAiC;AACpC,WAAO,KAAK,OAAO,KAAK,QAAQ,EAAE,GAAG,EAAE,CAAQ;AAAA,EACjD;AAAA,EAEA,SAAS,KAAgC;AACvC,WAAO,KAAK,IAAI,KAAK,MAAM,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,CAAQ;AAAA,EAC1D;AAAA,EAEA,OAAO,GAAc,SAA0C;AAC7D,WAAO,KAAK,IAAI,KAAK,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAU,CAAQ;AAAA,EACxE;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,KAAK,EAAE,EAChB,KAAK,OAAK,UAAU,CAAC,CAAC,EACtB,MAAM,OAAM,WAAW,SAAS,OAAO,EAAE,MAAM,IAAI,QAAQ,QAAQ,OAAO,CAAC,CAAE;AAAA,EAClF;AAAA,EAEA,IAAI,MAA2B;AAC7B,WAAO,KAAK,KAAK,KAAK,MAAM,GAAU,IAAI;AAAA,EAC5C;AAAA,EAEA,OAAO,SAA0C;AAC/C,WAAO,KAAK,WAAW,KAAK,MAAM,EAAE,OAAO,WAAW,CAAC,CAAC,CAAQ;AAAA,EAClE;AAAA,EAEA,OAAO,MAA2B;AAChC,WAAO,KAAK,MAAM,KAAK,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAU,IAAI;AAAA,EAC3D;AAAA,EAEA,OAAO,MAA2B;AAChC,WAAO,KAAK,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAU,IAAI;AAAA,EACzD;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,OAAO,KAAK,QAAQ,EAAE,GAAG,EAAE,CAAQ;AAAA,EACjD;AACF;","names":[]}
@@ -8,13 +8,13 @@ import {
8
8
  import {
9
9
  toResult
10
10
  } from "./chunk-BGSOJQAU.mjs";
11
+ import {
12
+ Exception
13
+ } from "./chunk-KXOBVHGI.mjs";
11
14
  import {
12
15
  reject,
13
16
  resolve
14
17
  } from "./chunk-PKILDKWU.mjs";
15
- import {
16
- Exception
17
- } from "./chunk-KXOBVHGI.mjs";
18
18
  import {
19
19
  isValue
20
20
  } from "./chunk-WSBULPUZ.mjs";
@@ -312,4 +312,4 @@ export {
312
312
  tryTo,
313
313
  choose
314
314
  };
315
- //# sourceMappingURL=chunk-5HLBJ56K.mjs.map
315
+ //# sourceMappingURL=chunk-TRIKRGDF.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toPageList
3
- } from "./chunk-YH4CTU3I.mjs";
3
+ } from "./chunk-DXXBPAXT.mjs";
4
4
  import {
5
5
  choose
6
- } from "./chunk-5HLBJ56K.mjs";
6
+ } from "./chunk-TRIKRGDF.mjs";
7
7
  import {
8
8
  resolve
9
9
  } from "./chunk-PKILDKWU.mjs";
@@ -45,4 +45,4 @@ var Search = class {
45
45
  export {
46
46
  Search
47
47
  };
48
- //# sourceMappingURL=chunk-DIJQ6NKV.mjs.map
48
+ //# sourceMappingURL=chunk-VZYOBAK7.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- reject
3
- } from "./chunk-PKILDKWU.mjs";
4
1
  import {
5
2
  Exception
6
3
  } from "./chunk-KXOBVHGI.mjs";
4
+ import {
5
+ reject
6
+ } from "./chunk-PKILDKWU.mjs";
7
7
 
8
8
  // src/types/Repository.ts
9
9
  var Repository = class {
@@ -48,4 +48,4 @@ var Repository = class {
48
48
  export {
49
49
  Repository
50
50
  };
51
- //# sourceMappingURL=chunk-4IH3OE4Y.mjs.map
51
+ //# sourceMappingURL=chunk-WVYZIPWC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/Repository.ts"],"sourcesContent":["import { FetchOptions } from './Gateway';\nimport { PageList } from './PageList';\nimport { Exception } from './Exception';\nimport { reject } from '../utils/Promise';\nimport { Id, Key } from './Id';\nimport { List } from './List';\nimport { Json, JsonValue } from './Json';\n\nexport class Repository<T, Options = FetchOptions> {\n all(options?: Options): Promise<PageList<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byId(id: Id): Promise<T> {\n return reject(Exception.IsNotImplemented);\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return reject(Exception.IsNotImplemented);\n }\n\n exists(id: Id): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n\n add(t: Partial<T> | Json): Promise<T> {\n return reject(Exception.IsNotImplemented);\n }\n\n update(id: Id, json: Partial<T> | Json): Promise<T> {\n return reject(Exception.IsNotImplemented);\n }\n\n remove(id: Id): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n\n upsert(id: Id, item: Partial<T> | Json): Promise<T> {\n return reject(Exception.IsNotImplemented);\n }\n}\n"],"mappings":";;;;;;;;AAQO,IAAM,aAAN,MAA4C;AAAA,EACjD,IAAI,SAAyC;AAC3C,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,KAAK,IAAoB;AACvB,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,SAAS,KAA6B;AACpC,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,MAAM,KAAU,SAAyC;AACvD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,GAAG,KAAc,OAAkB,SAAyC;AAC1E,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,GAAc,SAAyC;AAC5D,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,SAAyC;AAC9C,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,IAAI,GAAkC;AACpC,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,MAAqC;AAClD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,MAAqC;AAClD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AACF;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toResponse
3
- } from "./chunk-EL4LXAN7.mjs";
3
+ } from "./chunk-3B4UXDOZ.mjs";
4
4
  import {
5
5
  isRestResult
6
- } from "./chunk-FT66ANA7.mjs";
6
+ } from "./chunk-M456CJK4.mjs";
7
7
  import {
8
8
  HttpStatus
9
9
  } from "./chunk-H27UMLDT.mjs";
@@ -12,10 +12,10 @@ import {
12
12
  } from "./chunk-DKTEKZ4O.mjs";
13
13
  import {
14
14
  cacheAge
15
- } from "./chunk-4REZO4ZW.mjs";
15
+ } from "./chunk-BQ2N2Y7O.mjs";
16
16
  import {
17
17
  choose
18
- } from "./chunk-5HLBJ56K.mjs";
18
+ } from "./chunk-TRIKRGDF.mjs";
19
19
  import {
20
20
  toResult
21
21
  } from "./chunk-BGSOJQAU.mjs";
@@ -53,4 +53,4 @@ var AxiosProvider = class {
53
53
  export {
54
54
  AxiosProvider
55
55
  };
56
- //# sourceMappingURL=chunk-2VL6B3UJ.mjs.map
56
+ //# sourceMappingURL=chunk-XH47BBYI.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- reject
3
- } from "./chunk-PKILDKWU.mjs";
4
1
  import {
5
2
  Exception
6
3
  } from "./chunk-KXOBVHGI.mjs";
4
+ import {
5
+ reject
6
+ } from "./chunk-PKILDKWU.mjs";
7
7
 
8
8
  // src/types/Gateway.ts
9
9
  var Gateway = class {
@@ -42,4 +42,4 @@ var Gateway = class {
42
42
  export {
43
43
  Gateway
44
44
  };
45
- //# sourceMappingURL=chunk-LXCI7XE5.mjs.map
45
+ //# sourceMappingURL=chunk-ZDGQPZ6G.mjs.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  Gateway
3
- } from "../chunk-LXCI7XE5.mjs";
3
+ } from "../chunk-ZDGQPZ6G.mjs";
4
4
  import {
5
5
  toPageList
6
- } from "../chunk-YH4CTU3I.mjs";
6
+ } from "../chunk-DXXBPAXT.mjs";
7
7
  import {
8
8
  when
9
- } from "../chunk-5HLBJ56K.mjs";
9
+ } from "../chunk-TRIKRGDF.mjs";
10
10
  import "../chunk-OFGI5FLG.mjs";
11
11
  import "../chunk-KYQULNU4.mjs";
12
12
  import "../chunk-BGSOJQAU.mjs";
13
- import "../chunk-PKILDKWU.mjs";
14
13
  import {
15
14
  Exception
16
15
  } from "../chunk-KXOBVHGI.mjs";
16
+ import "../chunk-PKILDKWU.mjs";
17
17
  import "../chunk-WSBULPUZ.mjs";
18
18
  import "../chunk-YGKMN5UC.mjs";
19
19
  import "../chunk-3Y7X2UQ6.mjs";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Audit
3
- } from "../chunk-SOXQOCCH.mjs";
4
- import "../chunk-3E3YJR6L.mjs";
5
- import "../chunk-56HLMAA4.mjs";
3
+ } from "../chunk-LXJTNB3X.mjs";
4
+ import "../chunk-4U4PPZWS.mjs";
5
+ import "../chunk-5RL5STCD.mjs";
6
6
  import "../chunk-YDC3NPU4.mjs";
7
7
  import "../chunk-ADJAEGCT.mjs";
8
- import "../chunk-DK6TQHF3.mjs";
8
+ import "../chunk-K7NZINEX.mjs";
9
9
  import "../chunk-IANSP3JJ.mjs";
10
- import "../chunk-5HLBJ56K.mjs";
10
+ import "../chunk-TRIKRGDF.mjs";
11
11
  import "../chunk-OFGI5FLG.mjs";
12
12
  import "../chunk-KYQULNU4.mjs";
13
13
  import "../chunk-BGSOJQAU.mjs";
14
- import "../chunk-PKILDKWU.mjs";
15
14
  import "../chunk-KXOBVHGI.mjs";
15
+ import "../chunk-PKILDKWU.mjs";
16
16
  import "../chunk-WSBULPUZ.mjs";
17
17
  import "../chunk-YGKMN5UC.mjs";
18
18
  import "../chunk-3Y7X2UQ6.mjs";
@@ -4,20 +4,20 @@ import {
4
4
  import "../chunk-LXQQ5N6S.mjs";
5
5
  import {
6
6
  required
7
- } from "../chunk-3E3YJR6L.mjs";
7
+ } from "../chunk-4U4PPZWS.mjs";
8
8
  import "../chunk-ADJAEGCT.mjs";
9
9
  import {
10
10
  Struct
11
- } from "../chunk-DK6TQHF3.mjs";
11
+ } from "../chunk-K7NZINEX.mjs";
12
12
  import {
13
13
  json
14
14
  } from "../chunk-IANSP3JJ.mjs";
15
- import "../chunk-5HLBJ56K.mjs";
15
+ import "../chunk-TRIKRGDF.mjs";
16
16
  import "../chunk-OFGI5FLG.mjs";
17
17
  import "../chunk-KYQULNU4.mjs";
18
18
  import "../chunk-BGSOJQAU.mjs";
19
- import "../chunk-PKILDKWU.mjs";
20
19
  import "../chunk-KXOBVHGI.mjs";
20
+ import "../chunk-PKILDKWU.mjs";
21
21
  import "../chunk-WSBULPUZ.mjs";
22
22
  import "../chunk-YGKMN5UC.mjs";
23
23
  import "../chunk-3Y7X2UQ6.mjs";
@@ -2,15 +2,15 @@ import {
2
2
  DateTime,
3
3
  dt,
4
4
  isDateTime
5
- } from "../chunk-56HLMAA4.mjs";
5
+ } from "../chunk-5RL5STCD.mjs";
6
6
  import "../chunk-YDC3NPU4.mjs";
7
7
  import "../chunk-ADJAEGCT.mjs";
8
- import "../chunk-5HLBJ56K.mjs";
8
+ import "../chunk-TRIKRGDF.mjs";
9
9
  import "../chunk-OFGI5FLG.mjs";
10
10
  import "../chunk-KYQULNU4.mjs";
11
11
  import "../chunk-BGSOJQAU.mjs";
12
- import "../chunk-PKILDKWU.mjs";
13
12
  import "../chunk-KXOBVHGI.mjs";
13
+ import "../chunk-PKILDKWU.mjs";
14
14
  import "../chunk-WSBULPUZ.mjs";
15
15
  import "../chunk-YGKMN5UC.mjs";
16
16
  import "../chunk-3Y7X2UQ6.mjs";
@@ -4,25 +4,25 @@ import {
4
4
  import "../chunk-LXQQ5N6S.mjs";
5
5
  import {
6
6
  Audit
7
- } from "../chunk-SOXQOCCH.mjs";
7
+ } from "../chunk-LXJTNB3X.mjs";
8
8
  import {
9
9
  required
10
- } from "../chunk-3E3YJR6L.mjs";
11
- import "../chunk-56HLMAA4.mjs";
10
+ } from "../chunk-4U4PPZWS.mjs";
11
+ import "../chunk-5RL5STCD.mjs";
12
12
  import "../chunk-YDC3NPU4.mjs";
13
13
  import "../chunk-ADJAEGCT.mjs";
14
14
  import {
15
15
  Struct
16
- } from "../chunk-DK6TQHF3.mjs";
16
+ } from "../chunk-K7NZINEX.mjs";
17
17
  import {
18
18
  json
19
19
  } from "../chunk-IANSP3JJ.mjs";
20
- import "../chunk-5HLBJ56K.mjs";
20
+ import "../chunk-TRIKRGDF.mjs";
21
21
  import "../chunk-OFGI5FLG.mjs";
22
22
  import "../chunk-KYQULNU4.mjs";
23
23
  import "../chunk-BGSOJQAU.mjs";
24
- import "../chunk-PKILDKWU.mjs";
25
24
  import "../chunk-KXOBVHGI.mjs";
25
+ import "../chunk-PKILDKWU.mjs";
26
26
  import "../chunk-WSBULPUZ.mjs";
27
27
  import "../chunk-YGKMN5UC.mjs";
28
28
  import "../chunk-3Y7X2UQ6.mjs";
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  Repository
3
- } from "../chunk-4IH3OE4Y.mjs";
3
+ } from "../chunk-WVYZIPWC.mjs";
4
4
  import {
5
5
  toJson
6
6
  } from "../chunk-IANSP3JJ.mjs";
7
7
  import {
8
8
  when
9
- } from "../chunk-5HLBJ56K.mjs";
9
+ } from "../chunk-TRIKRGDF.mjs";
10
10
  import {
11
11
  isValidatable
12
12
  } from "../chunk-OFGI5FLG.mjs";
13
13
  import "../chunk-KYQULNU4.mjs";
14
14
  import "../chunk-BGSOJQAU.mjs";
15
+ import {
16
+ Exception
17
+ } from "../chunk-KXOBVHGI.mjs";
15
18
  import {
16
19
  reject,
17
20
  resolve
18
21
  } from "../chunk-PKILDKWU.mjs";
19
- import {
20
- Exception
21
- } from "../chunk-KXOBVHGI.mjs";
22
22
  import "../chunk-WSBULPUZ.mjs";
23
23
  import "../chunk-YGKMN5UC.mjs";
24
24
  import "../chunk-3Y7X2UQ6.mjs";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  Struct,
3
3
  isStruct
4
- } from "../chunk-DK6TQHF3.mjs";
4
+ } from "../chunk-K7NZINEX.mjs";
5
5
  import "../chunk-IANSP3JJ.mjs";
6
- import "../chunk-5HLBJ56K.mjs";
6
+ import "../chunk-TRIKRGDF.mjs";
7
7
  import "../chunk-OFGI5FLG.mjs";
8
8
  import "../chunk-KYQULNU4.mjs";
9
9
  import "../chunk-BGSOJQAU.mjs";
10
- import "../chunk-PKILDKWU.mjs";
11
10
  import "../chunk-KXOBVHGI.mjs";
11
+ import "../chunk-PKILDKWU.mjs";
12
12
  import "../chunk-WSBULPUZ.mjs";
13
13
  import "../chunk-YGKMN5UC.mjs";
14
14
  import "../chunk-3Y7X2UQ6.mjs";