@truenas/api-client 6.0.2 → 7.0.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.
@@ -1,4 +1,4 @@
1
- import { BehaviorSubject, filter, switchMap, catchError, EMPTY, tap, map, finalize, take, Subject, distinctUntilChanged, of, throwError, concat, retry, startWith, shareReplay, takeUntil, combineLatest, interval, Observable, timeout, timer, race, toArray, from, defer, firstValueFrom, share, merge, takeWhile } from 'rxjs';
1
+ import { BehaviorSubject, filter, switchMap, catchError, EMPTY, tap, map, finalize, take, Subject, distinctUntilChanged, of, throwError, concat, retry, startWith, shareReplay, takeUntil, interval, Observable, timeout, timer, race, toArray, from, defer, firstValueFrom, share, merge, takeWhile } from 'rxjs';
2
2
  import { webSocket } from 'rxjs/webSocket';
3
3
  import { map as map$1, catchError as catchError$1, shareReplay as shareReplay$1 } from 'rxjs/operators';
4
4
 
@@ -3121,16 +3121,11 @@ var TrueNasConnection = class {
3121
3121
  catchError(() => EMPTY)
3122
3122
  ))
3123
3123
  );
3124
- combineLatest([
3125
- interval(twentySeconds),
3126
- this.ws$
3127
- ]).pipe(
3124
+ this.ws$.pipe(
3125
+ switchMap((ws) => ws ? interval(twentySeconds).pipe(map(() => ws)) : EMPTY),
3128
3126
  takeUntil(this.closeConnection)
3129
- ).subscribe(([, ws]) => {
3130
- if (ws) {
3131
- const pingMessage = createJsonRpcMessage("core.ping");
3132
- ws.next(pingMessage);
3133
- }
3127
+ ).subscribe((ws) => {
3128
+ ws.next(createJsonRpcMessage("core.ping"));
3134
3129
  });
3135
3130
  this.opened$.subscribe((val) => this.opened.next(val));
3136
3131
  this.closed$.subscribe(() => this.closed.next());
@@ -4207,5 +4202,5 @@ var UserRole = /* @__PURE__ */ ((UserRole2) => {
4207
4202
  })(UserRole || {});
4208
4203
 
4209
4204
  export { AppState, AuthError, AuthErrorCode, AuthResponseType, InvalidVersionResponseError, JobState, NoCompatibleVersionsError, SUPPORTED_API_VERSIONS, TrueNasApiClient, TrueNasApiClientV2510, TrueNasApiClientV26, TrueNasApiClientV27, TrueNasAuthMechanism, TrueNasAuthenticator, TrueNasConnection, UserRole, VersionCompatibility, VersionDiscovery, VersionDiscoveryError, VersionDiscoveryNetworkError, VersionDiscoveryTimeoutError, VersionEndpointNotFoundError, VersionTooNewError, VersionTooOldError, clientClassFor, consoleLogger, createTrueNasClient, getApiErrorMessage, isJobFinished, noopLogger, parseApiVersion, v25_10_0_exports, v25_10_1_exports, v25_10_2_exports, v25_10_3_exports, v25_10_4_exports, v25_10_5_exports, v26_0_0_exports, v27_0_0_exports };
4210
- //# sourceMappingURL=chunk-7QVRLQIZ.js.map
4211
- //# sourceMappingURL=chunk-7QVRLQIZ.js.map
4205
+ //# sourceMappingURL=chunk-SAJ5HZHK.js.map
4206
+ //# sourceMappingURL=chunk-SAJ5HZHK.js.map