@freerdp-bridge/nestjs 0.0.0-stage → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FreeRDP Browser Bridge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,84 @@
1
- # Temporary Holding Version
1
+ # @freerdp-bridge/nestjs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Purpose
4
+
5
+ NestJS module for mounting FreeRDP Browser Bridge HTTP/WebSocket routes on the
6
+ application's existing port. Uses the existing session/media engine and one
7
+ native C++ worker per session; FreeRDP runs outside Node.js.
8
+
9
+ NestJS integration introduced in **0.2.2**, with Express and FastifyAdapter
10
+ profiles. All bridge packages and the native runtime use one product version.
11
+
12
+ ## Installation
13
+
14
+ Install the published release on Linux x64/glibc:
15
+
16
+ ```sh
17
+ npm install @freerdp-bridge/nestjs@0.2.2 @freerdp-bridge/runtime-linux-x64-gnu@0.2.2
18
+ ```
19
+
20
+ On Windows x64 select `@freerdp-bridge/runtime-win32-x64` instead. All bridge
21
+ packages and the runtime must share the same product version. The runtime is
22
+ an explicit dependency and includes ready binaries/private libraries; consumers
23
+ need no GCC, CMake or system FreeRDP.
24
+
25
+ ## Requirements
26
+
27
+ Node.js 24, ESM and NestJS 12.2 with its Express or Fastify HTTP/1.1 adapter.
28
+ Install the usual Nest common/core, selected platform adapter, reflect-metadata
29
+ and RxJS dependencies in the host application. Node.js and a browser are not
30
+ bundled. macOS, ARM and musl runtime packages are not provided here.
31
+
32
+ ## Usage
33
+
34
+ ```ts
35
+ import { Module } from '@nestjs/common';
36
+ import { RdpBridgeModule, resolveNativeRuntime } from '@freerdp-bridge/nestjs';
37
+
38
+ @Module({
39
+ imports: [RdpBridgeModule.forRootAsync({
40
+ useFactory: async () => ({
41
+ prefix: '/rdp',
42
+ worker: await resolveNativeRuntime({ runtimeRoot: '/private/run/rdp-bridge' }),
43
+ allowedOrigins: ['https://app.example'],
44
+ authenticate: request => verifyApplicationIdentity(request),
45
+ }),
46
+ })],
47
+ })
48
+ export class AppModule {}
49
+ ```
50
+
51
+ Provide verified host bearer/mTLS authentication returning `{ id: verifiedId }`
52
+ or undefined; `verifyApplicationIdentity` is application-owned. Cookies require
53
+ a separate CSRF/Origin adapter and are refused. Use an absolute Windows path
54
+ for runtimeRoot on Windows. `forRoot` accepts ready options; `forRootAsync`
55
+ supports imports/inject/useFactory for configuration through Nest DI.
56
+
57
+ After `app.init()` or `app.listen()`, get `RdpBridgeService` for `diagnostics()`, independent
58
+ `close()` and manual `handleUpgrade(request, socket, head)` dispatch. Set
59
+ `upgradeMode: 'manual'` when the host owns a catch-all WebSocket router. False
60
+ leaves foreign upgrades untouched. Retain the closed service in that dispatcher
61
+ until host shutdown. Nest shutdown joins bridge-owned resources.
62
+ The provider installs Express routing before the default body parser, while
63
+ worker admission and resource allocation wait for Nest initialization. A close
64
+ during startup joins that work and then retires its resources.
65
+
66
+ The optional `./browser` export provides `referenceBrowserDirectory`. Serve
67
+ those assets through the host static router and set client `basePath: '/rdp'`.
68
+
69
+ ## Limitations
70
+
71
+ The prefix is explicit and independent of Nest's global controller prefix.
72
+ Bridge authentication/validation/lifecycle are owned by the bridge; Nest
73
+ controller guards/pipes/interceptors are not implicitly applied to these raw
74
+ HTTP/WS routes. The host owns external TLS, destination policy and access-log
75
+ redaction. Bodies are limited to 64 KiB before bridge parsing. Default Express
76
+ body-parser ordering is handled by the provider factory; custom middleware
77
+ that has already consumed a bridge body is refused, not reparsed. RDP server
78
+ certificates remain strict by default. Capabilities/device policy and named
79
+ RDP acceptance remain separate from framework integration tests.
80
+
81
+ ## License
82
+
83
+ Project-owned code is MIT (LICENSE). Native dependencies retain their own terms
84
+ in the separate runtime's THIRD_PARTY_NOTICES.md, licenses and corresponding-source/.
@@ -0,0 +1 @@
1
+ export { referenceBrowserDirectory } from '@freerdp-bridge/api/browser';
@@ -0,0 +1,2 @@
1
+ export { referenceBrowserDirectory } from '@freerdp-bridge/api/browser';
2
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { RdpBridgeModule, RdpBridgeService, type RdpBridgeModuleOptions, type RdpBridgeModuleAsyncOptions, } from './module.js';
2
+ export { resolveNativeRuntime, NativeRuntimeError, NativeSessionWorker, WorkerProcess, SessionManager, SessionError, createSecureLogger, } from '@freerdp-bridge/api/fastify';
3
+ export type { WorkerOptions, Principal, SessionCreate, NativeRuntimeOptions, BridgeHandle, } from '@freerdp-bridge/api/fastify';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { RdpBridgeModule, RdpBridgeService, } from './module.js';
2
+ export { resolveNativeRuntime, NativeRuntimeError, NativeSessionWorker, WorkerProcess, SessionManager, SessionError, createSecureLogger, } from '@freerdp-bridge/api/fastify';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,GAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import 'reflect-metadata';
2
+ import type { DynamicModule, FactoryProvider, ModuleMetadata, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
3
+ import { HttpAdapterHost } from '@nestjs/core';
4
+ import { type IncomingMessage } from 'node:http';
5
+ import type { Duplex } from 'node:stream';
6
+ import { type RdpBridgePluginOptions, type BridgeHandle } from '@freerdp-bridge/api/fastify';
7
+ export interface RdpBridgeModuleOptions extends Omit<RdpBridgePluginOptions, 'onReady'> {
8
+ prefix: string;
9
+ authenticate: NonNullable<RdpBridgePluginOptions['authenticate']>;
10
+ }
11
+ export interface RdpBridgeModuleAsyncOptions {
12
+ imports?: ModuleMetadata['imports'];
13
+ inject?: FactoryProvider<RdpBridgeModuleOptions>['inject'];
14
+ useFactory: FactoryProvider<RdpBridgeModuleOptions>['useFactory'];
15
+ }
16
+ /** Created by the factory before Nest installs its global body parsers. */
17
+ export declare class RdpBridgeService implements OnModuleInit, OnModuleDestroy {
18
+ private readonly adapterHost;
19
+ private readonly options;
20
+ private bridge;
21
+ private router;
22
+ private host;
23
+ private automatic;
24
+ private closing;
25
+ private initialization;
26
+ private retirement;
27
+ private failed;
28
+ private release;
29
+ private readonly prefix;
30
+ private readonly manual;
31
+ private constructor();
32
+ static create(host: HttpAdapterHost, options: RdpBridgeModuleOptions): RdpBridgeService;
33
+ private owns;
34
+ private ready;
35
+ diagnostics(): ReturnType<BridgeHandle['diagnostics']>;
36
+ handleUpgrade(request: IncomingMessage, socket: Duplex, head: Buffer): boolean;
37
+ private install;
38
+ onModuleInit(): Promise<void>;
39
+ private retire;
40
+ close(): Promise<void>;
41
+ onModuleDestroy(): Promise<void>;
42
+ }
43
+ export declare class RdpBridgeModule {
44
+ static forRoot(options: RdpBridgeModuleOptions): DynamicModule;
45
+ static forRootAsync(options: RdpBridgeModuleAsyncOptions): DynamicModule;
46
+ }
package/dist/module.js ADDED
@@ -0,0 +1,243 @@
1
+ import 'reflect-metadata';
2
+ import { Module } from '@nestjs/common';
3
+ import { HttpAdapterHost } from '@nestjs/core';
4
+ import Fastify from 'fastify';
5
+ import { Server as HttpServer, } from 'node:http';
6
+ import { Server as HttpsServer } from 'node:https';
7
+ import { rdpBridgePlugin, } from '@freerdp-bridge/api/fastify';
8
+ const reservations = new WeakMap();
9
+ const optionsToken = Symbol('RDP_BRIDGE_OPTIONS');
10
+ const fail = (code) => Object.assign(new Error(code), { code });
11
+ const server = (value) => {
12
+ if (!(value instanceof HttpServer) && !(value instanceof HttpsServer))
13
+ throw fail('NEST_BRIDGE_HTTP1_REQUIRED');
14
+ return value;
15
+ };
16
+ /** Created by the factory before Nest installs its global body parsers. */
17
+ export class RdpBridgeService {
18
+ adapterHost;
19
+ options;
20
+ bridge;
21
+ router;
22
+ host;
23
+ automatic;
24
+ closing;
25
+ initialization;
26
+ retirement;
27
+ failed = false;
28
+ release = () => undefined;
29
+ prefix;
30
+ manual;
31
+ constructor(adapterHost, options) {
32
+ this.adapterHost = adapterHost;
33
+ this.options = options;
34
+ this.prefix = options.prefix;
35
+ this.manual = options.upgradeMode === 'manual';
36
+ }
37
+ static create(host, options) {
38
+ if (process.versions.node.split('.')[0] !== '24')
39
+ throw fail('NEST_BRIDGE_NODE_VERSION');
40
+ if (!options || typeof options.authenticate !== 'function')
41
+ throw fail('NEST_BRIDGE_IDENTITY_REQUIRED');
42
+ if (typeof options.prefix !== 'string' ||
43
+ options.prefix.length > 128 ||
44
+ !/^(?:\/[A-Za-z0-9_-]+){1,16}$/.test(options.prefix))
45
+ throw fail('BRIDGE_PREFIX_INVALID');
46
+ if (options.upgradeMode !== undefined &&
47
+ !['automatic', 'manual'].includes(options.upgradeMode))
48
+ throw fail('BRIDGE_UPGRADE_MODE_INVALID');
49
+ const adapter = host.httpAdapter;
50
+ if (!adapter || !['express', 'fastify'].includes(adapter.getType()))
51
+ throw fail('NEST_BRIDGE_ADAPTER_UNSUPPORTED');
52
+ const instance = adapter.getInstance();
53
+ if (!instance || !['object', 'function'].includes(typeof instance))
54
+ throw fail('NEST_BRIDGE_ADAPTER_UNSUPPORTED');
55
+ const key = instance;
56
+ const prefixes = reservations.get(key) ?? new Set();
57
+ if (prefixes.size >= 16 ||
58
+ [...prefixes].some((prefix) => prefix === options.prefix ||
59
+ prefix.startsWith(options.prefix + '/') ||
60
+ options.prefix.startsWith(prefix + '/')))
61
+ throw fail('BRIDGE_PREFIX_CONFLICT');
62
+ prefixes.add(options.prefix);
63
+ reservations.set(key, prefixes);
64
+ const service = new RdpBridgeService(host, { ...options });
65
+ service.release = () => {
66
+ prefixes.delete(service.prefix);
67
+ if (!prefixes.size)
68
+ reservations.delete(key);
69
+ };
70
+ try {
71
+ if (adapter.getType() === 'fastify') {
72
+ const fastify = instance;
73
+ server(fastify.server);
74
+ }
75
+ else {
76
+ const express = instance;
77
+ if (typeof express.use !== 'function')
78
+ throw fail('NEST_BRIDGE_ADAPTER_UNSUPPORTED');
79
+ express.use((request, response, next) => {
80
+ if (service.failed || !service.owns(request.url ?? ''))
81
+ return next();
82
+ if (!service.router || service.closing) {
83
+ response.writeHead(503, {
84
+ 'content-type': 'application/json',
85
+ 'cache-control': 'no-store',
86
+ });
87
+ response.end('{"code":"SERVER_CLOSING","message":"Bridge is not accepting requests","retryable":false}');
88
+ return;
89
+ }
90
+ const hasBody = request.headers['transfer-encoding'] !== undefined ||
91
+ Number(request.headers['content-length'] ?? 0) > 0;
92
+ if (request.body !== undefined ||
93
+ (hasBody && request.readableEnded)) {
94
+ response.writeHead(400, {
95
+ 'content-type': 'application/json',
96
+ 'cache-control': 'no-store',
97
+ });
98
+ response.end('{"code":"BRIDGE_RAW_BODY_REQUIRED","message":"Bridge requires the raw request body","retryable":false}');
99
+ return;
100
+ }
101
+ service.router.routing(request, response);
102
+ });
103
+ }
104
+ return service;
105
+ }
106
+ catch {
107
+ service.failed = true;
108
+ service.release();
109
+ throw fail('NEST_BRIDGE_INSTALL_FAILED');
110
+ }
111
+ }
112
+ owns(target) {
113
+ return (target.startsWith(this.prefix) &&
114
+ [undefined, '/', '?'].includes(target[this.prefix.length]));
115
+ }
116
+ ready() {
117
+ if (!this.bridge)
118
+ throw fail('NEST_BRIDGE_NOT_READY');
119
+ return this.bridge;
120
+ }
121
+ diagnostics() {
122
+ return this.ready().diagnostics();
123
+ }
124
+ handleUpgrade(request, socket, head) {
125
+ if (!this.owns(request.url ?? ''))
126
+ return false;
127
+ if (!this.bridge) {
128
+ socket.end('HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\nContent-Length: 0\r\n\r\n');
129
+ return true;
130
+ }
131
+ return this.bridge.handleUpgrade(request, socket, head);
132
+ }
133
+ async install() {
134
+ if (this.closing)
135
+ return;
136
+ this.host = server(this.adapterHost.httpAdapter.getHttpServer());
137
+ const adapter = this.adapterHost.httpAdapter;
138
+ // Allocation waits until Nest initialization, after all providers resolve.
139
+ // The early Express middleware above still precedes its default parser.
140
+ const router = adapter.getType() === 'fastify'
141
+ ? adapter.getInstance()
142
+ : Fastify({ logger: false, bodyLimit: 65536 });
143
+ if (adapter.getType() === 'express')
144
+ this.router = router;
145
+ await router.register(rdpBridgePlugin, {
146
+ ...this.options,
147
+ upgradeMode: 'manual',
148
+ onReady: (handle) => {
149
+ this.bridge = handle;
150
+ },
151
+ });
152
+ if (this.router)
153
+ await this.router.ready();
154
+ if (!this.bridge)
155
+ throw fail('NEST_BRIDGE_NOT_READY');
156
+ if (!this.manual && !this.closing) {
157
+ this.automatic = (request, socket, head) => {
158
+ this.handleUpgrade(request, socket, head);
159
+ };
160
+ this.host.on('upgrade', this.automatic);
161
+ }
162
+ }
163
+ onModuleInit() {
164
+ return (this.initialization ??= this.install().catch(async () => {
165
+ this.failed = true;
166
+ try {
167
+ await this.retire();
168
+ }
169
+ finally {
170
+ this.release();
171
+ }
172
+ throw fail('NEST_BRIDGE_INSTALL_FAILED');
173
+ }));
174
+ }
175
+ retire() {
176
+ return (this.retirement ??= (async () => {
177
+ if (this.automatic)
178
+ this.host?.off('upgrade', this.automatic);
179
+ try {
180
+ await this.bridge?.close();
181
+ await this.router?.close();
182
+ }
183
+ catch {
184
+ throw fail('NEST_BRIDGE_CLEANUP_FAILED');
185
+ }
186
+ })());
187
+ }
188
+ close() {
189
+ return (this.closing ??= (async () => {
190
+ await this.initialization?.catch(() => undefined);
191
+ await this.retire();
192
+ })());
193
+ }
194
+ async onModuleDestroy() {
195
+ try {
196
+ await this.close();
197
+ }
198
+ finally {
199
+ this.release();
200
+ }
201
+ }
202
+ }
203
+ const serviceProvider = {
204
+ provide: RdpBridgeService,
205
+ inject: [HttpAdapterHost, optionsToken],
206
+ useFactory: (host, options) => RdpBridgeService.create(host, options),
207
+ };
208
+ export class RdpBridgeModule {
209
+ static forRoot(options) {
210
+ return {
211
+ module: RdpBridgeModule,
212
+ providers: [
213
+ { provide: optionsToken, useValue: options },
214
+ serviceProvider,
215
+ ],
216
+ exports: [RdpBridgeService],
217
+ };
218
+ }
219
+ static forRootAsync(options) {
220
+ return {
221
+ module: RdpBridgeModule,
222
+ imports: options.imports ?? [],
223
+ providers: [
224
+ {
225
+ provide: optionsToken,
226
+ inject: options.inject ?? [],
227
+ useFactory: async (...values) => {
228
+ try {
229
+ return await options.useFactory(...values);
230
+ }
231
+ catch {
232
+ throw fail('NEST_BRIDGE_OPTIONS_FAILED');
233
+ }
234
+ },
235
+ },
236
+ serviceProvider,
237
+ ],
238
+ exports: [RdpBridgeService],
239
+ };
240
+ }
241
+ }
242
+ Module({})(RdpBridgeModule);
243
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,OAAiC,MAAM,SAAS,CAAC;AACxD,OAAO,EACL,MAAM,IAAI,UAAU,GAGrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EACL,eAAe,GAGhB,MAAM,6BAA6B,CAAC;AAqBrC,MAAM,YAAY,GAAG,IAAI,OAAO,EAAuB,CAAC;AACxD,MAAM,YAAY,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACxE,MAAM,MAAM,GAAG,CAAC,KAAc,EAAc,EAAE;IAC5C,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC;QACnE,MAAM,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,2EAA2E;AAC3E,MAAM,OAAO,gBAAgB;IAgBR;IACA;IAhBX,MAAM,CAA2B;IACjC,MAAM,CAA8B;IACpC,IAAI,CAAyB;IAC7B,SAAS,CAEH;IACN,OAAO,CAA4B;IACnC,cAAc,CAA4B;IAC1C,UAAU,CAA4B;IACtC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Y,CAAC;IACvC,UAAU,EAAE,CAAC,IAAqB,EAAE,OAA+B,EAAE,EAAE,CACrE,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,OAAO,eAAe;IAC1B,MAAM,CAAC,OAAO,CAAC,OAA+B;QAC5C,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAC5C,eAAe;aAChB;YACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC5B,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,YAAY,CAAC,OAAoC;QACtD,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;YAC9B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,YAAY;oBACrB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;oBAC5B,UAAU,EAAE,KAAK,EAAE,GAAG,MAAiB,EAAE,EAAE;wBACzC,IAAI,CAAC;4BACH,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;wBAC7C,CAAC;wBAAC,MAAM,CAAC;4BACP,MAAM,IAAI,CAAC,4BAA4B,CAAC,CAAC;wBAC3C,CAAC;oBACH,CAAC;iBACF;gBACD,eAAe;aAChB;YACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC5B,CAAC;IACJ,CAAC;CACF;AACD,MAAM,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@freerdp-bridge/nestjs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.2",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">=24 <25"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "LICENSE",
12
+ "README.md"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./browser": {
20
+ "types": "./dist/browser.d.ts",
21
+ "import": "./dist/browser.js"
22
+ }
23
+ },
24
+ "dependencies": {
25
+ "fastify": "5.12.5",
26
+ "@freerdp-bridge/api": "0.2.2"
27
+ },
28
+ "peerDependencies": {
29
+ "@nestjs/common": "^12.2.0",
30
+ "@nestjs/core": "^12.2.0",
31
+ "reflect-metadata": "^0.2.2"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc -b"
35
+ }
6
36
  }