@azure/storage-file-share 12.9.0-alpha.20220128.2 → 12.9.0-alpha.20220210.2
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/CHANGELOG.md +5 -8
- package/dist/index.js +584 -44
- package/dist/index.js.map +1 -1
- package/dist-esm/src/Clients.js +125 -1
- package/dist-esm/src/Clients.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/mappers.js +232 -0
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +101 -35
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/operations/directory.js +48 -0
- package/dist-esm/src/generated/src/operations/directory.js.map +1 -1
- package/dist-esm/src/generated/src/operations/file.js +51 -7
- package/dist-esm/src/generated/src/operations/file.js.map +1 -1
- package/dist-esm/src/generated/src/storageClientContext.js +1 -1
- package/dist-esm/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/src/generatedModels.js.map +1 -1
- package/dist-esm/src/utils/utils.common.js +22 -0
- package/dist-esm/src/utils/utils.common.js.map +1 -1
- package/package.json +1 -1
- package/types/3.1/storage-file-share.d.ts +225 -4
- package/types/latest/storage-file-share.d.ts +231 -4
package/dist/index.js
CHANGED
@@ -825,6 +825,28 @@ function getShareNameAndPathFromUrl(url) {
|
|
825
825
|
function httpAuthorizationToString(httpAuthorization) {
|
826
826
|
return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
|
827
827
|
}
|
828
|
+
/**
|
829
|
+
* Set URL path.
|
830
|
+
*
|
831
|
+
* @param url - URL to change path to.
|
832
|
+
* @param path - Path to set into the URL.
|
833
|
+
*/
|
834
|
+
function setURLPath(url, path) {
|
835
|
+
const urlParsed = coreHttp.URLBuilder.parse(url);
|
836
|
+
urlParsed.setPath(path);
|
837
|
+
return urlParsed.toString();
|
838
|
+
}
|
839
|
+
/**
|
840
|
+
* Set URL query string.
|
841
|
+
*
|
842
|
+
* @param url - URL to set query string to.
|
843
|
+
* @param queryString - Query string to set to the URL.
|
844
|
+
*/
|
845
|
+
function setURLQueries(url, queryString) {
|
846
|
+
const urlParsed = coreHttp.URLBuilder.parse(url);
|
847
|
+
urlParsed.setQuery(queryString);
|
848
|
+
return urlParsed.toString();
|
849
|
+
}
|
828
850
|
|
829
851
|
// Copyright (c) Microsoft Corporation.
|
830
852
|
/**
|
@@ -4477,6 +4499,122 @@ const DirectoryForceCloseHandlesExceptionHeaders = {
|
|
4477
4499
|
}
|
4478
4500
|
}
|
4479
4501
|
};
|
4502
|
+
const DirectoryRenameHeaders = {
|
4503
|
+
serializedName: "Directory_renameHeaders",
|
4504
|
+
type: {
|
4505
|
+
name: "Composite",
|
4506
|
+
className: "DirectoryRenameHeaders",
|
4507
|
+
modelProperties: {
|
4508
|
+
etag: {
|
4509
|
+
serializedName: "etag",
|
4510
|
+
xmlName: "etag",
|
4511
|
+
type: {
|
4512
|
+
name: "String"
|
4513
|
+
}
|
4514
|
+
},
|
4515
|
+
lastModified: {
|
4516
|
+
serializedName: "last-modified",
|
4517
|
+
xmlName: "last-modified",
|
4518
|
+
type: {
|
4519
|
+
name: "DateTimeRfc1123"
|
4520
|
+
}
|
4521
|
+
},
|
4522
|
+
requestId: {
|
4523
|
+
serializedName: "x-ms-request-id",
|
4524
|
+
xmlName: "x-ms-request-id",
|
4525
|
+
type: {
|
4526
|
+
name: "String"
|
4527
|
+
}
|
4528
|
+
},
|
4529
|
+
version: {
|
4530
|
+
serializedName: "x-ms-version",
|
4531
|
+
xmlName: "x-ms-version",
|
4532
|
+
type: {
|
4533
|
+
name: "String"
|
4534
|
+
}
|
4535
|
+
},
|
4536
|
+
date: {
|
4537
|
+
serializedName: "date",
|
4538
|
+
xmlName: "date",
|
4539
|
+
type: {
|
4540
|
+
name: "DateTimeRfc1123"
|
4541
|
+
}
|
4542
|
+
},
|
4543
|
+
isServerEncrypted: {
|
4544
|
+
serializedName: "x-ms-request-server-encrypted",
|
4545
|
+
xmlName: "x-ms-request-server-encrypted",
|
4546
|
+
type: {
|
4547
|
+
name: "Boolean"
|
4548
|
+
}
|
4549
|
+
},
|
4550
|
+
filePermissionKey: {
|
4551
|
+
serializedName: "x-ms-file-permission-key",
|
4552
|
+
xmlName: "x-ms-file-permission-key",
|
4553
|
+
type: {
|
4554
|
+
name: "String"
|
4555
|
+
}
|
4556
|
+
},
|
4557
|
+
fileAttributes: {
|
4558
|
+
serializedName: "x-ms-file-attributes",
|
4559
|
+
xmlName: "x-ms-file-attributes",
|
4560
|
+
type: {
|
4561
|
+
name: "String"
|
4562
|
+
}
|
4563
|
+
},
|
4564
|
+
fileCreationTime: {
|
4565
|
+
serializedName: "x-ms-file-creation-time",
|
4566
|
+
xmlName: "x-ms-file-creation-time",
|
4567
|
+
type: {
|
4568
|
+
name: "DateTimeRfc1123"
|
4569
|
+
}
|
4570
|
+
},
|
4571
|
+
fileLastWriteTime: {
|
4572
|
+
serializedName: "x-ms-file-last-write-time",
|
4573
|
+
xmlName: "x-ms-file-last-write-time",
|
4574
|
+
type: {
|
4575
|
+
name: "DateTimeRfc1123"
|
4576
|
+
}
|
4577
|
+
},
|
4578
|
+
fileChangeTime: {
|
4579
|
+
serializedName: "x-ms-file-change-time",
|
4580
|
+
xmlName: "x-ms-file-change-time",
|
4581
|
+
type: {
|
4582
|
+
name: "DateTimeRfc1123"
|
4583
|
+
}
|
4584
|
+
},
|
4585
|
+
fileId: {
|
4586
|
+
serializedName: "x-ms-file-id",
|
4587
|
+
xmlName: "x-ms-file-id",
|
4588
|
+
type: {
|
4589
|
+
name: "String"
|
4590
|
+
}
|
4591
|
+
},
|
4592
|
+
fileParentId: {
|
4593
|
+
serializedName: "x-ms-file-parent-id",
|
4594
|
+
xmlName: "x-ms-file-parent-id",
|
4595
|
+
type: {
|
4596
|
+
name: "String"
|
4597
|
+
}
|
4598
|
+
}
|
4599
|
+
}
|
4600
|
+
}
|
4601
|
+
};
|
4602
|
+
const DirectoryRenameExceptionHeaders = {
|
4603
|
+
serializedName: "Directory_renameExceptionHeaders",
|
4604
|
+
type: {
|
4605
|
+
name: "Composite",
|
4606
|
+
className: "DirectoryRenameExceptionHeaders",
|
4607
|
+
modelProperties: {
|
4608
|
+
errorCode: {
|
4609
|
+
serializedName: "x-ms-error-code",
|
4610
|
+
xmlName: "x-ms-error-code",
|
4611
|
+
type: {
|
4612
|
+
name: "String"
|
4613
|
+
}
|
4614
|
+
}
|
4615
|
+
}
|
4616
|
+
}
|
4617
|
+
};
|
4480
4618
|
const FileCreateHeaders = {
|
4481
4619
|
serializedName: "File_createHeaders",
|
4482
4620
|
type: {
|
@@ -6173,6 +6311,122 @@ const FileForceCloseHandlesExceptionHeaders = {
|
|
6173
6311
|
}
|
6174
6312
|
}
|
6175
6313
|
};
|
6314
|
+
const FileRenameHeaders = {
|
6315
|
+
serializedName: "File_renameHeaders",
|
6316
|
+
type: {
|
6317
|
+
name: "Composite",
|
6318
|
+
className: "FileRenameHeaders",
|
6319
|
+
modelProperties: {
|
6320
|
+
etag: {
|
6321
|
+
serializedName: "etag",
|
6322
|
+
xmlName: "etag",
|
6323
|
+
type: {
|
6324
|
+
name: "String"
|
6325
|
+
}
|
6326
|
+
},
|
6327
|
+
lastModified: {
|
6328
|
+
serializedName: "last-modified",
|
6329
|
+
xmlName: "last-modified",
|
6330
|
+
type: {
|
6331
|
+
name: "DateTimeRfc1123"
|
6332
|
+
}
|
6333
|
+
},
|
6334
|
+
requestId: {
|
6335
|
+
serializedName: "x-ms-request-id",
|
6336
|
+
xmlName: "x-ms-request-id",
|
6337
|
+
type: {
|
6338
|
+
name: "String"
|
6339
|
+
}
|
6340
|
+
},
|
6341
|
+
version: {
|
6342
|
+
serializedName: "x-ms-version",
|
6343
|
+
xmlName: "x-ms-version",
|
6344
|
+
type: {
|
6345
|
+
name: "String"
|
6346
|
+
}
|
6347
|
+
},
|
6348
|
+
date: {
|
6349
|
+
serializedName: "date",
|
6350
|
+
xmlName: "date",
|
6351
|
+
type: {
|
6352
|
+
name: "DateTimeRfc1123"
|
6353
|
+
}
|
6354
|
+
},
|
6355
|
+
isServerEncrypted: {
|
6356
|
+
serializedName: "x-ms-request-server-encrypted",
|
6357
|
+
xmlName: "x-ms-request-server-encrypted",
|
6358
|
+
type: {
|
6359
|
+
name: "Boolean"
|
6360
|
+
}
|
6361
|
+
},
|
6362
|
+
filePermissionKey: {
|
6363
|
+
serializedName: "x-ms-file-permission-key",
|
6364
|
+
xmlName: "x-ms-file-permission-key",
|
6365
|
+
type: {
|
6366
|
+
name: "String"
|
6367
|
+
}
|
6368
|
+
},
|
6369
|
+
fileAttributes: {
|
6370
|
+
serializedName: "x-ms-file-attributes",
|
6371
|
+
xmlName: "x-ms-file-attributes",
|
6372
|
+
type: {
|
6373
|
+
name: "String"
|
6374
|
+
}
|
6375
|
+
},
|
6376
|
+
fileCreationTime: {
|
6377
|
+
serializedName: "x-ms-file-creation-time",
|
6378
|
+
xmlName: "x-ms-file-creation-time",
|
6379
|
+
type: {
|
6380
|
+
name: "DateTimeRfc1123"
|
6381
|
+
}
|
6382
|
+
},
|
6383
|
+
fileLastWriteTime: {
|
6384
|
+
serializedName: "x-ms-file-last-write-time",
|
6385
|
+
xmlName: "x-ms-file-last-write-time",
|
6386
|
+
type: {
|
6387
|
+
name: "DateTimeRfc1123"
|
6388
|
+
}
|
6389
|
+
},
|
6390
|
+
fileChangeTime: {
|
6391
|
+
serializedName: "x-ms-file-change-time",
|
6392
|
+
xmlName: "x-ms-file-change-time",
|
6393
|
+
type: {
|
6394
|
+
name: "DateTimeRfc1123"
|
6395
|
+
}
|
6396
|
+
},
|
6397
|
+
fileId: {
|
6398
|
+
serializedName: "x-ms-file-id",
|
6399
|
+
xmlName: "x-ms-file-id",
|
6400
|
+
type: {
|
6401
|
+
name: "String"
|
6402
|
+
}
|
6403
|
+
},
|
6404
|
+
fileParentId: {
|
6405
|
+
serializedName: "x-ms-file-parent-id",
|
6406
|
+
xmlName: "x-ms-file-parent-id",
|
6407
|
+
type: {
|
6408
|
+
name: "String"
|
6409
|
+
}
|
6410
|
+
}
|
6411
|
+
}
|
6412
|
+
}
|
6413
|
+
};
|
6414
|
+
const FileRenameExceptionHeaders = {
|
6415
|
+
serializedName: "File_renameExceptionHeaders",
|
6416
|
+
type: {
|
6417
|
+
name: "Composite",
|
6418
|
+
className: "FileRenameExceptionHeaders",
|
6419
|
+
modelProperties: {
|
6420
|
+
errorCode: {
|
6421
|
+
serializedName: "x-ms-error-code",
|
6422
|
+
xmlName: "x-ms-error-code",
|
6423
|
+
type: {
|
6424
|
+
name: "String"
|
6425
|
+
}
|
6426
|
+
}
|
6427
|
+
}
|
6428
|
+
}
|
6429
|
+
};
|
6176
6430
|
|
6177
6431
|
var Mappers = /*#__PURE__*/Object.freeze({
|
6178
6432
|
__proto__: null,
|
@@ -6257,6 +6511,8 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
6257
6511
|
DirectoryListHandlesExceptionHeaders: DirectoryListHandlesExceptionHeaders,
|
6258
6512
|
DirectoryForceCloseHandlesHeaders: DirectoryForceCloseHandlesHeaders,
|
6259
6513
|
DirectoryForceCloseHandlesExceptionHeaders: DirectoryForceCloseHandlesExceptionHeaders,
|
6514
|
+
DirectoryRenameHeaders: DirectoryRenameHeaders,
|
6515
|
+
DirectoryRenameExceptionHeaders: DirectoryRenameExceptionHeaders,
|
6260
6516
|
FileCreateHeaders: FileCreateHeaders,
|
6261
6517
|
FileCreateExceptionHeaders: FileCreateExceptionHeaders,
|
6262
6518
|
FileDownloadHeaders: FileDownloadHeaders,
|
@@ -6290,7 +6546,9 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
6290
6546
|
FileListHandlesHeaders: FileListHandlesHeaders,
|
6291
6547
|
FileListHandlesExceptionHeaders: FileListHandlesExceptionHeaders,
|
6292
6548
|
FileForceCloseHandlesHeaders: FileForceCloseHandlesHeaders,
|
6293
|
-
FileForceCloseHandlesExceptionHeaders: FileForceCloseHandlesExceptionHeaders
|
6549
|
+
FileForceCloseHandlesExceptionHeaders: FileForceCloseHandlesExceptionHeaders,
|
6550
|
+
FileRenameHeaders: FileRenameHeaders,
|
6551
|
+
FileRenameExceptionHeaders: FileRenameExceptionHeaders
|
6294
6552
|
});
|
6295
6553
|
|
6296
6554
|
/*
|
@@ -6376,7 +6634,7 @@ const timeoutInSeconds = {
|
|
6376
6634
|
const version = {
|
6377
6635
|
parameterPath: "version",
|
6378
6636
|
mapper: {
|
6379
|
-
defaultValue: "2021-
|
6637
|
+
defaultValue: "2021-04-10",
|
6380
6638
|
isConstant: true,
|
6381
6639
|
serializedName: "x-ms-version",
|
6382
6640
|
type: {
|
@@ -6938,6 +7196,102 @@ const handleId = {
|
|
6938
7196
|
}
|
6939
7197
|
}
|
6940
7198
|
};
|
7199
|
+
const comp11 = {
|
7200
|
+
parameterPath: "comp",
|
7201
|
+
mapper: {
|
7202
|
+
defaultValue: "rename",
|
7203
|
+
isConstant: true,
|
7204
|
+
serializedName: "comp",
|
7205
|
+
type: {
|
7206
|
+
name: "String"
|
7207
|
+
}
|
7208
|
+
}
|
7209
|
+
};
|
7210
|
+
const renameSource = {
|
7211
|
+
parameterPath: "renameSource",
|
7212
|
+
mapper: {
|
7213
|
+
serializedName: "x-ms-file-rename-source",
|
7214
|
+
required: true,
|
7215
|
+
xmlName: "x-ms-file-rename-source",
|
7216
|
+
type: {
|
7217
|
+
name: "String"
|
7218
|
+
}
|
7219
|
+
}
|
7220
|
+
};
|
7221
|
+
const replaceIfExists = {
|
7222
|
+
parameterPath: ["options", "replaceIfExists"],
|
7223
|
+
mapper: {
|
7224
|
+
serializedName: "x-ms-file-rename-replace-if-exists",
|
7225
|
+
xmlName: "x-ms-file-rename-replace-if-exists",
|
7226
|
+
type: {
|
7227
|
+
name: "Boolean"
|
7228
|
+
}
|
7229
|
+
}
|
7230
|
+
};
|
7231
|
+
const ignoreReadOnly = {
|
7232
|
+
parameterPath: ["options", "ignoreReadOnly"],
|
7233
|
+
mapper: {
|
7234
|
+
serializedName: "x-ms-file-rename-ignore-readonly",
|
7235
|
+
xmlName: "x-ms-file-rename-ignore-readonly",
|
7236
|
+
type: {
|
7237
|
+
name: "Boolean"
|
7238
|
+
}
|
7239
|
+
}
|
7240
|
+
};
|
7241
|
+
const sourceLeaseId = {
|
7242
|
+
parameterPath: ["options", "sourceLeaseAccessConditions", "sourceLeaseId"],
|
7243
|
+
mapper: {
|
7244
|
+
serializedName: "x-ms-source-lease-id",
|
7245
|
+
xmlName: "x-ms-source-lease-id",
|
7246
|
+
type: {
|
7247
|
+
name: "String"
|
7248
|
+
}
|
7249
|
+
}
|
7250
|
+
};
|
7251
|
+
const destinationLeaseId = {
|
7252
|
+
parameterPath: [
|
7253
|
+
"options",
|
7254
|
+
"destinationLeaseAccessConditions",
|
7255
|
+
"destinationLeaseId"
|
7256
|
+
],
|
7257
|
+
mapper: {
|
7258
|
+
serializedName: "x-ms-destination-lease-id",
|
7259
|
+
xmlName: "x-ms-destination-lease-id",
|
7260
|
+
type: {
|
7261
|
+
name: "String"
|
7262
|
+
}
|
7263
|
+
}
|
7264
|
+
};
|
7265
|
+
const fileAttributes1 = {
|
7266
|
+
parameterPath: ["options", "copyFileSmbInfo", "fileAttributes"],
|
7267
|
+
mapper: {
|
7268
|
+
serializedName: "x-ms-file-attributes",
|
7269
|
+
xmlName: "x-ms-file-attributes",
|
7270
|
+
type: {
|
7271
|
+
name: "String"
|
7272
|
+
}
|
7273
|
+
}
|
7274
|
+
};
|
7275
|
+
const fileCreationTime = {
|
7276
|
+
parameterPath: ["options", "copyFileSmbInfo", "fileCreationTime"],
|
7277
|
+
mapper: {
|
7278
|
+
serializedName: "x-ms-file-creation-time",
|
7279
|
+
xmlName: "x-ms-file-creation-time",
|
7280
|
+
type: {
|
7281
|
+
name: "String"
|
7282
|
+
}
|
7283
|
+
}
|
7284
|
+
};
|
7285
|
+
const fileLastWriteTime = {
|
7286
|
+
parameterPath: ["options", "copyFileSmbInfo", "fileLastWriteTime"],
|
7287
|
+
mapper: {
|
7288
|
+
serializedName: "x-ms-file-last-write-time",
|
7289
|
+
xmlName: "x-ms-file-last-write-time",
|
7290
|
+
type: {
|
7291
|
+
name: "String"
|
7292
|
+
}
|
7293
|
+
}
|
7294
|
+
};
|
6941
7295
|
const fileContentLength = {
|
6942
7296
|
parameterPath: "fileContentLength",
|
6943
7297
|
mapper: {
|
@@ -7082,7 +7436,7 @@ const accept3 = {
|
|
7082
7436
|
}
|
7083
7437
|
}
|
7084
7438
|
};
|
7085
|
-
const
|
7439
|
+
const comp12 = {
|
7086
7440
|
parameterPath: "comp",
|
7087
7441
|
mapper: {
|
7088
7442
|
defaultValue: "range",
|
@@ -7218,7 +7572,7 @@ const copySourceAuthorization = {
|
|
7218
7572
|
}
|
7219
7573
|
}
|
7220
7574
|
};
|
7221
|
-
const
|
7575
|
+
const comp13 = {
|
7222
7576
|
parameterPath: "comp",
|
7223
7577
|
mapper: {
|
7224
7578
|
defaultValue: "rangelist",
|
@@ -7250,7 +7604,7 @@ const filePermissionCopyMode = {
|
|
7250
7604
|
}
|
7251
7605
|
}
|
7252
7606
|
};
|
7253
|
-
const
|
7607
|
+
const ignoreReadOnly1 = {
|
7254
7608
|
parameterPath: ["options", "copyFileSmbInfo", "ignoreReadOnly"],
|
7255
7609
|
mapper: {
|
7256
7610
|
serializedName: "x-ms-file-copy-ignore-read-only",
|
@@ -7260,36 +7614,6 @@ const ignoreReadOnly = {
|
|
7260
7614
|
}
|
7261
7615
|
}
|
7262
7616
|
};
|
7263
|
-
const fileAttributes1 = {
|
7264
|
-
parameterPath: ["options", "copyFileSmbInfo", "fileAttributes"],
|
7265
|
-
mapper: {
|
7266
|
-
serializedName: "x-ms-file-attributes",
|
7267
|
-
xmlName: "x-ms-file-attributes",
|
7268
|
-
type: {
|
7269
|
-
name: "String"
|
7270
|
-
}
|
7271
|
-
}
|
7272
|
-
};
|
7273
|
-
const fileCreationTime = {
|
7274
|
-
parameterPath: ["options", "copyFileSmbInfo", "fileCreationTime"],
|
7275
|
-
mapper: {
|
7276
|
-
serializedName: "x-ms-file-creation-time",
|
7277
|
-
xmlName: "x-ms-file-creation-time",
|
7278
|
-
type: {
|
7279
|
-
name: "String"
|
7280
|
-
}
|
7281
|
-
}
|
7282
|
-
};
|
7283
|
-
const fileLastWriteTime = {
|
7284
|
-
parameterPath: ["options", "copyFileSmbInfo", "fileLastWriteTime"],
|
7285
|
-
mapper: {
|
7286
|
-
serializedName: "x-ms-file-last-write-time",
|
7287
|
-
xmlName: "x-ms-file-last-write-time",
|
7288
|
-
type: {
|
7289
|
-
name: "String"
|
7290
|
-
}
|
7291
|
-
}
|
7292
|
-
};
|
7293
7617
|
const setArchiveAttribute = {
|
7294
7618
|
parameterPath: ["options", "copyFileSmbInfo", "setArchiveAttribute"],
|
7295
7619
|
mapper: {
|
@@ -7300,7 +7624,7 @@ const setArchiveAttribute = {
|
|
7300
7624
|
}
|
7301
7625
|
}
|
7302
7626
|
};
|
7303
|
-
const
|
7627
|
+
const comp14 = {
|
7304
7628
|
parameterPath: "comp",
|
7305
7629
|
mapper: {
|
7306
7630
|
defaultValue: "copy",
|
@@ -8279,6 +8603,18 @@ class Directory {
|
|
8279
8603
|
};
|
8280
8604
|
return this.client.sendOperationRequest(operationArguments, forceCloseHandlesOperationSpec$1);
|
8281
8605
|
}
|
8606
|
+
/**
|
8607
|
+
* Renames a directory
|
8608
|
+
* @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length.
|
8609
|
+
* @param options The options parameters.
|
8610
|
+
*/
|
8611
|
+
rename(renameSource, options) {
|
8612
|
+
const operationArguments = {
|
8613
|
+
renameSource,
|
8614
|
+
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
|
8615
|
+
};
|
8616
|
+
return this.client.sendOperationRequest(operationArguments, renameOperationSpec$1);
|
8617
|
+
}
|
8282
8618
|
}
|
8283
8619
|
// Operation Specifications
|
8284
8620
|
const xmlSerializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
|
@@ -8494,6 +8830,42 @@ const forceCloseHandlesOperationSpec$1 = {
|
|
8494
8830
|
isXML: true,
|
8495
8831
|
serializer: xmlSerializer$1
|
8496
8832
|
};
|
8833
|
+
const renameOperationSpec$1 = {
|
8834
|
+
path: "/{shareName}/{directory}",
|
8835
|
+
httpMethod: "PUT",
|
8836
|
+
responses: {
|
8837
|
+
200: {
|
8838
|
+
headersMapper: DirectoryRenameHeaders
|
8839
|
+
},
|
8840
|
+
default: {
|
8841
|
+
bodyMapper: StorageError,
|
8842
|
+
headersMapper: DirectoryRenameExceptionHeaders
|
8843
|
+
}
|
8844
|
+
},
|
8845
|
+
queryParameters: [
|
8846
|
+
timeoutInSeconds,
|
8847
|
+
restype2,
|
8848
|
+
comp11
|
8849
|
+
],
|
8850
|
+
urlParameters: [url],
|
8851
|
+
headerParameters: [
|
8852
|
+
version,
|
8853
|
+
accept1,
|
8854
|
+
metadata,
|
8855
|
+
filePermission,
|
8856
|
+
filePermissionKey1,
|
8857
|
+
renameSource,
|
8858
|
+
replaceIfExists,
|
8859
|
+
ignoreReadOnly,
|
8860
|
+
sourceLeaseId,
|
8861
|
+
destinationLeaseId,
|
8862
|
+
fileAttributes1,
|
8863
|
+
fileCreationTime,
|
8864
|
+
fileLastWriteTime
|
8865
|
+
],
|
8866
|
+
isXML: true,
|
8867
|
+
serializer: xmlSerializer$1
|
8868
|
+
};
|
8497
8869
|
|
8498
8870
|
/*
|
8499
8871
|
* Copyright (c) Microsoft Corporation.
|
@@ -8747,6 +9119,18 @@ class File {
|
|
8747
9119
|
};
|
8748
9120
|
return this.client.sendOperationRequest(operationArguments, forceCloseHandlesOperationSpec);
|
8749
9121
|
}
|
9122
|
+
/**
|
9123
|
+
* Renames a file
|
9124
|
+
* @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length.
|
9125
|
+
* @param options The options parameters.
|
9126
|
+
*/
|
9127
|
+
rename(renameSource, options) {
|
9128
|
+
const operationArguments = {
|
9129
|
+
renameSource,
|
9130
|
+
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
|
9131
|
+
};
|
9132
|
+
return this.client.sendOperationRequest(operationArguments, renameOperationSpec);
|
9133
|
+
}
|
8750
9134
|
}
|
8751
9135
|
// Operation Specifications
|
8752
9136
|
const xmlSerializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
|
@@ -9033,7 +9417,7 @@ const uploadRangeOperationSpec = {
|
|
9033
9417
|
}
|
9034
9418
|
},
|
9035
9419
|
requestBody: body,
|
9036
|
-
queryParameters: [timeoutInSeconds,
|
9420
|
+
queryParameters: [timeoutInSeconds, comp12],
|
9037
9421
|
urlParameters: [url],
|
9038
9422
|
headerParameters: [
|
9039
9423
|
version,
|
@@ -9061,7 +9445,7 @@ const uploadRangeFromURLOperationSpec = {
|
|
9061
9445
|
headersMapper: FileUploadRangeFromURLExceptionHeaders
|
9062
9446
|
}
|
9063
9447
|
},
|
9064
|
-
queryParameters: [timeoutInSeconds,
|
9448
|
+
queryParameters: [timeoutInSeconds, comp12],
|
9065
9449
|
urlParameters: [url],
|
9066
9450
|
headerParameters: [
|
9067
9451
|
version,
|
@@ -9096,7 +9480,7 @@ const getRangeListOperationSpec = {
|
|
9096
9480
|
queryParameters: [
|
9097
9481
|
timeoutInSeconds,
|
9098
9482
|
shareSnapshot,
|
9099
|
-
|
9483
|
+
comp13,
|
9100
9484
|
prevsharesnapshot
|
9101
9485
|
],
|
9102
9486
|
urlParameters: [url],
|
@@ -9130,12 +9514,12 @@ const startCopyOperationSpec = {
|
|
9130
9514
|
leaseId,
|
9131
9515
|
filePermission,
|
9132
9516
|
filePermissionKey1,
|
9133
|
-
copySource,
|
9134
|
-
filePermissionCopyMode,
|
9135
|
-
ignoreReadOnly,
|
9136
9517
|
fileAttributes1,
|
9137
9518
|
fileCreationTime,
|
9138
9519
|
fileLastWriteTime,
|
9520
|
+
copySource,
|
9521
|
+
filePermissionCopyMode,
|
9522
|
+
ignoreReadOnly1,
|
9139
9523
|
setArchiveAttribute
|
9140
9524
|
],
|
9141
9525
|
isXML: true,
|
@@ -9155,7 +9539,7 @@ const abortCopyOperationSpec = {
|
|
9155
9539
|
},
|
9156
9540
|
queryParameters: [
|
9157
9541
|
timeoutInSeconds,
|
9158
|
-
|
9542
|
+
comp14,
|
9159
9543
|
copyId
|
9160
9544
|
],
|
9161
9545
|
urlParameters: [url],
|
@@ -9220,6 +9604,38 @@ const forceCloseHandlesOperationSpec = {
|
|
9220
9604
|
isXML: true,
|
9221
9605
|
serializer: xmlSerializer
|
9222
9606
|
};
|
9607
|
+
const renameOperationSpec = {
|
9608
|
+
path: "/{shareName}/{directory}/{fileName}",
|
9609
|
+
httpMethod: "PUT",
|
9610
|
+
responses: {
|
9611
|
+
200: {
|
9612
|
+
headersMapper: FileRenameHeaders
|
9613
|
+
},
|
9614
|
+
default: {
|
9615
|
+
bodyMapper: StorageError,
|
9616
|
+
headersMapper: FileRenameExceptionHeaders
|
9617
|
+
}
|
9618
|
+
},
|
9619
|
+
queryParameters: [timeoutInSeconds, comp11],
|
9620
|
+
urlParameters: [url],
|
9621
|
+
headerParameters: [
|
9622
|
+
version,
|
9623
|
+
accept1,
|
9624
|
+
metadata,
|
9625
|
+
filePermission,
|
9626
|
+
filePermissionKey1,
|
9627
|
+
renameSource,
|
9628
|
+
replaceIfExists,
|
9629
|
+
ignoreReadOnly,
|
9630
|
+
sourceLeaseId,
|
9631
|
+
destinationLeaseId,
|
9632
|
+
fileAttributes1,
|
9633
|
+
fileCreationTime,
|
9634
|
+
fileLastWriteTime
|
9635
|
+
],
|
9636
|
+
isXML: true,
|
9637
|
+
serializer: xmlSerializer
|
9638
|
+
};
|
9223
9639
|
|
9224
9640
|
// Copyright (c) Microsoft Corporation.
|
9225
9641
|
/**
|
@@ -9959,7 +10375,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
9959
10375
|
// Parameter assignments
|
9960
10376
|
this.url = url;
|
9961
10377
|
// Assigning values to Constant parameters
|
9962
|
-
this.version = options.version || "2021-
|
10378
|
+
this.version = options.version || "2021-04-10";
|
9963
10379
|
this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
|
9964
10380
|
}
|
9965
10381
|
}
|
@@ -12797,6 +13213,68 @@ class ShareDirectoryClient extends StorageClient {
|
|
12797
13213
|
span.end();
|
12798
13214
|
}
|
12799
13215
|
}
|
13216
|
+
/**
|
13217
|
+
* Renames a directory.
|
13218
|
+
* This API only supports renaming a directory in the same share.
|
13219
|
+
*
|
13220
|
+
* @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
|
13221
|
+
* @param options - Options for the renaming operation.
|
13222
|
+
* @returns Response data for the file renaming operation.
|
13223
|
+
*
|
13224
|
+
* Example usage:
|
13225
|
+
*
|
13226
|
+
* ```js
|
13227
|
+
*
|
13228
|
+
* // Rename the directory
|
13229
|
+
* await diretoryClient.rename(destinationPath);
|
13230
|
+
* console.log("Renamed directory successfully!");
|
13231
|
+
* ```
|
13232
|
+
*/
|
13233
|
+
async rename(destinationPath, options = {}) {
|
13234
|
+
const { span, updatedOptions } = createSpan("ShareDirectoryClient-rename", options);
|
13235
|
+
const split = destinationPath.split("?");
|
13236
|
+
let destinationUrl;
|
13237
|
+
if (split.length === 2) {
|
13238
|
+
const pathOnly = encodeURIComponent(split[0]);
|
13239
|
+
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
13240
|
+
destinationUrl = setURLPath(this.url, renameDestination);
|
13241
|
+
destinationUrl = setURLQueries(destinationUrl, split[1]);
|
13242
|
+
}
|
13243
|
+
else if (split.length === 1) {
|
13244
|
+
const pathOnly = encodeURIComponent(destinationPath);
|
13245
|
+
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
13246
|
+
destinationUrl = setURLPath(this.url, renameDestination);
|
13247
|
+
}
|
13248
|
+
else {
|
13249
|
+
throw new RangeError("Destination path should not contain more than one query string");
|
13250
|
+
}
|
13251
|
+
const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline);
|
13252
|
+
try {
|
13253
|
+
const response = await destDirectory.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
13254
|
+
? {
|
13255
|
+
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
13256
|
+
}
|
13257
|
+
: undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
|
13258
|
+
? {
|
13259
|
+
destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
|
13260
|
+
}
|
13261
|
+
: undefined }));
|
13262
|
+
return {
|
13263
|
+
destinationDirectoryClient: destDirectory,
|
13264
|
+
directoryRenameResponse: response,
|
13265
|
+
};
|
13266
|
+
}
|
13267
|
+
catch (e) {
|
13268
|
+
span.setStatus({
|
13269
|
+
code: coreTracing.SpanStatusCode.ERROR,
|
13270
|
+
message: e.message,
|
13271
|
+
});
|
13272
|
+
throw e;
|
13273
|
+
}
|
13274
|
+
finally {
|
13275
|
+
span.end();
|
13276
|
+
}
|
13277
|
+
}
|
12800
13278
|
}
|
12801
13279
|
/**
|
12802
13280
|
* A ShareFileClient represents a URL to an Azure Storage file.
|
@@ -14143,6 +14621,68 @@ class ShareFileClient extends StorageClient {
|
|
14143
14621
|
const sas = generateFileSASQueryParameters(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).toString();
|
14144
14622
|
return appendToURLQuery(this.url, sas);
|
14145
14623
|
}
|
14624
|
+
/**
|
14625
|
+
* Renames a file.
|
14626
|
+
* This API only supports renaming a file in the same share.
|
14627
|
+
*
|
14628
|
+
* @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
|
14629
|
+
* @param options - Options for the renaming operation.
|
14630
|
+
* @returns Response data for the file renaming operation.
|
14631
|
+
*
|
14632
|
+
* Example usage:
|
14633
|
+
*
|
14634
|
+
* ```js
|
14635
|
+
*
|
14636
|
+
* // Rename the file
|
14637
|
+
* await fileClient.rename(destinationPath);
|
14638
|
+
* console.log("Renamed file successfully!");
|
14639
|
+
* ```
|
14640
|
+
*/
|
14641
|
+
async rename(destinationPath, options = {}) {
|
14642
|
+
const { span, updatedOptions } = createSpan("ShareFileClient-rename", options);
|
14643
|
+
const split = destinationPath.split("?");
|
14644
|
+
let destinationUrl;
|
14645
|
+
if (split.length === 2) {
|
14646
|
+
const pathOnly = encodeURIComponent(split[0]);
|
14647
|
+
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
14648
|
+
destinationUrl = setURLPath(this.url, renameDestination);
|
14649
|
+
destinationUrl = setURLQueries(destinationUrl, split[1]);
|
14650
|
+
}
|
14651
|
+
else if (split.length === 1) {
|
14652
|
+
const pathOnly = encodeURIComponent(destinationPath);
|
14653
|
+
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
14654
|
+
destinationUrl = setURLPath(this.url, renameDestination);
|
14655
|
+
}
|
14656
|
+
else {
|
14657
|
+
throw new RangeError("Destination path should not contain more than one query string");
|
14658
|
+
}
|
14659
|
+
const destFile = new ShareFileClient(destinationUrl, this.pipeline);
|
14660
|
+
try {
|
14661
|
+
const response = await destFile.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
14662
|
+
? {
|
14663
|
+
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
14664
|
+
}
|
14665
|
+
: undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
|
14666
|
+
? {
|
14667
|
+
destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
|
14668
|
+
}
|
14669
|
+
: undefined }));
|
14670
|
+
return {
|
14671
|
+
destinationFileClient: destFile,
|
14672
|
+
fileRenameResponse: response,
|
14673
|
+
};
|
14674
|
+
}
|
14675
|
+
catch (e) {
|
14676
|
+
span.setStatus({
|
14677
|
+
code: coreTracing.SpanStatusCode.ERROR,
|
14678
|
+
message: e.message,
|
14679
|
+
});
|
14680
|
+
throw e;
|
14681
|
+
}
|
14682
|
+
finally {
|
14683
|
+
span.end();
|
14684
|
+
}
|
14685
|
+
}
|
14146
14686
|
}
|
14147
14687
|
/**
|
14148
14688
|
* A client that manages leases for a {@link ShareFileClient} or {@link ShareClient}.
|