@truenas/api-client 7.0.2 → 9.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.
@@ -1648,9 +1648,9 @@ __export(v25_10_5_exports, {
1648
1648
  ZfsTierRewriteJobEntryStatusInput: () => ZfsTierRewriteJobEntryStatusInput
1649
1649
  });
1650
1650
 
1651
- // src/generated/v26_0_0/index.ts
1652
- var v26_0_0_exports = {};
1653
- __export(v26_0_0_exports, {
1651
+ // src/generated/v27_0_0/index.ts
1652
+ var v27_0_0_exports = {};
1653
+ __export(v27_0_0_exports, {
1654
1654
  ACLTemplateEntryAcltypeInput: () => ACLTemplateEntryAcltypeInput,
1655
1655
  Access: () => Access,
1656
1656
  Aclmode: () => Aclmode,
@@ -1783,7 +1783,7 @@ __export(v26_0_0_exports, {
1783
1783
  ZpoolScrubRunAction: () => ZpoolScrubRunAction
1784
1784
  });
1785
1785
 
1786
- // src/generated/v26_0_0/api-types.ts
1786
+ // src/generated/v27_0_0/api-types.ts
1787
1787
  var Access = {
1788
1788
  Readonly: "READONLY",
1789
1789
  Writeonly: "WRITEONLY",
@@ -1905,9 +1905,9 @@ var ZpoolScrubRunAction = {
1905
1905
  Cancel: "CANCEL"
1906
1906
  };
1907
1907
 
1908
- // src/generated/v27_0_0/index.ts
1909
- var v27_0_0_exports = {};
1910
- __export(v27_0_0_exports, {
1908
+ // src/generated/v28_0_0/index.ts
1909
+ var v28_0_0_exports = {};
1910
+ __export(v28_0_0_exports, {
1911
1911
  ACLTemplateEntryAcltypeInput: () => ACLTemplateEntryAcltypeInput,
1912
1912
  Access: () => Access,
1913
1913
  Aclmode: () => Aclmode,
@@ -1930,7 +1930,7 @@ __export(v27_0_0_exports, {
1930
1930
  CloudTaskAttributesEncryption: () => CloudTaskAttributesEncryption,
1931
1931
  CloudTaskAttributesEncryptionInput: () => CloudTaskAttributesEncryptionInput,
1932
1932
  Code: () => Code,
1933
- Compression: () => Compression,
1933
+ Compression: () => Compression2,
1934
1934
  ContainerNICDeviceType: () => ContainerNICDeviceType,
1935
1935
  ContainerNICDeviceTypeInput: () => ContainerNICDeviceTypeInput,
1936
1936
  ContainerStatusState: () => ContainerStatusState,
@@ -2008,6 +2008,7 @@ __export(v27_0_0_exports, {
2008
2008
  Snapdir: () => Snapdir,
2009
2009
  SourceInput: () => SourceInput,
2010
2010
  SourceValueType: () => SourceValueType,
2011
+ SourceValueTypeInput: () => SourceValueTypeInput,
2011
2012
  SupportNewTicketCommunityTypeInput: () => SupportNewTicketCommunityTypeInput,
2012
2013
  Sync: () => Sync,
2013
2014
  SyslogServerTransport: () => SyslogServerTransport,
@@ -2041,7 +2042,67 @@ __export(v27_0_0_exports, {
2041
2042
  ZpoolScrubRunAction: () => ZpoolScrubRunAction
2042
2043
  });
2043
2044
 
2044
- // src/generated/v27_0_0/api-types.ts
2045
+ // src/generated/v28_0_0/api-types.ts
2046
+ var Compression2 = {
2047
+ On: "ON",
2048
+ Off: "OFF",
2049
+ Lz4: "LZ4",
2050
+ Gzip: "GZIP",
2051
+ Gzip1: "GZIP-1",
2052
+ Gzip2: "GZIP-2",
2053
+ Gzip3: "GZIP-3",
2054
+ Gzip4: "GZIP-4",
2055
+ Gzip5: "GZIP-5",
2056
+ Gzip6: "GZIP-6",
2057
+ Gzip7: "GZIP-7",
2058
+ Gzip8: "GZIP-8",
2059
+ Gzip9: "GZIP-9",
2060
+ Zstd: "ZSTD",
2061
+ ZstdFast: "ZSTD-FAST",
2062
+ Zle: "ZLE",
2063
+ Lzjb: "LZJB",
2064
+ Zstd1: "ZSTD-1",
2065
+ Zstd2: "ZSTD-2",
2066
+ Zstd3: "ZSTD-3",
2067
+ Zstd4: "ZSTD-4",
2068
+ Zstd5: "ZSTD-5",
2069
+ Zstd6: "ZSTD-6",
2070
+ Zstd7: "ZSTD-7",
2071
+ Zstd8: "ZSTD-8",
2072
+ Zstd9: "ZSTD-9",
2073
+ Zstd10: "ZSTD-10",
2074
+ Zstd11: "ZSTD-11",
2075
+ Zstd12: "ZSTD-12",
2076
+ Zstd13: "ZSTD-13",
2077
+ Zstd14: "ZSTD-14",
2078
+ Zstd15: "ZSTD-15",
2079
+ Zstd16: "ZSTD-16",
2080
+ Zstd17: "ZSTD-17",
2081
+ Zstd18: "ZSTD-18",
2082
+ Zstd19: "ZSTD-19",
2083
+ ZstdFast1: "ZSTD-FAST-1",
2084
+ ZstdFast2: "ZSTD-FAST-2",
2085
+ ZstdFast3: "ZSTD-FAST-3",
2086
+ ZstdFast4: "ZSTD-FAST-4",
2087
+ ZstdFast5: "ZSTD-FAST-5",
2088
+ ZstdFast6: "ZSTD-FAST-6",
2089
+ ZstdFast7: "ZSTD-FAST-7",
2090
+ ZstdFast8: "ZSTD-FAST-8",
2091
+ ZstdFast9: "ZSTD-FAST-9",
2092
+ ZstdFast10: "ZSTD-FAST-10",
2093
+ ZstdFast20: "ZSTD-FAST-20",
2094
+ ZstdFast30: "ZSTD-FAST-30",
2095
+ ZstdFast40: "ZSTD-FAST-40",
2096
+ ZstdFast50: "ZSTD-FAST-50",
2097
+ ZstdFast60: "ZSTD-FAST-60",
2098
+ ZstdFast70: "ZSTD-FAST-70",
2099
+ ZstdFast80: "ZSTD-FAST-80",
2100
+ ZstdFast90: "ZSTD-FAST-90",
2101
+ ZstdFast100: "ZSTD-FAST-100",
2102
+ ZstdFast500: "ZSTD-FAST-500",
2103
+ ZstdFast1000: "ZSTD-FAST-1000",
2104
+ Inherit: "INHERIT"
2105
+ };
2045
2106
  var Service2 = {
2046
2107
  Middleware: "MIDDLEWARE",
2047
2108
  S3: "S3",
@@ -2049,6 +2110,14 @@ var Service2 = {
2049
2110
  Sudo: "SUDO",
2050
2111
  System: "SYSTEM"
2051
2112
  };
2113
+ var SourceValueTypeInput = {
2114
+ None: "NONE",
2115
+ Default: "DEFAULT",
2116
+ Temporary: "TEMPORARY",
2117
+ Local: "LOCAL",
2118
+ Inherited: "INHERITED",
2119
+ Received: "RECEIVED"
2120
+ };
2052
2121
  var VMWareMatchDatastoresWithDatasetsResultFilesystemTypeInput = {
2053
2122
  Filesystem: "FILESYSTEM",
2054
2123
  Volume: "VOLUME"
@@ -2062,8 +2131,8 @@ var SUPPORTED_API_VERSIONS = [
2062
2131
  "v25.10.3",
2063
2132
  "v25.10.4",
2064
2133
  "v25.10.5",
2065
- "v26.0.0",
2066
- "v27.0.0"
2134
+ "v27.0.0",
2135
+ "v28.0.0"
2067
2136
  ];
2068
2137
 
2069
2138
  // src/types/api-version.type.ts
@@ -2071,6 +2140,7 @@ var VersionCompatibility = /* @__PURE__ */ ((VersionCompatibility2) => {
2071
2140
  VersionCompatibility2["Compatible"] = "compatible";
2072
2141
  VersionCompatibility2["TooOld"] = "too-old";
2073
2142
  VersionCompatibility2["TooNew"] = "too-new";
2143
+ VersionCompatibility2["Unsupported"] = "unsupported";
2074
2144
  VersionCompatibility2["Invalid"] = "invalid";
2075
2145
  return VersionCompatibility2;
2076
2146
  })(VersionCompatibility || {});
@@ -2272,7 +2342,7 @@ var TrueNasApi = class {
2272
2342
  *
2273
2343
  * The id comes from the first job event whose `message_ids` carries this
2274
2344
  * request's id, not from the response: what a job method returns on the wire
2275
- * differs by version (v25.10 answers with the id, v26 with `null`), while
2345
+ * differs by version (v25.10 answers with the id, v27 with `null`), while
2276
2346
  * the event correlation holds for both.
2277
2347
  *
2278
2348
  * @returns Observable that emits the job ID when received from websocket events
@@ -2429,7 +2499,7 @@ var apiVersionConfig = {
2429
2499
  * not write its client, so the ceiling is the newest version in
2430
2500
  * `CLIENT_BY_VERSION_KEY`. A factory test asserts the two agree.
2431
2501
  */
2432
- MAX_SUPPORTED_VERSION: "v27.0.0",
2502
+ MAX_SUPPORTED_VERSION: "v28.0.0",
2433
2503
  /**
2434
2504
  * Version assumed when discovery is CORS-blocked, as v25.10.0's
2435
2505
  * `/api/versions` is. Used only for an appliance that answers a reachability
@@ -2489,6 +2559,9 @@ function checkVersionCompatibility(version) {
2489
2559
  if (compareVersions(version, maxVersion) > 0) {
2490
2560
  return "too-new" /* TooNew */;
2491
2561
  }
2562
+ if (!SUPPORTED_API_VERSIONS.includes(version.version)) {
2563
+ return "unsupported" /* Unsupported */;
2564
+ }
2492
2565
  return "compatible" /* Compatible */;
2493
2566
  }
2494
2567
  function isVersionSupported(version) {
@@ -2594,7 +2667,7 @@ var TrueNasAuthenticator = class _TrueNasAuthenticator {
2594
2667
  /**
2595
2668
  * `login_options` asking for a reconnect token, when the server understands it.
2596
2669
  *
2597
- * Omitted below v26. `AuthCommonOptions` is `additionalProperties: false`
2670
+ * Omitted below v27. `AuthCommonOptions` is `additionalProperties: false`
2598
2671
  * there and has only `user_info`, so sending the member is a validation
2599
2672
  * error, not an ignored field — it would fail login outright on the oldest
2600
2673
  * version this client supports.
@@ -2602,7 +2675,7 @@ var TrueNasAuthenticator = class _TrueNasAuthenticator {
2602
2675
  /**
2603
2676
  * Two things this does not do, both deliberate and both worth knowing.
2604
2677
  *
2605
- * There is no way for a consumer to decline: every v26+ password login now
2678
+ * There is no way for a consumer to decline: every v27+ password login now
2606
2679
  * mints a single-use credential carrying that session's roles, whether or not
2607
2680
  * the caller wants one. And the auto-relogin in the constructor subscribes
2608
2681
  * with no observer, so the token it mints is dropped — a caller reconnecting
@@ -2737,7 +2810,7 @@ var TrueNasAuthenticator = class _TrueNasAuthenticator {
2737
2810
  * e.g. to open another connection without asking for the password again.
2738
2811
  *
2739
2812
  * Tokens are single-use, short-lived, and voided by a `middlewared` restart.
2740
- * On v26+ each successful login mints a new one; store the newest. Token
2813
+ * On v27+ each successful login mints a new one; store the newest. Token
2741
2814
  * sessions are not re-logged automatically on reconnect — the caller must.
2742
2815
  */
2743
2816
  loginWithToken(token) {
@@ -2796,7 +2869,7 @@ var TrueNasAuthenticator = class _TrueNasAuthenticator {
2796
2869
  );
2797
2870
  }
2798
2871
  /**
2799
- * No reconnect token is requested here, though v26+ would mint one: an
2872
+ * No reconnect token is requested here, though v27+ would mint one: an
2800
2873
  * api-key session already reconnects without a prompt, since the key is held
2801
2874
  * and replayed. The token exists for the credential that cannot be.
2802
2875
  */
@@ -3459,7 +3532,7 @@ function toAppState(state) {
3459
3532
  case "STARTING":
3460
3533
  case "DEPLOYING":
3461
3534
  return "DEPLOYING" /* Deploying */;
3462
- // v25.10's freezer states are the same idea as v26's `SUSPENDED`: the
3535
+ // v25.10's freezer states are the same idea as v27's `SUSPENDED`: the
3463
3536
  // processes are paused, not exited. `FROZEN` is that pause completed, so it
3464
3537
  // and `SUSPENDED` are the same answer.
3465
3538
  case "SUSPENDED":
@@ -3571,14 +3644,14 @@ function toContainer(instance) {
3571
3644
  // declares only `description`, but the API returns `architecture`, `os`,
3572
3645
  // `release` and more, and callers were already receiving them. Narrowing
3573
3646
  // to the declared field would take data away to match a type that was
3574
- // always an under-declaration — the same call as the v26 `description`
3647
+ // always an under-declaration — the same call as the v27 `description`
3575
3648
  // widening, decided the same way.
3576
3649
  image: instance.image.description === null ? void 0 : { ...instance.image, description: instance.image.description }
3577
3650
  };
3578
3651
  }
3579
- var TrueNasApiClientV26 = class extends TrueNasApiClient {
3652
+ var TrueNasApiClientV27 = class extends TrueNasApiClient {
3580
3653
  /**
3581
- * Create v26-specific operation mappings
3654
+ * Create v27-specific operation mappings
3582
3655
  *
3583
3656
  * Operations return Observable<Job | null>:
3584
3657
  * - Async operations emit Job updates until complete
@@ -3592,7 +3665,7 @@ var TrueNasApiClientV26 = class extends TrueNasApiClient {
3592
3665
  containerQuery: () => this.api.query("container.query").pipe(
3593
3666
  rxjs.map((containers) => containers.map(toContainer2))
3594
3667
  ),
3595
- // container.start is synchronous in v26.0.0 - emit null
3668
+ // container.start is synchronous in v27.0.0 - emit null
3596
3669
  containerStart: (id) => this.api.call("container.start", [parseInt(id, 10)]).pipe(rxjs.map(() => null)),
3597
3670
  // container.stop emits job updates
3598
3671
  containerStop: (id, options) => this.api.job("container.stop", [
@@ -3602,7 +3675,7 @@ var TrueNasApiClientV26 = class extends TrueNasApiClient {
3602
3675
  force_after_timeout: options.force
3603
3676
  }
3604
3677
  ]),
3605
- // v26.0.0 doesn't have container.restart - chain stop + start
3678
+ // v27.0.0 doesn't have container.restart - chain stop + start
3606
3679
  // Emits Job updates during stop, then null when start completes
3607
3680
  containerRestart: (id, options) => {
3608
3681
  const numericId = parseInt(id, 10);
@@ -3654,9 +3727,9 @@ function toContainer2(container) {
3654
3727
  description
3655
3728
  };
3656
3729
  }
3657
- var TrueNasApiClientV27 = class extends TrueNasApiClient {
3730
+ var TrueNasApiClientV28 = class extends TrueNasApiClient {
3658
3731
  /**
3659
- * Create v27-specific operation mappings
3732
+ * Create v28-specific operation mappings
3660
3733
  *
3661
3734
  * Operations return Observable<Job | null>:
3662
3735
  * - Async operations emit Job updates until complete
@@ -3670,7 +3743,7 @@ var TrueNasApiClientV27 = class extends TrueNasApiClient {
3670
3743
  containerQuery: () => this.api.query("container.query").pipe(
3671
3744
  rxjs.map((containers) => containers.map(toContainer3))
3672
3745
  ),
3673
- // container.start is synchronous in v27 - emit null
3746
+ // container.start is synchronous in v28 - emit null
3674
3747
  containerStart: (id) => this.api.call("container.start", [parseInt(id, 10)]).pipe(rxjs.map(() => null)),
3675
3748
  // container.stop emits job updates
3676
3749
  containerStop: (id, options) => this.api.job("container.stop", [
@@ -3680,7 +3753,7 @@ var TrueNasApiClientV27 = class extends TrueNasApiClient {
3680
3753
  force_after_timeout: options.force
3681
3754
  }
3682
3755
  ]),
3683
- // v27 still has no container.restart - chain stop + start.
3756
+ // v28 still has no container.restart - chain stop + start.
3684
3757
  // Emits Job updates during stop, then null when start completes.
3685
3758
  containerRestart: (id, options) => {
3686
3759
  const numericId = parseInt(id, 10);
@@ -3702,7 +3775,7 @@ var TrueNasApiClientV27 = class extends TrueNasApiClient {
3702
3775
  )
3703
3776
  );
3704
3777
  },
3705
- // Absent options are omitted, as in v26: `[id, null]` fails validation.
3778
+ // Absent options are omitted, as in v27: `[id, null]` fails validation.
3706
3779
  containerDelete: (id, options) => this.api.job(
3707
3780
  "container.delete",
3708
3781
  options ? [parseInt(id, 10), options] : [parseInt(id, 10)]
@@ -3799,13 +3872,16 @@ var NoCompatibleVersionsError = class extends VersionDiscoveryError {
3799
3872
  constructor(hostname, availableVersions, supportedRange = {
3800
3873
  min: apiVersionConfig.MIN_SUPPORTED_VERSION,
3801
3874
  max: apiVersionConfig.MAX_SUPPORTED_VERSION
3802
- }) {
3875
+ }, supportedVersions = SUPPORTED_API_VERSIONS) {
3803
3876
  super(
3804
- `No compatible API versions available. Supported: ${supportedRange.min} to ${supportedRange.max}. Available: ${availableVersions.join(", ")}`,
3877
+ `No compatible API versions available. Supported: ${supportedVersions.join(
3878
+ ", "
3879
+ )}. Available: ${availableVersions.join(", ")}`,
3805
3880
  hostname
3806
3881
  );
3807
3882
  this.availableVersions = availableVersions;
3808
3883
  this.supportedRange = supportedRange;
3884
+ this.supportedVersions = supportedVersions;
3809
3885
  }
3810
3886
  };
3811
3887
  var InvalidVersionResponseError = class extends VersionDiscoveryError {
@@ -4224,8 +4300,8 @@ function selectRepresentativeFailure(failures) {
4224
4300
  }
4225
4301
  var CLIENT_BY_VERSION_KEY = {
4226
4302
  "25.10": TrueNasApiClientV2510,
4227
- "26": TrueNasApiClientV26,
4228
- "27": TrueNasApiClientV27
4303
+ "27": TrueNasApiClientV27,
4304
+ "28": TrueNasApiClientV28
4229
4305
  };
4230
4306
  function clientVersionKey(version) {
4231
4307
  if (version.year <= legacyCutoffYear) {
@@ -4292,8 +4368,8 @@ exports.NoCompatibleVersionsError = NoCompatibleVersionsError;
4292
4368
  exports.SUPPORTED_API_VERSIONS = SUPPORTED_API_VERSIONS;
4293
4369
  exports.TrueNasApiClient = TrueNasApiClient;
4294
4370
  exports.TrueNasApiClientV2510 = TrueNasApiClientV2510;
4295
- exports.TrueNasApiClientV26 = TrueNasApiClientV26;
4296
4371
  exports.TrueNasApiClientV27 = TrueNasApiClientV27;
4372
+ exports.TrueNasApiClientV28 = TrueNasApiClientV28;
4297
4373
  exports.TrueNasAuthMechanism = TrueNasAuthMechanism;
4298
4374
  exports.TrueNasAuthenticator = TrueNasAuthenticator;
4299
4375
  exports.TrueNasConnection = TrueNasConnection;
@@ -4321,7 +4397,7 @@ exports.v25_10_2_exports = v25_10_2_exports;
4321
4397
  exports.v25_10_3_exports = v25_10_3_exports;
4322
4398
  exports.v25_10_4_exports = v25_10_4_exports;
4323
4399
  exports.v25_10_5_exports = v25_10_5_exports;
4324
- exports.v26_0_0_exports = v26_0_0_exports;
4325
4400
  exports.v27_0_0_exports = v27_0_0_exports;
4326
- //# sourceMappingURL=chunk-SKMB6DV7.cjs.map
4327
- //# sourceMappingURL=chunk-SKMB6DV7.cjs.map
4401
+ exports.v28_0_0_exports = v28_0_0_exports;
4402
+ //# sourceMappingURL=chunk-TSO2EHF3.cjs.map
4403
+ //# sourceMappingURL=chunk-TSO2EHF3.cjs.map