@opra/nestjs-socketio 1.26.3 → 1.27.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.
package/README.md CHANGED
@@ -1,3 +1,26 @@
1
- # OPRA
1
+ # @opra/nestjs-socketio
2
2
 
3
- Open Protocol for Restful Api
3
+ [![NPM Version][npm-image]][npm-url]
4
+ [![NPM Downloads][downloads-image]][downloads-url]
5
+ [![CI Tests][ci-test-image]][ci-test-url]
6
+ [![Test Coverage][coveralls-image]][coveralls-url]
7
+
8
+
9
+ ## Support
10
+ You can report bugs and discuss features on the [GitHub issues](https://github.com/panates/opra/issues) page.
11
+
12
+ ## Node Compatibility
13
+ - node >= 20.x
14
+
15
+
16
+ ## License
17
+ Available under [MIT](LICENSE) license.
18
+
19
+ [npm-image]: https://img.shields.io/npm/v/@opra/nestjs-socketio
20
+ [npm-url]: https://npmjs.org/package/@opra/nestjs-socketio
21
+ [downloads-image]: https://img.shields.io/npm/dm/@opra/nestjs-socketio.svg
22
+ [downloads-url]: https://npmjs.org/package/@opra/nestjs-socketio
23
+ [ci-test-image]: https://github.com/panates/opra/actions/workflows/test.yml/badge.svg
24
+ [ci-test-url]: https://github.com/panates/opra/actions/workflows/test.yml
25
+ [coveralls-image]: https://coveralls.io/repos/github/panates/opra/badge.svg?branch=main
26
+ [coveralls-url]: https://coveralls.io/github/panates/opra?branch=main
@@ -3,35 +3,66 @@ import type { ApiDocumentFactory } from '@opra/common';
3
3
  import type { SocketioAdapter } from '@opra/socketio';
4
4
  import * as socketio from 'socket.io';
5
5
  export declare namespace OpraSocketioModule {
6
+ /**
7
+ * Synchronous configuration options for OpraSocketioModule.
8
+ */
6
9
  export interface ModuleOptions extends BaseModuleOptions, ApiConfig {
7
10
  }
11
+ /**
12
+ * Asynchronous configuration options for OpraSocketioModule.
13
+ */
8
14
  export interface AsyncModuleOptions extends BaseModuleOptions {
15
+ /** Providers to be injected into the factory function */
9
16
  inject?: any[];
17
+ /** Factory function that returns the ApiConfig object asynchronously */
10
18
  useFactory?: (...args: any[]) => Promise<ApiConfig> | ApiConfig;
11
19
  }
20
+ /**
21
+ * Base configuration options for the module.
22
+ */
12
23
  interface BaseModuleOptions extends Pick<DynamicModule, 'imports' | 'providers' | 'exports' | 'controllers' | 'global'> {
24
+ /** Custom token for the module */
13
25
  token?: any;
26
+ /** Port the Socket.io server will listen on */
14
27
  port?: number;
28
+ /** Socket.io server options */
15
29
  serverOptions?: Partial<socketio.ServerOptions>;
30
+ /** Interceptor list for the Socket.io adapter */
16
31
  interceptors?: (SocketioAdapter.InterceptorFunction | SocketioAdapter.IWSInterceptor | Type<SocketioAdapter.IWSInterceptor>)[];
17
32
  }
33
+ /**
34
+ * OPRA Socket.io API configuration details.
35
+ */
18
36
  export interface ApiConfig extends Pick<ApiDocumentFactory.InitArguments, 'types' | 'references' | 'info'> {
37
+ /** API name */
19
38
  name: string;
39
+ /** API description */
20
40
  description?: string;
41
+ /** API scope */
21
42
  scope?: string;
43
+ /** Logger to be used */
22
44
  logger?: Logger;
23
45
  }
24
46
  export {};
25
47
  }
48
+ /**
49
+ * OpraSocketioModule
50
+ *
51
+ * Module that integrates OPRA Socket.io support into the NestJS application.
52
+ */
26
53
  export declare class OpraSocketioModule {
27
54
  /**
55
+ * Configures the module synchronously and imports it at the root level.
28
56
  *
29
- * @param init
57
+ * @param init - Module configuration options.
58
+ * @returns {DynamicModule} NestJS dynamic module.
30
59
  */
31
60
  static forRoot(init: OpraSocketioModule.ModuleOptions): DynamicModule;
32
61
  /**
62
+ * Configures the module asynchronously and imports it at the root level.
33
63
  *
34
- * @param options
64
+ * @param options - Asynchronous module configuration options.
65
+ * @returns {DynamicModule} NestJS dynamic module.
35
66
  */
36
67
  static forRootAsync(options: OpraSocketioModule.AsyncModuleOptions): DynamicModule;
37
68
  }
@@ -2,10 +2,17 @@ var OpraSocketioModule_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { Module } from '@nestjs/common';
4
4
  import { OpraSocketioCoreModule } from './opra-socketio-core.module.js';
5
+ /**
6
+ * OpraSocketioModule
7
+ *
8
+ * Module that integrates OPRA Socket.io support into the NestJS application.
9
+ */
5
10
  let OpraSocketioModule = OpraSocketioModule_1 = class OpraSocketioModule {
6
11
  /**
12
+ * Configures the module synchronously and imports it at the root level.
7
13
  *
8
- * @param init
14
+ * @param init - Module configuration options.
15
+ * @returns {DynamicModule} NestJS dynamic module.
9
16
  */
10
17
  static forRoot(init) {
11
18
  return {
@@ -14,8 +21,10 @@ let OpraSocketioModule = OpraSocketioModule_1 = class OpraSocketioModule {
14
21
  };
15
22
  }
16
23
  /**
24
+ * Configures the module asynchronously and imports it at the root level.
17
25
  *
18
- * @param options
26
+ * @param options - Asynchronous module configuration options.
27
+ * @returns {DynamicModule} NestJS dynamic module.
19
28
  */
20
29
  static forRootAsync(options) {
21
30
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/nestjs-socketio",
3
- "version": "1.26.3",
3
+ "version": "1.27.0",
4
4
  "description": "Opra NestJS Socket.io Module",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -9,10 +9,10 @@
9
9
  "tslib": "^2.8.1"
10
10
  },
11
11
  "peerDependencies": {
12
- "@opra/common": "^1.26.3",
13
- "@opra/core": "^1.26.3",
14
- "@opra/nestjs": "^1.26.3",
15
- "@opra/socketio": "^1.26.3",
12
+ "@opra/common": "^1.27.0",
13
+ "@opra/core": "^1.27.0",
14
+ "@opra/nestjs": "^1.27.0",
15
+ "@opra/socketio": "^1.27.0",
16
16
  "@nestjs/common": "^10.0.0 || ^11.0.0",
17
17
  "@nestjs/core": "^10.0.0 || ^11.0.0",
18
18
  "socket.io": "^4.8.3"