@thisisagile/easy-service 19.1.4 → 20.0.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 (78) hide show
  1. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js +9 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js +6 -0
  3. package/dist/health/HealthResource.d.ts +6 -3
  4. package/dist/health/HealthResource.js +16 -0
  5. package/dist/health/HealthResource.js.map +1 -0
  6. package/dist/health/HealthUri.d.ts +6 -3
  7. package/dist/health/HealthUri.js +10 -0
  8. package/dist/health/HealthUri.js.map +1 -0
  9. package/dist/http/OriginatedError.d.ts +8 -5
  10. package/dist/http/OriginatedError.js +18 -0
  11. package/dist/http/OriginatedError.js.map +1 -0
  12. package/dist/http/Verb.d.ts +11 -8
  13. package/dist/http/Verb.js +38 -0
  14. package/dist/http/Verb.js.map +1 -0
  15. package/dist/index.d.ts +11 -10
  16. package/dist/index.js +9 -236
  17. package/dist/resources/AppProvider.d.ts +9 -6
  18. package/dist/resources/AppProvider.js +0 -0
  19. package/dist/resources/Requires.d.ts +8 -5
  20. package/dist/resources/Requires.js +23 -0
  21. package/dist/resources/Requires.js.map +1 -0
  22. package/dist/resources/Resource.d.ts +3 -0
  23. package/dist/resources/Resource.js +0 -0
  24. package/dist/resources/Route.d.ts +19 -16
  25. package/dist/resources/Route.js +37 -0
  26. package/dist/resources/Route.js.map +1 -0
  27. package/dist/resources/Service.d.ts +16 -13
  28. package/dist/resources/Service.js +29 -0
  29. package/dist/resources/Service.js.map +1 -0
  30. package/dist/security/Jwt.d.ts +12 -9
  31. package/dist/security/Jwt.js +19 -0
  32. package/dist/security/Jwt.js.map +1 -0
  33. package/package.json +19 -17
  34. package/dist/chunk-2XMYNSTI.mjs +0 -11
  35. package/dist/chunk-2XMYNSTI.mjs.map +0 -1
  36. package/dist/chunk-4D3CGIDW.mjs +0 -22
  37. package/dist/chunk-4D3CGIDW.mjs.map +0 -1
  38. package/dist/chunk-4N72FQFX.mjs +0 -16
  39. package/dist/chunk-4N72FQFX.mjs.map +0 -1
  40. package/dist/chunk-B37TXK4C.mjs +0 -40
  41. package/dist/chunk-B37TXK4C.mjs.map +0 -1
  42. package/dist/chunk-BTPC4SVP.mjs +0 -1
  43. package/dist/chunk-BTPC4SVP.mjs.map +0 -1
  44. package/dist/chunk-KHAYZJCB.mjs +0 -29
  45. package/dist/chunk-KHAYZJCB.mjs.map +0 -1
  46. package/dist/chunk-OQUQPJ6S.mjs +0 -25
  47. package/dist/chunk-OQUQPJ6S.mjs.map +0 -1
  48. package/dist/chunk-RJWBTUKZ.mjs +0 -27
  49. package/dist/chunk-RJWBTUKZ.mjs.map +0 -1
  50. package/dist/chunk-VXGHOHGY.mjs +0 -1
  51. package/dist/chunk-VXGHOHGY.mjs.map +0 -1
  52. package/dist/chunk-W62PBGRF.mjs +0 -31
  53. package/dist/chunk-W62PBGRF.mjs.map +0 -1
  54. package/dist/chunk-YB7NDS5U.mjs +0 -20
  55. package/dist/chunk-YB7NDS5U.mjs.map +0 -1
  56. package/dist/health/HealthResource.mjs +0 -11
  57. package/dist/health/HealthResource.mjs.map +0 -1
  58. package/dist/health/HealthUri.mjs +0 -8
  59. package/dist/health/HealthUri.mjs.map +0 -1
  60. package/dist/http/OriginatedError.mjs +0 -12
  61. package/dist/http/OriginatedError.mjs.map +0 -1
  62. package/dist/http/Verb.mjs +0 -22
  63. package/dist/http/Verb.mjs.map +0 -1
  64. package/dist/index.js.map +0 -1
  65. package/dist/index.mjs +0 -60
  66. package/dist/index.mjs.map +0 -1
  67. package/dist/resources/AppProvider.mjs +0 -2
  68. package/dist/resources/AppProvider.mjs.map +0 -1
  69. package/dist/resources/Requires.mjs +0 -10
  70. package/dist/resources/Requires.mjs.map +0 -1
  71. package/dist/resources/Resource.mjs +0 -2
  72. package/dist/resources/Resource.mjs.map +0 -1
  73. package/dist/resources/Route.mjs +0 -10
  74. package/dist/resources/Route.mjs.map +0 -1
  75. package/dist/resources/Service.mjs +0 -8
  76. package/dist/resources/Service.mjs.map +0 -1
  77. package/dist/security/Jwt.mjs +0 -8
  78. package/dist/security/Jwt.mjs.map +0 -1
@@ -1,15 +1,18 @@
1
- import { AppProvider, Handler } from './AppProvider';
2
- import { Constructor, Enum, List } from '@thisisagile/easy';
3
- import { Resource } from './Resource';
1
+ import { Resource } from "./Resource.js";
2
+ import { AppProvider, Handler } from "./AppProvider.js";
3
+ import { Constructor, Enum, List } from "@thisisagile/easy";
4
+ //#region src/resources/Service.d.ts
4
5
  export declare class Service extends Enum {
5
- readonly name: string;
6
- protected app: AppProvider;
7
- protected resources: List<Resource>;
8
- protected port: number;
9
- constructor(name: string, app: AppProvider, resources?: List<Resource>);
10
- pre: () => Handler[];
11
- post: () => Handler[];
12
- with(...resources: Constructor<Resource>[]): this;
13
- atPort(port: number): this;
14
- start(message?: string): void;
6
+ readonly name: string;
7
+ protected app: AppProvider;
8
+ protected resources: List<Resource>;
9
+ protected port: number;
10
+ constructor(name: string, app: AppProvider, resources?: List<Resource>);
11
+ pre: () => Handler[];
12
+ post: () => Handler[];
13
+ with(...resources: Constructor<Resource>[]): this;
14
+ atPort(port: number): this;
15
+ start(message?: string): void;
15
16
  }
17
+ //#endregion
18
+ //# sourceMappingURL=Service.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { Enum, toList, tryTo } from "@thisisagile/easy";
2
+ //#region src/resources/Service.ts
3
+ var Service = class extends Enum {
4
+ name;
5
+ app;
6
+ resources;
7
+ port = 8080;
8
+ constructor(name, app, resources = toList()) {
9
+ super(name);
10
+ this.name = name;
11
+ this.app = app;
12
+ this.resources = resources;
13
+ }
14
+ pre = () => [];
15
+ post = () => [];
16
+ with(...resources) {
17
+ return tryTo(this).accept((t) => t.resources.add(resources.map((r) => new r()))).value;
18
+ }
19
+ atPort(port) {
20
+ return tryTo(this).accept((t) => t.port = port).value;
21
+ }
22
+ start(message = `Service ${this.name} listening on port ${this.port} with ${this.resources.length} resources.`) {
23
+ tryTo(this).accept((t) => t.pre().forEach((h) => this.app.use(h))).accept((t) => t.resources.forEach((r) => this.app.route(this, r))).accept((t) => t.post().forEach((h) => this.app.use(h))).accept((t) => t.app.listen(this.port, message));
24
+ }
25
+ };
26
+ //#endregion
27
+ export { Service };
28
+
29
+ //# sourceMappingURL=Service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Service.js","names":[],"sources":["../../src/resources/Service.ts"],"sourcesContent":["import { AppProvider, Handler } from './AppProvider';\nimport { Constructor, Enum, List, toList, tryTo } from '@thisisagile/easy';\nimport { Resource } from './Resource';\n\nexport class Service extends Enum {\n protected port = 8080;\n\n constructor(\n readonly name: string,\n protected app: AppProvider,\n protected resources: List<Resource> = toList()\n ) {\n super(name);\n }\n\n pre = (): Handler[] => [];\n post = (): Handler[] => [];\n\n with(...resources: Constructor<Resource>[]): this {\n return tryTo(this).accept(t => t.resources.add(resources.map(r => new r()))).value;\n }\n\n atPort(port: number): this {\n return tryTo(this).accept(t => (t.port = port)).value;\n }\n\n start(message = `Service ${this.name} listening on port ${this.port} with ${this.resources.length} resources.`): void {\n tryTo(this)\n .accept(t => t.pre().forEach(h => this.app.use(h)))\n .accept(t => t.resources.forEach(r => this.app.route(this, r)))\n .accept(t => t.post().forEach(h => this.app.use(h)))\n .accept(t => t.app.listen(this.port, message));\n }\n}\n"],"mappings":";;AAIA,IAAa,UAAb,cAA6B,KAAK;CAIrB;CACC;CACA;CALZ,OAAiB;CAEjB,YACE,MACA,KACA,YAAsC,OAAO,GAC7C;EACA,MAAM,IAAI;EAJD,KAAA,OAAA;EACC,KAAA,MAAA;EACA,KAAA,YAAA;CAGZ;CAEA,YAAuB,CAAC;CACxB,aAAwB,CAAC;CAEzB,KAAK,GAAG,WAA0C;EAChD,OAAO,MAAM,IAAI,CAAC,CAAC,QAAO,MAAK,EAAE,UAAU,IAAI,UAAU,KAAI,MAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/E;CAEA,OAAO,MAAoB;EACzB,OAAO,MAAM,IAAI,CAAC,CAAC,QAAO,MAAM,EAAE,OAAO,IAAK,CAAC,CAAC;CAClD;CAEA,MAAM,UAAU,WAAW,KAAK,KAAK,qBAAqB,KAAK,KAAK,QAAQ,KAAK,UAAU,OAAO,cAAoB;EACpH,MAAM,IAAI,CAAC,CACR,QAAO,MAAK,EAAE,IAAI,CAAC,CAAC,SAAQ,MAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAClD,QAAO,MAAK,EAAE,UAAU,SAAQ,MAAK,KAAK,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,CAC9D,QAAO,MAAK,EAAE,KAAK,CAAC,CAAC,SAAQ,MAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CACnD,QAAO,MAAK,EAAE,IAAI,OAAO,KAAK,MAAM,OAAO,CAAC;CACjD;AACF"}
@@ -1,13 +1,16 @@
1
- import { Json, OneOrMore, Optional, Validatable, Jwt as JwtBase } from '@thisisagile/easy';
1
+ import { Json, Jwt as Jwt$1, OneOrMore, Optional, Validatable } from "@thisisagile/easy";
2
+ //#region src/security/Jwt.d.ts
2
3
  interface SignOptions {
3
- audience?: Optional<OneOrMore<string>>;
4
- issuer?: Optional<string>;
4
+ audience?: Optional<OneOrMore<string>>;
5
+ issuer?: Optional<string>;
5
6
  }
6
- export declare class Jwt extends JwtBase implements Validatable {
7
- static of: (a: {
8
- jwt: string;
9
- }) => Jwt;
10
- get isValid(): boolean;
11
- static sign: (token: Json, options?: SignOptions) => Jwt;
7
+ export declare class Jwt extends Jwt$1 implements Validatable {
8
+ static of: (a: {
9
+ jwt: string;
10
+ }) => Jwt;
11
+ get isValid(): boolean;
12
+ static sign: (token: Json, options?: SignOptions) => Jwt;
12
13
  }
14
+ //#endregion
13
15
  export {};
16
+ //# sourceMappingURL=Jwt.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { Jwt as Jwt$1, ctx, tryTo } from "@thisisagile/easy";
2
+ import jwt from "jsonwebtoken";
3
+ //#region src/security/Jwt.ts
4
+ var Jwt = class Jwt extends Jwt$1 {
5
+ static of = (a) => new Jwt(a.jwt);
6
+ get isValid() {
7
+ return tryTo(() => ctx.env.get("tokenPublicKey") ?? "").map((key) => jwt.verify(this.value, key)).map(() => true).orElse() ?? false;
8
+ }
9
+ static sign = (token, options) => tryTo(() => ctx.env.get("tokenPrivateKey") ?? "").is.not.empty().map((key) => jwt.sign(token, key, {
10
+ ...options,
11
+ expiresIn: ctx.env.get("tokenExpiresIn") ?? "1h",
12
+ keyid: ctx.env.get("tokenKeyid") ?? "easy",
13
+ algorithm: ctx.env.get("tokenAlgorithm", "RS256")
14
+ })).map((s) => new Jwt(s)).value;
15
+ };
16
+ //#endregion
17
+ export { Jwt };
18
+
19
+ //# sourceMappingURL=Jwt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Jwt.js","names":["JwtBase"],"sources":["../../src/security/Jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken';\nimport type { Algorithm } from 'jsonwebtoken';\nimport { ctx, Json, OneOrMore, Optional, tryTo, Validatable, Jwt as JwtBase } from '@thisisagile/easy';\n\ninterface SignOptions {\n audience?: Optional<OneOrMore<string>>;\n issuer?: Optional<string>;\n}\nexport class Jwt extends JwtBase implements Validatable {\n static of = (a: { jwt: string }): Jwt => new Jwt(a.jwt);\n\n get isValid(): boolean {\n return (\n tryTo(() => ctx.env.get('tokenPublicKey') ?? '')\n .map(key => jwt.verify(this.value, key))\n .map(() => true)\n .orElse() ?? false\n );\n }\n\n static sign = (token: Json, options?: SignOptions): Jwt =>\n tryTo(() => ctx.env.get('tokenPrivateKey') ?? '')\n .is.not.empty()\n .map(key =>\n jwt.sign(token, key, {\n ...options,\n expiresIn: (ctx.env.get('tokenExpiresIn') as any) ?? '1h',\n keyid: ctx.env.get('tokenKeyid') ?? 'easy',\n algorithm: ctx.env.get('tokenAlgorithm', 'RS256') as Algorithm,\n })\n )\n .map(s => new Jwt(s)).value;\n}\n"],"mappings":";;;AAQA,IAAa,MAAb,MAAa,YAAYA,MAA+B;CACtD,OAAO,MAAM,MAA4B,IAAI,IAAI,EAAE,GAAG;CAEtD,IAAI,UAAmB;EACrB,OACE,YAAY,IAAI,IAAI,IAAI,gBAAgB,KAAK,EAAE,CAAC,CAC7C,KAAI,QAAO,IAAI,OAAO,KAAK,OAAO,GAAG,CAAC,CAAC,CACvC,UAAU,IAAI,CAAC,CACf,OAAO,KAAK;CAEnB;CAEA,OAAO,QAAQ,OAAa,YAC1B,YAAY,IAAI,IAAI,IAAI,iBAAiB,KAAK,EAAE,CAAC,CAC9C,GAAG,IAAI,MAAM,CAAC,CACd,KAAI,QACH,IAAI,KAAK,OAAO,KAAK;EACnB,GAAG;EACH,WAAY,IAAI,IAAI,IAAI,gBAAgB,KAAa;EACrD,OAAO,IAAI,IAAI,IAAI,YAAY,KAAK;EACpC,WAAW,IAAI,IAAI,IAAI,kBAAkB,OAAO;CAClD,CAAC,CACH,CAAC,CACA,KAAI,MAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5B"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@thisisagile/easy-service",
3
- "version": "19.1.4",
3
+ "version": "20.0.0",
4
4
  "description": "Straightforward library for building domain-driven microservice architectures",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
7
+ "type": "module",
7
8
  "main": "dist/index.js",
8
- "module": "dist/index.mjs",
9
+ "module": "dist/index.js",
9
10
  "types": "dist/index.d.ts",
10
11
  "repository": {
11
12
  "type": "git",
@@ -20,8 +21,7 @@
20
21
  "scripts": {
21
22
  "lint": "yarn g:eslint . --ext .js,.jsx,.ts,.tsx --fix",
22
23
  "format": "yarn g:prettier --check --write src test *.json",
23
- "build": "yarn build:tsup",
24
- "build:tsup": "yarn g:tsup && yarn g:tsc --emitDeclarationOnly --declaration",
24
+ "build": "yarn g:tsdown && yarn g:exports",
25
25
  "test": "yarn g:jest --coverage",
26
26
  "prepack": "yarn g:copy-readme"
27
27
  },
@@ -33,58 +33,60 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
+ "engines": {
37
+ "node": ">=20.19.0"
38
+ },
36
39
  "devDependencies": {
37
40
  "@thisisagile/easy-test": "*"
38
41
  },
39
42
  "dependencies": {
40
- "@thisisagile/easy": "^19.1.4",
43
+ "@thisisagile/easy": "^20.0.0",
41
44
  "jsonwebtoken": "^9.0.3"
42
45
  },
43
46
  "exports": {
44
47
  ".": {
45
48
  "types": "./dist/index.d.ts",
46
- "import": "./dist/index.mjs",
47
- "require": "./dist/index.js"
49
+ "default": "./dist/index.js"
48
50
  },
49
51
  "./health/HealthResource": {
50
52
  "types": "./dist/health/HealthResource.d.ts",
51
- "import": "./dist/health/HealthResource.mjs"
53
+ "default": "./dist/health/HealthResource.js"
52
54
  },
53
55
  "./health/HealthUri": {
54
56
  "types": "./dist/health/HealthUri.d.ts",
55
- "import": "./dist/health/HealthUri.mjs"
57
+ "default": "./dist/health/HealthUri.js"
56
58
  },
57
59
  "./http/OriginatedError": {
58
60
  "types": "./dist/http/OriginatedError.d.ts",
59
- "import": "./dist/http/OriginatedError.mjs"
61
+ "default": "./dist/http/OriginatedError.js"
60
62
  },
61
63
  "./http/Verb": {
62
64
  "types": "./dist/http/Verb.d.ts",
63
- "import": "./dist/http/Verb.mjs"
65
+ "default": "./dist/http/Verb.js"
64
66
  },
65
67
  "./resources/AppProvider": {
66
68
  "types": "./dist/resources/AppProvider.d.ts",
67
- "import": "./dist/resources/AppProvider.mjs"
69
+ "default": "./dist/resources/AppProvider.js"
68
70
  },
69
71
  "./resources/Requires": {
70
72
  "types": "./dist/resources/Requires.d.ts",
71
- "import": "./dist/resources/Requires.mjs"
73
+ "default": "./dist/resources/Requires.js"
72
74
  },
73
75
  "./resources/Resource": {
74
76
  "types": "./dist/resources/Resource.d.ts",
75
- "import": "./dist/resources/Resource.mjs"
77
+ "default": "./dist/resources/Resource.js"
76
78
  },
77
79
  "./resources/Route": {
78
80
  "types": "./dist/resources/Route.d.ts",
79
- "import": "./dist/resources/Route.mjs"
81
+ "default": "./dist/resources/Route.js"
80
82
  },
81
83
  "./resources/Service": {
82
84
  "types": "./dist/resources/Service.d.ts",
83
- "import": "./dist/resources/Service.mjs"
85
+ "default": "./dist/resources/Service.js"
84
86
  },
85
87
  "./security/Jwt": {
86
88
  "types": "./dist/security/Jwt.d.ts",
87
- "import": "./dist/security/Jwt.mjs"
89
+ "default": "./dist/security/Jwt.js"
88
90
  },
89
91
  "./src/*": "./src/*",
90
92
  "./dist/*": "./dist/*",
@@ -1,11 +0,0 @@
1
- // src/health/HealthUri.ts
2
- import { EasyUri, uri } from "@thisisagile/easy";
3
- var HealthUri = class _HealthUri extends EasyUri {
4
- static health = uri.segment("health");
5
- static Health = new _HealthUri([_HealthUri.health]);
6
- };
7
-
8
- export {
9
- HealthUri
10
- };
11
- //# sourceMappingURL=chunk-2XMYNSTI.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/health/HealthUri.ts"],"sourcesContent":["import { EasyUri, uri } from '@thisisagile/easy';\n\nexport class HealthUri extends EasyUri {\n static readonly health = uri.segment('health');\n static readonly Health = new HealthUri([HealthUri.health]);\n}\n"],"mappings":";AAAA,SAAS,SAAS,WAAW;AAEtB,IAAM,YAAN,MAAM,mBAAkB,QAAQ;AAAA,EACrC,OAAgB,SAAS,IAAI,QAAQ,QAAQ;AAAA,EAC7C,OAAgB,SAAS,IAAI,WAAU,CAAC,WAAU,MAAM,CAAC;AAC3D;","names":[]}
@@ -1,22 +0,0 @@
1
- // src/security/Jwt.ts
2
- import jwt from "jsonwebtoken";
3
- import { ctx, tryTo, Jwt as JwtBase } from "@thisisagile/easy";
4
- var Jwt = class _Jwt extends JwtBase {
5
- static of = (a) => new _Jwt(a.jwt);
6
- get isValid() {
7
- return tryTo(() => ctx.env.get("tokenPublicKey") ?? "").map((key) => jwt.verify(this.value, key)).map(() => true).orElse() ?? false;
8
- }
9
- static sign = (token, options) => tryTo(() => ctx.env.get("tokenPrivateKey") ?? "").is.not.empty().map(
10
- (key) => jwt.sign(token, key, {
11
- ...options,
12
- expiresIn: ctx.env.get("tokenExpiresIn") ?? "1h",
13
- keyid: ctx.env.get("tokenKeyid") ?? "easy",
14
- algorithm: ctx.env.get("tokenAlgorithm", "RS256")
15
- })
16
- ).map((s) => new _Jwt(s)).value;
17
- };
18
-
19
- export {
20
- Jwt
21
- };
22
- //# sourceMappingURL=chunk-4D3CGIDW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/security/Jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken';\nimport type { Algorithm } from 'jsonwebtoken';\nimport { ctx, Json, OneOrMore, Optional, tryTo, Validatable, Jwt as JwtBase } from '@thisisagile/easy';\n\ninterface SignOptions {\n audience?: Optional<OneOrMore<string>>;\n issuer?: Optional<string>;\n}\nexport class Jwt extends JwtBase implements Validatable {\n static of = (a: { jwt: string }): Jwt => new Jwt(a.jwt);\n\n get isValid(): boolean {\n return (\n tryTo(() => ctx.env.get('tokenPublicKey') ?? '')\n .map(key => jwt.verify(this.value, key))\n .map(() => true)\n .orElse() ?? false\n );\n }\n\n static sign = (token: Json, options?: SignOptions): Jwt =>\n tryTo(() => ctx.env.get('tokenPrivateKey') ?? '')\n .is.not.empty()\n .map(key =>\n jwt.sign(token, key, {\n ...options,\n expiresIn: (ctx.env.get('tokenExpiresIn') as any) ?? '1h',\n keyid: ctx.env.get('tokenKeyid') ?? 'easy',\n algorithm: ctx.env.get('tokenAlgorithm', 'RS256') as Algorithm,\n })\n )\n .map(s => new Jwt(s)).value;\n}\n"],"mappings":";AAAA,OAAO,SAAS;AAEhB,SAAS,KAAgC,OAAoB,OAAO,eAAe;AAM5E,IAAM,MAAN,MAAM,aAAY,QAA+B;AAAA,EACtD,OAAO,KAAK,CAAC,MAA4B,IAAI,KAAI,EAAE,GAAG;AAAA,EAEtD,IAAI,UAAmB;AACrB,WACE,MAAM,MAAM,IAAI,IAAI,IAAI,gBAAgB,KAAK,EAAE,EAC5C,IAAI,SAAO,IAAI,OAAO,KAAK,OAAO,GAAG,CAAC,EACtC,IAAI,MAAM,IAAI,EACd,OAAO,KAAK;AAAA,EAEnB;AAAA,EAEA,OAAO,OAAO,CAAC,OAAa,YAC1B,MAAM,MAAM,IAAI,IAAI,IAAI,iBAAiB,KAAK,EAAE,EAC7C,GAAG,IAAI,MAAM,EACb;AAAA,IAAI,SACH,IAAI,KAAK,OAAO,KAAK;AAAA,MACnB,GAAG;AAAA,MACH,WAAY,IAAI,IAAI,IAAI,gBAAgB,KAAa;AAAA,MACrD,OAAO,IAAI,IAAI,IAAI,YAAY,KAAK;AAAA,MACpC,WAAW,IAAI,IAAI,IAAI,kBAAkB,OAAO;AAAA,IAClD,CAAC;AAAA,EACH,EACC,IAAI,OAAK,IAAI,KAAI,CAAC,CAAC,EAAE;AAC5B;","names":[]}
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result)
9
- __defProp(target, key, result);
10
- return result;
11
- };
12
-
13
- export {
14
- __decorateClass
15
- };
16
- //# sourceMappingURL=chunk-4N72FQFX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,40 +0,0 @@
1
- // src/resources/Route.ts
2
- import { meta, tryTo } from "@thisisagile/easy";
3
- var route = (uri) => (subject) => {
4
- meta(subject).set("route", uri);
5
- };
6
- var toRoute = (endpoint, requires, verb, middleware, name = "") => tryTo(verb).is.defined().map((verb2) => ({ verb: verb2, name, endpoint, requires, middleware: middleware ?? [] })).orElse();
7
- var Router = class {
8
- constructor(resource) {
9
- this.resource = resource;
10
- }
11
- get route() {
12
- return meta(this.resource).get("route");
13
- }
14
- get middleware() {
15
- return meta(this.resource).get("middleware") ?? [];
16
- }
17
- get endpoints() {
18
- return meta(this.resource).properties("verb").mapDefined(
19
- (v) => toRoute(
20
- this.resource[v.property],
21
- {
22
- labCoat: v.get("labCoat") ?? false,
23
- token: v.get("token") ?? false,
24
- scope: v.get("scope"),
25
- uc: v.get("uc")
26
- },
27
- v.get("verb"),
28
- v.get("middleware"),
29
- v.property.toString()
30
- )
31
- );
32
- }
33
- };
34
- var routes = (resource) => new Router(resource);
35
-
36
- export {
37
- route,
38
- routes
39
- };
40
- //# sourceMappingURL=chunk-B37TXK4C.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/Route.ts"],"sourcesContent":["import { List, meta, Optional, tryTo, Uri, Scope, UseCase, Req } from '@thisisagile/easy';\nimport { Resource } from './Resource';\nimport { RequestHandler } from 'express';\nimport { Verb } from '../http/Verb';\n\nexport const route =\n (uri: Uri): ClassDecorator =>\n (subject: unknown): void => {\n meta(subject).set('route', uri);\n };\n\nexport type Endpoint<T = unknown> = (re: Req) => Promise<T | List<T>>;\nexport type RouteRequires = { token: boolean; labCoat: boolean; scope?: Scope; uc?: UseCase };\nexport type Route = { verb: Verb; name: string, endpoint: Endpoint; requires: RouteRequires; middleware: RequestHandler[] };\nexport type Routes = { route: Uri; middleware: RequestHandler[]; endpoints: List<Route> };\n\nconst toRoute = (endpoint: Endpoint, requires: RouteRequires, verb?: Verb, middleware?: RequestHandler[], name = ''): Optional<Route> =>\n tryTo(verb)\n .is.defined()\n .map(verb => ({ verb, name, endpoint, requires, middleware: middleware ?? [] }) as Route)\n .orElse();\n\nclass Router implements Routes {\n constructor(readonly resource: Resource) {}\n\n get route(): Uri {\n return meta(this.resource).get('route');\n }\n\n get middleware(): RequestHandler[] {\n return meta(this.resource).get<RequestHandler[]>('middleware') ?? [];\n }\n\n get endpoints(): List<Route> {\n return meta(this.resource)\n .properties('verb')\n .mapDefined(v =>\n toRoute(\n this.resource[v.property],\n {\n labCoat: v.get<boolean>('labCoat') ?? false,\n token: v.get<boolean>('token') ?? false,\n scope: v.get<Scope>('scope'),\n uc: v.get<UseCase>('uc'),\n },\n v.get<Verb>('verb'),\n v.get<RequestHandler[]>('middleware'),\n v.property.toString(),\n )\n );\n }\n}\n\nexport const routes = (resource: Resource): Routes => new Router(resource);\n"],"mappings":";AAAA,SAAe,MAAgB,aAAuC;AAK/D,IAAM,QACX,CAAC,QACD,CAAC,YAA2B;AAC1B,OAAK,OAAO,EAAE,IAAI,SAAS,GAAG;AAChC;AAOF,IAAM,UAAU,CAAC,UAAoB,UAAyB,MAAa,YAA+B,OAAO,OAC/G,MAAM,IAAI,EACP,GAAG,QAAQ,EACX,IAAI,CAAAA,WAAS,EAAE,MAAAA,OAAM,MAAM,UAAU,UAAU,YAAY,cAAc,CAAC,EAAE,EAAW,EACvF,OAAO;AAEZ,IAAM,SAAN,MAA+B;AAAA,EAC7B,YAAqB,UAAoB;AAApB;AAAA,EAAqB;AAAA,EAE1C,IAAI,QAAa;AACf,WAAO,KAAK,KAAK,QAAQ,EAAE,IAAI,OAAO;AAAA,EACxC;AAAA,EAEA,IAAI,aAA+B;AACjC,WAAO,KAAK,KAAK,QAAQ,EAAE,IAAsB,YAAY,KAAK,CAAC;AAAA,EACrE;AAAA,EAEA,IAAI,YAAyB;AAC3B,WAAO,KAAK,KAAK,QAAQ,EACtB,WAAW,MAAM,EACjB;AAAA,MAAW,OACV;AAAA,QACE,KAAK,SAAS,EAAE,QAAQ;AAAA,QACxB;AAAA,UACE,SAAS,EAAE,IAAa,SAAS,KAAK;AAAA,UACtC,OAAO,EAAE,IAAa,OAAO,KAAK;AAAA,UAClC,OAAO,EAAE,IAAW,OAAO;AAAA,UAC3B,IAAI,EAAE,IAAa,IAAI;AAAA,QACzB;AAAA,QACA,EAAE,IAAU,MAAM;AAAA,QAClB,EAAE,IAAsB,YAAY;AAAA,QACpC,EAAE,SAAS,SAAS;AAAA,MACtB;AAAA,IACF;AAAA,EACJ;AACF;AAEO,IAAM,SAAS,CAAC,aAA+B,IAAI,OAAO,QAAQ;","names":["verb"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-BTPC4SVP.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,29 +0,0 @@
1
- import {
2
- route
3
- } from "./chunk-B37TXK4C.mjs";
4
- import {
5
- HealthUri
6
- } from "./chunk-2XMYNSTI.mjs";
7
- import {
8
- get
9
- } from "./chunk-W62PBGRF.mjs";
10
- import {
11
- __decorateClass
12
- } from "./chunk-4N72FQFX.mjs";
13
-
14
- // src/health/HealthResource.ts
15
- import { resolve } from "@thisisagile/easy";
16
- var HealthResource = class {
17
- ok = () => resolve({ state: "Service is healthy." });
18
- };
19
- __decorateClass([
20
- get()
21
- ], HealthResource.prototype, "ok", 2);
22
- HealthResource = __decorateClass([
23
- route(HealthUri.Health)
24
- ], HealthResource);
25
-
26
- export {
27
- HealthResource
28
- };
29
- //# sourceMappingURL=chunk-KHAYZJCB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/health/HealthResource.ts"],"sourcesContent":["import { resolve, Json } from '@thisisagile/easy';\nimport { HealthUri } from './HealthUri';\nimport { Resource } from '../resources/Resource';\nimport { route } from '../resources/Route';\nimport { get } from '../http/Verb';\n\n@route(HealthUri.Health)\nexport class HealthResource implements Resource {\n @get()\n ok = (): Promise<Json> => resolve({ state: 'Service is healthy.' });\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,eAAqB;AAOvB,IAAM,iBAAN,MAAyC;AAAA,EAE9C,KAAK,MAAqB,QAAQ,EAAE,OAAO,sBAAsB,CAAC;AACpE;AADE;AAAA,EADC,IAAI;AAAA,GADM,eAEX;AAFW,iBAAN;AAAA,EADN,MAAM,UAAU,MAAM;AAAA,GACV;","names":[]}
@@ -1,25 +0,0 @@
1
- // src/resources/Requires.ts
2
- import { meta } from "@thisisagile/easy";
3
- var Requires = class {
4
- labCoat = () => (subject, property) => {
5
- meta(subject).property(property).set("labCoat", true);
6
- };
7
- token = () => (subject, property) => {
8
- meta(subject).property(property).set("token", true);
9
- };
10
- scope = (scope) => (subject, property) => {
11
- meta(subject).property(property).set("token", true);
12
- meta(subject).property(property).set("scope", scope);
13
- };
14
- useCase = (uc) => (subject, property) => {
15
- meta(subject).property(property).set("token", true);
16
- meta(subject).property(property).set("uc", uc);
17
- };
18
- };
19
- var requires = new Requires();
20
-
21
- export {
22
- Requires,
23
- requires
24
- };
25
- //# sourceMappingURL=chunk-OQUQPJ6S.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/Requires.ts"],"sourcesContent":["import { meta } from '@thisisagile/easy';\nimport { Scope, UseCase } from '@thisisagile/easy';\n\nexport class Requires {\n readonly labCoat =\n (): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n meta(subject).property(property).set('labCoat', true);\n };\n\n readonly token =\n (): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n meta(subject).property(property).set('token', true);\n };\n\n readonly scope =\n (scope: Scope): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n meta(subject).property(property).set('token', true);\n meta(subject).property(property).set('scope', scope);\n };\n\n readonly useCase =\n (uc: UseCase): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n meta(subject).property(property).set('token', true);\n meta(subject).property(property).set('uc', uc);\n };\n}\n\nexport const requires = new Requires();\n"],"mappings":";AAAA,SAAS,YAAY;AAGd,IAAM,WAAN,MAAe;AAAA,EACX,UACP,MACA,CAAC,SAAkB,aAAoC;AACrD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,WAAW,IAAI;AAAA,EACtD;AAAA,EAEO,QACP,MACA,CAAC,SAAkB,aAAoC;AACrD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,SAAS,IAAI;AAAA,EACpD;AAAA,EAEO,QACP,CAAC,UACD,CAAC,SAAkB,aAAoC;AACrD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,SAAS,IAAI;AAClD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,SAAS,KAAK;AAAA,EACrD;AAAA,EAEO,UACP,CAAC,OACD,CAAC,SAAkB,aAAoC;AACrD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,SAAS,IAAI;AAClD,SAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,MAAM,EAAE;AAAA,EAC/C;AACJ;AAEO,IAAM,WAAW,IAAI,SAAS;","names":[]}
@@ -1,27 +0,0 @@
1
- // src/resources/Service.ts
2
- import { Enum, toList, tryTo } from "@thisisagile/easy";
3
- var Service = class extends Enum {
4
- constructor(name, app, resources = toList()) {
5
- super(name);
6
- this.name = name;
7
- this.app = app;
8
- this.resources = resources;
9
- }
10
- port = 8080;
11
- pre = () => [];
12
- post = () => [];
13
- with(...resources) {
14
- return tryTo(this).accept((t) => t.resources.add(resources.map((r) => new r()))).value;
15
- }
16
- atPort(port) {
17
- return tryTo(this).accept((t) => t.port = port).value;
18
- }
19
- start(message = `Service ${this.name} listening on port ${this.port} with ${this.resources.length} resources.`) {
20
- tryTo(this).accept((t) => t.pre().forEach((h) => this.app.use(h))).accept((t) => t.resources.forEach((r) => this.app.route(this, r))).accept((t) => t.post().forEach((h) => this.app.use(h))).accept((t) => t.app.listen(this.port, message));
21
- }
22
- };
23
-
24
- export {
25
- Service
26
- };
27
- //# sourceMappingURL=chunk-RJWBTUKZ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/Service.ts"],"sourcesContent":["import { AppProvider, Handler } from './AppProvider';\nimport { Constructor, Enum, List, toList, tryTo } from '@thisisagile/easy';\nimport { Resource } from './Resource';\n\nexport class Service extends Enum {\n protected port = 8080;\n\n constructor(\n readonly name: string,\n protected app: AppProvider,\n protected resources: List<Resource> = toList()\n ) {\n super(name);\n }\n\n pre = (): Handler[] => [];\n post = (): Handler[] => [];\n\n with(...resources: Constructor<Resource>[]): this {\n return tryTo(this).accept(t => t.resources.add(resources.map(r => new r()))).value;\n }\n\n atPort(port: number): this {\n return tryTo(this).accept(t => (t.port = port)).value;\n }\n\n start(message = `Service ${this.name} listening on port ${this.port} with ${this.resources.length} resources.`): void {\n tryTo(this)\n .accept(t => t.pre().forEach(h => this.app.use(h)))\n .accept(t => t.resources.forEach(r => this.app.route(this, r)))\n .accept(t => t.post().forEach(h => this.app.use(h)))\n .accept(t => t.app.listen(this.port, message));\n }\n}\n"],"mappings":";AACA,SAAsB,MAAY,QAAQ,aAAa;AAGhD,IAAM,UAAN,cAAsB,KAAK;AAAA,EAGhC,YACW,MACC,KACA,YAA4B,OAAO,GAC7C;AACA,UAAM,IAAI;AAJD;AACC;AACA;AAAA,EAGZ;AAAA,EARU,OAAO;AAAA,EAUjB,MAAM,MAAiB,CAAC;AAAA,EACxB,OAAO,MAAiB,CAAC;AAAA,EAEzB,QAAQ,WAA0C;AAChD,WAAO,MAAM,IAAI,EAAE,OAAO,OAAK,EAAE,UAAU,IAAI,UAAU,IAAI,OAAK,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;AAAA,EAC/E;AAAA,EAEA,OAAO,MAAoB;AACzB,WAAO,MAAM,IAAI,EAAE,OAAO,OAAM,EAAE,OAAO,IAAK,EAAE;AAAA,EAClD;AAAA,EAEA,MAAM,UAAU,WAAW,KAAK,IAAI,sBAAsB,KAAK,IAAI,SAAS,KAAK,UAAU,MAAM,eAAqB;AACpH,UAAM,IAAI,EACP,OAAO,OAAK,EAAE,IAAI,EAAE,QAAQ,OAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EACjD,OAAO,OAAK,EAAE,UAAU,QAAQ,OAAK,KAAK,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,EAC7D,OAAO,OAAK,EAAE,KAAK,EAAE,QAAQ,OAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAClD,OAAO,OAAK,EAAE,IAAI,OAAO,KAAK,MAAM,OAAO,CAAC;AAAA,EACjD;AACF;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-VXGHOHGY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,31 +0,0 @@
1
- // src/http/Verb.ts
2
- import { meta, CacheControl, ContentType, HttpStatus, HttpVerb } from "@thisisagile/easy";
3
- var toVerbOptions = (options) => ({
4
- onOk: options?.onOk ?? HttpStatus.Ok,
5
- onNotFound: options?.onNotFound ?? HttpStatus.NotFound,
6
- onError: options?.onError ?? HttpStatus.BadRequest,
7
- type: options?.type ?? ContentType.Json,
8
- cache: options?.cache ?? CacheControl.disabled()
9
- });
10
- var toVerb = (verb, options) => (subject, property) => {
11
- meta(subject).property(property).set("verb", { verb, options });
12
- };
13
- var get = (options) => toVerb(HttpVerb.Get, options);
14
- var search = (options) => toVerb(HttpVerb.Get, { onNotFound: HttpStatus.Ok, ...options });
15
- var put = (options) => toVerb(HttpVerb.Put, options);
16
- var patch = (options) => toVerb(HttpVerb.Patch, options);
17
- var post = (options) => toVerb(HttpVerb.Post, { onOk: HttpStatus.Created, ...options });
18
- var del = (options) => toVerb(HttpVerb.Delete, { onOk: HttpStatus.NoContent, ...options });
19
- var stream = (options) => toVerb(HttpVerb.Get, { type: ContentType.Stream, ...options });
20
-
21
- export {
22
- toVerbOptions,
23
- get,
24
- search,
25
- put,
26
- patch,
27
- post,
28
- del,
29
- stream
30
- };
31
- //# sourceMappingURL=chunk-W62PBGRF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/http/Verb.ts"],"sourcesContent":["import { meta, CacheControl, ContentType, HttpStatus, HttpVerb } from '@thisisagile/easy';\n\nexport type VerbOptions = { onOk?: HttpStatus; onNotFound?: HttpStatus; onError?: HttpStatus; type?: ContentType; cache?: CacheControl };\nexport type Verb = { verb: HttpVerb; options: VerbOptions };\n\nexport const toVerbOptions = (options?: VerbOptions): Required<VerbOptions> => ({\n onOk: options?.onOk ?? HttpStatus.Ok,\n onNotFound: options?.onNotFound ?? HttpStatus.NotFound,\n onError: options?.onError ?? HttpStatus.BadRequest,\n type: options?.type ?? ContentType.Json,\n cache: options?.cache ?? CacheControl.disabled(),\n});\n\nconst toVerb =\n <T>(verb: HttpVerb, options?: VerbOptions): PropertyDecorator =>\n (subject: unknown, property: string | symbol): void => {\n meta(subject).property(property).set('verb', { verb, options });\n };\n\nexport const get = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Get, options);\n\nexport const search = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Get, { onNotFound: HttpStatus.Ok, ...options });\n\nexport const put = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Put, options);\n\nexport const patch = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Patch, options);\n\nexport const post = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Post, { onOk: HttpStatus.Created, ...options });\n\nexport const del = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Delete, { onOk: HttpStatus.NoContent, ...options });\n\nexport const stream = (options?: VerbOptions): PropertyDecorator => toVerb(HttpVerb.Get, { type: ContentType.Stream, ...options });\n"],"mappings":";AAAA,SAAS,MAAM,cAAc,aAAa,YAAY,gBAAgB;AAK/D,IAAM,gBAAgB,CAAC,aAAkD;AAAA,EAC9E,MAAM,SAAS,QAAQ,WAAW;AAAA,EAClC,YAAY,SAAS,cAAc,WAAW;AAAA,EAC9C,SAAS,SAAS,WAAW,WAAW;AAAA,EACxC,MAAM,SAAS,QAAQ,YAAY;AAAA,EACnC,OAAO,SAAS,SAAS,aAAa,SAAS;AACjD;AAEA,IAAM,SACJ,CAAI,MAAgB,YACpB,CAAC,SAAkB,aAAoC;AACrD,OAAK,OAAO,EAAE,SAAS,QAAQ,EAAE,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAChE;AAEK,IAAM,MAAM,CAAC,YAA6C,OAAO,SAAS,KAAK,OAAO;AAEtF,IAAM,SAAS,CAAC,YAA6C,OAAO,SAAS,KAAK,EAAE,YAAY,WAAW,IAAI,GAAG,QAAQ,CAAC;AAE3H,IAAM,MAAM,CAAC,YAA6C,OAAO,SAAS,KAAK,OAAO;AAEtF,IAAM,QAAQ,CAAC,YAA6C,OAAO,SAAS,OAAO,OAAO;AAE1F,IAAM,OAAO,CAAC,YAA6C,OAAO,SAAS,MAAM,EAAE,MAAM,WAAW,SAAS,GAAG,QAAQ,CAAC;AAEzH,IAAM,MAAM,CAAC,YAA6C,OAAO,SAAS,QAAQ,EAAE,MAAM,WAAW,WAAW,GAAG,QAAQ,CAAC;AAE5H,IAAM,SAAS,CAAC,YAA6C,OAAO,SAAS,KAAK,EAAE,MAAM,YAAY,QAAQ,GAAG,QAAQ,CAAC;","names":[]}
@@ -1,20 +0,0 @@
1
- // src/http/OriginatedError.ts
2
- import { isError } from "@thisisagile/easy";
3
- var OriginatedError = class extends Error {
4
- constructor(origin, options) {
5
- super();
6
- this.origin = origin;
7
- this.options = options;
8
- if (isError(origin))
9
- this.stack = origin.stack;
10
- }
11
- };
12
- var isOriginatedError = (e) => isError(e) && e instanceof OriginatedError;
13
- var toOriginatedError = (e, options) => isOriginatedError(e) ? e : new OriginatedError(e, options);
14
-
15
- export {
16
- OriginatedError,
17
- isOriginatedError,
18
- toOriginatedError
19
- };
20
- //# sourceMappingURL=chunk-YB7NDS5U.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/http/OriginatedError.ts"],"sourcesContent":["import { ErrorOrigin, isError } from '@thisisagile/easy';\nimport { VerbOptions } from './Verb';\n\nexport class OriginatedError extends Error {\n constructor(\n readonly origin: ErrorOrigin,\n readonly options?: VerbOptions\n ) {\n super();\n if (isError(origin)) this.stack = origin.stack;\n }\n}\n\nexport const isOriginatedError = (e?: unknown): e is OriginatedError => isError(e) && e instanceof OriginatedError;\n\nexport const toOriginatedError = (e: unknown, options?: VerbOptions): OriginatedError =>\n isOriginatedError(e) ? e : new OriginatedError(e as ErrorOrigin, options);\n"],"mappings":";AAAA,SAAsB,eAAe;AAG9B,IAAM,kBAAN,cAA8B,MAAM;AAAA,EACzC,YACW,QACA,SACT;AACA,UAAM;AAHG;AACA;AAGT,QAAI,QAAQ,MAAM;AAAG,WAAK,QAAQ,OAAO;AAAA,EAC3C;AACF;AAEO,IAAM,oBAAoB,CAAC,MAAsC,QAAQ,CAAC,KAAK,aAAa;AAE5F,IAAM,oBAAoB,CAAC,GAAY,YAC5C,kBAAkB,CAAC,IAAI,IAAI,IAAI,gBAAgB,GAAkB,OAAO;","names":[]}
@@ -1,11 +0,0 @@
1
- import {
2
- HealthResource
3
- } from "../chunk-KHAYZJCB.mjs";
4
- import "../chunk-B37TXK4C.mjs";
5
- import "../chunk-2XMYNSTI.mjs";
6
- import "../chunk-W62PBGRF.mjs";
7
- import "../chunk-4N72FQFX.mjs";
8
- export {
9
- HealthResource
10
- };
11
- //# sourceMappingURL=HealthResource.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +0,0 @@
1
- import {
2
- HealthUri
3
- } from "../chunk-2XMYNSTI.mjs";
4
- import "../chunk-4N72FQFX.mjs";
5
- export {
6
- HealthUri
7
- };
8
- //# sourceMappingURL=HealthUri.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,12 +0,0 @@
1
- import {
2
- OriginatedError,
3
- isOriginatedError,
4
- toOriginatedError
5
- } from "../chunk-YB7NDS5U.mjs";
6
- import "../chunk-4N72FQFX.mjs";
7
- export {
8
- OriginatedError,
9
- isOriginatedError,
10
- toOriginatedError
11
- };
12
- //# sourceMappingURL=OriginatedError.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,22 +0,0 @@
1
- import {
2
- del,
3
- get,
4
- patch,
5
- post,
6
- put,
7
- search,
8
- stream,
9
- toVerbOptions
10
- } from "../chunk-W62PBGRF.mjs";
11
- import "../chunk-4N72FQFX.mjs";
12
- export {
13
- del,
14
- get,
15
- patch,
16
- post,
17
- put,
18
- search,
19
- stream,
20
- toVerbOptions
21
- };
22
- //# sourceMappingURL=Verb.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}