@azure/storage-file-share 12.9.0-alpha.20220111.2 → 12.9.0-alpha.20220211.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azure/storage-file-share",
3
3
  "sdk-type": "client",
4
- "version": "12.9.0-alpha.20220111.2",
4
+ "version": "12.9.0-alpha.20220211.2",
5
5
  "description": "Microsoft Azure Storage SDK for JavaScript - File",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist-esm/src/index.js",
@@ -15,11 +15,11 @@
15
15
  "os": false,
16
16
  "process": false
17
17
  },
18
- "types": "./typings/latest/storage-file-share.d.ts",
18
+ "types": "./types/latest/storage-file-share.d.ts",
19
19
  "typesVersions": {
20
20
  "<3.6": {
21
21
  "*": [
22
- "./typings/3.1/storage-file-share.d.ts"
22
+ "./types/3.1/storage-file-share.d.ts"
23
23
  ]
24
24
  }
25
25
  },
@@ -28,20 +28,20 @@
28
28
  },
29
29
  "scripts": {
30
30
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
31
- "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
32
- "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
33
- "build:nodebrowser": "rollup -c 2>&1",
34
- "build:samples": "npm run build && npm run build:prep-samples",
31
+ "build:browser": "tsc -p . && dev-tool run bundle",
32
+ "build:node": "tsc -p . && dev-tool run bundle",
33
+ "build:nodebrowser": "dev-tool run bundle",
35
34
  "build:prep-samples": "dev-tool samples prep && cd dist-samples && tsc",
36
- "build:test": "tsc -p . && rollup -c 2>&1",
37
- "build:types": "downlevel-dts typings/latest typings/3.1",
38
- "build": "npm run clean && tsc -p . && rollup -c 2>&1 && api-extractor run --local && npm run build:types",
39
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
40
- "clean": "rimraf dist dist-* typings temp statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
41
- "clean:samples": "rimraf samples/javascript/node_modules samples/typescript/node_modules samples/typescript/dist samples/typescript/package-lock.json samples/javascript/package-lock.json",
35
+ "build:test": "tsc -p . && dev-tool run bundle",
36
+ "build:types": "downlevel-dts types/latest types/3.1",
37
+ "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local && npm run build:types",
38
+ "build:samples": "echo Obsolete.",
39
+ "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
40
+ "clean": "rimraf dist dist-* types temp statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
41
+ "clean:samples": "rimraf samples/v12/javascript/node_modules samples/v12/typescript/node_modules samples/v12/typescript/dist samples/v12/typescript/package-lock.json samples/v12/javascript/package-lock.json",
42
42
  "extract-api": "tsc -p . && api-extractor run --local",
43
- "execute:samples": "npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/src/",
44
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
43
+ "execute:samples": "dev-tool samples run samples-dev",
44
+ "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
45
45
  "generate:client": "autorest --typescript ./swagger/README.md",
46
46
  "integration-test:browser": "karma start --single-run",
47
47
  "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"",
@@ -61,8 +61,8 @@
61
61
  "ThirdPartyNotices.txt",
62
62
  "dist/",
63
63
  "dist-esm/src/",
64
- "typings/latest/storage-file-share.d.ts",
65
- "typings/3.1/storage-file-share.d.ts",
64
+ "types/latest/storage-file-share.d.ts",
65
+ "types/3.1/storage-file-share.d.ts",
66
66
  "README.md",
67
67
  "LICENSE"
68
68
  ],
@@ -102,14 +102,22 @@
102
102
  },
103
103
  "//sampleConfiguration": {
104
104
  "skip": [
105
- "advanced.js",
106
- "anonymousCred.js",
107
- "basic.js",
105
+ "advancedRequestOptions.js",
106
+ "anonymousAuth.js",
107
+ "shareServiceClient.js",
108
108
  "customPipeline.js",
109
- "iterators-files-and-directories.js",
110
- "iterators-shares.js",
111
- "sharedKeyCred.js"
112
- ]
109
+ "listFilesAndDirectories.js",
110
+ "listShares.js",
111
+ "sharedKeyAuth.js"
112
+ ],
113
+ "productName": "Azure Storage File Share",
114
+ "productSlugs": [
115
+ "azure",
116
+ "azure-storage"
117
+ ],
118
+ "requiredResources": {
119
+ "Azure Storage Account": "https://docs.microsoft.com/azure/storage/common/storage-account-overview"
120
+ }
113
121
  },
114
122
  "dependencies": {
115
123
  "@azure/abort-controller": "^1.0.0",
@@ -121,17 +129,13 @@
121
129
  "tslib": "^2.2.0"
122
130
  },
123
131
  "devDependencies": {
124
- "@azure/storage-blob": "^12.9.0-beta.1",
132
+ "@azure/storage-blob": "^12.9.0-beta.3",
125
133
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
126
134
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
127
135
  "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
128
136
  "@azure-tools/test-recorder": "^1.0.0",
129
137
  "@azure/test-utils-perf": ">=1.0.0-alpha <1.0.0-alphb",
130
138
  "@microsoft/api-extractor": "^7.18.11",
131
- "@rollup/plugin-commonjs": "11.0.2",
132
- "@rollup/plugin-multi-entry": "^3.0.0",
133
- "@rollup/plugin-node-resolve": "^8.0.0",
134
- "@rollup/plugin-replace": "^2.2.0",
135
139
  "@types/chai": "^4.1.6",
136
140
  "@types/mocha": "^7.0.2",
137
141
  "@types/node": "^12.0.0",
@@ -162,11 +166,6 @@
162
166
  "prettier": "^2.5.1",
163
167
  "puppeteer": "^10.2.0",
164
168
  "rimraf": "^3.0.0",
165
- "rollup": "^1.16.3",
166
- "rollup-plugin-shim": "^1.0.0",
167
- "rollup-plugin-sourcemaps": "^0.4.2",
168
- "rollup-plugin-terser": "^5.1.1",
169
- "rollup-plugin-visualizer": "^4.0.4",
170
169
  "source-map-support": "^0.5.9",
171
170
  "ts-node": "^10.0.0",
172
171
  "typescript": "~4.2.0",
@@ -321,16 +321,16 @@ export declare interface CommonOptions {
321
321
  }
322
322
  /** Parameter group */
323
323
  export declare interface CopyFileSmbInfo {
324
- /** Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key. */
325
- filePermissionCopyMode?: PermissionCopyModeType;
326
- /** Specifies the option to overwrite the target file if it already exists and has read-only attribute set. */
327
- ignoreReadOnly?: boolean;
328
324
  /** Specifies either the option to copy file attributes from a source file(source) to a target file or a list of attributes to set on a target file. */
329
325
  fileAttributes?: string;
330
326
  /** Specifies either the option to copy file creation time from a source file(source) to a target file or a time value in ISO 8601 format to set as creation time on a target file. */
331
327
  fileCreationTime?: string;
332
328
  /** Specifies either the option to copy file last write time from a source file(source) to a target file or a time value in ISO 8601 format to set as last write time on a target file. */
333
329
  fileLastWriteTime?: string;
330
+ /** Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key. */
331
+ filePermissionCopyMode?: PermissionCopyModeType;
332
+ /** Specifies the option to overwrite the target file if it already exists and has read-only attribute set. */
333
+ ignoreReadOnly?: boolean;
334
334
  /** Specifies the option to set archive attribute on a target file. True means archive attribute will be set on a target file despite attribute overrides or a source file state. */
335
335
  setArchiveAttribute?: boolean;
336
336
  }
@@ -767,6 +767,96 @@ export declare interface DirectoryProperties extends FileAndDirectorySetProperti
767
767
  */
768
768
  abortSignal?: AbortSignalLike;
769
769
  }
770
+ /** Defines headers for Directory_rename operation. */
771
+ export declare interface DirectoryRenameHeaders {
772
+ /** The ETag contains a value which represents the version of the file, in quotes. */
773
+ etag?: string;
774
+ /** Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. */
775
+ lastModified?: Date;
776
+ /** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
777
+ requestId?: string;
778
+ /** Indicates the version of the File service used to execute the request. */
779
+ version?: string;
780
+ /** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
781
+ date?: Date;
782
+ /** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
783
+ isServerEncrypted?: boolean;
784
+ /** Key of the permission set for the file. */
785
+ filePermissionKey?: string;
786
+ /** Attributes set for the file. */
787
+ fileAttributes?: string;
788
+ /** Creation time for the file. */
789
+ fileCreationTime?: Date;
790
+ /** Last write time for the file. */
791
+ fileLastWriteTime?: Date;
792
+ /** Change time for the file. */
793
+ fileChangeTime?: Date;
794
+ /** The fileId of the file. */
795
+ fileId?: string;
796
+ /** The parent fileId of the directory. */
797
+ fileParentId?: string;
798
+ }
799
+ /**
800
+ * Options to configure the {@link ShareDirectoryClient.rename} operation.
801
+ */
802
+ export declare interface DirectoryRenameOptions extends CommonOptions {
803
+ /**
804
+ * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
805
+ * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
806
+ */
807
+ abortSignal?: AbortSignalLike;
808
+ /**
809
+ * Lease access condition for source file. Required if the source file has an active infinite lease.
810
+ */
811
+ sourceLeaseAccessConditions?: LeaseAccessConditions;
812
+ /**
813
+ * Lease access condition for destination file. Required if the destination file has an active infinite lease.
814
+ */
815
+ destinationLeaseAccessConditions?: LeaseAccessConditions;
816
+ /**
817
+ * Optional.
818
+ * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.
819
+ */
820
+ copyFileSmbInfo?: CopyFileSmbInfo;
821
+ /**
822
+ * Optional.
823
+ * The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>
824
+ */
825
+ timeoutInSeconds?: number;
826
+ /**
827
+ * Optional.
828
+ * A name-value pair to associate with a file storage object.
829
+ */
830
+ metadata?: Metadata;
831
+ /**
832
+ * Optional.
833
+ * If specified the permission (security descriptor) shall be set for the directory/file.
834
+ */
835
+ filePermission?: string;
836
+ /**
837
+ * Optional.
838
+ * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.
839
+ */
840
+ filePermissionKey?: string;
841
+ /**
842
+ * Optional.
843
+ * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.
844
+ */
845
+ replaceIfExists?: boolean;
846
+ /**
847
+ * Optional.
848
+ * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.
849
+ */
850
+ ignoreReadOnly?: boolean;
851
+ }
852
+ /** Contains response data for the rename operation. */
853
+ export declare type DirectoryRenameResponse = DirectoryRenameHeaders & {
854
+ /** The underlying HTTP response. */
855
+ _response: coreHttp.HttpResponse & {
856
+ /** The parsed HTTP response headers. */
857
+ parsedHeaders: DirectoryRenameHeaders;
858
+ };
859
+ };
770
860
  /** Defines headers for Directory_setMetadata operation. */
771
861
  export declare interface DirectorySetMetadataHeaders {
772
862
  /** The ETag contains a value which represents the version of the directory, in quotes. */
@@ -1683,6 +1773,95 @@ export declare interface FileProperty {
1683
1773
  lastModified?: Date;
1684
1774
  etag?: string;
1685
1775
  }
1776
+ /** Defines headers for File_rename operation. */
1777
+ export declare interface FileRenameHeaders {
1778
+ /** The ETag contains a value which represents the version of the file, in quotes. */
1779
+ etag?: string;
1780
+ /** Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. */
1781
+ lastModified?: Date;
1782
+ /** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
1783
+ requestId?: string;
1784
+ /** Indicates the version of the File service used to execute the request. */
1785
+ version?: string;
1786
+ /** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
1787
+ date?: Date;
1788
+ /** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
1789
+ isServerEncrypted?: boolean;
1790
+ /** Key of the permission set for the file. */
1791
+ filePermissionKey?: string;
1792
+ /** Attributes set for the file. */
1793
+ fileAttributes?: string;
1794
+ /** Creation time for the file. */
1795
+ fileCreationTime?: Date;
1796
+ /** Last write time for the file. */
1797
+ fileLastWriteTime?: Date;
1798
+ /** Change time for the file. */
1799
+ fileChangeTime?: Date;
1800
+ /** The fileId of the file. */
1801
+ fileId?: string;
1802
+ /** The parent fileId of the directory. */
1803
+ fileParentId?: string;
1804
+ }
1805
+ /**
1806
+ * Options to configure the {@link ShareFileClient.rename} operation.
1807
+ */
1808
+ export declare interface FileRenameOptions extends CommonOptions {
1809
+ /**
1810
+ * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
1811
+ * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.
1812
+ */
1813
+ abortSignal?: AbortSignalLike;
1814
+ /**
1815
+ * Lease access condition for source file. Required if the source file has an active infinite lease.
1816
+ */
1817
+ sourceLeaseAccessConditions?: LeaseAccessConditions;
1818
+ /**
1819
+ * Lease access condition for destination file. Required if the destination file has an active infinite lease.
1820
+ */
1821
+ destinationLeaseAccessConditions?: LeaseAccessConditions;
1822
+ /**
1823
+ * Optional.
1824
+ * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.
1825
+ */
1826
+ copyFileSmbInfo?: CopyFileSmbInfo;
1827
+ /**
1828
+ * A name-value pair to associate with a file storage object.
1829
+ */
1830
+ metadata?: Metadata;
1831
+ /**
1832
+ * Optional.
1833
+ * The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>
1834
+ */
1835
+ timeoutInSeconds?: number;
1836
+ /**
1837
+ * Optional.
1838
+ * If specified the permission (security descriptor) shall be set for the directory/file.
1839
+ */
1840
+ filePermission?: string;
1841
+ /**
1842
+ * Optional.
1843
+ * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.
1844
+ */
1845
+ filePermissionKey?: string;
1846
+ /**
1847
+ * Optional.
1848
+ * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.
1849
+ */
1850
+ replaceIfExists?: boolean;
1851
+ /**
1852
+ * Optional.
1853
+ * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.
1854
+ */
1855
+ ignoreReadOnly?: boolean;
1856
+ }
1857
+ /** Contains response data for the rename operation. */
1858
+ export declare type FileRenameResponse = FileRenameHeaders & {
1859
+ /** The underlying HTTP response. */
1860
+ _response: coreHttp.HttpResponse & {
1861
+ /** The parsed HTTP response headers. */
1862
+ parsedHeaders: FileRenameHeaders;
1863
+ };
1864
+ };
1686
1865
  /**
1687
1866
  * Options to configure the {@link ShareFileClient.resize} operation.
1688
1867
  */
@@ -3725,6 +3904,27 @@ export declare class ShareDirectoryClient extends StorageClient {
3725
3904
  * @param options -
3726
3905
  */
3727
3906
  forceCloseHandle(handleId: string, options?: DirectoryForceCloseHandlesOptions): Promise<DirectoryForceCloseHandlesResponse>;
3907
+ /**
3908
+ * Renames a directory.
3909
+ * This API only supports renaming a directory in the same share.
3910
+ *
3911
+ * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
3912
+ * @param options - Options for the renaming operation.
3913
+ * @returns Response data for the file renaming operation.
3914
+ *
3915
+ * Example usage:
3916
+ *
3917
+ * ```js
3918
+ *
3919
+ * // Rename the directory
3920
+ * await diretoryClient.rename(destinationPath);
3921
+ * console.log("Renamed directory successfully!");
3922
+ * ```
3923
+ */
3924
+ rename(destinationPath: string, options?: DirectoryRenameOptions): Promise<{
3925
+ destinationDirectoryClient: ShareDirectoryClient;
3926
+ directoryRenameResponse: DirectoryRenameResponse;
3927
+ }>;
3728
3928
  }
3729
3929
  /**
3730
3930
  * Options to configure the {@link ShareClient.exists} operation.
@@ -4278,6 +4478,27 @@ export declare class ShareFileClient extends StorageClient {
4278
4478
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
4279
4479
  */
4280
4480
  generateSasUrl(options: FileGenerateSasUrlOptions): string;
4481
+ /**
4482
+ * Renames a file.
4483
+ * This API only supports renaming a file in the same share.
4484
+ *
4485
+ * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
4486
+ * @param options - Options for the renaming operation.
4487
+ * @returns Response data for the file renaming operation.
4488
+ *
4489
+ * Example usage:
4490
+ *
4491
+ * ```js
4492
+ *
4493
+ * // Rename the file
4494
+ * await fileClient.rename(destinationPath);
4495
+ * console.log("Renamed file successfully!");
4496
+ * ```
4497
+ */
4498
+ rename(destinationPath: string, options?: FileRenameOptions): Promise<{
4499
+ destinationFileClient: ShareFileClient;
4500
+ fileRenameResponse: FileRenameResponse;
4501
+ }>;
4281
4502
  }
4282
4503
  /** The list of file ranges */
4283
4504
  export declare interface ShareFileRangeList {