hcloud-sdk 22.7.0 → 22.8.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/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
- ## [22.7.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.6.0...v22.7.0) (2026-07-24)
1
+ ## [22.8.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.7.0...v22.8.0) (2026-07-29)
2
2
 
3
3
  ### Features
4
4
 
5
- * update error codes ([dccfcf8](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/dccfcf8a1e07eed7840727555f4c656efd8f2715))
5
+ * add method to reconnect to nats ([c200268](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/c200268fcb6660e5da21cacf1930e055c24940e0))
@@ -45,6 +45,10 @@ declare class Nats extends Base {
45
45
  requestAndWaitForResponse(subject: string, type: NatsMessageType, objectType: NatsObjectType, object: unknown, options?: RequestOptions): Promise<Msg | undefined>;
46
46
  respond(msg: Msg | RawMsg, data: unknown): void;
47
47
  protected getEndpoint(endpoint: string): string;
48
+ /**
49
+ * Gracefully reconnect the NATS connection (experimental).
50
+ */
51
+ reconnect(): Promise<void>;
48
52
  /**
49
53
  * Gracefully closes the NATS connection.
50
54
  * * This method uses 'drain' to ensure that all outgoing messages are sent
@@ -61,6 +61,7 @@ class Nats extends Base_1.default {
61
61
  (_b = (_a = entry.sub).callback) === null || _b === void 0 ? void 0 : _b.call(_a, err, msg ? msg : {});
62
62
  });
63
63
  }
64
+ this.natsConnection.reconnect();
64
65
  return this.natsConnection;
65
66
  });
66
67
  }
@@ -150,6 +151,16 @@ class Nats extends Base_1.default {
150
151
  getEndpoint(endpoint) {
151
152
  return `${this.options.server}/ws/nats${endpoint}`;
152
153
  }
154
+ /**
155
+ * Gracefully reconnect the NATS connection (experimental).
156
+ */
157
+ reconnect() {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ if (this.natsConnection && !this.natsConnection.isClosed()) {
160
+ yield this.natsConnection.reconnect();
161
+ }
162
+ });
163
+ }
153
164
  /**
154
165
  * Gracefully closes the NATS connection.
155
166
  * * This method uses 'drain' to ensure that all outgoing messages are sent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "22.7.0",
3
+ "version": "22.8.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",