@furystack/rest-service 13.0.0 → 14.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 (224) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +47 -28
  3. package/esm/actions/get-current-user.spec.js +10 -6
  4. package/esm/actions/get-current-user.spec.js.map +1 -1
  5. package/esm/actions/is-authenticated.spec.js +10 -6
  6. package/esm/actions/is-authenticated.spec.js.map +1 -1
  7. package/esm/actions/logout-action.spec.js +11 -9
  8. package/esm/actions/logout-action.spec.js.map +1 -1
  9. package/esm/actions/logout.js +1 -1
  10. package/esm/actions/logout.js.map +1 -1
  11. package/esm/actions/password-login-action.js +1 -1
  12. package/esm/actions/password-login-action.js.map +1 -1
  13. package/esm/actions/password-login-action.spec.js +23 -28
  14. package/esm/actions/password-login-action.spec.js.map +1 -1
  15. package/esm/authenticate.js +1 -1
  16. package/esm/authenticate.js.map +1 -1
  17. package/esm/authenticate.spec.js +41 -33
  18. package/esm/authenticate.spec.js.map +1 -1
  19. package/esm/authorize.spec.js +34 -29
  20. package/esm/authorize.spec.js.map +1 -1
  21. package/esm/endpoint-generators/create-delete-endpoint.d.ts +6 -11
  22. package/esm/endpoint-generators/create-delete-endpoint.d.ts.map +1 -1
  23. package/esm/endpoint-generators/create-delete-endpoint.js +7 -11
  24. package/esm/endpoint-generators/create-delete-endpoint.js.map +1 -1
  25. package/esm/endpoint-generators/create-delete-endpoint.spec.js +14 -21
  26. package/esm/endpoint-generators/create-delete-endpoint.spec.js.map +1 -1
  27. package/esm/endpoint-generators/create-get-collection-endpoint.d.ts +11 -11
  28. package/esm/endpoint-generators/create-get-collection-endpoint.d.ts.map +1 -1
  29. package/esm/endpoint-generators/create-get-collection-endpoint.js +13 -12
  30. package/esm/endpoint-generators/create-get-collection-endpoint.js.map +1 -1
  31. package/esm/endpoint-generators/create-get-collection-endpoint.spec.js +43 -70
  32. package/esm/endpoint-generators/create-get-collection-endpoint.spec.js.map +1 -1
  33. package/esm/endpoint-generators/create-get-entity-endpoint.d.ts +6 -11
  34. package/esm/endpoint-generators/create-get-entity-endpoint.d.ts.map +1 -1
  35. package/esm/endpoint-generators/create-get-entity-endpoint.js +7 -11
  36. package/esm/endpoint-generators/create-get-entity-endpoint.js.map +1 -1
  37. package/esm/endpoint-generators/create-get-entity-endpoint.spec.js +16 -33
  38. package/esm/endpoint-generators/create-get-entity-endpoint.spec.js.map +1 -1
  39. package/esm/endpoint-generators/create-get-openapi-document-action.d.ts +1 -1
  40. package/esm/endpoint-generators/create-get-openapi-document-action.d.ts.map +1 -1
  41. package/esm/endpoint-generators/create-get-openapi-document-action.js +1 -1
  42. package/esm/endpoint-generators/create-get-openapi-document-action.js.map +1 -1
  43. package/esm/endpoint-generators/create-get-schema-action.d.ts +1 -1
  44. package/esm/endpoint-generators/create-get-schema-action.d.ts.map +1 -1
  45. package/esm/endpoint-generators/create-get-schema-action.js.map +1 -1
  46. package/esm/endpoint-generators/create-patch-endpoint.d.ts +7 -13
  47. package/esm/endpoint-generators/create-patch-endpoint.d.ts.map +1 -1
  48. package/esm/endpoint-generators/create-patch-endpoint.js +8 -13
  49. package/esm/endpoint-generators/create-patch-endpoint.js.map +1 -1
  50. package/esm/endpoint-generators/create-patch-endpoint.spec.js +10 -17
  51. package/esm/endpoint-generators/create-patch-endpoint.spec.js.map +1 -1
  52. package/esm/endpoint-generators/create-post-endpoint.d.ts +7 -13
  53. package/esm/endpoint-generators/create-post-endpoint.d.ts.map +1 -1
  54. package/esm/endpoint-generators/create-post-endpoint.js +8 -13
  55. package/esm/endpoint-generators/create-post-endpoint.js.map +1 -1
  56. package/esm/endpoint-generators/create-post-endpoint.spec.js +41 -14
  57. package/esm/endpoint-generators/create-post-endpoint.spec.js.map +1 -1
  58. package/esm/endpoint-generators/utils.d.ts +17 -2
  59. package/esm/endpoint-generators/utils.d.ts.map +1 -1
  60. package/esm/endpoint-generators/utils.js +33 -20
  61. package/esm/endpoint-generators/utils.js.map +1 -1
  62. package/esm/get-schema-from-api.d.ts +1 -1
  63. package/esm/get-schema-from-api.d.ts.map +1 -1
  64. package/esm/get-schema-from-api.spec.js.map +1 -1
  65. package/esm/helpers.d.ts +53 -87
  66. package/esm/helpers.d.ts.map +1 -1
  67. package/esm/helpers.js +91 -92
  68. package/esm/helpers.js.map +1 -1
  69. package/esm/helpers.spec.d.ts +2 -1
  70. package/esm/helpers.spec.d.ts.map +1 -1
  71. package/esm/helpers.spec.js +41 -38
  72. package/esm/helpers.spec.js.map +1 -1
  73. package/esm/http-authentication-settings.d.ts +35 -12
  74. package/esm/http-authentication-settings.d.ts.map +1 -1
  75. package/esm/http-authentication-settings.js +21 -29
  76. package/esm/http-authentication-settings.js.map +1 -1
  77. package/esm/http-server-pool.d.ts +64 -0
  78. package/esm/http-server-pool.d.ts.map +1 -0
  79. package/esm/http-server-pool.js +95 -0
  80. package/esm/http-server-pool.js.map +1 -0
  81. package/esm/http-server-pool.spec.d.ts +2 -0
  82. package/esm/http-server-pool.spec.d.ts.map +1 -0
  83. package/esm/http-server-pool.spec.js +193 -0
  84. package/esm/http-server-pool.spec.js.map +1 -0
  85. package/esm/http-user-context.d.ts +31 -44
  86. package/esm/http-user-context.d.ts.map +1 -1
  87. package/esm/http-user-context.js +76 -95
  88. package/esm/http-user-context.js.map +1 -1
  89. package/esm/http-user-context.spec.d.ts +8 -2
  90. package/esm/http-user-context.spec.d.ts.map +1 -1
  91. package/esm/http-user-context.spec.js +189 -337
  92. package/esm/http-user-context.spec.js.map +1 -1
  93. package/esm/index.d.ts +6 -4
  94. package/esm/index.d.ts.map +1 -1
  95. package/esm/index.js +6 -4
  96. package/esm/index.js.map +1 -1
  97. package/esm/login-response-strategy.d.ts +11 -10
  98. package/esm/login-response-strategy.d.ts.map +1 -1
  99. package/esm/login-response-strategy.js +7 -6
  100. package/esm/login-response-strategy.js.map +1 -1
  101. package/esm/login-response-strategy.spec.js +25 -29
  102. package/esm/login-response-strategy.spec.js.map +1 -1
  103. package/esm/proxy-manager.spec.js +152 -176
  104. package/esm/proxy-manager.spec.js.map +1 -1
  105. package/esm/proxy-runtime.d.ts +27 -0
  106. package/esm/proxy-runtime.d.ts.map +1 -0
  107. package/esm/proxy-runtime.js +45 -0
  108. package/esm/proxy-runtime.js.map +1 -0
  109. package/esm/proxy-runtime.spec.d.ts +2 -0
  110. package/esm/proxy-runtime.spec.d.ts.map +1 -0
  111. package/esm/proxy-runtime.spec.js +39 -0
  112. package/esm/proxy-runtime.spec.js.map +1 -0
  113. package/esm/rest-api-runtime.d.ts +76 -0
  114. package/esm/rest-api-runtime.d.ts.map +1 -0
  115. package/esm/rest-api-runtime.js +131 -0
  116. package/esm/rest-api-runtime.js.map +1 -0
  117. package/esm/rest-api-runtime.spec.d.ts +2 -0
  118. package/esm/rest-api-runtime.spec.d.ts.map +1 -0
  119. package/esm/rest-api-runtime.spec.js +58 -0
  120. package/esm/rest-api-runtime.spec.js.map +1 -0
  121. package/esm/rest-service.integration.spec.d.ts +1 -1
  122. package/esm/rest-service.integration.spec.d.ts.map +1 -1
  123. package/esm/rest-service.integration.spec.js +57 -80
  124. package/esm/rest-service.integration.spec.js.map +1 -1
  125. package/esm/rest.integration.test.js +26 -84
  126. package/esm/rest.integration.test.js.map +1 -1
  127. package/esm/server-telemetry.d.ts +57 -0
  128. package/esm/server-telemetry.d.ts.map +1 -0
  129. package/esm/server-telemetry.js +26 -0
  130. package/esm/server-telemetry.js.map +1 -0
  131. package/esm/server-telemetry.spec.d.ts +2 -0
  132. package/esm/server-telemetry.spec.d.ts.map +1 -0
  133. package/esm/server-telemetry.spec.js +52 -0
  134. package/esm/server-telemetry.spec.js.map +1 -0
  135. package/esm/static-server-manager.spec.js +60 -125
  136. package/esm/static-server-manager.spec.js.map +1 -1
  137. package/esm/static-site-runtime.d.ts +21 -0
  138. package/esm/static-site-runtime.d.ts.map +1 -0
  139. package/esm/static-site-runtime.js +48 -0
  140. package/esm/static-site-runtime.js.map +1 -0
  141. package/esm/static-site-runtime.spec.d.ts +2 -0
  142. package/esm/static-site-runtime.spec.d.ts.map +1 -0
  143. package/esm/static-site-runtime.spec.js +30 -0
  144. package/esm/static-site-runtime.spec.js.map +1 -0
  145. package/esm/user-store.d.ts +39 -0
  146. package/esm/user-store.d.ts.map +1 -0
  147. package/esm/user-store.js +62 -0
  148. package/esm/user-store.js.map +1 -0
  149. package/esm/user-store.spec.d.ts +2 -0
  150. package/esm/user-store.spec.d.ts.map +1 -0
  151. package/esm/user-store.spec.js +72 -0
  152. package/esm/user-store.spec.js.map +1 -0
  153. package/esm/validate.integration.spec.js +26 -28
  154. package/esm/validate.integration.spec.js.map +1 -1
  155. package/package.json +8 -8
  156. package/src/actions/get-current-user.spec.ts +11 -10
  157. package/src/actions/is-authenticated.spec.ts +12 -7
  158. package/src/actions/logout-action.spec.ts +12 -12
  159. package/src/actions/logout.ts +1 -1
  160. package/src/actions/password-login-action.spec.ts +30 -30
  161. package/src/actions/password-login-action.ts +1 -1
  162. package/src/authenticate.spec.ts +45 -51
  163. package/src/authenticate.ts +1 -1
  164. package/src/authorize.spec.ts +37 -39
  165. package/src/endpoint-generators/create-delete-endpoint.spec.ts +16 -24
  166. package/src/endpoint-generators/create-delete-endpoint.ts +11 -17
  167. package/src/endpoint-generators/create-get-collection-endpoint.spec.ts +45 -78
  168. package/src/endpoint-generators/create-get-collection-endpoint.ts +17 -19
  169. package/src/endpoint-generators/create-get-entity-endpoint.spec.ts +17 -33
  170. package/src/endpoint-generators/create-get-entity-endpoint.ts +11 -17
  171. package/src/endpoint-generators/create-get-openapi-document-action.ts +2 -2
  172. package/src/endpoint-generators/create-get-schema-action.ts +1 -1
  173. package/src/endpoint-generators/create-patch-endpoint.spec.ts +11 -18
  174. package/src/endpoint-generators/create-patch-endpoint.ts +12 -23
  175. package/src/endpoint-generators/create-post-endpoint.spec.ts +45 -14
  176. package/src/endpoint-generators/create-post-endpoint.ts +13 -23
  177. package/src/endpoint-generators/utils.ts +36 -28
  178. package/src/get-schema-from-api.spec.ts +1 -1
  179. package/src/get-schema-from-api.ts +1 -1
  180. package/src/helpers.spec.ts +51 -41
  181. package/src/helpers.ts +140 -109
  182. package/src/http-authentication-settings.ts +51 -25
  183. package/src/http-server-pool.spec.ts +220 -0
  184. package/src/http-server-pool.ts +169 -0
  185. package/src/http-user-context.spec.ts +203 -383
  186. package/src/http-user-context.ts +114 -91
  187. package/src/index.ts +6 -4
  188. package/src/login-response-strategy.spec.ts +32 -31
  189. package/src/login-response-strategy.ts +13 -12
  190. package/src/proxy-manager.spec.ts +152 -182
  191. package/src/proxy-runtime.spec.ts +50 -0
  192. package/src/proxy-runtime.ts +75 -0
  193. package/src/rest-api-runtime.spec.ts +77 -0
  194. package/src/rest-api-runtime.ts +204 -0
  195. package/src/rest-service.integration.spec.ts +65 -85
  196. package/src/rest.integration.test.ts +27 -87
  197. package/src/server-telemetry.spec.ts +56 -0
  198. package/src/server-telemetry.ts +51 -0
  199. package/src/static-server-manager.spec.ts +63 -151
  200. package/src/static-site-runtime.spec.ts +39 -0
  201. package/src/static-site-runtime.ts +75 -0
  202. package/src/user-store.spec.ts +86 -0
  203. package/src/user-store.ts +68 -0
  204. package/src/validate.integration.spec.ts +39 -35
  205. package/esm/api-manager.d.ts +0 -104
  206. package/esm/api-manager.d.ts.map +0 -1
  207. package/esm/api-manager.js +0 -179
  208. package/esm/api-manager.js.map +0 -1
  209. package/esm/proxy-manager.d.ts +0 -53
  210. package/esm/proxy-manager.d.ts.map +0 -1
  211. package/esm/proxy-manager.js +0 -84
  212. package/esm/proxy-manager.js.map +0 -1
  213. package/esm/server-manager.d.ts +0 -48
  214. package/esm/server-manager.d.ts.map +0 -1
  215. package/esm/server-manager.js +0 -100
  216. package/esm/server-manager.js.map +0 -1
  217. package/esm/static-server-manager.d.ts +0 -19
  218. package/esm/static-server-manager.d.ts.map +0 -1
  219. package/esm/static-server-manager.js +0 -65
  220. package/esm/static-server-manager.js.map +0 -1
  221. package/src/api-manager.ts +0 -304
  222. package/src/proxy-manager.ts +0 -102
  223. package/src/server-manager.ts +0 -135
  224. package/src/static-server-manager.ts +0 -90
@@ -1,26 +1,39 @@
1
- import { addStore, InMemoryStore, User } from '@furystack/core';
1
+ import { defineStore, InMemoryStore, User } from '@furystack/core';
2
+ import { defineDataSet } from '@furystack/repository';
2
3
  import { DefaultSession } from '../models/default-session.js';
3
- import '@furystack/repository';
4
- import '../helpers.js';
5
- import { getRepository } from '@furystack/repository';
4
+ import { SessionStore, UserStore } from '../user-store.js';
5
+ /**
6
+ * Mock entity used by endpoint-generator specs.
7
+ */
6
8
  export class MockClass {
7
9
  }
10
+ /**
11
+ * Store token for {@link MockClass}. The default factory throws so each spec
12
+ * explicitly opts into an in-memory backing via `setupContext`.
13
+ */
14
+ export const MockStore = defineStore({
15
+ name: 'test/MockStore',
16
+ model: MockClass,
17
+ primaryKey: 'id',
18
+ factory: () => {
19
+ throw new Error('MockStore is not configured in this injector');
20
+ },
21
+ });
22
+ /**
23
+ * Data set token over {@link MockStore}.
24
+ */
25
+ export const MockDataSet = defineDataSet({
26
+ name: 'test/MockDataSet',
27
+ store: MockStore,
28
+ });
29
+ /**
30
+ * Binds in-memory implementations of {@link UserStore}, {@link SessionStore}
31
+ * and {@link MockStore} on the provided injector. Endpoint-generator specs
32
+ * and integration tests call this at setup time.
33
+ */
8
34
  export const setupContext = (i) => {
9
- addStore(i, new InMemoryStore({
10
- model: MockClass,
11
- primaryKey: 'id',
12
- }))
13
- .addStore(new InMemoryStore({
14
- model: User,
15
- primaryKey: 'username',
16
- }))
17
- .addStore(new InMemoryStore({
18
- model: DefaultSession,
19
- primaryKey: 'sessionId',
20
- }));
21
- getRepository(i)
22
- .createDataSet(MockClass, 'id')
23
- .createDataSet(User, 'username')
24
- .createDataSet(DefaultSession, 'sessionId');
35
+ i.bind(UserStore, () => new InMemoryStore({ model: User, primaryKey: 'username' }));
36
+ i.bind(SessionStore, () => new InMemoryStore({ model: DefaultSession, primaryKey: 'sessionId' }));
37
+ i.bind(MockStore, () => new InMemoryStore({ model: MockClass, primaryKey: 'id' }));
25
38
  };
26
39
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/endpoint-generators/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,uBAAuB,CAAA;AAC9B,OAAO,eAAe,CAAA;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,MAAM,OAAO,SAAS;CAGrB;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAW,EAAE,EAAE;IAC1C,QAAQ,CACN,CAAC,EACD,IAAI,aAAa,CAAC;QAChB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,IAAI;KACjB,CAAC,CACH;SACE,QAAQ,CACP,IAAI,aAAa,CAAC;QAChB,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,UAAU;KACvB,CAAC,CACH;SACA,QAAQ,CACP,IAAI,aAAa,CAAC;QAChB,KAAK,EAAE,cAAc;QACrB,UAAU,EAAE,WAAW;KACxB,CAAC,CACH,CAAA;IACH,aAAa,CAAC,CAAC,CAAC;SACb,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC;SAC9B,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC;SAC/B,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;AAC/C,CAAC,CAAA"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/endpoint-generators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;GAEG;AACH,MAAM,OAAO,SAAS;CAGrB;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACnC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACjE,CAAC;CACF,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAW,EAAQ,EAAE;IAChD,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IACnF,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC,CAAA;IACjG,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACpF,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { ApiEndpointSchema, RestApi, Schema } from '@furystack/rest';
2
- import type { RestApiImplementation } from './api-manager.js';
2
+ import type { RestApiImplementation } from './rest-api-runtime.js';
3
3
  export declare const defaultSchema: Schema;
4
4
  export declare const getSchemaFromApi: <T extends RestApiImplementation<RestApi>>({ api, name, description, version, }: {
5
5
  api: T;
@@ -1 +1 @@
1
- {"version":3,"file":"get-schema-from-api.d.ts","sourceRoot":"","sources":["../src/get-schema-from-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,iBAAiB,EAAU,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAG7D,eAAO,MAAM,aAAa,EAAE,MA2B3B,CAAA;AAcD,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,qBAAqB,CAAC,OAAO,CAAC,EAAE,sCAKxE;IACD,GAAG,EAAE,CAAC,CAAA;IACN,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,KAAG,iBAuBH,CAAA"}
1
+ {"version":3,"file":"get-schema-from-api.d.ts","sourceRoot":"","sources":["../src/get-schema-from-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,iBAAiB,EAAU,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAElE,eAAO,MAAM,aAAa,EAAE,MA2B3B,CAAA;AAcD,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,qBAAqB,CAAC,OAAO,CAAC,EAAE,sCAKxE;IACD,GAAG,EAAE,CAAC,CAAA;IACN,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,KAAG,iBAuBH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-schema-from-api.spec.js","sourceRoot":"","sources":["../src/get-schema-from-api.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,M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,GAAG,EAAE;oBACH,iBAAiB,EAAE;wBACjB,eAAe,EAAE,KAAK;wBACtB,IAAI,EAAE,iBAAiB;wBACvB,MAAM,EAAE,gBAAgB;wBACxB,UAAU,EAAE,eAAe;qBAC5B;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/esm/helpers.d.ts CHANGED
@@ -1,105 +1,71 @@
1
- import type { User } from '@furystack/core';
2
1
  import type { Injector } from '@furystack/inject';
3
2
  import type { RestApi } from '@furystack/rest';
4
- import type { ImplementApiOptions } from './api-manager.js';
5
3
  import { HttpAuthenticationSettings } from './http-authentication-settings.js';
6
- import type { DefaultSession } from './models/default-session.js';
7
- import type { ProxyOptions } from './proxy-manager.js';
8
- import type { StaticServerOptions } from './static-server-manager.js';
4
+ import { type ServerApi } from './http-server-pool.js';
5
+ import type { CorsOptions } from './models/cors-options.js';
6
+ import { type ProxyOptions } from './proxy-runtime.js';
7
+ import { type RestApiImplementation } from './rest-api-runtime.js';
8
+ import { type StaticServerOptions } from './static-site-runtime.js';
9
9
  /**
10
- * Sets up the @furystack/rest-service with the provided settings
11
- * @param api The API implementation details
12
- * @returns a promise that resolves when the API is added to the server
10
+ * Options accepted by {@link useRestService}. Mirrors the pre-migration
11
+ * shape, minus fields that have moved to tokens.
13
12
  */
14
- export declare const useRestService: <T extends RestApi>(api: ImplementApiOptions<T>) => Promise<{
15
- shouldExec: (msg: import("./server-manager.js").OnRequest) => boolean;
16
- onRequest: (msg: import("./server-manager.js").OnRequest) => Promise<void>;
17
- }>;
13
+ export interface ImplementApiOptions<T extends RestApi> {
14
+ /** The structure of the implemented API. */
15
+ api: RestApiImplementation<T>;
16
+ /** Injector used to resolve request-scoped services and to acquire the HTTP server. */
17
+ injector: Injector;
18
+ /** Optional host name; defaults to `localhost`. */
19
+ hostName?: string;
20
+ /** Root path prepended to every API route. */
21
+ root: string;
22
+ /** Port the API should listen on. */
23
+ port: number;
24
+ /** Optional CORS configuration applied to every matched request. */
25
+ cors?: CorsOptions;
26
+ /** Optional query-string deserialiser override. */
27
+ deserializeQueryParams?: (param: string) => Record<string, unknown>;
28
+ /** When `true`, adds `GET /schema` and `GET /openapi.json` endpoints. */
29
+ enableGetSchema?: boolean;
30
+ /** OpenAPI display name. */
31
+ name?: string;
32
+ /** OpenAPI description. */
33
+ description?: string;
34
+ /** OpenAPI version. */
35
+ version?: string;
36
+ }
18
37
  /**
19
- * Sets up the HTTP Authentication with pluggable providers.
38
+ * Acquires a pooled HTTP server, compiles the user-supplied API definition
39
+ * and attaches a {@link ServerApi} that dispatches matching requests.
20
40
  *
21
- * Registers Basic Auth (if enabled) and Cookie Auth as built-in providers,
22
- * then appends any custom providers passed via settings.
41
+ * Public contract is unchanged from the pre-migration release; internally
42
+ * everything goes through the functional tokens.
43
+ */
44
+ export declare const useRestService: <T extends RestApi>(options: ImplementApiOptions<T>) => Promise<ServerApi>;
45
+ /**
46
+ * Installs HTTP authentication on the given injector: builds the provider
47
+ * chain (Basic + Cookie by default), appends any caller-provided providers
48
+ * and rebinds {@link HttpAuthenticationSettings}.
23
49
  *
24
- * @param injector The Injector instance
25
- * @param settings Settings for HTTP Authentication
50
+ * Prerequisite: {@link UserStore} and {@link SessionStore} must be bound to
51
+ * persistent implementations before calling this helper, since the Basic
52
+ * and Cookie providers need to read users and sessions immediately.
26
53
  */
27
- export declare const useHttpAuthentication: <TUser extends User, TSession extends DefaultSession>(injector: Injector, settings?: Partial<HttpAuthenticationSettings<TUser, TSession>>) => void;
54
+ export declare const useHttpAuthentication: (injector: Injector, overrides?: Partial<HttpAuthenticationSettings>) => void;
28
55
  /**
29
- * Sets up a static file server
30
- * @param options The settings for the static file server
31
- * @param options.injector The Injector instance
32
- * @param options.settings Settings for the static file server
33
- * @returns a promise that resolves when the server is ready
56
+ * Attaches a static-file {@link ServerApi} to the pooled HTTP server
57
+ * identified by `options.port`/`options.hostName`.
34
58
  */
35
59
  export declare const useStaticFiles: (options: {
36
60
  injector: Injector;
37
- } & StaticServerOptions) => Promise<void>;
61
+ } & StaticServerOptions) => Promise<ServerApi>;
38
62
  /**
39
- * Sets up a proxy server that forwards HTTP requests from a source URL to a target URL.
40
- *
41
- * The proxy acts as an intermediary, forwarding requests and responses while allowing
42
- * transformation of headers, cookies, and paths. It returns 502 Bad Gateway on errors
43
- * and emits 'onProxyFailed' events for monitoring.
44
- *
45
- * WebSocket connections can also be proxied by setting `enableWebsockets: true`, allowing
46
- * bidirectional real-time communication through the proxy.
47
- *
48
- * @param options The settings for the proxy server
49
- * @param options.injector The Injector instance
50
- * @param options.sourceBaseUrl The base URL path to match for proxying (e.g., '/api', '/old').
51
- * Can be specified with or without a trailing slash.
52
- * @param options.targetBaseUrl The target server URL (must be a valid HTTP/HTTPS URL)
53
- * @param options.pathRewrite Optional function to rewrite the path before forwarding.
54
- * Receives the path after sourceBaseUrl, including leading slash and query string.
55
- * Example: for 'GET /api/users?active=true' with sourceBaseUrl='/api',
56
- * pathRewrite receives '/users?active=true'
57
- * @param options.sourceHostName The hostname for the source server (optional, defaults to all interfaces)
58
- * @param options.sourcePort The port for the source server
59
- * @param options.headers Optional function to transform request headers.
60
- * **Note**: Receives headers AFTER filtering hop-by-hop headers
61
- * (Connection, Keep-Alive, Transfer-Encoding, Upgrade, etc.) for security
62
- * and protocol compliance. The proxy automatically adds X-Forwarded-* headers.
63
- * This transformation applies to both HTTP and WebSocket requests.
64
- * @param options.cookies Optional function to transform request cookies (array of cookie strings)
65
- * @param options.responseCookies Optional function to transform response Set-Cookie headers
66
- * @param options.timeout Optional timeout in milliseconds for proxy requests (default: 30000).
67
- * If exceeded, the request is aborted and 502 is returned.
68
- * Applies to both HTTP and WebSocket upgrade requests.
69
- * @param options.enableWebsockets Optional flag to enable WebSocket proxying (default: false).
70
- * When enabled, WebSocket upgrade requests will be forwarded to the target.
71
- * @returns a promise that resolves when the proxy is set up
72
- * @example
73
- * ```ts
74
- * // Basic HTTP proxy with timeout
75
- * await useProxy({
76
- * injector,
77
- * sourceBaseUrl: '/api',
78
- * targetBaseUrl: 'https://api.example.com',
79
- * sourcePort: 3000,
80
- * timeout: 5000,
81
- * })
82
- *
83
- * // Proxy with WebSocket support
84
- * await useProxy({
85
- * injector,
86
- * sourceBaseUrl: '/ws',
87
- * targetBaseUrl: 'https://ws.example.com',
88
- * sourcePort: 3000,
89
- * enableWebsockets: true,
90
- * })
91
- *
92
- * // Proxy with error monitoring (HTTP and WebSocket)
93
- * const proxyManager = injector.getInstance(ProxyManager)
94
- * proxyManager.subscribe('onProxyFailed', ({ from, to, error }) => {
95
- * console.error(`HTTP Proxy failed: ${from} -> ${to}`, error)
96
- * })
97
- * proxyManager.subscribe('onWebSocketProxyFailed', ({ from, to, error }) => {
98
- * console.error(`WebSocket Proxy failed: ${from} -> ${to}`, error)
99
- * })
100
- * ```
63
+ * Attaches a proxy {@link ServerApi} that forwards HTTP (and optionally
64
+ * WebSocket) traffic from `options.sourceBaseUrl` to `options.targetBaseUrl`.
65
+ * Emits `onProxyFailed` and `onWebSocketProxyFailed` events into the shared
66
+ * {@link ServerTelemetryToken} — subscribe there for observability.
101
67
  */
102
68
  export declare const useProxy: (options: {
103
69
  injector: Injector;
104
- } & ProxyOptions) => Promise<void>;
70
+ } & ProxyOptions) => Promise<ServerApi>;
105
71
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAI9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAM3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,E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IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAAG,YAAY,KAAG,OAAO,CAAC,SAAS,CAQhG,CAAA"}
package/esm/helpers.js CHANGED
@@ -1,119 +1,118 @@
1
1
  import { useSystemIdentityContext } from '@furystack/core';
2
2
  import { PasswordAuthenticator } from '@furystack/security';
3
- import { ApiManager } from './api-manager.js';
3
+ import { PathHelper } from '@furystack/utils';
4
4
  import { createBasicAuthProvider } from './authentication-providers/basic-auth-provider.js';
5
5
  import { createCookieAuthProvider } from './authentication-providers/cookie-auth-provider.js';
6
6
  import { authenticateUserWithDataSet, findSessionById, findUserByName } from './authentication-providers/helpers.js';
7
- import { HttpAuthenticationSettings } from './http-authentication-settings.js';
8
- import { ProxyManager } from './proxy-manager.js';
9
- import { StaticServerManager } from './static-server-manager.js';
7
+ import { CreateGetOpenApiDocumentAction } from './endpoint-generators/create-get-openapi-document-action.js';
8
+ import { CreateGetSchemaAction } from './endpoint-generators/create-get-schema-action.js';
9
+ import { defaultHttpAuthenticationSettings, HttpAuthenticationSettings } from './http-authentication-settings.js';
10
+ import { HttpServerPoolToken } from './http-server-pool.js';
11
+ import { HttpUserContext } from './http-user-context.js';
12
+ import { buildProxyServerApi } from './proxy-runtime.js';
13
+ import { compileApi, onRestApiMessage, shouldExecRequest } from './rest-api-runtime.js';
14
+ import { ServerTelemetryToken } from './server-telemetry.js';
15
+ import { buildStaticSiteServerApi } from './static-site-runtime.js';
10
16
  /**
11
- * Sets up the @furystack/rest-service with the provided settings
12
- * @param api The API implementation details
13
- * @returns a promise that resolves when the API is added to the server
17
+ * Acquires a pooled HTTP server, compiles the user-supplied API definition
18
+ * and attaches a {@link ServerApi} that dispatches matching requests.
19
+ *
20
+ * Public contract is unchanged from the pre-migration release; internally
21
+ * everything goes through the functional tokens.
14
22
  */
15
- export const useRestService = async (api) => await api.injector.getInstance(ApiManager).addApi({ ...api });
23
+ export const useRestService = async (options) => {
24
+ const { injector, api, hostName, port, root, cors, deserializeQueryParams, enableGetSchema, name, description, version, } = options;
25
+ const extendedApi = enableGetSchema
26
+ ? {
27
+ ...api,
28
+ GET: {
29
+ ...api.GET,
30
+ '/schema': CreateGetSchemaAction(api, name, description, version),
31
+ '/openapi.json': CreateGetOpenApiDocumentAction(api, name, description, version),
32
+ },
33
+ }
34
+ : api;
35
+ const supportedMethods = Object.keys(extendedApi);
36
+ const rootApiPath = PathHelper.normalize(root);
37
+ const compiledApi = compileApi(extendedApi, root);
38
+ const serverApi = {
39
+ shouldExec: ({ req }) => shouldExecRequest({
40
+ method: req.method?.toUpperCase(),
41
+ url: PathHelper.normalize(req.url || ''),
42
+ rootApiPath,
43
+ supportedMethods,
44
+ }),
45
+ onRequest: (msg) => onRestApiMessage({
46
+ ...msg,
47
+ compiledApi,
48
+ rootApiPath,
49
+ port,
50
+ supportedMethods,
51
+ cors,
52
+ injector,
53
+ hostName,
54
+ deserializeQueryParams,
55
+ }),
56
+ };
57
+ const pool = injector.get(HttpServerPoolToken);
58
+ const record = await pool.acquire({ port, hostName });
59
+ record.apis.push(serverApi);
60
+ return serverApi;
61
+ };
16
62
  /**
17
- * Sets up the HTTP Authentication with pluggable providers.
63
+ * Installs HTTP authentication on the given injector: builds the provider
64
+ * chain (Basic + Cookie by default), appends any caller-provided providers
65
+ * and rebinds {@link HttpAuthenticationSettings}.
18
66
  *
19
- * Registers Basic Auth (if enabled) and Cookie Auth as built-in providers,
20
- * then appends any custom providers passed via settings.
21
- *
22
- * @param injector The Injector instance
23
- * @param settings Settings for HTTP Authentication
67
+ * Prerequisite: {@link UserStore} and {@link SessionStore} must be bound to
68
+ * persistent implementations before calling this helper, since the Basic
69
+ * and Cookie providers need to read users and sessions immediately.
24
70
  */
25
- export const useHttpAuthentication = (injector, settings) => {
26
- const mergedSettings = Object.assign(new HttpAuthenticationSettings(), settings);
71
+ export const useHttpAuthentication = (injector, overrides) => {
72
+ const mergedSettings = {
73
+ ...defaultHttpAuthenticationSettings(),
74
+ ...overrides,
75
+ };
27
76
  const systemInjector = useSystemIdentityContext({ injector, username: 'useHttpAuthentication' });
28
- const passwordAuthenticator = injector.getInstance(PasswordAuthenticator);
29
- const userDataSet = mergedSettings.getUserDataSet(systemInjector);
30
- const sessionDataSet = mergedSettings.getSessionDataSet(systemInjector);
77
+ const passwordAuthenticator = injector.get(PasswordAuthenticator);
78
+ const userDataSet = systemInjector.get(mergedSettings.userDataSet);
79
+ const sessionDataSet = systemInjector.get(mergedSettings.sessionDataSet);
31
80
  const providers = [];
32
81
  if (mergedSettings.enableBasicAuth) {
33
82
  providers.push(createBasicAuthProvider((username, password) => authenticateUserWithDataSet(passwordAuthenticator, userDataSet, systemInjector, username, password)));
34
83
  }
35
84
  providers.push(createCookieAuthProvider(mergedSettings.cookieName, (sessionId) => findSessionById(sessionDataSet, systemInjector, sessionId), (username) => findUserByName(userDataSet, systemInjector, username)));
36
- providers.push(...(settings?.authenticationProviders ?? []));
85
+ providers.push(...(overrides?.authenticationProviders ?? []));
37
86
  mergedSettings.authenticationProviders = providers;
38
- injector.setExplicitInstance(mergedSettings, HttpAuthenticationSettings);
87
+ injector.bind(HttpAuthenticationSettings, () => mergedSettings);
88
+ injector.invalidate(HttpAuthenticationSettings);
89
+ injector.invalidate(HttpUserContext);
39
90
  };
40
91
  /**
41
- * Sets up a static file server
42
- * @param options The settings for the static file server
43
- * @param options.injector The Injector instance
44
- * @param options.settings Settings for the static file server
45
- * @returns a promise that resolves when the server is ready
92
+ * Attaches a static-file {@link ServerApi} to the pooled HTTP server
93
+ * identified by `options.port`/`options.hostName`.
46
94
  */
47
- export const useStaticFiles = (options) => {
95
+ export const useStaticFiles = async (options) => {
48
96
  const { injector, ...settings } = options;
49
- return injector.getInstance(StaticServerManager).addStaticSite(settings);
97
+ const pool = injector.get(HttpServerPoolToken);
98
+ const record = await pool.acquire({ port: settings.port, hostName: settings.hostName });
99
+ const serverApi = buildStaticSiteServerApi(settings);
100
+ record.apis.push(serverApi);
101
+ return serverApi;
50
102
  };
51
103
  /**
52
- * Sets up a proxy server that forwards HTTP requests from a source URL to a target URL.
53
- *
54
- * The proxy acts as an intermediary, forwarding requests and responses while allowing
55
- * transformation of headers, cookies, and paths. It returns 502 Bad Gateway on errors
56
- * and emits 'onProxyFailed' events for monitoring.
57
- *
58
- * WebSocket connections can also be proxied by setting `enableWebsockets: true`, allowing
59
- * bidirectional real-time communication through the proxy.
60
- *
61
- * @param options The settings for the proxy server
62
- * @param options.injector The Injector instance
63
- * @param options.sourceBaseUrl The base URL path to match for proxying (e.g., '/api', '/old').
64
- * Can be specified with or without a trailing slash.
65
- * @param options.targetBaseUrl The target server URL (must be a valid HTTP/HTTPS URL)
66
- * @param options.pathRewrite Optional function to rewrite the path before forwarding.
67
- * Receives the path after sourceBaseUrl, including leading slash and query string.
68
- * Example: for 'GET /api/users?active=true' with sourceBaseUrl='/api',
69
- * pathRewrite receives '/users?active=true'
70
- * @param options.sourceHostName The hostname for the source server (optional, defaults to all interfaces)
71
- * @param options.sourcePort The port for the source server
72
- * @param options.headers Optional function to transform request headers.
73
- * **Note**: Receives headers AFTER filtering hop-by-hop headers
74
- * (Connection, Keep-Alive, Transfer-Encoding, Upgrade, etc.) for security
75
- * and protocol compliance. The proxy automatically adds X-Forwarded-* headers.
76
- * This transformation applies to both HTTP and WebSocket requests.
77
- * @param options.cookies Optional function to transform request cookies (array of cookie strings)
78
- * @param options.responseCookies Optional function to transform response Set-Cookie headers
79
- * @param options.timeout Optional timeout in milliseconds for proxy requests (default: 30000).
80
- * If exceeded, the request is aborted and 502 is returned.
81
- * Applies to both HTTP and WebSocket upgrade requests.
82
- * @param options.enableWebsockets Optional flag to enable WebSocket proxying (default: false).
83
- * When enabled, WebSocket upgrade requests will be forwarded to the target.
84
- * @returns a promise that resolves when the proxy is set up
85
- * @example
86
- * ```ts
87
- * // Basic HTTP proxy with timeout
88
- * await useProxy({
89
- * injector,
90
- * sourceBaseUrl: '/api',
91
- * targetBaseUrl: 'https://api.example.com',
92
- * sourcePort: 3000,
93
- * timeout: 5000,
94
- * })
95
- *
96
- * // Proxy with WebSocket support
97
- * await useProxy({
98
- * injector,
99
- * sourceBaseUrl: '/ws',
100
- * targetBaseUrl: 'https://ws.example.com',
101
- * sourcePort: 3000,
102
- * enableWebsockets: true,
103
- * })
104
- *
105
- * // Proxy with error monitoring (HTTP and WebSocket)
106
- * const proxyManager = injector.getInstance(ProxyManager)
107
- * proxyManager.subscribe('onProxyFailed', ({ from, to, error }) => {
108
- * console.error(`HTTP Proxy failed: ${from} -> ${to}`, error)
109
- * })
110
- * proxyManager.subscribe('onWebSocketProxyFailed', ({ from, to, error }) => {
111
- * console.error(`WebSocket Proxy failed: ${from} -> ${to}`, error)
112
- * })
113
- * ```
104
+ * Attaches a proxy {@link ServerApi} that forwards HTTP (and optionally
105
+ * WebSocket) traffic from `options.sourceBaseUrl` to `options.targetBaseUrl`.
106
+ * Emits `onProxyFailed` and `onWebSocketProxyFailed` events into the shared
107
+ * {@link ServerTelemetryToken} — subscribe there for observability.
114
108
  */
115
- export const useProxy = (options) => {
109
+ export const useProxy = async (options) => {
116
110
  const { injector, ...settings } = options;
117
- return injector.getInstance(ProxyManager).addProxy(settings);
111
+ const telemetry = injector.get(ServerTelemetryToken);
112
+ const pool = injector.get(HttpServerPoolToken);
113
+ const record = await pool.acquire({ port: settings.sourcePort, hostName: settings.sourceHostName });
114
+ const serverApi = buildProxyServerApi(settings, telemetry);
115
+ record.apis.push(serverApi);
116
+ return serverApi;
118
117
  };
119
118
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAA;AAC3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1 +1 @@
1
- {"version":3,"file":"helpers.spec.d.ts","sourceRoot":"","sources":["../src/helpers.spec.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"helpers.spec.d.ts","sourceRoot":"","sources":["../src/helpers.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AA4G3C,YAAY,EAAE,IAAI,EAAE,CAAA"}