@senhainfo/shared-utils 1.2.2 → 1.2.3

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.
@@ -1,16 +1,22 @@
1
1
  import { Service, ServiceConfig } from "node-windows";
2
+ interface WindowsServiceOptions extends Partial<ServiceConfig> {
3
+ name: string;
4
+ description: string;
5
+ script: string;
6
+ }
2
7
  export declare class WindowsService {
3
8
  private options;
4
9
  service: Service;
5
10
  /**
6
11
  * Constructor
7
- * @param {ServiceConfig} config - Configuration for the Windows service
12
+ * @param {WindowsServiceOptions} options - Options for the Windows service
8
13
  *
9
14
  * @default { name: "Senha API - Service", script: "dist/server.js" }
10
15
  *
11
16
  * @example
12
17
  * const service = new WindowsService({ name: "My Service", script: "path/to/service" });
13
18
  */
14
- constructor(config?: ServiceConfig);
19
+ constructor(options: WindowsServiceOptions);
15
20
  }
21
+ export {};
16
22
  //# sourceMappingURL=windows-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"windows-service.d.ts","sourceRoot":"","sources":["../src/windows-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAIb;IAEK,OAAO,EAAE,OAAO,CAA6B;IAEpD;;;;;;;;OAQG;gBACS,MAAM,CAAC,EAAE,aAAa;CAuBnC"}
1
+ {"version":3,"file":"windows-service.d.ts","sourceRoot":"","sources":["../src/windows-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtD,UAAU,qBAAsB,SAAQ,OAAO,CAAC,aAAa,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IAExB;;;;;;;;OAQG;gBACS,OAAO,EAAE,qBAAqB;CAqB3C"}
@@ -1,31 +1,18 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.WindowsService = void 0;
7
- const node_windows_1 = require("node-windows");
8
- const node_path_1 = __importDefault(require("node:path"));
9
4
  class WindowsService {
10
5
  /**
11
6
  * Constructor
12
- * @param {ServiceConfig} config - Configuration for the Windows service
7
+ * @param {WindowsServiceOptions} options - Options for the Windows service
13
8
  *
14
9
  * @default { name: "Senha API - Service", script: "dist/server.js" }
15
10
  *
16
11
  * @example
17
12
  * const service = new WindowsService({ name: "My Service", script: "path/to/service" });
18
13
  */
19
- constructor(config) {
20
- this.options = {
21
- name: "Senha API - Service",
22
- description: "Senha API - Service",
23
- script: node_path_1.default.join("dist", "server.js"),
24
- };
25
- this.service = new node_windows_1.Service(this.options);
26
- if (config) {
27
- Object.assign(this.options, config);
28
- }
14
+ constructor(options) {
15
+ Object.assign(this.options, options);
29
16
  this.service
30
17
  .on("install", () => {
31
18
  this.service.start();
@@ -1 +1 @@
1
- {"version":3,"file":"windows-service.js","sourceRoot":"","sources":["../src/windows-service.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAsD;AACtD,0DAA6B;AAE7B,MAAa,cAAc;IASzB;;;;;;;;OAQG;IACH,YAAY,MAAsB;QAjB1B,YAAO,GAAkB;YAC/B,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,qBAAqB;YAClC,MAAM,EAAE,mBAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC;SACvC,CAAC;QAEK,YAAO,GAAY,IAAI,sBAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAYlD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO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CAAC,kBAAkB,EAAE,GAAG,EAAE;YAC3B,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,wBAAwB,CAAC,CAAC;QACrE,CAAC,CAAC;aACD,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,CAAC;QAC5D,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC,CAAC;aACD,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAlCD,wCAkCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senhainfo/shared-utils",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "repository": "https://github.com/senha-info/senha-shared-utils.git",
5
5
  "author": "Bruno Gaspar <bruninhoogaspar@gmail.com>",
6
6
  "license": "MIT",