@openshift-migration-advisor/agent-sdk 0.25.0 → 0.27.0-d06ac0ff3309
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/.openapi-generator/VERSION +1 -1
- package/README.md +3 -3
- package/dist/apis/CollectionsApi.d.ts +4 -4
- package/dist/esm/apis/CollectionsApi.d.ts +4 -4
- package/dist/esm/models/Datastore.d.ts +17 -0
- package/dist/esm/models/Datastore.js +12 -0
- package/dist/esm/runtime.d.ts +16 -9
- package/dist/esm/runtime.js +39 -58
- package/dist/models/Datastore.d.ts +17 -0
- package/dist/models/Datastore.js +13 -0
- package/dist/runtime.d.ts +16 -9
- package/dist/runtime.js +39 -58
- package/docs/Datastore.md +4 -0
- package/package.json +1 -1
- package/src/apis/CollectionsApi.ts +4 -4
- package/src/models/Datastore.ts +24 -0
- package/src/runtime.ts +46 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.27.0-SNAPSHOT
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @openshift-migration-advisor/agent-sdk@0.
|
|
1
|
+
# @openshift-migration-advisor/agent-sdk@0.27.0-d06ac0ff3309
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the raw.githubusercontent.com API.
|
|
4
4
|
|
|
@@ -200,8 +200,8 @@ and is automatically generated by the
|
|
|
200
200
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
201
201
|
|
|
202
202
|
- API version: `v2`
|
|
203
|
-
- Package version: `0.
|
|
204
|
-
- Generator version: `7.
|
|
203
|
+
- Package version: `0.27.0-d06ac0ff3309`
|
|
204
|
+
- Generator version: `7.27.0-SNAPSHOT`
|
|
205
205
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
206
206
|
|
|
207
207
|
The generated npm module supports the following:
|
|
@@ -153,11 +153,11 @@ export interface CollectionsApiInterface {
|
|
|
153
153
|
* @throws {RequiredError}
|
|
154
154
|
* @memberof CollectionsApiInterface
|
|
155
155
|
*/
|
|
156
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
156
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
157
157
|
/**
|
|
158
158
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
159
159
|
*/
|
|
160
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
160
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
161
161
|
/**
|
|
162
162
|
* Creates request options for listCollections without sending the request
|
|
163
163
|
* @throws {RequiredError}
|
|
@@ -224,11 +224,11 @@ export declare class CollectionsApi extends runtime.BaseAPI implements Collectio
|
|
|
224
224
|
/**
|
|
225
225
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
226
226
|
*/
|
|
227
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
227
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
228
228
|
/**
|
|
229
229
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
230
230
|
*/
|
|
231
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
231
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
232
232
|
/**
|
|
233
233
|
* Creates request options for listCollections without sending the request
|
|
234
234
|
*/
|
|
@@ -153,11 +153,11 @@ export interface CollectionsApiInterface {
|
|
|
153
153
|
* @throws {RequiredError}
|
|
154
154
|
* @memberof CollectionsApiInterface
|
|
155
155
|
*/
|
|
156
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
156
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
157
157
|
/**
|
|
158
158
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
159
159
|
*/
|
|
160
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
160
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
161
161
|
/**
|
|
162
162
|
* Creates request options for listCollections without sending the request
|
|
163
163
|
* @throws {RequiredError}
|
|
@@ -224,11 +224,11 @@ export declare class CollectionsApi extends runtime.BaseAPI implements Collectio
|
|
|
224
224
|
/**
|
|
225
225
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
226
226
|
*/
|
|
227
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
227
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
228
228
|
/**
|
|
229
229
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
230
230
|
*/
|
|
231
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
231
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
232
232
|
/**
|
|
233
233
|
* Creates request options for listCollections without sending the request
|
|
234
234
|
*/
|
|
@@ -20,6 +20,14 @@ export interface Datastore {
|
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
type: string;
|
|
23
|
+
/**
|
|
24
|
+
* Storage access category derived from Datastore.Type
|
|
25
|
+
*/
|
|
26
|
+
storageProtocol?: DatastoreStorageProtocolEnum;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this datastore supports vSAN point-in-time snapshots
|
|
29
|
+
*/
|
|
30
|
+
vsanSnapshotSupport?: boolean;
|
|
23
31
|
/**
|
|
24
32
|
*
|
|
25
33
|
*/
|
|
@@ -57,6 +65,15 @@ export interface Datastore {
|
|
|
57
65
|
*/
|
|
58
66
|
storageIoConfiguration?: StorageIoConfiguration;
|
|
59
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export declare const DatastoreStorageProtocolEnum: {
|
|
72
|
+
readonly Block: "Block";
|
|
73
|
+
readonly File: "File";
|
|
74
|
+
readonly Object: "Object";
|
|
75
|
+
};
|
|
76
|
+
export type DatastoreStorageProtocolEnum = typeof DatastoreStorageProtocolEnum[keyof typeof DatastoreStorageProtocolEnum];
|
|
60
77
|
/**
|
|
61
78
|
* Check if a given object implements the Datastore interface.
|
|
62
79
|
*/
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { StorageIoConfigurationFromJSON, StorageIoConfigurationToJSON, } from './StorageIoConfiguration.js';
|
|
15
|
+
/**
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const DatastoreStorageProtocolEnum = {
|
|
19
|
+
Block: 'Block',
|
|
20
|
+
File: 'File',
|
|
21
|
+
Object: 'Object',
|
|
22
|
+
};
|
|
15
23
|
/**
|
|
16
24
|
* Check if a given object implements the Datastore interface.
|
|
17
25
|
*/
|
|
@@ -43,6 +51,8 @@ export function DatastoreFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
51
|
}
|
|
44
52
|
return {
|
|
45
53
|
'type': json['type'],
|
|
54
|
+
'storageProtocol': json['storageProtocol'] == null ? undefined : json['storageProtocol'],
|
|
55
|
+
'vsanSnapshotSupport': json['vsanSnapshotSupport'] == null ? undefined : json['vsanSnapshotSupport'],
|
|
46
56
|
'totalCapacityGB': json['totalCapacityGB'],
|
|
47
57
|
'freeCapacityGB': json['freeCapacityGB'],
|
|
48
58
|
'vendor': json['vendor'],
|
|
@@ -63,6 +73,8 @@ export function DatastoreToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
63
73
|
}
|
|
64
74
|
return {
|
|
65
75
|
'type': value['type'],
|
|
76
|
+
'storageProtocol': value['storageProtocol'],
|
|
77
|
+
'vsanSnapshotSupport': value['vsanSnapshotSupport'],
|
|
66
78
|
'totalCapacityGB': value['totalCapacityGB'],
|
|
67
79
|
'freeCapacityGB': value['freeCapacityGB'],
|
|
68
80
|
'vendor': value['vendor'],
|
package/dist/esm/runtime.d.ts
CHANGED
|
@@ -184,23 +184,30 @@ export declare class VoidApiResponse {
|
|
|
184
184
|
constructor(raw: Response);
|
|
185
185
|
value(): Promise<void>;
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* A Blob carrying the file name the server advertised, empty when it did not send one. It is a File
|
|
189
|
+
* wherever one can be built, and the bare Blob given a name otherwise. Same name and shape as the
|
|
190
|
+
* `typescript` generator's browser HttpFile.
|
|
191
|
+
*/
|
|
192
|
+
export type HttpFile = Blob & {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
};
|
|
187
195
|
export declare class BlobApiResponse {
|
|
188
196
|
raw: Response;
|
|
189
197
|
constructor(raw: Response);
|
|
190
198
|
/**
|
|
191
|
-
* The body
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
199
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
200
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
201
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
202
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
203
|
+
* would stringify instead of wrapping.
|
|
195
204
|
*/
|
|
196
|
-
value(): Promise<
|
|
205
|
+
value(): Promise<HttpFile>;
|
|
197
206
|
}
|
|
198
207
|
/**
|
|
199
208
|
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
200
|
-
* `filename*` parameter first,
|
|
201
|
-
*
|
|
202
|
-
* part is dropped so that the name is safe to write to disk as is; undefined when no usable name
|
|
203
|
-
* is advertised.
|
|
209
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
210
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
204
211
|
*/
|
|
205
212
|
export declare function parseContentDispositionFilename(headers: Headers): string | undefined;
|
|
206
213
|
export declare class TextApiResponse {
|
package/dist/esm/runtime.js
CHANGED
|
@@ -381,90 +381,71 @@ export class BlobApiResponse {
|
|
|
381
381
|
this.raw = raw;
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
|
-
* The body
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
384
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
385
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
386
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
387
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
388
|
+
* would stringify instead of wrapping.
|
|
388
389
|
*/
|
|
389
390
|
value() {
|
|
390
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
391
392
|
var _a;
|
|
392
393
|
const blob = yield this.raw.blob();
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
const name = (_a = parseContentDispositionFilename(this.raw.headers)) !== null && _a !== void 0 ? _a : '';
|
|
395
|
+
if (typeof File !== 'undefined' && blob instanceof Blob) {
|
|
396
|
+
try {
|
|
397
|
+
return new File([blob], name, { type: blob.type });
|
|
398
|
+
}
|
|
399
|
+
catch (_b) {
|
|
400
|
+
// File cannot be constructed: name the Blob itself
|
|
401
|
+
}
|
|
395
402
|
}
|
|
396
|
-
return
|
|
403
|
+
return Object.assign(blob, { name });
|
|
397
404
|
});
|
|
398
405
|
}
|
|
399
406
|
;
|
|
400
407
|
}
|
|
401
408
|
/**
|
|
402
409
|
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
403
|
-
* `filename*` parameter first,
|
|
404
|
-
*
|
|
405
|
-
* part is dropped so that the name is safe to write to disk as is; undefined when no usable name
|
|
406
|
-
* is advertised.
|
|
410
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
411
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
407
412
|
*/
|
|
408
413
|
export function parseContentDispositionFilename(headers) {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
414
|
+
var _a, _b;
|
|
415
|
+
const params = parseHeaderParameters((_a = headers.get('Content-Disposition')) !== null && _a !== void 0 ? _a : '');
|
|
416
|
+
return (_b = basename(decodeExtValue(params.get('filename*')))) !== null && _b !== void 0 ? _b : basename(params.get('filename'));
|
|
417
|
+
}
|
|
418
|
+
/** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
|
|
419
|
+
function decodeExtValue(value) {
|
|
420
|
+
const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
|
|
421
|
+
try {
|
|
422
|
+
return match ? decodeURIComponent(match[1]) : undefined;
|
|
412
423
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (encoded !== undefined) {
|
|
416
|
-
const extValue = /^utf-8'[^']*'(.*)$/i.exec(encoded);
|
|
417
|
-
if (extValue) {
|
|
418
|
-
try {
|
|
419
|
-
return basename(decodeURIComponent(extValue[1]));
|
|
420
|
-
}
|
|
421
|
-
catch (_a) {
|
|
422
|
-
// malformed percent-encoding: fall through to the plain form
|
|
423
|
-
}
|
|
424
|
-
}
|
|
424
|
+
catch (_a) {
|
|
425
|
+
return undefined;
|
|
425
426
|
}
|
|
426
|
-
const plain = params.get('filename');
|
|
427
|
-
return plain === undefined ? undefined : basename(plain);
|
|
428
427
|
}
|
|
429
428
|
/**
|
|
430
|
-
* The `name=value` parameters of a header value,
|
|
431
|
-
* lower-cased, quoted-string values are unquoted with their
|
|
432
|
-
* first occurrence of a name wins.
|
|
429
|
+
* The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
|
|
430
|
+
* taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
|
|
431
|
+
* backslash escapes resolved, and the first occurrence of a name wins.
|
|
433
432
|
*/
|
|
434
433
|
function parseHeaderParameters(value) {
|
|
435
434
|
const params = new Map();
|
|
436
|
-
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
if (
|
|
441
|
-
|
|
442
|
-
const eq = part.indexOf('=');
|
|
443
|
-
if (eq !== -1) {
|
|
444
|
-
const name = part.slice(0, eq).trim().toLowerCase();
|
|
445
|
-
let raw = part.slice(eq + 1).trim();
|
|
446
|
-
if (raw.startsWith('"')) {
|
|
447
|
-
raw = raw.slice(1, raw.length > 1 && raw.endsWith('"') ? -1 : undefined).replace(/\\(.)/g, '$1');
|
|
448
|
-
}
|
|
449
|
-
if (name && !params.has(name)) {
|
|
450
|
-
params.set(name, raw);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
start = i + 1;
|
|
454
|
-
}
|
|
455
|
-
else if (c === '"') {
|
|
456
|
-
quoted = !quoted;
|
|
457
|
-
}
|
|
458
|
-
else if (c === '\\' && quoted) {
|
|
459
|
-
i++;
|
|
435
|
+
const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
|
|
436
|
+
let match;
|
|
437
|
+
while ((match = parameter.exec(value)) !== null) {
|
|
438
|
+
const name = match[1].toLowerCase();
|
|
439
|
+
if (!params.has(name)) {
|
|
440
|
+
params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
|
|
460
441
|
}
|
|
461
442
|
}
|
|
462
443
|
return params;
|
|
463
444
|
}
|
|
464
|
-
/** The last
|
|
445
|
+
/** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
|
|
465
446
|
function basename(name) {
|
|
466
|
-
const base = name
|
|
467
|
-
return base
|
|
447
|
+
const base = name === null || name === void 0 ? void 0 : name.split(/[\\/]/).pop();
|
|
448
|
+
return !base || base === '.' || base === '..' ? undefined : base;
|
|
468
449
|
}
|
|
469
450
|
export class TextApiResponse {
|
|
470
451
|
constructor(raw) {
|
|
@@ -20,6 +20,14 @@ export interface Datastore {
|
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
type: string;
|
|
23
|
+
/**
|
|
24
|
+
* Storage access category derived from Datastore.Type
|
|
25
|
+
*/
|
|
26
|
+
storageProtocol?: DatastoreStorageProtocolEnum;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this datastore supports vSAN point-in-time snapshots
|
|
29
|
+
*/
|
|
30
|
+
vsanSnapshotSupport?: boolean;
|
|
23
31
|
/**
|
|
24
32
|
*
|
|
25
33
|
*/
|
|
@@ -57,6 +65,15 @@ export interface Datastore {
|
|
|
57
65
|
*/
|
|
58
66
|
storageIoConfiguration?: StorageIoConfiguration;
|
|
59
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export declare const DatastoreStorageProtocolEnum: {
|
|
72
|
+
readonly Block: "Block";
|
|
73
|
+
readonly File: "File";
|
|
74
|
+
readonly Object: "Object";
|
|
75
|
+
};
|
|
76
|
+
export type DatastoreStorageProtocolEnum = typeof DatastoreStorageProtocolEnum[keyof typeof DatastoreStorageProtocolEnum];
|
|
60
77
|
/**
|
|
61
78
|
* Check if a given object implements the Datastore interface.
|
|
62
79
|
*/
|
package/dist/models/Datastore.js
CHANGED
|
@@ -13,12 +13,21 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DatastoreStorageProtocolEnum = void 0;
|
|
16
17
|
exports.instanceOfDatastore = instanceOfDatastore;
|
|
17
18
|
exports.DatastoreFromJSON = DatastoreFromJSON;
|
|
18
19
|
exports.DatastoreFromJSONTyped = DatastoreFromJSONTyped;
|
|
19
20
|
exports.DatastoreToJSON = DatastoreToJSON;
|
|
20
21
|
exports.DatastoreToJSONTyped = DatastoreToJSONTyped;
|
|
21
22
|
const StorageIoConfiguration_js_1 = require("./StorageIoConfiguration.js");
|
|
23
|
+
/**
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.DatastoreStorageProtocolEnum = {
|
|
27
|
+
Block: 'Block',
|
|
28
|
+
File: 'File',
|
|
29
|
+
Object: 'Object',
|
|
30
|
+
};
|
|
22
31
|
/**
|
|
23
32
|
* Check if a given object implements the Datastore interface.
|
|
24
33
|
*/
|
|
@@ -50,6 +59,8 @@ function DatastoreFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
50
59
|
}
|
|
51
60
|
return {
|
|
52
61
|
'type': json['type'],
|
|
62
|
+
'storageProtocol': json['storageProtocol'] == null ? undefined : json['storageProtocol'],
|
|
63
|
+
'vsanSnapshotSupport': json['vsanSnapshotSupport'] == null ? undefined : json['vsanSnapshotSupport'],
|
|
53
64
|
'totalCapacityGB': json['totalCapacityGB'],
|
|
54
65
|
'freeCapacityGB': json['freeCapacityGB'],
|
|
55
66
|
'vendor': json['vendor'],
|
|
@@ -70,6 +81,8 @@ function DatastoreToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
70
81
|
}
|
|
71
82
|
return {
|
|
72
83
|
'type': value['type'],
|
|
84
|
+
'storageProtocol': value['storageProtocol'],
|
|
85
|
+
'vsanSnapshotSupport': value['vsanSnapshotSupport'],
|
|
73
86
|
'totalCapacityGB': value['totalCapacityGB'],
|
|
74
87
|
'freeCapacityGB': value['freeCapacityGB'],
|
|
75
88
|
'vendor': value['vendor'],
|
package/dist/runtime.d.ts
CHANGED
|
@@ -184,23 +184,30 @@ export declare class VoidApiResponse {
|
|
|
184
184
|
constructor(raw: Response);
|
|
185
185
|
value(): Promise<void>;
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* A Blob carrying the file name the server advertised, empty when it did not send one. It is a File
|
|
189
|
+
* wherever one can be built, and the bare Blob given a name otherwise. Same name and shape as the
|
|
190
|
+
* `typescript` generator's browser HttpFile.
|
|
191
|
+
*/
|
|
192
|
+
export type HttpFile = Blob & {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
};
|
|
187
195
|
export declare class BlobApiResponse {
|
|
188
196
|
raw: Response;
|
|
189
197
|
constructor(raw: Response);
|
|
190
198
|
/**
|
|
191
|
-
* The body
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
199
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
200
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
201
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
202
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
203
|
+
* would stringify instead of wrapping.
|
|
195
204
|
*/
|
|
196
|
-
value(): Promise<
|
|
205
|
+
value(): Promise<HttpFile>;
|
|
197
206
|
}
|
|
198
207
|
/**
|
|
199
208
|
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
200
|
-
* `filename*` parameter first,
|
|
201
|
-
*
|
|
202
|
-
* part is dropped so that the name is safe to write to disk as is; undefined when no usable name
|
|
203
|
-
* is advertised.
|
|
209
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
210
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
204
211
|
*/
|
|
205
212
|
export declare function parseContentDispositionFilename(headers: Headers): string | undefined;
|
|
206
213
|
export declare class TextApiResponse {
|
package/dist/runtime.js
CHANGED
|
@@ -401,19 +401,26 @@ class BlobApiResponse {
|
|
|
401
401
|
this.raw = raw;
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
|
-
* The body
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
404
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
405
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
406
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
407
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
408
|
+
* would stringify instead of wrapping.
|
|
408
409
|
*/
|
|
409
410
|
value() {
|
|
410
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
411
412
|
var _a;
|
|
412
413
|
const blob = yield this.raw.blob();
|
|
413
|
-
|
|
414
|
-
|
|
414
|
+
const name = (_a = parseContentDispositionFilename(this.raw.headers)) !== null && _a !== void 0 ? _a : '';
|
|
415
|
+
if (typeof File !== 'undefined' && blob instanceof Blob) {
|
|
416
|
+
try {
|
|
417
|
+
return new File([blob], name, { type: blob.type });
|
|
418
|
+
}
|
|
419
|
+
catch (_b) {
|
|
420
|
+
// File cannot be constructed: name the Blob itself
|
|
421
|
+
}
|
|
415
422
|
}
|
|
416
|
-
return
|
|
423
|
+
return Object.assign(blob, { name });
|
|
417
424
|
});
|
|
418
425
|
}
|
|
419
426
|
;
|
|
@@ -421,71 +428,45 @@ class BlobApiResponse {
|
|
|
421
428
|
exports.BlobApiResponse = BlobApiResponse;
|
|
422
429
|
/**
|
|
423
430
|
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
424
|
-
* `filename*` parameter first,
|
|
425
|
-
*
|
|
426
|
-
* part is dropped so that the name is safe to write to disk as is; undefined when no usable name
|
|
427
|
-
* is advertised.
|
|
431
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
432
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
428
433
|
*/
|
|
429
434
|
function parseContentDispositionFilename(headers) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
435
|
+
var _a, _b;
|
|
436
|
+
const params = parseHeaderParameters((_a = headers.get('Content-Disposition')) !== null && _a !== void 0 ? _a : '');
|
|
437
|
+
return (_b = basename(decodeExtValue(params.get('filename*')))) !== null && _b !== void 0 ? _b : basename(params.get('filename'));
|
|
438
|
+
}
|
|
439
|
+
/** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
|
|
440
|
+
function decodeExtValue(value) {
|
|
441
|
+
const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
|
|
442
|
+
try {
|
|
443
|
+
return match ? decodeURIComponent(match[1]) : undefined;
|
|
433
444
|
}
|
|
434
|
-
|
|
435
|
-
|
|
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
|
-
}
|
|
445
|
+
catch (_a) {
|
|
446
|
+
return undefined;
|
|
446
447
|
}
|
|
447
|
-
const plain = params.get('filename');
|
|
448
|
-
return plain === undefined ? undefined : basename(plain);
|
|
449
448
|
}
|
|
450
449
|
/**
|
|
451
|
-
* The `name=value` parameters of a header value,
|
|
452
|
-
* lower-cased, quoted-string values are unquoted with their
|
|
453
|
-
* first occurrence of a name wins.
|
|
450
|
+
* The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
|
|
451
|
+
* taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
|
|
452
|
+
* backslash escapes resolved, and the first occurrence of a name wins.
|
|
454
453
|
*/
|
|
455
454
|
function parseHeaderParameters(value) {
|
|
456
455
|
const params = new Map();
|
|
457
|
-
|
|
458
|
-
let
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
462
|
-
|
|
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++;
|
|
456
|
+
const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
|
|
457
|
+
let match;
|
|
458
|
+
while ((match = parameter.exec(value)) !== null) {
|
|
459
|
+
const name = match[1].toLowerCase();
|
|
460
|
+
if (!params.has(name)) {
|
|
461
|
+
params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
|
|
481
462
|
}
|
|
482
463
|
}
|
|
483
464
|
return params;
|
|
484
465
|
}
|
|
485
|
-
/** The last
|
|
466
|
+
/** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
|
|
486
467
|
function basename(name) {
|
|
487
|
-
const base = name
|
|
488
|
-
return base
|
|
468
|
+
const base = name === null || name === void 0 ? void 0 : name.split(/[\\/]/).pop();
|
|
469
|
+
return !base || base === '.' || base === '..' ? undefined : base;
|
|
489
470
|
}
|
|
490
471
|
class TextApiResponse {
|
|
491
472
|
constructor(raw) {
|
package/docs/Datastore.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`type` | string
|
|
10
|
+
`storageProtocol` | string
|
|
11
|
+
`vsanSnapshotSupport` | boolean
|
|
10
12
|
`totalCapacityGB` | number
|
|
11
13
|
`freeCapacityGB` | number
|
|
12
14
|
`vendor` | string
|
|
@@ -25,6 +27,8 @@ import type { Datastore } from '@openshift-migration-advisor/agent-sdk'
|
|
|
25
27
|
// TODO: Update the object below with actual values
|
|
26
28
|
const example = {
|
|
27
29
|
"type": null,
|
|
30
|
+
"storageProtocol": null,
|
|
31
|
+
"vsanSnapshotSupport": null,
|
|
28
32
|
"totalCapacityGB": null,
|
|
29
33
|
"freeCapacityGB": null,
|
|
30
34
|
"vendor": null,
|
package/package.json
CHANGED
|
@@ -182,12 +182,12 @@ export interface CollectionsApiInterface {
|
|
|
182
182
|
* @throws {RequiredError}
|
|
183
183
|
* @memberof CollectionsApiInterface
|
|
184
184
|
*/
|
|
185
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
185
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
189
189
|
*/
|
|
190
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
190
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Creates request options for listCollections without sending the request
|
|
@@ -413,7 +413,7 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
|
|
|
413
413
|
/**
|
|
414
414
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
415
415
|
*/
|
|
416
|
-
async exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
416
|
+
async exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>> {
|
|
417
417
|
const requestOptions = await this.exportCollectionRequestOpts(requestParameters);
|
|
418
418
|
const response = await this.request(requestOptions, initOverrides);
|
|
419
419
|
|
|
@@ -423,7 +423,7 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
|
|
|
423
423
|
/**
|
|
424
424
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
425
425
|
*/
|
|
426
|
-
async exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
426
|
+
async exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile> {
|
|
427
427
|
const response = await this.exportCollectionRaw(requestParameters, initOverrides);
|
|
428
428
|
return await response.value();
|
|
429
429
|
}
|
package/src/models/Datastore.ts
CHANGED
|
@@ -31,6 +31,14 @@ export interface Datastore {
|
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
33
|
type: string;
|
|
34
|
+
/**
|
|
35
|
+
* Storage access category derived from Datastore.Type
|
|
36
|
+
*/
|
|
37
|
+
storageProtocol?: DatastoreStorageProtocolEnum;
|
|
38
|
+
/**
|
|
39
|
+
* Whether this datastore supports vSAN point-in-time snapshots
|
|
40
|
+
*/
|
|
41
|
+
vsanSnapshotSupport?: boolean;
|
|
34
42
|
/**
|
|
35
43
|
*
|
|
36
44
|
*/
|
|
@@ -69,6 +77,18 @@ export interface Datastore {
|
|
|
69
77
|
storageIoConfiguration?: StorageIoConfiguration;
|
|
70
78
|
}
|
|
71
79
|
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @export
|
|
83
|
+
*/
|
|
84
|
+
export const DatastoreStorageProtocolEnum = {
|
|
85
|
+
Block: 'Block',
|
|
86
|
+
File: 'File',
|
|
87
|
+
Object: 'Object',
|
|
88
|
+
} as const;
|
|
89
|
+
export type DatastoreStorageProtocolEnum = typeof DatastoreStorageProtocolEnum[keyof typeof DatastoreStorageProtocolEnum];
|
|
90
|
+
|
|
91
|
+
|
|
72
92
|
/**
|
|
73
93
|
* Check if a given object implements the Datastore interface.
|
|
74
94
|
*/
|
|
@@ -95,6 +115,8 @@ export function DatastoreFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
95
115
|
return {
|
|
96
116
|
|
|
97
117
|
'type': json['type'],
|
|
118
|
+
'storageProtocol': json['storageProtocol'] == null ? undefined : json['storageProtocol'],
|
|
119
|
+
'vsanSnapshotSupport': json['vsanSnapshotSupport'] == null ? undefined : json['vsanSnapshotSupport'],
|
|
98
120
|
'totalCapacityGB': json['totalCapacityGB'],
|
|
99
121
|
'freeCapacityGB': json['freeCapacityGB'],
|
|
100
122
|
'vendor': json['vendor'],
|
|
@@ -119,6 +141,8 @@ export function DatastoreToJSONTyped(value?: Datastore | null, ignoreDiscriminat
|
|
|
119
141
|
return {
|
|
120
142
|
|
|
121
143
|
'type': value['type'],
|
|
144
|
+
'storageProtocol': value['storageProtocol'],
|
|
145
|
+
'vsanSnapshotSupport': value['vsanSnapshotSupport'],
|
|
122
146
|
'totalCapacityGB': value['totalCapacityGB'],
|
|
123
147
|
'freeCapacityGB': value['freeCapacityGB'],
|
|
124
148
|
'vendor': value['vendor'],
|
package/src/runtime.ts
CHANGED
|
@@ -488,90 +488,79 @@ export class VoidApiResponse {
|
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
+
/**
|
|
492
|
+
* A Blob carrying the file name the server advertised, empty when it did not send one. It is a File
|
|
493
|
+
* wherever one can be built, and the bare Blob given a name otherwise. Same name and shape as the
|
|
494
|
+
* `typescript` generator's browser HttpFile.
|
|
495
|
+
*/
|
|
496
|
+
export type HttpFile = Blob & { readonly name: string };
|
|
497
|
+
|
|
491
498
|
export class BlobApiResponse {
|
|
492
499
|
constructor(public raw: Response) {}
|
|
493
500
|
|
|
494
501
|
/**
|
|
495
|
-
* The body
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
502
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
503
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
504
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
505
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
506
|
+
* would stringify instead of wrapping.
|
|
499
507
|
*/
|
|
500
|
-
async value(): Promise<
|
|
508
|
+
async value(): Promise<HttpFile> {
|
|
501
509
|
const blob = await this.raw.blob();
|
|
502
|
-
|
|
503
|
-
|
|
510
|
+
const name = parseContentDispositionFilename(this.raw.headers) ?? '';
|
|
511
|
+
if (typeof File !== 'undefined' && blob instanceof Blob) {
|
|
512
|
+
try {
|
|
513
|
+
return new File([blob], name, { type: blob.type });
|
|
514
|
+
} catch {
|
|
515
|
+
// File cannot be constructed: name the Blob itself
|
|
516
|
+
}
|
|
504
517
|
}
|
|
505
|
-
return
|
|
518
|
+
return Object.assign(blob, { name });
|
|
506
519
|
};
|
|
507
520
|
}
|
|
508
521
|
|
|
509
522
|
/**
|
|
510
523
|
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
511
|
-
* `filename*` parameter first,
|
|
512
|
-
*
|
|
513
|
-
* part is dropped so that the name is safe to write to disk as is; undefined when no usable name
|
|
514
|
-
* is advertised.
|
|
524
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
525
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
515
526
|
*/
|
|
516
527
|
export function parseContentDispositionFilename(headers: Headers): string | undefined {
|
|
517
|
-
const
|
|
518
|
-
|
|
528
|
+
const params = parseHeaderParameters(headers.get('Content-Disposition') ?? '');
|
|
529
|
+
return basename(decodeExtValue(params.get('filename*'))) ?? basename(params.get('filename'));
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
|
|
533
|
+
function decodeExtValue(value: string | undefined): string | undefined {
|
|
534
|
+
const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
|
|
535
|
+
try {
|
|
536
|
+
return match ? decodeURIComponent(match[1]) : undefined;
|
|
537
|
+
} catch {
|
|
519
538
|
return undefined;
|
|
520
539
|
}
|
|
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
540
|
}
|
|
536
541
|
|
|
537
542
|
/**
|
|
538
|
-
* The `name=value` parameters of a header value,
|
|
539
|
-
* lower-cased, quoted-string values are unquoted with their
|
|
540
|
-
* first occurrence of a name wins.
|
|
543
|
+
* The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
|
|
544
|
+
* taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
|
|
545
|
+
* backslash escapes resolved, and the first occurrence of a name wins.
|
|
541
546
|
*/
|
|
542
547
|
function parseHeaderParameters(value: string): Map<string, string> {
|
|
543
548
|
const params = new Map<string, string>();
|
|
544
|
-
|
|
545
|
-
let
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
|
|
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++;
|
|
549
|
+
const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
|
|
550
|
+
let match: RegExpExecArray | null;
|
|
551
|
+
while ((match = parameter.exec(value)) !== null) {
|
|
552
|
+
const name = match[1].toLowerCase();
|
|
553
|
+
if (!params.has(name)) {
|
|
554
|
+
params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
|
|
566
555
|
}
|
|
567
556
|
}
|
|
568
557
|
return params;
|
|
569
558
|
}
|
|
570
559
|
|
|
571
|
-
/** The last
|
|
572
|
-
function basename(name: string): string | undefined {
|
|
573
|
-
const base = name
|
|
574
|
-
return base
|
|
560
|
+
/** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
|
|
561
|
+
function basename(name: string | undefined): string | undefined {
|
|
562
|
+
const base = name?.split(/[\\/]/).pop();
|
|
563
|
+
return !base || base === '.' || base === '..' ? undefined : base;
|
|
575
564
|
}
|
|
576
565
|
|
|
577
566
|
export class TextApiResponse {
|