@truenas/api-client 4.0.1 → 5.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.
- package/README.md +59 -0
- package/dist/index.cjs +104 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +911 -301
- package/dist/index.d.ts +911 -301
- package/dist/index.js +104 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1964,6 +1964,7 @@ __export(v25_10_5_exports, {
|
|
|
1964
1964
|
var v26_0_0_exports = {};
|
|
1965
1965
|
__export(v26_0_0_exports, {
|
|
1966
1966
|
ACLTemplateEntryAcltypeInput: () => ACLTemplateEntryAcltypeInput,
|
|
1967
|
+
Access: () => Access,
|
|
1967
1968
|
Aclmode: () => Aclmode,
|
|
1968
1969
|
Acltype: () => Acltype,
|
|
1969
1970
|
Advpowermgmt: () => Advpowermgmt,
|
|
@@ -2047,6 +2048,8 @@ __export(v26_0_0_exports, {
|
|
|
2047
2048
|
RsyncTaskCreateDirectionInput: () => RsyncTaskCreateDirectionInput,
|
|
2048
2049
|
RsyncTaskCreateMode: () => RsyncTaskCreateMode,
|
|
2049
2050
|
RsyncTaskCreateModeInput: () => RsyncTaskCreateModeInput,
|
|
2051
|
+
S3AccesskeyEntryStatus: () => S3AccesskeyEntryStatus,
|
|
2052
|
+
S3AccesskeyEntryStatusInput: () => S3AccesskeyEntryStatusInput,
|
|
2050
2053
|
SMBEntryEncryption: () => SMBEntryEncryption,
|
|
2051
2054
|
SMBEntryEncryptionInput: () => SMBEntryEncryptionInput,
|
|
2052
2055
|
STIGType: () => STIGType,
|
|
@@ -2084,6 +2087,7 @@ __export(v26_0_0_exports, {
|
|
|
2084
2087
|
VMWareEntryStateStateInput: () => VMWareEntryStateStateInput,
|
|
2085
2088
|
VMWareMatchDatastoresWithDatasetsResultFilesystemType: () => VMWareMatchDatastoresWithDatasetsResultFilesystemType,
|
|
2086
2089
|
Vendor: () => Vendor,
|
|
2090
|
+
Versioning: () => Versioning,
|
|
2087
2091
|
Volblocksize: () => Volblocksize,
|
|
2088
2092
|
When: () => When,
|
|
2089
2093
|
ZfsTierRewriteJobEntryStatus: () => ZfsTierRewriteJobEntryStatus,
|
|
@@ -2092,6 +2096,12 @@ __export(v26_0_0_exports, {
|
|
|
2092
2096
|
});
|
|
2093
2097
|
|
|
2094
2098
|
// src/generated/v26_0_0/api-types.ts
|
|
2099
|
+
var Access = {
|
|
2100
|
+
Readonly: "READONLY",
|
|
2101
|
+
Writeonly: "WRITEONLY",
|
|
2102
|
+
Readwrite: "READWRITE",
|
|
2103
|
+
Deny: "DENY"
|
|
2104
|
+
};
|
|
2095
2105
|
var AppContainerDetailsState = {
|
|
2096
2106
|
Crashed: "crashed",
|
|
2097
2107
|
Created: "created",
|
|
@@ -2168,6 +2178,25 @@ var PoolScrubAction = {
|
|
|
2168
2178
|
Stop: "STOP",
|
|
2169
2179
|
Pause: "PAUSE"
|
|
2170
2180
|
};
|
|
2181
|
+
var S3AccesskeyEntryStatus = {
|
|
2182
|
+
Enabled: "ENABLED",
|
|
2183
|
+
Disabled: "DISABLED",
|
|
2184
|
+
Expired: "EXPIRED",
|
|
2185
|
+
UserMissing: "USER_MISSING",
|
|
2186
|
+
SecretLost: "SECRET_LOST"
|
|
2187
|
+
};
|
|
2188
|
+
var S3AccesskeyEntryStatusInput = {
|
|
2189
|
+
Enabled: "ENABLED",
|
|
2190
|
+
Disabled: "DISABLED",
|
|
2191
|
+
Expired: "EXPIRED",
|
|
2192
|
+
UserMissing: "USER_MISSING",
|
|
2193
|
+
SecretLost: "SECRET_LOST"
|
|
2194
|
+
};
|
|
2195
|
+
var Versioning = {
|
|
2196
|
+
Off: "OFF",
|
|
2197
|
+
Enabled: "ENABLED",
|
|
2198
|
+
Suspended: "SUSPENDED"
|
|
2199
|
+
};
|
|
2171
2200
|
var VMWareEntryStateState = {
|
|
2172
2201
|
Pending: "PENDING",
|
|
2173
2202
|
Success: "SUCCESS",
|
|
@@ -2192,6 +2221,7 @@ var ZpoolScrubRunAction = {
|
|
|
2192
2221
|
var v27_0_0_exports = {};
|
|
2193
2222
|
__export(v27_0_0_exports, {
|
|
2194
2223
|
ACLTemplateEntryAcltypeInput: () => ACLTemplateEntryAcltypeInput,
|
|
2224
|
+
Access: () => Access,
|
|
2195
2225
|
Aclmode: () => Aclmode,
|
|
2196
2226
|
Acltype: () => Acltype,
|
|
2197
2227
|
Advpowermgmt: () => Advpowermgmt,
|
|
@@ -2275,6 +2305,8 @@ __export(v27_0_0_exports, {
|
|
|
2275
2305
|
RsyncTaskCreateDirectionInput: () => RsyncTaskCreateDirectionInput,
|
|
2276
2306
|
RsyncTaskCreateMode: () => RsyncTaskCreateMode,
|
|
2277
2307
|
RsyncTaskCreateModeInput: () => RsyncTaskCreateModeInput,
|
|
2308
|
+
S3AccesskeyEntryStatus: () => S3AccesskeyEntryStatus,
|
|
2309
|
+
S3AccesskeyEntryStatusInput: () => S3AccesskeyEntryStatusInput,
|
|
2278
2310
|
SMBEntryEncryption: () => SMBEntryEncryption,
|
|
2279
2311
|
SMBEntryEncryptionInput: () => SMBEntryEncryptionInput,
|
|
2280
2312
|
STIGType: () => STIGType,
|
|
@@ -2311,7 +2343,9 @@ __export(v27_0_0_exports, {
|
|
|
2311
2343
|
VMWareEntryStateState: () => VMWareEntryStateState,
|
|
2312
2344
|
VMWareEntryStateStateInput: () => VMWareEntryStateStateInput,
|
|
2313
2345
|
VMWareMatchDatastoresWithDatasetsResultFilesystemType: () => VMWareMatchDatastoresWithDatasetsResultFilesystemType,
|
|
2346
|
+
VMWareMatchDatastoresWithDatasetsResultFilesystemTypeInput: () => VMWareMatchDatastoresWithDatasetsResultFilesystemTypeInput,
|
|
2314
2347
|
Vendor: () => Vendor,
|
|
2348
|
+
Versioning: () => Versioning,
|
|
2315
2349
|
Volblocksize: () => Volblocksize,
|
|
2316
2350
|
When: () => When,
|
|
2317
2351
|
ZfsTierRewriteJobEntryStatus: () => ZfsTierRewriteJobEntryStatus,
|
|
@@ -2327,6 +2361,10 @@ var Service2 = {
|
|
|
2327
2361
|
Sudo: "SUDO",
|
|
2328
2362
|
System: "SYSTEM"
|
|
2329
2363
|
};
|
|
2364
|
+
var VMWareMatchDatastoresWithDatasetsResultFilesystemTypeInput = {
|
|
2365
|
+
Filesystem: "FILESYSTEM",
|
|
2366
|
+
Volume: "VOLUME"
|
|
2367
|
+
};
|
|
2330
2368
|
|
|
2331
2369
|
// src/generated/index.ts
|
|
2332
2370
|
var SUPPORTED_API_VERSIONS = [
|
|
@@ -3447,6 +3485,16 @@ function toAppState(state) {
|
|
|
3447
3485
|
}
|
|
3448
3486
|
}
|
|
3449
3487
|
|
|
3488
|
+
// src/utils/smb-status.utils.ts
|
|
3489
|
+
function toSmbStatusParams(request = {}) {
|
|
3490
|
+
return [
|
|
3491
|
+
request.infoLevel ?? "ALL",
|
|
3492
|
+
request.filters ?? [],
|
|
3493
|
+
request.options ?? {},
|
|
3494
|
+
request.statusOptions ?? {}
|
|
3495
|
+
];
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3450
3498
|
// src/client/truenas-api-client-v25-10.ts
|
|
3451
3499
|
var TrueNasApiClientV2510 = class extends TrueNasApiClient {
|
|
3452
3500
|
/**
|
|
@@ -3486,6 +3534,42 @@ var TrueNasApiClientV2510 = class extends TrueNasApiClient {
|
|
|
3486
3534
|
);
|
|
3487
3535
|
}
|
|
3488
3536
|
return this.api.job("virt.instance.delete", [id]);
|
|
3537
|
+
},
|
|
3538
|
+
// The private leg. See `PrivateSmbStatusCall` for why this is a cast and
|
|
3539
|
+
// not a directory lookup.
|
|
3540
|
+
//
|
|
3541
|
+
// v25.10 answers rather than refusing, for a caller with the authority.
|
|
3542
|
+
// Being private does not stop the method running: `ws_handler/rpc.py`
|
|
3543
|
+
// logs a warning for a private call over websocket and dispatches it
|
|
3544
|
+
// anyway — the `# FIXME: Eventually, prohibit this` above that branch is
|
|
3545
|
+
// still unresolved on master.
|
|
3546
|
+
//
|
|
3547
|
+
// It does decide who may run it. `smb.status` carries no `roles=` here,
|
|
3548
|
+
// and middleware role-registers a method only `if roles:`, so it is in no
|
|
3549
|
+
// role's allowlist and only the non-STIG full-admin wildcard reaches it.
|
|
3550
|
+
// That is documented on `OperationMappings.smbStatus`; this leg does not
|
|
3551
|
+
// pre-empt it. A caller without the authority gets middleware's `EACCES`,
|
|
3552
|
+
// which is the honest answer and the server's to give.
|
|
3553
|
+
//
|
|
3554
|
+
// The server-side warning is per dispatch, and a client count is exactly
|
|
3555
|
+
// the sort of thing a caller polls. Reported at debug rather than warn,
|
|
3556
|
+
// because nothing here is degraded or unhonoured — the request is served
|
|
3557
|
+
// in full — and left to the caller to weigh.
|
|
3558
|
+
//
|
|
3559
|
+
// Future tense, and for the same reason as `containerDelete` above: this
|
|
3560
|
+
// runs when the operation is built, and `api.call` is cold, so no request
|
|
3561
|
+
// has gone out yet and may never. One built observable subscribed twice
|
|
3562
|
+
// dispatches twice; this line is what will happen, not a record that it
|
|
3563
|
+
// did.
|
|
3564
|
+
smbStatus: (request) => {
|
|
3565
|
+
this.logger.debug(
|
|
3566
|
+
"smbStatus: smb.status is private on v25.10; each dispatch will log a warning server-side and needs a non-STIG full-admin session",
|
|
3567
|
+
{ method: "smb.status", infoLevel: request?.infoLevel ?? "ALL" }
|
|
3568
|
+
);
|
|
3569
|
+
return this.api.call(
|
|
3570
|
+
"smb.status",
|
|
3571
|
+
toSmbStatusParams(request)
|
|
3572
|
+
);
|
|
3489
3573
|
}
|
|
3490
3574
|
};
|
|
3491
3575
|
}
|
|
@@ -3573,7 +3657,16 @@ var TrueNasApiClientV26 = class extends TrueNasApiClient {
|
|
|
3573
3657
|
containerDelete: (id, options) => this.api.job(
|
|
3574
3658
|
"container.delete",
|
|
3575
3659
|
options ? [parseInt(id, 10), options] : [parseInt(id, 10)]
|
|
3576
|
-
)
|
|
3660
|
+
),
|
|
3661
|
+
// `smb.status` is public here and gated on `SHARING_SMB_READ`, so it is
|
|
3662
|
+
// an ordinary `call` read straight out of the generated directory — the
|
|
3663
|
+
// one leg of this operation that needs no assertion about the server.
|
|
3664
|
+
//
|
|
3665
|
+
// Not a query verb: middleware returns the same `list | dict | int`
|
|
3666
|
+
// polymorphism a `.query` does, but the generator did not mark the entry
|
|
3667
|
+
// with an `entity`, so `api.query` does not accept it and the union is
|
|
3668
|
+
// handed to the caller to narrow.
|
|
3669
|
+
smbStatus: (request) => this.api.call("smb.status", toSmbStatusParams(request))
|
|
3577
3670
|
};
|
|
3578
3671
|
}
|
|
3579
3672
|
};
|
|
@@ -3654,7 +3747,16 @@ var TrueNasApiClientV27 = class extends TrueNasApiClient {
|
|
|
3654
3747
|
containerDelete: (id, options) => this.api.job(
|
|
3655
3748
|
"container.delete",
|
|
3656
3749
|
options ? [parseInt(id, 10), options] : [parseInt(id, 10)]
|
|
3657
|
-
)
|
|
3750
|
+
),
|
|
3751
|
+
// `smb.status` is public here and gated on `SHARING_SMB_READ`, so it is
|
|
3752
|
+
// an ordinary `call` read straight out of the generated directory — the
|
|
3753
|
+
// one leg of this operation that needs no assertion about the server.
|
|
3754
|
+
//
|
|
3755
|
+
// Not a query verb: middleware returns the same `list | dict | int`
|
|
3756
|
+
// polymorphism a `.query` does, but the generator did not mark the entry
|
|
3757
|
+
// with an `entity`, so `api.query` does not accept it and the union is
|
|
3758
|
+
// handed to the caller to narrow.
|
|
3759
|
+
smbStatus: (request) => this.api.call("smb.status", toSmbStatusParams(request))
|
|
3658
3760
|
};
|
|
3659
3761
|
}
|
|
3660
3762
|
};
|