UNPKG

@azure/storage-file-share

Version:
95 lines 3.43 kB
import type { StorageSharedKeyCredential } from "@azure/storage-common"; import { FileSASPermissions } from "./FileSASPermissions.js"; import type { SasIPRange } from "./SasIPRange.js"; import type { SASProtocol } from "./SASQueryParameters.js"; import { SASQueryParameters } from "./SASQueryParameters.js"; import { ShareSASPermissions } from "./ShareSASPermissions.js"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * * FileSASSignatureValues is used to help generating File service SAS tokens for shares or files. */ export interface FileSASSignatureValues { /** * The version of the service this SAS will target. If not specified, it will default to the version targeted by the * library. */ version?: string; /** * Optional. SAS protocols, HTTPS only or HTTPSandHTTP */ protocol?: SASProtocol; /** * Optional. When the SAS will take effect. */ startsOn?: Date; /** * Optional only when identifier is provided. The time after which the SAS will no longer work. */ expiresOn?: Date; /** * Optional only when identifier is provided. * Please refer to either {@link ShareSASPermissions} or {@link FileSASPermissions} depending on the resource * being accessed for help constructing the permissions string. */ permissions?: FileSASPermissions | ShareSASPermissions; /** * Optional. IP ranges allowed in this SAS. */ ipRange?: SasIPRange; /** * The name of the share the SAS user may access. */ shareName: string; /** * Optional. The path of the file like, "directory/FileName" or "FileName". */ filePath?: string; /** * Optional. The name of the access policy on the share this SAS references if any. * * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ identifier?: string; /** * Optional. The cache-control header for the SAS. */ cacheControl?: string; /** * Optional. The content-disposition header for the SAS. */ contentDisposition?: string; /** * Optional. The content-encoding header for the SAS. */ contentEncoding?: string; /** * Optional. The content-language header for the SAS. */ contentLanguage?: string; /** * Optional. The content-type header for the SAS. */ contentType?: string; } /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * * Creates an instance of SASQueryParameters. * * Only accepts required settings needed to create a SAS. For optional settings please * set corresponding properties directly, such as permissions, startsOn and identifier. * * WARNING: When identifier is not provided, permissions and expiresOn are required. * You MUST assign value to identifier or expiresOn & permissions manually if you initial with * this constructor. * * @param fileSASSignatureValues - * @param sharedKeyCredential - */ export declare function generateFileSASQueryParameters(fileSASSignatureValues: FileSASSignatureValues, sharedKeyCredential: StorageSharedKeyCredential): SASQueryParameters; export declare function generateFileSASQueryParametersInternal(fileSASSignatureValues: FileSASSignatureValues, sharedKeyCredential: StorageSharedKeyCredential): { sasQueryParameters: SASQueryParameters; stringToSign: string; }; //# sourceMappingURL=FileSASSignatureValues.d.ts.map