@twin.org/api-models 0.0.3-next.2 → 0.0.3-next.20

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/es/helpers/httpErrorHelper.js +28 -19
  2. package/dist/es/helpers/httpErrorHelper.js.map +1 -1
  3. package/dist/es/helpers/httpUrlHelper.js +92 -0
  4. package/dist/es/helpers/httpUrlHelper.js.map +1 -0
  5. package/dist/es/index.js +6 -2
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/es/models/api/IServerLivezResponse.js +2 -0
  8. package/dist/es/models/api/IServerLivezResponse.js.map +1 -0
  9. package/dist/es/models/api/IServerRootResponse.js +0 -2
  10. package/dist/es/models/api/IServerRootResponse.js.map +1 -1
  11. package/dist/es/models/protocol/IHttpRequestContext.js.map +1 -1
  12. package/dist/es/models/protocol/IHttpRequestPathParams.js.map +1 -1
  13. package/dist/es/models/protocol/IHttpRequestQuery.js.map +1 -1
  14. package/dist/es/models/protocol/IHttpServerRequest.js.map +1 -1
  15. package/dist/es/models/routes/IBaseRoute.js.map +1 -1
  16. package/dist/es/models/server/IBaseRouteProcessor.js.map +1 -1
  17. package/dist/es/models/server/IRestRouteProcessor.js.map +1 -1
  18. package/dist/es/models/services/IHealthComponentInfo.js +2 -0
  19. package/dist/es/models/services/IHealthComponentInfo.js.map +1 -0
  20. package/dist/es/models/services/IHealthInfo.js.map +1 -1
  21. package/dist/es/models/services/IHostingComponent.js +2 -0
  22. package/dist/es/models/services/IHostingComponent.js.map +1 -0
  23. package/dist/es/models/services/IInformationComponent.js.map +1 -1
  24. package/dist/es/models/services/ITenant.js +4 -0
  25. package/dist/es/models/services/ITenant.js.map +1 -0
  26. package/dist/es/models/services/ITenantAdminComponent.js +2 -0
  27. package/dist/es/models/services/ITenantAdminComponent.js.map +1 -0
  28. package/dist/types/helpers/httpErrorHelper.d.ts +6 -0
  29. package/dist/types/helpers/httpUrlHelper.d.ts +46 -0
  30. package/dist/types/index.d.ts +6 -2
  31. package/dist/types/models/api/IServerLivezResponse.d.ts +16 -0
  32. package/dist/types/models/api/IServerRootResponse.d.ts +7 -0
  33. package/dist/types/models/protocol/IHttpRequestContext.d.ts +4 -0
  34. package/dist/types/models/protocol/IHttpRequestPathParams.d.ts +1 -1
  35. package/dist/types/models/protocol/IHttpRequestQuery.d.ts +1 -1
  36. package/dist/types/models/protocol/IHttpServerRequest.d.ts +4 -4
  37. package/dist/types/models/routes/IBaseRoute.d.ts +9 -1
  38. package/dist/types/models/server/IBaseRouteProcessor.d.ts +14 -4
  39. package/dist/types/models/server/IRestRouteProcessor.d.ts +7 -2
  40. package/dist/types/models/services/IHealthComponentInfo.d.ts +18 -0
  41. package/dist/types/models/services/IHealthInfo.d.ts +2 -14
  42. package/dist/types/models/services/IHostingComponent.d.ts +24 -0
  43. package/dist/types/models/services/IInformationComponent.d.ts +9 -2
  44. package/dist/types/models/services/ITenant.d.ts +33 -0
  45. package/dist/types/models/services/ITenantAdminComponent.d.ts +63 -0
  46. package/docs/changelog.md +157 -0
  47. package/docs/reference/classes/HttpErrorHelper.md +12 -0
  48. package/docs/reference/classes/HttpUrlHelper.md +169 -0
  49. package/docs/reference/index.md +6 -2
  50. package/docs/reference/interfaces/IBaseRoute.md +17 -1
  51. package/docs/reference/interfaces/IBaseRouteProcessor.md +26 -6
  52. package/docs/reference/interfaces/IHealthComponentInfo.md +27 -0
  53. package/docs/reference/interfaces/IHealthInfo.md +1 -19
  54. package/docs/reference/interfaces/IHostingComponent.md +73 -0
  55. package/docs/reference/interfaces/IHttpRequestContext.md +8 -0
  56. package/docs/reference/interfaces/IHttpRequestPathParams.md +1 -1
  57. package/docs/reference/interfaces/IHttpRequestQuery.md +1 -1
  58. package/docs/reference/interfaces/IHttpServerRequest.md +6 -6
  59. package/docs/reference/interfaces/IInformationComponent.md +28 -2
  60. package/docs/reference/interfaces/IRestRoute.md +25 -1
  61. package/docs/reference/interfaces/IRestRouteProcessor.md +39 -9
  62. package/docs/reference/interfaces/IServerLivezResponse.md +23 -0
  63. package/docs/reference/interfaces/IServerRootResponse.md +12 -0
  64. package/docs/reference/interfaces/ISocketRequestContext.md +12 -0
  65. package/docs/reference/interfaces/ISocketRoute.md +25 -1
  66. package/docs/reference/interfaces/ISocketRouteProcessor.md +26 -6
  67. package/docs/reference/interfaces/ISocketServerRequest.md +8 -8
  68. package/docs/reference/interfaces/ITenant.md +59 -0
  69. package/docs/reference/interfaces/ITenantAdminComponent.md +193 -0
  70. package/package.json +1 -1
  71. package/dist/es/factories/authenticationGeneratorFactory.js +0 -9
  72. package/dist/es/factories/authenticationGeneratorFactory.js.map +0 -1
  73. package/dist/es/models/client/IAuthenticationGenerator.js +0 -2
  74. package/dist/es/models/client/IAuthenticationGenerator.js.map +0 -1
  75. package/dist/types/factories/authenticationGeneratorFactory.d.ts +0 -6
  76. package/dist/types/models/client/IAuthenticationGenerator.d.ts +0 -14
  77. package/docs/reference/interfaces/IAuthenticationGenerator.md +0 -35
  78. package/docs/reference/variables/AuthenticationGeneratorFactory.md +0 -5
@@ -21,12 +21,17 @@ export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> ext
21
21
  * @param route The route being requested, if a matching one was found.
22
22
  * @param contextIds The context IDs of the request.
23
23
  * @param processorState The state handed through the processors.
24
- * @param loggingComponentType The logging component type for the request.
24
+ * @param componentTypes The component types for the request.
25
+ * @param componentTypes.loggingComponentType The logging component type.
26
+ * @param componentTypes.hostingComponentType The hosting component type.
25
27
  * @returns Promise that resolves when the request is processed.
26
28
  */
27
29
  pre?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
28
30
  [id: string]: unknown;
29
- }, loggingComponentType?: string): Promise<void>;
31
+ }, componentTypes?: {
32
+ loggingComponentType?: string;
33
+ hostingComponentType?: string;
34
+ }): Promise<void>;
30
35
  /**
31
36
  * Post process the REST request for the specified route.
32
37
  * @param request The request to handle.
@@ -34,10 +39,15 @@ export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> ext
34
39
  * @param route The route being requested, if a matching one was found.
35
40
  * @param contextIds The context IDs of the request.
36
41
  * @param processorState The state handed through the processors.
37
- * @param loggingComponentType The logging component type for the request.
42
+ * @param componentTypes The component types for the request.
43
+ * @param componentTypes.loggingComponentType The logging component type.
44
+ * @param componentTypes.hostingComponentType The hosting component type.
38
45
  * @returns Promise that resolves when the request is processed.
39
46
  */
40
47
  post?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
41
48
  [id: string]: unknown;
42
- }, loggingComponentType?: string): Promise<void>;
49
+ }, componentTypes?: {
50
+ loggingComponentType?: string;
51
+ hostingComponentType?: string;
52
+ }): Promise<void>;
43
53
  }
@@ -12,10 +12,15 @@ export interface IRestRouteProcessor extends IBaseRouteProcessor<IRestRoute> {
12
12
  * @param response The response data to send if any.
13
13
  * @param route The route being requested, if a matching one was found.
14
14
  * @param processorState The state handed through the processors.
15
- * @param loggingComponentType The logging component type for the request.
15
+ * @param componentTypes The component types for the request.
16
+ * @param componentTypes.loggingComponentType The logging component type.
17
+ * @param componentTypes.hostingComponentType The hosting component type.
16
18
  * @returns Promise that resolves when the request is processed.
17
19
  */
18
20
  process?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, processorState: {
19
21
  [id: string]: unknown;
20
- }, loggingComponentType?: string): Promise<void>;
22
+ }, componentTypes?: {
23
+ loggingComponentType?: string;
24
+ hostingComponentType?: string;
25
+ }): Promise<void>;
21
26
  }
@@ -0,0 +1,18 @@
1
+ import type { HealthStatus } from "./healthStatus.js";
2
+ /**
3
+ * The health component information.
4
+ */
5
+ export interface IHealthComponentInfo {
6
+ /**
7
+ * The name of the component.
8
+ */
9
+ name: string;
10
+ /**
11
+ * The status of the component.
12
+ */
13
+ status: HealthStatus;
14
+ /**
15
+ * The details for the status.
16
+ */
17
+ details?: string;
18
+ }
@@ -1,4 +1,5 @@
1
1
  import type { HealthStatus } from "./healthStatus.js";
2
+ import type { IHealthComponentInfo } from "./IHealthComponentInfo.js";
2
3
  /**
3
4
  * The status of the server.
4
5
  */
@@ -10,18 +11,5 @@ export interface IHealthInfo {
10
11
  /**
11
12
  * The status of the components.
12
13
  */
13
- components?: {
14
- /**
15
- * The name of the component.
16
- */
17
- name: string;
18
- /**
19
- * The status of the component.
20
- */
21
- status: HealthStatus;
22
- /**
23
- * The details for the status.
24
- */
25
- details?: string;
26
- }[];
14
+ components?: IHealthComponentInfo[];
27
15
  }
@@ -0,0 +1,24 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ /**
3
+ * The information about the hosting of the API.
4
+ */
5
+ export interface IHostingComponent extends IComponent {
6
+ /**
7
+ * Get the public origin for the hosting.
8
+ * @param serverRequestUrl The url of the current server request if there is one.
9
+ * @returns The public origin.
10
+ */
11
+ getPublicOrigin(serverRequestUrl?: string): Promise<string>;
12
+ /**
13
+ * Get the public origin for the tenant if one exists.
14
+ * @param tenantId The tenant identifier.
15
+ * @returns The public origin for the tenant.
16
+ */
17
+ getTenantOrigin(tenantId: string): Promise<string | undefined>;
18
+ /**
19
+ * Build a public url based on the public origin and the url provided.
20
+ * @param url The url to build upon the public origin.
21
+ * @returns The full url based on the public origin.
22
+ */
23
+ buildPublicUrl(url: string): Promise<string>;
24
+ }
@@ -26,6 +26,11 @@ export interface IInformationComponent extends IComponent {
26
26
  * @returns The OpenAPI spec.
27
27
  */
28
28
  spec(): Promise<unknown>;
29
+ /**
30
+ * Is the server live.
31
+ * @returns True if the server is live.
32
+ */
33
+ livez(): Promise<boolean>;
29
34
  /**
30
35
  * Get the server health.
31
36
  * @returns The service health.
@@ -36,13 +41,15 @@ export interface IInformationComponent extends IComponent {
36
41
  * @param name The component name.
37
42
  * @param status The status of the component.
38
43
  * @param details The details for the status.
44
+ * @param tenantId The tenant id, optional if the health status is not tenant specific.
39
45
  * @returns Nothing.
40
46
  */
41
- setComponentHealth(name: string, status: HealthStatus, details?: string): Promise<void>;
47
+ setComponentHealth(name: string, status: HealthStatus, details?: string, tenantId?: string): Promise<void>;
42
48
  /**
43
49
  * Remove the status of a component.
44
50
  * @param name The component name.
51
+ * @param tenantId The tenant id, optional if the health status is not tenant specific.
45
52
  * @returns Nothing.
46
53
  */
47
- removeComponentHealth(name: string): Promise<void>;
54
+ removeComponentHealth(name: string, tenantId?: string): Promise<void>;
48
55
  }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Model defining the tenant.
3
+ */
4
+ export interface ITenant {
5
+ /**
6
+ * The unique identifier for the tenant.
7
+ */
8
+ id: string;
9
+ /**
10
+ * The api key for the tenant.
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * The label of the tenant.
15
+ */
16
+ label: string;
17
+ /**
18
+ * The date the tenant was created.
19
+ */
20
+ dateCreated: string;
21
+ /**
22
+ * The date the tenant was modified.
23
+ */
24
+ dateModified: string;
25
+ /**
26
+ * The public origin available to the public for accessing the API.
27
+ */
28
+ publicOrigin?: string;
29
+ /**
30
+ * Indicates whether the tenant is the node tenant.
31
+ */
32
+ isNodeTenant: boolean;
33
+ }
@@ -0,0 +1,63 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ import type { ITenant } from "./ITenant.js";
3
+ /**
4
+ * Configuration for the tenant admin component
5
+ */
6
+ export interface ITenantAdminComponent extends IComponent {
7
+ /**
8
+ * Create a tenant.
9
+ * @param tenant The tenant to store.
10
+ * @returns The tenant id.
11
+ */
12
+ create(tenant: Omit<ITenant, "id" | "dateCreated" | "dateModified"> & {
13
+ id?: string;
14
+ }): Promise<string>;
15
+ /**
16
+ * Update a tenant.
17
+ * @param tenant The tenant to update.
18
+ * @returns Nothing.
19
+ */
20
+ update(tenant: Partial<Omit<ITenant, "dateCreated" | "dateModified">>): Promise<void>;
21
+ /**
22
+ * Get a tenant by its id.
23
+ * @param tenantId The id of the tenant.
24
+ * @returns The tenant.
25
+ * @throws Error if the tenant is not found.
26
+ */
27
+ get(tenantId: string): Promise<ITenant>;
28
+ /**
29
+ * Get a tenant by its api key.
30
+ * @param apiKey The api key of the tenant.
31
+ * @returns The tenant.
32
+ * @throws Error if the tenant is not found.
33
+ */
34
+ getByApiKey(apiKey: string): Promise<ITenant>;
35
+ /**
36
+ * Get a tenant by its public origin.
37
+ * @param publicOrigin The origin of the tenant.
38
+ * @returns The tenant.
39
+ * @throws Error if the tenant is not found.
40
+ */
41
+ getByPublicOrigin(publicOrigin: string): Promise<ITenant>;
42
+ /**
43
+ * Remove a tenant by its id.
44
+ * @param tenantId The id of the tenant.
45
+ * @returns Nothing.
46
+ * @throws Error if the tenant is not found.
47
+ */
48
+ remove(tenantId: string): Promise<void>;
49
+ /**
50
+ * Query tenants with pagination.
51
+ * @param options Optional query options.
52
+ * @param options.isNodeTenant Whether to filter for node admin tenants.
53
+ * @param cursor The cursor to start from.
54
+ * @param limit The maximum number of tenants to return.
55
+ * @returns The tenants and the next cursor if more tenants are available.
56
+ */
57
+ query(options?: {
58
+ isNodeTenant?: boolean;
59
+ }, cursor?: string, limit?: number): Promise<{
60
+ tenants: ITenant[];
61
+ cursor?: string;
62
+ }>;
63
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,162 @@
1
1
  # @twin.org/api-models - Changelog
2
2
 
3
+ ## [0.0.3-next.20](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.19...api-models-v0.0.3-next.20) (2026-02-09)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **api-models:** Synchronize repo versions
9
+
10
+ ## [0.0.3-next.19](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.18...api-models-v0.0.3-next.19) (2026-02-06)
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * **api-models:** Synchronize repo versions
16
+
17
+ ## [0.0.3-next.18](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.17...api-models-v0.0.3-next.18) (2026-02-04)
18
+
19
+
20
+ ### Features
21
+
22
+ * tenant api and scopes ([#75](https://github.com/twinfoundation/api/issues/75)) ([c663141](https://github.com/twinfoundation/api/commit/c663141091e8974d769f8f9904ecdab009ebd083))
23
+
24
+ ## [0.0.3-next.17](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.16...api-models-v0.0.3-next.17) (2026-01-26)
25
+
26
+
27
+ ### Features
28
+
29
+ * update public origin building ([6c8e042](https://github.com/twinfoundation/api/commit/6c8e0422d9ddbed42a843e1c23498c99977b2fc7))
30
+
31
+ ## [0.0.3-next.16](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.15...api-models-v0.0.3-next.16) (2026-01-26)
32
+
33
+
34
+ ### Features
35
+
36
+ * public base url ([#70](https://github.com/twinfoundation/api/issues/70)) ([5b958cd](https://github.com/twinfoundation/api/commit/5b958cd91e8a38cdae2835ff5f2356c7e48d37c3))
37
+
38
+ ## [0.0.3-next.15](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.14...api-models-v0.0.3-next.15) (2026-01-22)
39
+
40
+
41
+ ### Miscellaneous Chores
42
+
43
+ * **api-models:** Synchronize repo versions
44
+
45
+ ## [0.0.3-next.14](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.13...api-models-v0.0.3-next.14) (2026-01-20)
46
+
47
+
48
+ ### Features
49
+
50
+ * export error type map ([#68](https://github.com/twinfoundation/api/issues/68)) ([697dfc4](https://github.com/twinfoundation/api/commit/697dfc4c9f6a7be493bf4b3619d7bcebf2e4584e))
51
+
52
+ ## [0.0.3-next.13](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.12...api-models-v0.0.3-next.13) (2026-01-19)
53
+
54
+
55
+ ### Features
56
+
57
+ * remove authentication generators ([#66](https://github.com/twinfoundation/api/issues/66)) ([adaa169](https://github.com/twinfoundation/api/commit/adaa1698df1c5ccb0ad645a7a7c0d3ef82ef6ac1))
58
+
59
+ ## [0.0.3-next.12](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.11...api-models-v0.0.3-next.12) (2026-01-12)
60
+
61
+
62
+ ### Miscellaneous Chores
63
+
64
+ * **api-models:** Synchronize repo versions
65
+
66
+ ## [0.0.3-next.11](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.10...api-models-v0.0.3-next.11) (2026-01-08)
67
+
68
+
69
+ ### Miscellaneous Chores
70
+
71
+ * **api-models:** Synchronize repo versions
72
+
73
+ ## [0.0.3-next.10](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.9...api-models-v0.0.3-next.10) (2026-01-05)
74
+
75
+
76
+ ### Miscellaneous Chores
77
+
78
+ * **api-models:** Synchronize repo versions
79
+
80
+ ## [0.0.3-next.9](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.8...api-models-v0.0.3-next.9) (2026-01-05)
81
+
82
+
83
+ ### Features
84
+
85
+ * add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
86
+ * add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
87
+ * add livez endpoint ([#57](https://github.com/twinfoundation/api/issues/57)) ([ef007db](https://github.com/twinfoundation/api/commit/ef007db8201736dd3053211f849ffd03baaa485e))
88
+ * add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
89
+ * add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
90
+ * add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
91
+ * add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
92
+ * decodeURIComponent for query and path params ([ead68a2](https://github.com/twinfoundation/api/commit/ead68a257425c10dd912497f7edd473c469ca132))
93
+ * eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
94
+ * update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
95
+ * update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
96
+ * update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
97
+ * use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
98
+ * use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
99
+ * validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * error handling make sure primary error takes precedence ([84b61f2](https://github.com/twinfoundation/api/commit/84b61f27fe5e4919c0c9f9a1edc8ff46dc45c1f7))
105
+
106
+ ## [0.0.3-next.8](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.7...api-models-v0.0.3-next.8) (2025-12-17)
107
+
108
+
109
+ ### Miscellaneous Chores
110
+
111
+ * **api-models:** Synchronize repo versions
112
+
113
+ ## [0.0.3-next.7](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.6...api-models-v0.0.3-next.7) (2025-11-26)
114
+
115
+
116
+ ### Bug Fixes
117
+
118
+ * error handling make sure primary error takes precedence ([84b61f2](https://github.com/twinfoundation/api/commit/84b61f27fe5e4919c0c9f9a1edc8ff46dc45c1f7))
119
+
120
+ ## [0.0.3-next.6](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.5...api-models-v0.0.3-next.6) (2025-11-20)
121
+
122
+
123
+ ### Miscellaneous Chores
124
+
125
+ * **api-models:** Synchronize repo versions
126
+
127
+ ## [0.0.3-next.5](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.4...api-models-v0.0.3-next.5) (2025-11-14)
128
+
129
+
130
+ ### Features
131
+
132
+ * decodeURIComponent for query and path params ([ead68a2](https://github.com/twinfoundation/api/commit/ead68a257425c10dd912497f7edd473c469ca132))
133
+
134
+ ## [0.0.3-next.4](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.3...api-models-v0.0.3-next.4) (2025-11-14)
135
+
136
+
137
+ ### Features
138
+
139
+ * add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
140
+ * add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
141
+ * add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
142
+ * add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
143
+ * add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
144
+ * add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
145
+ * eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
146
+ * update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
147
+ * update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
148
+ * update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
149
+ * use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
150
+ * use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
151
+ * validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
152
+
153
+ ## [0.0.3-next.3](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.2...api-models-v0.0.3-next.3) (2025-11-14)
154
+
155
+
156
+ ### Miscellaneous Chores
157
+
158
+ * **api-models:** Synchronize repo versions
159
+
3
160
  ## [0.0.3-next.2](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.1...api-models-v0.0.3-next.2) (2025-11-12)
4
161
 
5
162
 
@@ -12,6 +12,18 @@ Class to help with processing http errors.
12
12
 
13
13
  `HttpErrorHelper`
14
14
 
15
+ ## Properties
16
+
17
+ ### ERROR\_TYPE\_MAP
18
+
19
+ > `readonly` `static` **ERROR\_TYPE\_MAP**: `object`
20
+
21
+ Mapping of error types to status codes.
22
+
23
+ #### Index Signature
24
+
25
+ \[`id`: `string`\]: `HttpStatusCode`
26
+
15
27
  ## Methods
16
28
 
17
29
  ### processError()
@@ -0,0 +1,169 @@
1
+ # Class: HttpUrlHelper
2
+
3
+ Class to help with handling http URLs.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new HttpUrlHelper**(): `HttpUrlHelper`
10
+
11
+ #### Returns
12
+
13
+ `HttpUrlHelper`
14
+
15
+ ## Methods
16
+
17
+ ### extractOrigin()
18
+
19
+ > `static` **extractOrigin**(`url`): `string` \| `undefined`
20
+
21
+ Extract the origin from the url which includes protocol,host,port.
22
+
23
+ #### Parameters
24
+
25
+ ##### url
26
+
27
+ `string`
28
+
29
+ The url to extract the origin from.
30
+
31
+ #### Returns
32
+
33
+ `string` \| `undefined`
34
+
35
+ The extracted origin.
36
+
37
+ #### See
38
+
39
+ https://developer.mozilla.org/en-US/docs/Web/API/URL/origin
40
+
41
+ ***
42
+
43
+ ### extractPath()
44
+
45
+ > `static` **extractPath**(`url`): `string` \| `undefined`
46
+
47
+ Extract the path from the url.
48
+
49
+ #### Parameters
50
+
51
+ ##### url
52
+
53
+ `string`
54
+
55
+ The url to extract the path from.
56
+
57
+ #### Returns
58
+
59
+ `string` \| `undefined`
60
+
61
+ The extracted path.
62
+
63
+ #### See
64
+
65
+ https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname
66
+
67
+ ***
68
+
69
+ ### extractSearch()
70
+
71
+ > `static` **extractSearch**(`url`): `string` \| `undefined`
72
+
73
+ Extract the search from the url.
74
+
75
+ #### Parameters
76
+
77
+ ##### url
78
+
79
+ `string`
80
+
81
+ The url to extract the search from.
82
+
83
+ #### Returns
84
+
85
+ `string` \| `undefined`
86
+
87
+ The extracted search.
88
+
89
+ #### See
90
+
91
+ https://developer.mozilla.org/en-US/docs/Web/API/URL/search
92
+
93
+ ***
94
+
95
+ ### extractPathAndSearch()
96
+
97
+ > `static` **extractPathAndSearch**(`url`): `string` \| `undefined`
98
+
99
+ Extract the path and search from the url.
100
+
101
+ #### Parameters
102
+
103
+ ##### url
104
+
105
+ `string`
106
+
107
+ The url to extract the path and search from.
108
+
109
+ #### Returns
110
+
111
+ `string` \| `undefined`
112
+
113
+ The extracted path and search.
114
+
115
+ ***
116
+
117
+ ### combineParts()
118
+
119
+ > `static` **combineParts**(`origin`, `pathAndSearch`): `string` \| `undefined`
120
+
121
+ Combine the urls parts.
122
+
123
+ #### Parameters
124
+
125
+ ##### origin
126
+
127
+ `string`
128
+
129
+ The origin to combine.
130
+
131
+ ##### pathAndSearch
132
+
133
+ `string`
134
+
135
+ The path and search to combine.
136
+
137
+ #### Returns
138
+
139
+ `string` \| `undefined`
140
+
141
+ The combined parts.
142
+
143
+ ***
144
+
145
+ ### replaceOrigin()
146
+
147
+ > `static` **replaceOrigin**(`url`, `newOrigin?`): `string`
148
+
149
+ Replace the origin in the url.
150
+
151
+ #### Parameters
152
+
153
+ ##### url
154
+
155
+ `string`
156
+
157
+ The url to replace the origin in.
158
+
159
+ ##### newOrigin?
160
+
161
+ `string`
162
+
163
+ The new origin to use.
164
+
165
+ #### Returns
166
+
167
+ `string`
168
+
169
+ The url with the replaced origin.
@@ -4,15 +4,16 @@
4
4
 
5
5
  - [HttpErrorHelper](classes/HttpErrorHelper.md)
6
6
  - [HttpParameterHelper](classes/HttpParameterHelper.md)
7
+ - [HttpUrlHelper](classes/HttpUrlHelper.md)
7
8
 
8
9
  ## Interfaces
9
10
 
10
11
  - [IServerFavIconResponse](interfaces/IServerFavIconResponse.md)
11
12
  - [IServerHealthResponse](interfaces/IServerHealthResponse.md)
12
13
  - [IServerInfoResponse](interfaces/IServerInfoResponse.md)
14
+ - [IServerLivezResponse](interfaces/IServerLivezResponse.md)
13
15
  - [IServerRootResponse](interfaces/IServerRootResponse.md)
14
16
  - [IServerSpecResponse](interfaces/IServerSpecResponse.md)
15
- - [IAuthenticationGenerator](interfaces/IAuthenticationGenerator.md)
16
17
  - [IBaseRestClientConfig](interfaces/IBaseRestClientConfig.md)
17
18
  - [IBaseSocketClientConfig](interfaces/IBaseSocketClientConfig.md)
18
19
  - [IHttpRequest](interfaces/IHttpRequest.md)
@@ -51,9 +52,13 @@
51
52
  - [ISocketRouteProcessor](interfaces/ISocketRouteProcessor.md)
52
53
  - [IWebServer](interfaces/IWebServer.md)
53
54
  - [IWebServerOptions](interfaces/IWebServerOptions.md)
55
+ - [IHealthComponentInfo](interfaces/IHealthComponentInfo.md)
54
56
  - [IHealthInfo](interfaces/IHealthInfo.md)
57
+ - [IHostingComponent](interfaces/IHostingComponent.md)
55
58
  - [IInformationComponent](interfaces/IInformationComponent.md)
56
59
  - [IServerInfo](interfaces/IServerInfo.md)
60
+ - [ITenant](interfaces/ITenant.md)
61
+ - [ITenantAdminComponent](interfaces/ITenantAdminComponent.md)
57
62
 
58
63
  ## Type Aliases
59
64
 
@@ -63,7 +68,6 @@
63
68
 
64
69
  ## Variables
65
70
 
66
- - [AuthenticationGeneratorFactory](variables/AuthenticationGeneratorFactory.md)
67
71
  - [MimeTypeProcessorFactory](variables/MimeTypeProcessorFactory.md)
68
72
  - [RestRouteProcessorFactory](variables/RestRouteProcessorFactory.md)
69
73
  - [SocketRouteProcessorFactory](variables/SocketRouteProcessorFactory.md)
@@ -29,7 +29,23 @@ The path to use for routing.
29
29
 
30
30
  > `optional` **skipAuth**: `boolean`
31
31
 
32
- Skips the authentication for this route.
32
+ Skips the authentication requirement for this route.
33
+
34
+ ***
35
+
36
+ ### skipTenant?
37
+
38
+ > `optional` **skipTenant**: `boolean`
39
+
40
+ Skips the tenant requirement for this route.
41
+
42
+ ***
43
+
44
+ ### requiredScope?
45
+
46
+ > `optional` **requiredScope**: `string`[]
47
+
48
+ The user must have one of the specified scopes to access the route.
33
49
 
34
50
  ***
35
51