@openshift-migration-advisor/agent-sdk 0.23.0 → 0.24.0-958d6428562e

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.
@@ -62,6 +62,7 @@ function VMsFromJSONTyped(json, ignoreDiscriminator) {
62
62
  'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],
63
63
  'totalWithSharedDisks': json['totalWithSharedDisks'] == null ? undefined : json['totalWithSharedDisks'],
64
64
  'totalWithRDM': json['totalWithRDM'] == null ? undefined : json['totalWithRDM'],
65
+ 'totalWithFaultTolerance': json['totalWithFaultTolerance'] == null ? undefined : json['totalWithFaultTolerance'],
65
66
  'cpuCores': (0, VMResourceBreakdown_js_1.VMResourceBreakdownFromJSON)(json['cpuCores']),
66
67
  'diskSizeTier': json['diskSizeTier'] == null ? undefined : ((0, runtime_js_1.mapValues)(json['diskSizeTier'], DiskSizeTierSummary_js_1.DiskSizeTierSummaryFromJSON)),
67
68
  'diskComplexityTier': json['diskComplexityTier'] == null ? undefined : ((0, runtime_js_1.mapValues)(json['diskComplexityTier'], DiskSizeTierSummary_js_1.DiskSizeTierSummaryFromJSON)),
@@ -96,6 +97,7 @@ function VMsToJSONTyped(value, ignoreDiscriminator = false) {
96
97
  'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],
97
98
  'totalWithSharedDisks': value['totalWithSharedDisks'],
98
99
  'totalWithRDM': value['totalWithRDM'],
100
+ 'totalWithFaultTolerance': value['totalWithFaultTolerance'],
99
101
  'cpuCores': (0, VMResourceBreakdown_js_1.VMResourceBreakdownToJSON)(value['cpuCores']),
100
102
  'diskSizeTier': value['diskSizeTier'] == null ? undefined : ((0, runtime_js_1.mapValues)(value['diskSizeTier'], DiskSizeTierSummary_js_1.DiskSizeTierSummaryToJSON)),
101
103
  'diskComplexityTier': value['diskComplexityTier'] == null ? undefined : ((0, runtime_js_1.mapValues)(value['diskComplexityTier'], DiskSizeTierSummary_js_1.DiskSizeTierSummaryToJSON)),
package/dist/runtime.d.ts CHANGED
@@ -187,8 +187,22 @@ export declare class VoidApiResponse {
187
187
  export declare class BlobApiResponse {
188
188
  raw: Response;
189
189
  constructor(raw: Response);
190
- value(): Promise<Blob>;
190
+ /**
191
+ * The body as a File named after the Content-Disposition header, so that a download keeps the
192
+ * name the server gave it. A File is a Blob: callers reading a Blob are unaffected, and the name
193
+ * is empty when the server did not send one. Runtimes without a global File (Node.js before 20)
194
+ * keep receiving the bare Blob.
195
+ */
196
+ value(): Promise<File>;
191
197
  }
198
+ /**
199
+ * The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
200
+ * `filename*` parameter first, then the plain `filename` as a quoted-string or a token. Parameters
201
+ * are split on `;` outside quoted-strings and matched by name case-insensitively. Any directory
202
+ * part is dropped so that the name is safe to write to disk as is; undefined when no usable name
203
+ * is advertised.
204
+ */
205
+ export declare function parseContentDispositionFilename(headers: Headers): string | undefined;
192
206
  export declare class TextApiResponse {
193
207
  raw: Response;
194
208
  constructor(raw: Response);
package/dist/runtime.js CHANGED
@@ -32,6 +32,7 @@ exports.parseDateTime = parseDateTime;
32
32
  exports.mapValues = mapValues;
33
33
  exports.anyToJSON = anyToJSON;
34
34
  exports.canConsumeForm = canConsumeForm;
35
+ exports.parseContentDispositionFilename = parseContentDispositionFilename;
35
36
  exports.BASE_PATH = "https://raw.githubusercontent.com/api/v2".replace(/\/+$/, "");
36
37
  class Configuration {
37
38
  constructor(configuration = {}) {
@@ -399,14 +400,93 @@ class BlobApiResponse {
399
400
  constructor(raw) {
400
401
  this.raw = raw;
401
402
  }
403
+ /**
404
+ * The body as a File named after the Content-Disposition header, so that a download keeps the
405
+ * name the server gave it. A File is a Blob: callers reading a Blob are unaffected, and the name
406
+ * is empty when the server did not send one. Runtimes without a global File (Node.js before 20)
407
+ * keep receiving the bare Blob.
408
+ */
402
409
  value() {
403
410
  return __awaiter(this, void 0, void 0, function* () {
404
- return yield this.raw.blob();
411
+ var _a;
412
+ const blob = yield this.raw.blob();
413
+ if (typeof File === 'undefined') {
414
+ return blob;
415
+ }
416
+ return new File([blob], (_a = parseContentDispositionFilename(this.raw.headers)) !== null && _a !== void 0 ? _a : '', { type: blob.type });
405
417
  });
406
418
  }
407
419
  ;
408
420
  }
409
421
  exports.BlobApiResponse = BlobApiResponse;
422
+ /**
423
+ * The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
424
+ * `filename*` parameter first, then the plain `filename` as a quoted-string or a token. Parameters
425
+ * are split on `;` outside quoted-strings and matched by name case-insensitively. Any directory
426
+ * part is dropped so that the name is safe to write to disk as is; undefined when no usable name
427
+ * is advertised.
428
+ */
429
+ function parseContentDispositionFilename(headers) {
430
+ const value = headers.get('Content-Disposition');
431
+ if (!value) {
432
+ return undefined;
433
+ }
434
+ const params = parseHeaderParameters(value);
435
+ const encoded = params.get('filename*');
436
+ if (encoded !== undefined) {
437
+ const extValue = /^utf-8'[^']*'(.*)$/i.exec(encoded);
438
+ if (extValue) {
439
+ try {
440
+ return basename(decodeURIComponent(extValue[1]));
441
+ }
442
+ catch (_a) {
443
+ // malformed percent-encoding: fall through to the plain form
444
+ }
445
+ }
446
+ }
447
+ const plain = params.get('filename');
448
+ return plain === undefined ? undefined : basename(plain);
449
+ }
450
+ /**
451
+ * The `name=value` parameters of a header value, split on `;` outside quoted-strings. Names are
452
+ * lower-cased, quoted-string values are unquoted with their backslash escapes resolved, and the
453
+ * first occurrence of a name wins.
454
+ */
455
+ function parseHeaderParameters(value) {
456
+ const params = new Map();
457
+ let start = 0;
458
+ let quoted = false;
459
+ for (let i = 0; i <= value.length; i++) {
460
+ const c = value[i];
461
+ if (i === value.length || (c === ';' && !quoted)) {
462
+ const part = value.slice(start, i);
463
+ const eq = part.indexOf('=');
464
+ if (eq !== -1) {
465
+ const name = part.slice(0, eq).trim().toLowerCase();
466
+ let raw = part.slice(eq + 1).trim();
467
+ if (raw.startsWith('"')) {
468
+ raw = raw.slice(1, raw.length > 1 && raw.endsWith('"') ? -1 : undefined).replace(/\\(.)/g, '$1');
469
+ }
470
+ if (name && !params.has(name)) {
471
+ params.set(name, raw);
472
+ }
473
+ }
474
+ start = i + 1;
475
+ }
476
+ else if (c === '"') {
477
+ quoted = !quoted;
478
+ }
479
+ else if (c === '\\' && quoted) {
480
+ i++;
481
+ }
482
+ }
483
+ return params;
484
+ }
485
+ /** The last path segment of a file name, or undefined when nothing usable is left. */
486
+ function basename(name) {
487
+ const base = name.slice(Math.max(name.lastIndexOf('/'), name.lastIndexOf('\\')) + 1).trim();
488
+ return base === '' || base === '.' || base === '..' ? undefined : base;
489
+ }
410
490
  class TextApiResponse {
411
491
  constructor(raw) {
412
492
  this.raw = raw;
@@ -6,6 +6,7 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v2*
6
6
  |------------- | ------------- | -------------|
7
7
  | [**compareCollections**](CollectionsApi.md#comparecollections) | **GET** /collections/compare/{aId}/{bId} | Compare two collections — returns aggregates and diffs |
8
8
  | [**compareCollectionsDiff**](CollectionsApi.md#comparecollectionsdiff) | **GET** /collections/compare/{aId}/{bId}/{dimension} | Drill down — VM IDs that differ between two collections for a given dimension |
9
+ | [**deleteCollections**](CollectionsApi.md#deletecollections) | **DELETE** /collections | Delete all collections |
9
10
  | [**exportCollection**](CollectionsApi.md#exportcollection) | **GET** /collections/{id}/export | Export collection data as CSV ZIP archive or Excel workbook |
10
11
  | [**listCollections**](CollectionsApi.md#listcollections) | **GET** /collections | List all collections |
11
12
 
@@ -161,6 +162,64 @@ No authorization required
161
162
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
162
163
 
163
164
 
165
+ ## deleteCollections
166
+
167
+ > deleteCollections()
168
+
169
+ Delete all collections
170
+
171
+ ### Example
172
+
173
+ ```ts
174
+ import {
175
+ Configuration,
176
+ CollectionsApi,
177
+ } from '@openshift-migration-advisor/agent-sdk';
178
+ import type { DeleteCollectionsRequest } from '@openshift-migration-advisor/agent-sdk';
179
+
180
+ async function example() {
181
+ console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
182
+ const api = new CollectionsApi();
183
+
184
+ try {
185
+ const data = await api.deleteCollections();
186
+ console.log(data);
187
+ } catch (error) {
188
+ console.error(error);
189
+ }
190
+ }
191
+
192
+ // Run the test
193
+ example().catch(console.error);
194
+ ```
195
+
196
+ ### Parameters
197
+
198
+ This endpoint does not need any parameter.
199
+
200
+ ### Return type
201
+
202
+ `void` (Empty response body)
203
+
204
+ ### Authorization
205
+
206
+ No authorization required
207
+
208
+ ### HTTP request headers
209
+
210
+ - **Content-Type**: Not defined
211
+ - **Accept**: Not defined
212
+
213
+
214
+ ### HTTP response details
215
+ | Status code | Description | Response headers |
216
+ |-------------|-------------|------------------|
217
+ | **204** | Delete all collections | - |
218
+ | **500** | Internal server error | - |
219
+
220
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
221
+
222
+
164
223
  ## exportCollection
165
224
 
166
225
  > Blob exportCollection(id, scope, format)
package/docs/GroupsApi.md CHANGED
@@ -8,6 +8,7 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v2*
8
8
  | [**deleteLatestGroup**](GroupsApi.md#deletelatestgroup) | **DELETE** /groups/{groupId} | Delete group from the latest collection |
9
9
  | [**getGroup**](GroupsApi.md#getgroup) | **GET** /collections/{id}/groups/{groupId} | Get group by ID with its VirtualMachines |
10
10
  | [**getLatestGroup**](GroupsApi.md#getlatestgroup) | **GET** /groups/{groupId} | Get group by ID from the latest collection |
11
+ | [**listGroupApplications**](GroupsApi.md#listgroupapplications) | **GET** /groups/{groupId}/applications | List detected applications for a group |
11
12
  | [**listGroups**](GroupsApi.md#listgroups) | **GET** /collections/{id}/groups | List all groups in a collection |
12
13
  | [**listLatestGroups**](GroupsApi.md#listlatestgroups) | **GET** /groups | List groups from the latest collection |
13
14
  | [**updateLatestGroup**](GroupsApi.md#updatelatestgroup) | **PATCH** /groups/{groupId} | Update group in the latest collection |
@@ -304,6 +305,73 @@ No authorization required
304
305
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
305
306
 
306
307
 
308
+ ## listGroupApplications
309
+
310
+ > ApplicationListResponse listGroupApplications(groupId)
311
+
312
+ List detected applications for a group
313
+
314
+ ### Example
315
+
316
+ ```ts
317
+ import {
318
+ Configuration,
319
+ GroupsApi,
320
+ } from '@openshift-migration-advisor/agent-sdk';
321
+ import type { ListGroupApplicationsRequest } from '@openshift-migration-advisor/agent-sdk';
322
+
323
+ async function example() {
324
+ console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
325
+ const api = new GroupsApi();
326
+
327
+ const body = {
328
+ // string | Group ID
329
+ groupId: groupId_example,
330
+ } satisfies ListGroupApplicationsRequest;
331
+
332
+ try {
333
+ const data = await api.listGroupApplications(body);
334
+ console.log(data);
335
+ } catch (error) {
336
+ console.error(error);
337
+ }
338
+ }
339
+
340
+ // Run the test
341
+ example().catch(console.error);
342
+ ```
343
+
344
+ ### Parameters
345
+
346
+
347
+ | Name | Type | Description | Notes |
348
+ |------------- | ------------- | ------------- | -------------|
349
+ | **groupId** | `string` | Group ID | [Defaults to `undefined`] |
350
+
351
+ ### Return type
352
+
353
+ [**ApplicationListResponse**](ApplicationListResponse.md)
354
+
355
+ ### Authorization
356
+
357
+ No authorization required
358
+
359
+ ### HTTP request headers
360
+
361
+ - **Content-Type**: Not defined
362
+ - **Accept**: `application/json`
363
+
364
+
365
+ ### HTTP response details
366
+ | Status code | Description | Response headers |
367
+ |-------------|-------------|------------------|
368
+ | **200** | List of detected applications | - |
369
+ | **404** | No collections or group not found | - |
370
+ | **500** | Internal server error | - |
371
+
372
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
373
+
374
+
307
375
  ## listGroups
308
376
 
309
377
  > GroupListResponse listGroups(id, byName, page, pageSize)
package/docs/Infra.md CHANGED
@@ -7,6 +7,7 @@
7
7
  Name | Type
8
8
  ------------ | -------------
9
9
  `totalHosts` | number
10
+ `standaloneHostsDetected` | boolean
10
11
  `totalDatacenters` | number
11
12
  `totalClusters` | number
12
13
  `clustersPerDatacenter` | Array&lt;number&gt;
@@ -28,6 +29,7 @@ import type { Infra } from '@openshift-migration-advisor/agent-sdk'
28
29
  // TODO: Update the object below with actual values
29
30
  const example = {
30
31
  "totalHosts": null,
32
+ "standaloneHostsDetected": null,
31
33
  "totalDatacenters": null,
32
34
  "totalClusters": null,
33
35
  "clustersPerDatacenter": null,
package/docs/VMs.md CHANGED
@@ -11,6 +11,7 @@ Name | Type
11
11
  `totalMigratableWithWarnings` | number
12
12
  `totalWithSharedDisks` | number
13
13
  `totalWithRDM` | number
14
+ `totalWithFaultTolerance` | number
14
15
  `cpuCores` | [VMResourceBreakdown](VMResourceBreakdown.md)
15
16
  `diskSizeTier` | [{ [key: string]: DiskSizeTierSummary; }](DiskSizeTierSummary.md)
16
17
  `diskComplexityTier` | [{ [key: string]: DiskSizeTierSummary; }](DiskSizeTierSummary.md)
@@ -43,6 +44,7 @@ const example = {
43
44
  "totalMigratableWithWarnings": null,
44
45
  "totalWithSharedDisks": null,
45
46
  "totalWithRDM": null,
47
+ "totalWithFaultTolerance": null,
46
48
  "cpuCores": null,
47
49
  "diskSizeTier": null,
48
50
  "diskComplexityTier": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openshift-migration-advisor/agent-sdk",
3
- "version": "0.23.0",
3
+ "version": "0.24.0-958d6428562e",
4
4
  "description": "OpenAPI client for @openshift-migration-advisor/agent-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -141,6 +141,27 @@ export interface CollectionsApiInterface {
141
141
  */
142
142
  compareCollectionsDiff(requestParameters: CompareCollectionsDiffRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionComparisonDiff>;
143
143
 
144
+ /**
145
+ * Creates request options for deleteCollections without sending the request
146
+ * @throws {RequiredError}
147
+ * @memberof CollectionsApiInterface
148
+ */
149
+ deleteCollectionsRequestOpts(): Promise<runtime.RequestOpts>;
150
+
151
+ /**
152
+ *
153
+ * @summary Delete all collections
154
+ * @param {*} [options] Override http request option.
155
+ * @throws {RequiredError}
156
+ * @memberof CollectionsApiInterface
157
+ */
158
+ deleteCollectionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
159
+
160
+ /**
161
+ * Delete all collections
162
+ */
163
+ deleteCollections(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
164
+
144
165
  /**
145
166
  * Creates request options for exportCollection without sending the request
146
167
  * @param {string} id Collection ID
@@ -318,6 +339,42 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
318
339
  return await response.value();
319
340
  }
320
341
 
342
+ /**
343
+ * Creates request options for deleteCollections without sending the request
344
+ */
345
+ async deleteCollectionsRequestOpts(): Promise<runtime.RequestOpts> {
346
+ const queryParameters: any = {};
347
+
348
+ const headerParameters: runtime.HTTPHeaders = {};
349
+
350
+
351
+ let urlPath = `/collections`;
352
+
353
+ return {
354
+ path: urlPath,
355
+ method: 'DELETE',
356
+ headers: headerParameters,
357
+ query: queryParameters,
358
+ };
359
+ }
360
+
361
+ /**
362
+ * Delete all collections
363
+ */
364
+ async deleteCollectionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
365
+ const requestOptions = await this.deleteCollectionsRequestOpts();
366
+ const response = await this.request(requestOptions, initOverrides);
367
+
368
+ return new runtime.VoidApiResponse(response);
369
+ }
370
+
371
+ /**
372
+ * Delete all collections
373
+ */
374
+ async deleteCollections(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
375
+ await this.deleteCollectionsRaw(initOverrides);
376
+ }
377
+
321
378
  /**
322
379
  * Creates request options for exportCollection without sending the request
323
380
  */
@@ -13,6 +13,11 @@
13
13
  */
14
14
 
15
15
  import * as runtime from '../runtime.js';
16
+ import {
17
+ type ApplicationListResponse,
18
+ ApplicationListResponseFromJSON,
19
+ ApplicationListResponseToJSON,
20
+ } from '../models/ApplicationListResponse.js';
16
21
  import {
17
22
  type CreateGroupRequest,
18
23
  CreateGroupRequestFromJSON,
@@ -95,6 +100,13 @@ export interface GetLatestGroupRequest {
95
100
  pageSize?: number;
96
101
  }
97
102
 
103
+ export interface ListGroupApplicationsRequest {
104
+ /**
105
+ * Group ID
106
+ */
107
+ groupId: string;
108
+ }
109
+
98
110
  export interface ListGroupsRequest {
99
111
  /**
100
112
  * Collection ID
@@ -253,6 +265,29 @@ export interface GroupsApiInterface {
253
265
  */
254
266
  getLatestGroup(requestParameters: GetLatestGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupResponse>;
255
267
 
268
+ /**
269
+ * Creates request options for listGroupApplications without sending the request
270
+ * @param {string} groupId Group ID
271
+ * @throws {RequiredError}
272
+ * @memberof GroupsApiInterface
273
+ */
274
+ listGroupApplicationsRequestOpts(requestParameters: ListGroupApplicationsRequest): Promise<runtime.RequestOpts>;
275
+
276
+ /**
277
+ *
278
+ * @summary List detected applications for a group
279
+ * @param {string} groupId Group ID
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ * @memberof GroupsApiInterface
283
+ */
284
+ listGroupApplicationsRaw(requestParameters: ListGroupApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApplicationListResponse>>;
285
+
286
+ /**
287
+ * List detected applications for a group
288
+ */
289
+ listGroupApplications(requestParameters: ListGroupApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApplicationListResponse>;
290
+
256
291
  /**
257
292
  * Creates request options for listGroups without sending the request
258
293
  * @param {string} id Collection ID
@@ -554,6 +589,51 @@ export class GroupsApi extends runtime.BaseAPI implements GroupsApiInterface {
554
589
  return await response.value();
555
590
  }
556
591
 
592
+ /**
593
+ * Creates request options for listGroupApplications without sending the request
594
+ */
595
+ async listGroupApplicationsRequestOpts(requestParameters: ListGroupApplicationsRequest): Promise<runtime.RequestOpts> {
596
+ if (requestParameters['groupId'] == null) {
597
+ throw new runtime.RequiredError(
598
+ 'groupId',
599
+ 'Required parameter "groupId" was null or undefined when calling listGroupApplications().'
600
+ );
601
+ }
602
+
603
+ const queryParameters: any = {};
604
+
605
+ const headerParameters: runtime.HTTPHeaders = {};
606
+
607
+
608
+ let urlPath = `/groups/{groupId}/applications`;
609
+ urlPath = urlPath.replace('{groupId}', encodeURIComponent(String(requestParameters['groupId'])));
610
+
611
+ return {
612
+ path: urlPath,
613
+ method: 'GET',
614
+ headers: headerParameters,
615
+ query: queryParameters,
616
+ };
617
+ }
618
+
619
+ /**
620
+ * List detected applications for a group
621
+ */
622
+ async listGroupApplicationsRaw(requestParameters: ListGroupApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApplicationListResponse>> {
623
+ const requestOptions = await this.listGroupApplicationsRequestOpts(requestParameters);
624
+ const response = await this.request(requestOptions, initOverrides);
625
+
626
+ return new runtime.JSONApiResponse(response, (jsonValue) => ApplicationListResponseFromJSON(jsonValue));
627
+ }
628
+
629
+ /**
630
+ * List detected applications for a group
631
+ */
632
+ async listGroupApplications(requestParameters: ListGroupApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApplicationListResponse> {
633
+ const response = await this.listGroupApplicationsRaw(requestParameters, initOverrides);
634
+ return await response.value();
635
+ }
636
+
557
637
  /**
558
638
  * Creates request options for listGroups without sending the request
559
639
  */
@@ -45,6 +45,10 @@ export interface Infra {
45
45
  *
46
46
  */
47
47
  totalHosts: number;
48
+ /**
49
+ * Whether any hosts run without vCenter cluster management (not part of any cluster)
50
+ */
51
+ standaloneHostsDetected?: boolean;
48
52
  /**
49
53
  *
50
54
  */
@@ -120,6 +124,7 @@ export function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Inf
120
124
  return {
121
125
 
122
126
  'totalHosts': json['totalHosts'],
127
+ 'standaloneHostsDetected': json['standaloneHostsDetected'] == null ? undefined : json['standaloneHostsDetected'],
123
128
  'totalDatacenters': json['totalDatacenters'] == null ? undefined : json['totalDatacenters'],
124
129
  'totalClusters': json['totalClusters'] == null ? undefined : json['totalClusters'],
125
130
  'clustersPerDatacenter': json['clustersPerDatacenter'] == null ? undefined : json['clustersPerDatacenter'],
@@ -147,6 +152,7 @@ export function InfraToJSONTyped(value?: Infra | null, ignoreDiscriminator: bool
147
152
  return {
148
153
 
149
154
  'totalHosts': value['totalHosts'],
155
+ 'standaloneHostsDetected': value['standaloneHostsDetected'],
150
156
  'totalDatacenters': value['totalDatacenters'],
151
157
  'totalClusters': value['totalClusters'],
152
158
  'clustersPerDatacenter': value['clustersPerDatacenter'],
package/src/models/VMs.ts CHANGED
@@ -82,6 +82,10 @@ export interface VMs {
82
82
  * Number of VMs that have at least one raw device mapping (RDM) disk
83
83
  */
84
84
  totalWithRDM?: number;
85
+ /**
86
+ * Number of VMs that have Fault Tolerance enabled
87
+ */
88
+ totalWithFaultTolerance?: number;
85
89
  /**
86
90
  *
87
91
  */
@@ -194,6 +198,7 @@ export function VMsFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMs {
194
198
  'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],
195
199
  'totalWithSharedDisks': json['totalWithSharedDisks'] == null ? undefined : json['totalWithSharedDisks'],
196
200
  'totalWithRDM': json['totalWithRDM'] == null ? undefined : json['totalWithRDM'],
201
+ 'totalWithFaultTolerance': json['totalWithFaultTolerance'] == null ? undefined : json['totalWithFaultTolerance'],
197
202
  'cpuCores': VMResourceBreakdownFromJSON(json['cpuCores']),
198
203
  'diskSizeTier': json['diskSizeTier'] == null ? undefined : (mapValues(json['diskSizeTier'], DiskSizeTierSummaryFromJSON)),
199
204
  'diskComplexityTier': json['diskComplexityTier'] == null ? undefined : (mapValues(json['diskComplexityTier'], DiskSizeTierSummaryFromJSON)),
@@ -232,6 +237,7 @@ export function VMsToJSONTyped(value?: VMs | null, ignoreDiscriminator: boolean
232
237
  'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],
233
238
  'totalWithSharedDisks': value['totalWithSharedDisks'],
234
239
  'totalWithRDM': value['totalWithRDM'],
240
+ 'totalWithFaultTolerance': value['totalWithFaultTolerance'],
235
241
  'cpuCores': VMResourceBreakdownToJSON(value['cpuCores']),
236
242
  'diskSizeTier': value['diskSizeTier'] == null ? undefined : (mapValues(value['diskSizeTier'], DiskSizeTierSummaryToJSON)),
237
243
  'diskComplexityTier': value['diskComplexityTier'] == null ? undefined : (mapValues(value['diskComplexityTier'], DiskSizeTierSummaryToJSON)),
package/src/runtime.ts CHANGED
@@ -491,11 +491,89 @@ export class VoidApiResponse {
491
491
  export class BlobApiResponse {
492
492
  constructor(public raw: Response) {}
493
493
 
494
- async value(): Promise<Blob> {
495
- return await this.raw.blob();
494
+ /**
495
+ * The body as a File named after the Content-Disposition header, so that a download keeps the
496
+ * name the server gave it. A File is a Blob: callers reading a Blob are unaffected, and the name
497
+ * is empty when the server did not send one. Runtimes without a global File (Node.js before 20)
498
+ * keep receiving the bare Blob.
499
+ */
500
+ async value(): Promise<File> {
501
+ const blob = await this.raw.blob();
502
+ if (typeof File === 'undefined') {
503
+ return blob as File;
504
+ }
505
+ return new File([blob], parseContentDispositionFilename(this.raw.headers) ?? '', { type: blob.type });
496
506
  };
497
507
  }
498
508
 
509
+ /**
510
+ * The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
511
+ * `filename*` parameter first, then the plain `filename` as a quoted-string or a token. Parameters
512
+ * are split on `;` outside quoted-strings and matched by name case-insensitively. Any directory
513
+ * part is dropped so that the name is safe to write to disk as is; undefined when no usable name
514
+ * is advertised.
515
+ */
516
+ export function parseContentDispositionFilename(headers: Headers): string | undefined {
517
+ const value = headers.get('Content-Disposition');
518
+ if (!value) {
519
+ return undefined;
520
+ }
521
+ const params = parseHeaderParameters(value);
522
+ const encoded = params.get('filename*');
523
+ if (encoded !== undefined) {
524
+ const extValue = /^utf-8'[^']*'(.*)$/i.exec(encoded);
525
+ if (extValue) {
526
+ try {
527
+ return basename(decodeURIComponent(extValue[1]));
528
+ } catch {
529
+ // malformed percent-encoding: fall through to the plain form
530
+ }
531
+ }
532
+ }
533
+ const plain = params.get('filename');
534
+ return plain === undefined ? undefined : basename(plain);
535
+ }
536
+
537
+ /**
538
+ * The `name=value` parameters of a header value, split on `;` outside quoted-strings. Names are
539
+ * lower-cased, quoted-string values are unquoted with their backslash escapes resolved, and the
540
+ * first occurrence of a name wins.
541
+ */
542
+ function parseHeaderParameters(value: string): Map<string, string> {
543
+ const params = new Map<string, string>();
544
+ let start = 0;
545
+ let quoted = false;
546
+ for (let i = 0; i <= value.length; i++) {
547
+ const c = value[i];
548
+ if (i === value.length || (c === ';' && !quoted)) {
549
+ const part = value.slice(start, i);
550
+ const eq = part.indexOf('=');
551
+ if (eq !== -1) {
552
+ const name = part.slice(0, eq).trim().toLowerCase();
553
+ let raw = part.slice(eq + 1).trim();
554
+ if (raw.startsWith('"')) {
555
+ raw = raw.slice(1, raw.length > 1 && raw.endsWith('"') ? -1 : undefined).replace(/\\(.)/g, '$1');
556
+ }
557
+ if (name && !params.has(name)) {
558
+ params.set(name, raw);
559
+ }
560
+ }
561
+ start = i + 1;
562
+ } else if (c === '"') {
563
+ quoted = !quoted;
564
+ } else if (c === '\\' && quoted) {
565
+ i++;
566
+ }
567
+ }
568
+ return params;
569
+ }
570
+
571
+ /** The last path segment of a file name, or undefined when nothing usable is left. */
572
+ function basename(name: string): string | undefined {
573
+ const base = name.slice(Math.max(name.lastIndexOf('/'), name.lastIndexOf('\\')) + 1).trim();
574
+ return base === '' || base === '.' || base === '..' ? undefined : base;
575
+ }
576
+
499
577
  export class TextApiResponse {
500
578
  constructor(public raw: Response) {}
501
579