@syncbridge/pinggy 0.4.19 → 0.4.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.
@@ -13,6 +13,7 @@ export declare class PinggyTcpClientComponent<TEvents extends PinggyTcpClientCom
13
13
  protected _reconnectTimer?: NodeJS.Timeout;
14
14
  values: PinggyTcpClientVariables;
15
15
  get connected(): boolean;
16
+ protected _init(): Promise<void>;
16
17
  protected _start(abortSignal: AbortSignal): Promise<void>;
17
18
  protected _stop(): Promise<void>;
18
19
  write(data: string | Buffer): void;
@@ -18,6 +18,18 @@ let PinggyTcpClientComponent = class PinggyTcpClientComponent extends IoClientBa
18
18
  get connected() {
19
19
  return !!this._socket;
20
20
  }
21
+ async _init() {
22
+ await super._init();
23
+ this.on('values-updated', async () => {
24
+ const isStopped = this.stopped;
25
+ await this._stop();
26
+ if (!isStopped) {
27
+ await this._start(new AbortController().signal).catch(err => {
28
+ this.setStatus(ServiceStatus.unhealthy, err.message);
29
+ });
30
+ }
31
+ });
32
+ }
21
33
  async _start(abortSignal) {
22
34
  await super._start(abortSignal);
23
35
  this._stopping = false;
@@ -12,6 +12,7 @@ __decorate([
12
12
  type: VariableType.Secret,
13
13
  description: 'Pingy auth token. https://dashboard.pinggy.io/managetokens',
14
14
  required: true,
15
+ hotPlug: true,
15
16
  }),
16
17
  __metadata("design:type", String)
17
18
  ], PinggyTcpClientVariables.prototype, "authToken", void 0);
@@ -20,6 +21,7 @@ __decorate([
20
21
  label: 'Local Port',
21
22
  description: 'Local port number which pinggy process connection to be served. If not set, a port number will be automatically selected',
22
23
  default: 0,
24
+ hotPlug: true,
23
25
  }),
24
26
  __metadata("design:type", Number)
25
27
  ], PinggyTcpClientVariables.prototype, "localPort", void 0);
package/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = '0.4.19';
1
+ export const version = '0.4.20';
2
2
  export const noOp = () => undefined;
3
3
  export const panatesAuthor = {
4
4
  name: 'Panates Technology AS',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncbridge/pinggy",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "description": "SyncBridge Pinggy component",
5
5
  "author": "Panates Inc",
6
6
  "license": "UNLICENSED",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "peerDependencies": {
14
14
  "@syncbridge/common": "^0.6.0",
15
- "@syncbridge/builtins": "^0.4.19"
15
+ "@syncbridge/builtins": "^0.4.20"
16
16
  },
17
17
  "exports": {
18
18
  ".": {