@microsoft/microsoft-graph-client
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -7,43 +7,42 @@ /** | ||
*/ | ||
export * from "../content/BatchRequestContent"; | ||
export * from "../content/BatchResponseContent"; | ||
export * from "../middleware/AuthenticationHandler"; | ||
export * from "../middleware/HTTPMessageHandler"; | ||
export * from "../middleware/IMiddleware"; | ||
export * from "../middleware/RetryHandler"; | ||
export * from "../middleware/RedirectHandler"; | ||
export * from "../middleware/TelemetryHandler"; | ||
export * from "../middleware/MiddlewareFactory"; | ||
export * from "../middleware/options/AuthenticationHandlerOptions"; | ||
export * from "../middleware/options/IMiddlewareOptions"; | ||
export * from "../middleware/options/RetryHandlerOptions"; | ||
export * from "../middleware/options/RedirectHandlerOptions"; | ||
export * from "../middleware/options/TelemetryHandlerOptions"; | ||
export * from "../middleware/options/ChaosHandlerOptions"; | ||
export * from "../middleware/options/ChaosStrategy"; | ||
export * from "../middleware/ChaosHandler"; | ||
export * from "../tasks/LargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/UploadResult"; | ||
export * from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "../tasks/FileUploadTask/Range"; | ||
export * from "../tasks/PageIterator"; | ||
export * from "../Client"; | ||
export * from "../CustomAuthenticationProvider"; | ||
export * from "../GraphError"; | ||
export * from "../GraphClientError"; | ||
export * from "../GraphRequest"; | ||
export * from "../IAuthProvider"; | ||
export * from "../IAuthenticationProvider"; | ||
export * from "../IAuthenticationProviderOptions"; | ||
export * from "../IAuthProviderCallback"; | ||
export * from "../IClientOptions"; | ||
export * from "../IContext"; | ||
export * from "../IFetchOptions"; | ||
export * from "../IGraphRequestCallback"; | ||
export * from "../IOptions"; | ||
export * from "../ResponseType"; | ||
export { BatchRequestStep, BatchRequestData, BatchRequestContent, RequestData, BatchRequestBody } from "../content/BatchRequestContent"; | ||
export { BatchResponseContent } from "../content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "../middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler"; | ||
export { Middleware } from "../middleware/IMiddleware"; | ||
export { RetryHandler } from "../middleware/RetryHandler"; | ||
export { RedirectHandler } from "../middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "../middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "../middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "../middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "../middleware/options/IMiddlewareOptions"; | ||
export { ShouldRetry, RetryHandlerOptions } from "../middleware/options/RetryHandlerOptions"; | ||
export { ShouldRedirect, RedirectHandlerOptions } from "../middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "../middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "../middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "../middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "../middleware/ChaosHandler"; | ||
export { SliceType, LargeFileUploadTaskOptions, LargeFileUploadTask, LargeFileUploadSession, FileObject } from "../tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadTask, OneDriveLargeFileUploadOptions } from "../tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "../tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "../tasks/FileUploadTask/Range"; | ||
export { PageIteratorCallback, PageIterator, PageCollection, GraphRequestOptions } from "../tasks/PageIterator"; | ||
export { Client } from "../Client"; | ||
export { CustomAuthenticationProvider } from "../CustomAuthenticationProvider"; | ||
export { GraphError } from "../GraphError"; | ||
export { GraphClientError } from "../GraphClientError"; | ||
export { GraphRequest } from "../GraphRequest"; | ||
export { AuthProvider } from "../IAuthProvider"; | ||
export { AuthenticationProvider } from "../IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "../IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "../IAuthProviderCallback"; | ||
export { ClientOptions } from "../IClientOptions"; | ||
export { Context } from "../IContext"; | ||
export { NodeFetchInit, FetchOptions } from "../IFetchOptions"; | ||
export { GraphRequestCallback } from "../IGraphRequestCallback"; | ||
export { Options } from "../IOptions"; | ||
export { ResponseType } from "../ResponseType"; |
@@ -7,44 +7,31 @@ /** | ||
*/ | ||
export * from "../content/BatchRequestContent"; | ||
export * from "../content/BatchResponseContent"; | ||
export * from "../middleware/AuthenticationHandler"; | ||
export * from "../middleware/HTTPMessageHandler"; | ||
export * from "../middleware/IMiddleware"; | ||
export * from "../middleware/RetryHandler"; | ||
export * from "../middleware/RedirectHandler"; | ||
export * from "../middleware/TelemetryHandler"; | ||
export * from "../middleware/MiddlewareFactory"; | ||
export * from "../middleware/options/AuthenticationHandlerOptions"; | ||
export * from "../middleware/options/IMiddlewareOptions"; | ||
export * from "../middleware/options/RetryHandlerOptions"; | ||
export * from "../middleware/options/RedirectHandlerOptions"; | ||
export * from "../middleware/options/TelemetryHandlerOptions"; | ||
export * from "../middleware/options/ChaosHandlerOptions"; | ||
export * from "../middleware/options/ChaosStrategy"; | ||
export * from "../middleware/ChaosHandler"; | ||
export * from "../tasks/LargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/UploadResult"; | ||
export * from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "../tasks/FileUploadTask/Range"; | ||
export * from "../tasks/PageIterator"; | ||
export * from "../Client"; | ||
export * from "../CustomAuthenticationProvider"; | ||
export * from "../GraphError"; | ||
export * from "../GraphClientError"; | ||
export * from "../GraphRequest"; | ||
export * from "../IAuthProvider"; | ||
export * from "../IAuthenticationProvider"; | ||
export * from "../IAuthenticationProviderOptions"; | ||
export * from "../IAuthProviderCallback"; | ||
export * from "../IClientOptions"; | ||
export * from "../IContext"; | ||
export * from "../IFetchOptions"; | ||
export * from "../IGraphRequestCallback"; | ||
export * from "../IOptions"; | ||
export * from "../ResponseType"; | ||
export { BatchRequestContent } from "../content/BatchRequestContent"; | ||
export { BatchResponseContent } from "../content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "../middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler"; | ||
export { RetryHandler } from "../middleware/RetryHandler"; | ||
export { RedirectHandler } from "../middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "../middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "../middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "../middleware/options/AuthenticationHandlerOptions"; | ||
export { RetryHandlerOptions } from "../middleware/options/RetryHandlerOptions"; | ||
export { RedirectHandlerOptions } from "../middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "../middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "../middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "../middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "../middleware/ChaosHandler"; | ||
export { LargeFileUploadTask } from "../tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadTask } from "../tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "../tasks/FileUploadTask/UploadResult"; | ||
export { Range } from "../tasks/FileUploadTask/Range"; | ||
export { PageIterator } from "../tasks/PageIterator"; | ||
export { Client } from "../Client"; | ||
export { CustomAuthenticationProvider } from "../CustomAuthenticationProvider"; | ||
export { GraphError } from "../GraphError"; | ||
export { GraphClientError } from "../GraphClientError"; | ||
export { GraphRequest } from "../GraphRequest"; | ||
export { ResponseType } from "../ResponseType"; | ||
//# sourceMappingURL=index.js.map |
@@ -32,3 +32,3 @@ /** | ||
* To set the GraphClientError object | ||
* @param {any} - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @returns GraphClientError object set to the error passed | ||
@@ -35,0 +35,0 @@ */ |
@@ -33,3 +33,3 @@ /** | ||
* To set the GraphClientError object | ||
* @param {any} - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @returns GraphClientError object set to the error passed | ||
@@ -36,0 +36,0 @@ */ |
@@ -48,2 +48,4 @@ /** | ||
* @param {number} [statusCode = -1] - The status code of the error | ||
* @param {string} [message] - The message of the error | ||
* @param {Error} [baseError] - The base error | ||
* @returns An instance of GraphError | ||
@@ -50,0 +52,0 @@ */ |
@@ -23,2 +23,4 @@ /** | ||
* @param {number} [statusCode = -1] - The status code of the error | ||
* @param {string} [message] - The message of the error | ||
* @param {Error} [baseError] - The base error | ||
* @returns An instance of GraphError | ||
@@ -25,0 +27,0 @@ */ |
@@ -109,3 +109,3 @@ /** | ||
* Throws error if the string is not a valid host/hostname and contains other url parts. | ||
* @param {string} url - The host to be verified | ||
* @param {string} host - The host to be verified | ||
*/ | ||
@@ -112,0 +112,0 @@ const isCustomHostValid = (host) => { |
@@ -40,3 +40,3 @@ /** | ||
* Processes the middleware array to construct the chain | ||
* and sets this.middleware property to the first middlware handler of the array | ||
* and sets this.middleware property to the first middleware handler of the array | ||
* The calling function should validate if middleware is not undefined or not empty | ||
@@ -43,0 +43,0 @@ * @param {Middleware[]} middlewareArray - The array of middleware handlers |
@@ -46,3 +46,3 @@ /** | ||
* Processes the middleware array to construct the chain | ||
* and sets this.middleware property to the first middlware handler of the array | ||
* and sets this.middleware property to the first middleware handler of the array | ||
* The calling function should validate if middleware is not undefined or not empty | ||
@@ -49,0 +49,0 @@ * @param {Middleware[]} middlewareArray - The array of middleware handlers |
@@ -26,3 +26,3 @@ /** | ||
* NOTE: These are the things that we need to remember while doing modifications in the below default pipeline. | ||
* * HTTPMessageHander should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * HTTPMessageHandler should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * TelemetryHandler should be the one prior to the last middleware in the chain, because this is the one which actually collects and appends the usage flag and placing this handler * before making the actual network call ensures that the usage of all features are recorded in the flag. | ||
@@ -29,0 +29,0 @@ * * The best place for AuthenticationHandler is in the starting of the pipeline, because every other handler might have to work for multiple times for a request but the auth token for |
@@ -39,3 +39,3 @@ /** | ||
* NOTE: These are the things that we need to remember while doing modifications in the below default pipeline. | ||
* * HTTPMessageHander should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * HTTPMessageHandler should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * TelemetryHandler should be the one prior to the last middleware in the chain, because this is the one which actually collects and appends the usage flag and placing this handler * before making the actual network call ensures that the usage of all features are recorded in the flag. | ||
@@ -42,0 +42,0 @@ * * The best place for AuthenticationHandler is in the starting of the pipeline, because every other handler might have to work for multiple times for a request but the auth token for |
@@ -7,43 +7,42 @@ /** | ||
*/ | ||
export * from "./content/BatchRequestContent"; | ||
export * from "./content/BatchResponseContent"; | ||
export * from "./middleware/AuthenticationHandler"; | ||
export * from "./middleware/HTTPMessageHandler"; | ||
export * from "./middleware/IMiddleware"; | ||
export * from "./middleware/RetryHandler"; | ||
export * from "./middleware/RedirectHandler"; | ||
export * from "./middleware/TelemetryHandler"; | ||
export * from "./middleware/MiddlewareFactory"; | ||
export * from "./middleware/options/AuthenticationHandlerOptions"; | ||
export * from "./middleware/options/IMiddlewareOptions"; | ||
export * from "./middleware/options/RetryHandlerOptions"; | ||
export * from "./middleware/options/RedirectHandlerOptions"; | ||
export * from "./middleware/options/TelemetryHandlerOptions"; | ||
export * from "./middleware/options/ChaosHandlerOptions"; | ||
export * from "./middleware/options/ChaosStrategy"; | ||
export * from "./middleware/ChaosHandler"; | ||
export * from "./tasks/LargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/UploadResult"; | ||
export * from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "./tasks/FileUploadTask/Range"; | ||
export * from "./tasks/PageIterator"; | ||
export * from "./Client"; | ||
export * from "./CustomAuthenticationProvider"; | ||
export * from "./GraphError"; | ||
export * from "./GraphClientError"; | ||
export * from "./GraphRequest"; | ||
export * from "./IAuthProvider"; | ||
export * from "./IAuthenticationProvider"; | ||
export * from "./IAuthenticationProviderOptions"; | ||
export * from "./IAuthProviderCallback"; | ||
export * from "./IClientOptions"; | ||
export * from "./IContext"; | ||
export * from "./IFetchOptions"; | ||
export * from "./IGraphRequestCallback"; | ||
export * from "./IOptions"; | ||
export * from "./ResponseType"; | ||
export { BatchRequestBody, RequestData, BatchRequestContent, BatchRequestData, BatchRequestStep } from "./content/BatchRequestContent"; | ||
export { BatchResponseContent } from "./content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "./middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; | ||
export { Middleware } from "./middleware/IMiddleware"; | ||
export { RetryHandler } from "./middleware/RetryHandler"; | ||
export { RedirectHandler } from "./middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "./middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "./middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "./middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "./middleware/options/IMiddlewareOptions"; | ||
export { RetryHandlerOptions, ShouldRetry } from "./middleware/options/RetryHandlerOptions"; | ||
export { RedirectHandlerOptions, ShouldRedirect } from "./middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "./middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "./middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "./middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "./middleware/ChaosHandler"; | ||
export { FileObject, LargeFileUploadSession, LargeFileUploadTask, LargeFileUploadTaskOptions, SliceType } from "./tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadOptions, OneDriveLargeFileUploadTask } from "./tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "./tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "./tasks/FileUploadTask/Range"; | ||
export { GraphRequestOptions, PageCollection, PageIterator, PageIteratorCallback } from "./tasks/PageIterator"; | ||
export { Client } from "./Client"; | ||
export { CustomAuthenticationProvider } from "./CustomAuthenticationProvider"; | ||
export { GraphError } from "./GraphError"; | ||
export { GraphClientError } from "./GraphClientError"; | ||
export { GraphRequest, URLComponents } from "./GraphRequest"; | ||
export { AuthProvider } from "./IAuthProvider"; | ||
export { AuthenticationProvider } from "./IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "./IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "./IAuthProviderCallback"; | ||
export { ClientOptions } from "./IClientOptions"; | ||
export { Context } from "./IContext"; | ||
export { FetchOptions, NodeFetchInit } from "./IFetchOptions"; | ||
export { GraphRequestCallback } from "./IGraphRequestCallback"; | ||
export { Options } from "./IOptions"; | ||
export { ResponseType } from "./ResponseType"; |
@@ -7,44 +7,31 @@ /** | ||
*/ | ||
export * from "./content/BatchRequestContent"; | ||
export * from "./content/BatchResponseContent"; | ||
export * from "./middleware/AuthenticationHandler"; | ||
export * from "./middleware/HTTPMessageHandler"; | ||
export * from "./middleware/IMiddleware"; | ||
export * from "./middleware/RetryHandler"; | ||
export * from "./middleware/RedirectHandler"; | ||
export * from "./middleware/TelemetryHandler"; | ||
export * from "./middleware/MiddlewareFactory"; | ||
export * from "./middleware/options/AuthenticationHandlerOptions"; | ||
export * from "./middleware/options/IMiddlewareOptions"; | ||
export * from "./middleware/options/RetryHandlerOptions"; | ||
export * from "./middleware/options/RedirectHandlerOptions"; | ||
export * from "./middleware/options/TelemetryHandlerOptions"; | ||
export * from "./middleware/options/ChaosHandlerOptions"; | ||
export * from "./middleware/options/ChaosStrategy"; | ||
export * from "./middleware/ChaosHandler"; | ||
export * from "./tasks/LargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/UploadResult"; | ||
export * from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "./tasks/FileUploadTask/Range"; | ||
export * from "./tasks/PageIterator"; | ||
export * from "./Client"; | ||
export * from "./CustomAuthenticationProvider"; | ||
export * from "./GraphError"; | ||
export * from "./GraphClientError"; | ||
export * from "./GraphRequest"; | ||
export * from "./IAuthProvider"; | ||
export * from "./IAuthenticationProvider"; | ||
export * from "./IAuthenticationProviderOptions"; | ||
export * from "./IAuthProviderCallback"; | ||
export * from "./IClientOptions"; | ||
export * from "./IContext"; | ||
export * from "./IFetchOptions"; | ||
export * from "./IGraphRequestCallback"; | ||
export * from "./IOptions"; | ||
export * from "./ResponseType"; | ||
export { BatchRequestContent } from "./content/BatchRequestContent"; | ||
export { BatchResponseContent } from "./content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "./middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; | ||
export { RetryHandler } from "./middleware/RetryHandler"; | ||
export { RedirectHandler } from "./middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "./middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "./middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "./middleware/options/AuthenticationHandlerOptions"; | ||
export { RetryHandlerOptions } from "./middleware/options/RetryHandlerOptions"; | ||
export { RedirectHandlerOptions } from "./middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "./middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "./middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "./middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "./middleware/ChaosHandler"; | ||
export { LargeFileUploadTask } from "./tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadTask } from "./tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "./tasks/FileUploadTask/UploadResult"; | ||
export { Range } from "./tasks/FileUploadTask/Range"; | ||
export { PageIterator } from "./tasks/PageIterator"; | ||
export { Client } from "./Client"; | ||
export { CustomAuthenticationProvider } from "./CustomAuthenticationProvider"; | ||
export { GraphError } from "./GraphError"; | ||
export { GraphClientError } from "./GraphClientError"; | ||
export { GraphRequest } from "./GraphRequest"; | ||
export { ResponseType } from "./ResponseType"; | ||
//# sourceMappingURL=index.js.map |
@@ -58,3 +58,3 @@ /** | ||
* @private | ||
* @param {ChaosHandlerOptions} options - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestID - request id | ||
@@ -68,3 +68,3 @@ * @param {string} requestDate - date of the request | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {Context} context - Contains the context of the request | ||
@@ -98,3 +98,3 @@ */ | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestURL - the URL for the request | ||
@@ -101,0 +101,0 @@ * @param {string} requestMethod - the API method for the request |
@@ -57,3 +57,3 @@ /** | ||
* @private | ||
* @param {ChaosHandlerOptions} options - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestID - request id | ||
@@ -90,3 +90,3 @@ * @param {string} requestDate - date of the request | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {Context} context - Contains the context of the request | ||
@@ -148,3 +148,3 @@ */ | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestURL - the URL for the request | ||
@@ -151,0 +151,0 @@ * @param {string} requestMethod - the API method for the request |
@@ -60,3 +60,3 @@ /** | ||
* To create an instance of Testing Handler Options | ||
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {ChaosStrategy} chaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {string} statusMessage - The Message to be returned in the response | ||
@@ -63,0 +63,0 @@ * @param {number?} statusCode - The statusCode to be returned in the response |
@@ -22,3 +22,3 @@ /** | ||
* To create an instance of Testing Handler Options | ||
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {ChaosStrategy} chaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {string} statusMessage - The Message to be returned in the response | ||
@@ -25,0 +25,0 @@ * @param {number?} statusCode - The statusCode to be returned in the response |
@@ -48,3 +48,3 @@ /** | ||
*/ | ||
private static defaultShouldRetry; | ||
private static defaultShouldRedirect; | ||
/** | ||
@@ -51,0 +51,0 @@ * @public |
@@ -21,3 +21,3 @@ /** | ||
*/ | ||
constructor(maxRedirects = RedirectHandlerOptions.DEFAULT_MAX_REDIRECTS, shouldRedirect = RedirectHandlerOptions.defaultShouldRetry) { | ||
constructor(maxRedirects = RedirectHandlerOptions.DEFAULT_MAX_REDIRECTS, shouldRedirect = RedirectHandlerOptions.defaultShouldRedirect) { | ||
if (maxRedirects > RedirectHandlerOptions.MAX_MAX_REDIRECTS) { | ||
@@ -53,3 +53,3 @@ const error = new Error(`MaxRedirects should not be more than ${RedirectHandlerOptions.MAX_MAX_REDIRECTS}`); | ||
*/ | ||
RedirectHandlerOptions.defaultShouldRetry = () => true; | ||
RedirectHandlerOptions.defaultShouldRedirect = () => true; | ||
//# sourceMappingURL=RedirectHandlerOptions.js.map |
@@ -27,3 +27,3 @@ /** | ||
if (!content || !name || !size) { | ||
throw new GraphClientError("Please provide the Readable Stream content, name of the file and size of the file"); | ||
throw new GraphClientError("Please provide the upload content, name of the file and size of the file"); | ||
} | ||
@@ -30,0 +30,0 @@ } |
@@ -100,2 +100,3 @@ /** | ||
* @param {Client} client - The GraphClient instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {any} payload - The payload that needs to be sent | ||
@@ -102,0 +103,0 @@ * @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent |
@@ -58,2 +58,3 @@ /** | ||
* @param {Client} client - The GraphClient instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {any} payload - The payload that needs to be sent | ||
@@ -196,2 +197,3 @@ * @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent | ||
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -217,2 +219,3 @@ .put(fileSlice); | ||
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -219,0 +222,0 @@ .responseType(ResponseType.RAW) |
@@ -17,2 +17,4 @@ /** | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
* @property {UploadEventHandlers} [uploadEventHandlers] - UploadEventHandlers attached to an upload task | ||
*/ | ||
@@ -30,4 +32,3 @@ export interface OneDriveLargeFileUploadOptions { | ||
* @property {string} fileName - Specifies the name of a file to be uploaded (with extension) | ||
* @property {string} [path] - The path to which the file needs to be uploaded | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
*/ | ||
@@ -59,2 +60,11 @@ interface OneDriveFileUploadSessionPayLoad { | ||
/** | ||
* @private | ||
* @static | ||
* Get file information | ||
* @param {Blob | Buffer | File} file - The file entity | ||
* @param {string} fileName - The file name | ||
* @returns {FileInfo} The file information | ||
*/ | ||
private static getFileInfo; | ||
/** | ||
* @public | ||
@@ -76,3 +86,3 @@ * @static | ||
* @param {Client} client - The GraphClient instance | ||
* @param {FileObject} file - FileObject instance | ||
* @param {FileObject} fileObject - FileObject instance | ||
* @param {OneDriveLargeFileUploadOptions} options - The options for upload task | ||
@@ -89,4 +99,3 @@ * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {string} fileName - The name of a file to upload, (with extension) | ||
* @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' | ||
* @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' | ||
* @returns The promise that resolves to LargeFileUploadSession | ||
@@ -93,0 +102,0 @@ */ |
@@ -61,2 +61,31 @@ /** | ||
/** | ||
* @private | ||
* @static | ||
* Get file information | ||
* @param {Blob | Buffer | File} file - The file entity | ||
* @param {string} fileName - The file name | ||
* @returns {FileInfo} The file information | ||
*/ | ||
static getFileInfo(file, fileName) { | ||
let content; | ||
let size; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file], fileName); | ||
size = content.size; | ||
} | ||
else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file; | ||
size = content.size; | ||
} | ||
else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
const b = file; | ||
size = b.byteLength; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
return { | ||
content, | ||
size, | ||
}; | ||
} | ||
/** | ||
* @public | ||
@@ -76,19 +105,5 @@ * @static | ||
} | ||
const name = options.fileName; | ||
let content; | ||
let size; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file], name); | ||
size = content.size; | ||
} | ||
else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file; | ||
size = content.size; | ||
} | ||
else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
const b = file; | ||
size = b.byteLength - b.byteOffset; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
const fileObj = new FileUpload(content, name, size); | ||
const fileName = options.fileName; | ||
const fileInfo = OneDriveLargeFileUploadTask.getFileInfo(file, fileName); | ||
const fileObj = new FileUpload(fileInfo.content, fileName, fileInfo.size); | ||
return this.createTaskWithFileObject(client, fileObj, options); | ||
@@ -103,3 +118,3 @@ }); | ||
* @param {Client} client - The GraphClient instance | ||
* @param {FileObject} file - FileObject instance | ||
* @param {FileObject} fileObject - FileObject instance | ||
* @param {OneDriveLargeFileUploadOptions} options - The options for upload task | ||
@@ -133,4 +148,3 @@ * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {string} fileName - The name of a file to upload, (with extension) | ||
* @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' | ||
* @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' | ||
* @returns The promise that resolves to LargeFileUploadSession | ||
@@ -137,0 +151,0 @@ */ |
@@ -10,2 +10,2 @@ /** | ||
*/ | ||
export declare const PACKAGE_VERSION = "3.0.0"; | ||
export declare const PACKAGE_VERSION = "3.0.1"; |
@@ -12,3 +12,3 @@ /** | ||
*/ | ||
export const PACKAGE_VERSION = "3.0.0"; | ||
export const PACKAGE_VERSION = "3.0.1"; | ||
//# sourceMappingURL=Version.js.map |
@@ -7,43 +7,42 @@ /** | ||
*/ | ||
export * from "../content/BatchRequestContent"; | ||
export * from "../content/BatchResponseContent"; | ||
export * from "../middleware/AuthenticationHandler"; | ||
export * from "../middleware/HTTPMessageHandler"; | ||
export * from "../middleware/IMiddleware"; | ||
export * from "../middleware/RetryHandler"; | ||
export * from "../middleware/RedirectHandler"; | ||
export * from "../middleware/TelemetryHandler"; | ||
export * from "../middleware/MiddlewareFactory"; | ||
export * from "../middleware/options/AuthenticationHandlerOptions"; | ||
export * from "../middleware/options/IMiddlewareOptions"; | ||
export * from "../middleware/options/RetryHandlerOptions"; | ||
export * from "../middleware/options/RedirectHandlerOptions"; | ||
export * from "../middleware/options/TelemetryHandlerOptions"; | ||
export * from "../middleware/options/ChaosHandlerOptions"; | ||
export * from "../middleware/options/ChaosStrategy"; | ||
export * from "../middleware/ChaosHandler"; | ||
export * from "../tasks/LargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/UploadResult"; | ||
export * from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "../tasks/FileUploadTask/Range"; | ||
export * from "../tasks/PageIterator"; | ||
export * from "../Client"; | ||
export * from "../CustomAuthenticationProvider"; | ||
export * from "../GraphError"; | ||
export * from "../GraphClientError"; | ||
export * from "../GraphRequest"; | ||
export * from "../IAuthProvider"; | ||
export * from "../IAuthenticationProvider"; | ||
export * from "../IAuthenticationProviderOptions"; | ||
export * from "../IAuthProviderCallback"; | ||
export * from "../IClientOptions"; | ||
export * from "../IContext"; | ||
export * from "../IFetchOptions"; | ||
export * from "../IGraphRequestCallback"; | ||
export * from "../IOptions"; | ||
export * from "../ResponseType"; | ||
export { BatchRequestStep, BatchRequestData, BatchRequestContent, RequestData, BatchRequestBody } from "../content/BatchRequestContent"; | ||
export { BatchResponseContent } from "../content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "../middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler"; | ||
export { Middleware } from "../middleware/IMiddleware"; | ||
export { RetryHandler } from "../middleware/RetryHandler"; | ||
export { RedirectHandler } from "../middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "../middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "../middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "../middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "../middleware/options/IMiddlewareOptions"; | ||
export { ShouldRetry, RetryHandlerOptions } from "../middleware/options/RetryHandlerOptions"; | ||
export { ShouldRedirect, RedirectHandlerOptions } from "../middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "../middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "../middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "../middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "../middleware/ChaosHandler"; | ||
export { SliceType, LargeFileUploadTaskOptions, LargeFileUploadTask, LargeFileUploadSession, FileObject } from "../tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadTask, OneDriveLargeFileUploadOptions } from "../tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "../tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "../tasks/FileUploadTask/Range"; | ||
export { PageIteratorCallback, PageIterator, PageCollection, GraphRequestOptions } from "../tasks/PageIterator"; | ||
export { Client } from "../Client"; | ||
export { CustomAuthenticationProvider } from "../CustomAuthenticationProvider"; | ||
export { GraphError } from "../GraphError"; | ||
export { GraphClientError } from "../GraphClientError"; | ||
export { GraphRequest } from "../GraphRequest"; | ||
export { AuthProvider } from "../IAuthProvider"; | ||
export { AuthenticationProvider } from "../IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "../IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "../IAuthProviderCallback"; | ||
export { ClientOptions } from "../IClientOptions"; | ||
export { Context } from "../IContext"; | ||
export { NodeFetchInit, FetchOptions } from "../IFetchOptions"; | ||
export { GraphRequestCallback } from "../IGraphRequestCallback"; | ||
export { Options } from "../IOptions"; | ||
export { ResponseType } from "../ResponseType"; |
@@ -9,45 +9,62 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("../content/BatchRequestContent"), exports); | ||
tslib_1.__exportStar(require("../content/BatchResponseContent"), exports); | ||
tslib_1.__exportStar(require("../middleware/AuthenticationHandler"), exports); | ||
tslib_1.__exportStar(require("../middleware/HTTPMessageHandler"), exports); | ||
tslib_1.__exportStar(require("../middleware/IMiddleware"), exports); | ||
tslib_1.__exportStar(require("../middleware/RetryHandler"), exports); | ||
tslib_1.__exportStar(require("../middleware/RedirectHandler"), exports); | ||
tslib_1.__exportStar(require("../middleware/TelemetryHandler"), exports); | ||
tslib_1.__exportStar(require("../middleware/MiddlewareFactory"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/AuthenticationHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/IMiddlewareOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/RetryHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/RedirectHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/TelemetryHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/ChaosHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("../middleware/options/ChaosStrategy"), exports); | ||
tslib_1.__exportStar(require("../middleware/ChaosHandler"), exports); | ||
tslib_1.__exportStar(require("../tasks/LargeFileUploadTask"), exports); | ||
tslib_1.__exportStar(require("../tasks/OneDriveLargeFileUploadTask"), exports); | ||
tslib_1.__exportStar(require("../tasks/OneDriveLargeFileUploadTaskUtil"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/FileObjectClasses/StreamUpload"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/FileObjectClasses/FileUpload"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/FileObjectClasses/StreamUpload"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/UploadResult"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"), exports); | ||
tslib_1.__exportStar(require("../tasks/FileUploadTask/Range"), exports); | ||
tslib_1.__exportStar(require("../tasks/PageIterator"), exports); | ||
tslib_1.__exportStar(require("../Client"), exports); | ||
tslib_1.__exportStar(require("../CustomAuthenticationProvider"), exports); | ||
tslib_1.__exportStar(require("../GraphError"), exports); | ||
tslib_1.__exportStar(require("../GraphClientError"), exports); | ||
tslib_1.__exportStar(require("../GraphRequest"), exports); | ||
tslib_1.__exportStar(require("../IAuthProvider"), exports); | ||
tslib_1.__exportStar(require("../IAuthenticationProvider"), exports); | ||
tslib_1.__exportStar(require("../IAuthenticationProviderOptions"), exports); | ||
tslib_1.__exportStar(require("../IAuthProviderCallback"), exports); | ||
tslib_1.__exportStar(require("../IClientOptions"), exports); | ||
tslib_1.__exportStar(require("../IContext"), exports); | ||
tslib_1.__exportStar(require("../IFetchOptions"), exports); | ||
tslib_1.__exportStar(require("../IGraphRequestCallback"), exports); | ||
tslib_1.__exportStar(require("../IOptions"), exports); | ||
tslib_1.__exportStar(require("../ResponseType"), exports); | ||
exports.ResponseType = exports.GraphRequest = exports.GraphClientError = exports.GraphError = exports.CustomAuthenticationProvider = exports.Client = exports.PageIterator = exports.Range = exports.UploadResult = exports.FileUpload = exports.StreamUpload = exports.getValidRangeSize = exports.OneDriveLargeFileUploadTask = exports.LargeFileUploadTask = exports.ChaosHandler = exports.ChaosStrategy = exports.ChaosHandlerOptions = exports.TelemetryHandlerOptions = exports.FeatureUsageFlag = exports.RedirectHandlerOptions = exports.RetryHandlerOptions = exports.AuthenticationHandlerOptions = exports.MiddlewareFactory = exports.TelemetryHandler = exports.RedirectHandler = exports.RetryHandler = exports.HTTPMessageHandler = exports.AuthenticationHandler = exports.BatchResponseContent = exports.BatchRequestContent = void 0; | ||
var BatchRequestContent_1 = require("../content/BatchRequestContent"); | ||
Object.defineProperty(exports, "BatchRequestContent", { enumerable: true, get: function () { return BatchRequestContent_1.BatchRequestContent; } }); | ||
var BatchResponseContent_1 = require("../content/BatchResponseContent"); | ||
Object.defineProperty(exports, "BatchResponseContent", { enumerable: true, get: function () { return BatchResponseContent_1.BatchResponseContent; } }); | ||
var AuthenticationHandler_1 = require("../middleware/AuthenticationHandler"); | ||
Object.defineProperty(exports, "AuthenticationHandler", { enumerable: true, get: function () { return AuthenticationHandler_1.AuthenticationHandler; } }); | ||
var HTTPMessageHandler_1 = require("../middleware/HTTPMessageHandler"); | ||
Object.defineProperty(exports, "HTTPMessageHandler", { enumerable: true, get: function () { return HTTPMessageHandler_1.HTTPMessageHandler; } }); | ||
var RetryHandler_1 = require("../middleware/RetryHandler"); | ||
Object.defineProperty(exports, "RetryHandler", { enumerable: true, get: function () { return RetryHandler_1.RetryHandler; } }); | ||
var RedirectHandler_1 = require("../middleware/RedirectHandler"); | ||
Object.defineProperty(exports, "RedirectHandler", { enumerable: true, get: function () { return RedirectHandler_1.RedirectHandler; } }); | ||
var TelemetryHandler_1 = require("../middleware/TelemetryHandler"); | ||
Object.defineProperty(exports, "TelemetryHandler", { enumerable: true, get: function () { return TelemetryHandler_1.TelemetryHandler; } }); | ||
var MiddlewareFactory_1 = require("../middleware/MiddlewareFactory"); | ||
Object.defineProperty(exports, "MiddlewareFactory", { enumerable: true, get: function () { return MiddlewareFactory_1.MiddlewareFactory; } }); | ||
var AuthenticationHandlerOptions_1 = require("../middleware/options/AuthenticationHandlerOptions"); | ||
Object.defineProperty(exports, "AuthenticationHandlerOptions", { enumerable: true, get: function () { return AuthenticationHandlerOptions_1.AuthenticationHandlerOptions; } }); | ||
var RetryHandlerOptions_1 = require("../middleware/options/RetryHandlerOptions"); | ||
Object.defineProperty(exports, "RetryHandlerOptions", { enumerable: true, get: function () { return RetryHandlerOptions_1.RetryHandlerOptions; } }); | ||
var RedirectHandlerOptions_1 = require("../middleware/options/RedirectHandlerOptions"); | ||
Object.defineProperty(exports, "RedirectHandlerOptions", { enumerable: true, get: function () { return RedirectHandlerOptions_1.RedirectHandlerOptions; } }); | ||
var TelemetryHandlerOptions_1 = require("../middleware/options/TelemetryHandlerOptions"); | ||
Object.defineProperty(exports, "FeatureUsageFlag", { enumerable: true, get: function () { return TelemetryHandlerOptions_1.FeatureUsageFlag; } }); | ||
Object.defineProperty(exports, "TelemetryHandlerOptions", { enumerable: true, get: function () { return TelemetryHandlerOptions_1.TelemetryHandlerOptions; } }); | ||
var ChaosHandlerOptions_1 = require("../middleware/options/ChaosHandlerOptions"); | ||
Object.defineProperty(exports, "ChaosHandlerOptions", { enumerable: true, get: function () { return ChaosHandlerOptions_1.ChaosHandlerOptions; } }); | ||
var ChaosStrategy_1 = require("../middleware/options/ChaosStrategy"); | ||
Object.defineProperty(exports, "ChaosStrategy", { enumerable: true, get: function () { return ChaosStrategy_1.ChaosStrategy; } }); | ||
var ChaosHandler_1 = require("../middleware/ChaosHandler"); | ||
Object.defineProperty(exports, "ChaosHandler", { enumerable: true, get: function () { return ChaosHandler_1.ChaosHandler; } }); | ||
var LargeFileUploadTask_1 = require("../tasks/LargeFileUploadTask"); | ||
Object.defineProperty(exports, "LargeFileUploadTask", { enumerable: true, get: function () { return LargeFileUploadTask_1.LargeFileUploadTask; } }); | ||
var OneDriveLargeFileUploadTask_1 = require("../tasks/OneDriveLargeFileUploadTask"); | ||
Object.defineProperty(exports, "OneDriveLargeFileUploadTask", { enumerable: true, get: function () { return OneDriveLargeFileUploadTask_1.OneDriveLargeFileUploadTask; } }); | ||
var OneDriveLargeFileUploadTaskUtil_1 = require("../tasks/OneDriveLargeFileUploadTaskUtil"); | ||
Object.defineProperty(exports, "getValidRangeSize", { enumerable: true, get: function () { return OneDriveLargeFileUploadTaskUtil_1.getValidRangeSize; } }); | ||
var StreamUpload_1 = require("../tasks/FileUploadTask/FileObjectClasses/StreamUpload"); | ||
Object.defineProperty(exports, "StreamUpload", { enumerable: true, get: function () { return StreamUpload_1.StreamUpload; } }); | ||
var FileUpload_1 = require("../tasks/FileUploadTask/FileObjectClasses/FileUpload"); | ||
Object.defineProperty(exports, "FileUpload", { enumerable: true, get: function () { return FileUpload_1.FileUpload; } }); | ||
var UploadResult_1 = require("../tasks/FileUploadTask/UploadResult"); | ||
Object.defineProperty(exports, "UploadResult", { enumerable: true, get: function () { return UploadResult_1.UploadResult; } }); | ||
var Range_1 = require("../tasks/FileUploadTask/Range"); | ||
Object.defineProperty(exports, "Range", { enumerable: true, get: function () { return Range_1.Range; } }); | ||
var PageIterator_1 = require("../tasks/PageIterator"); | ||
Object.defineProperty(exports, "PageIterator", { enumerable: true, get: function () { return PageIterator_1.PageIterator; } }); | ||
var Client_1 = require("../Client"); | ||
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } }); | ||
var CustomAuthenticationProvider_1 = require("../CustomAuthenticationProvider"); | ||
Object.defineProperty(exports, "CustomAuthenticationProvider", { enumerable: true, get: function () { return CustomAuthenticationProvider_1.CustomAuthenticationProvider; } }); | ||
var GraphError_1 = require("../GraphError"); | ||
Object.defineProperty(exports, "GraphError", { enumerable: true, get: function () { return GraphError_1.GraphError; } }); | ||
var GraphClientError_1 = require("../GraphClientError"); | ||
Object.defineProperty(exports, "GraphClientError", { enumerable: true, get: function () { return GraphClientError_1.GraphClientError; } }); | ||
var GraphRequest_1 = require("../GraphRequest"); | ||
Object.defineProperty(exports, "GraphRequest", { enumerable: true, get: function () { return GraphRequest_1.GraphRequest; } }); | ||
var ResponseType_1 = require("../ResponseType"); | ||
Object.defineProperty(exports, "ResponseType", { enumerable: true, get: function () { return ResponseType_1.ResponseType; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -32,3 +32,3 @@ /** | ||
* To set the GraphClientError object | ||
* @param {any} - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @returns GraphClientError object set to the error passed | ||
@@ -35,0 +35,0 @@ */ |
@@ -39,3 +39,3 @@ "use strict"; | ||
* To set the GraphClientError object | ||
* @param {any} - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @returns GraphClientError object set to the error passed | ||
@@ -42,0 +42,0 @@ */ |
@@ -48,2 +48,4 @@ /** | ||
* @param {number} [statusCode = -1] - The status code of the error | ||
* @param {string} [message] - The message of the error | ||
* @param {Error} [baseError] - The base error | ||
* @returns An instance of GraphError | ||
@@ -50,0 +52,0 @@ */ |
@@ -28,2 +28,4 @@ "use strict"; | ||
* @param {number} [statusCode = -1] - The status code of the error | ||
* @param {string} [message] - The message of the error | ||
* @param {Error} [baseError] - The base error | ||
* @returns An instance of GraphError | ||
@@ -30,0 +32,0 @@ */ |
@@ -117,3 +117,3 @@ "use strict"; | ||
* Throws error if the string is not a valid host/hostname and contains other url parts. | ||
* @param {string} url - The host to be verified | ||
* @param {string} host - The host to be verified | ||
*/ | ||
@@ -120,0 +120,0 @@ var isCustomHostValid = function (host) { |
@@ -40,3 +40,3 @@ /** | ||
* Processes the middleware array to construct the chain | ||
* and sets this.middleware property to the first middlware handler of the array | ||
* and sets this.middleware property to the first middleware handler of the array | ||
* The calling function should validate if middleware is not undefined or not empty | ||
@@ -43,0 +43,0 @@ * @param {Middleware[]} middlewareArray - The array of middleware handlers |
@@ -57,3 +57,3 @@ "use strict"; | ||
* Processes the middleware array to construct the chain | ||
* and sets this.middleware property to the first middlware handler of the array | ||
* and sets this.middleware property to the first middleware handler of the array | ||
* The calling function should validate if middleware is not undefined or not empty | ||
@@ -60,0 +60,0 @@ * @param {Middleware[]} middlewareArray - The array of middleware handlers |
@@ -26,3 +26,3 @@ /** | ||
* NOTE: These are the things that we need to remember while doing modifications in the below default pipeline. | ||
* * HTTPMessageHander should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * HTTPMessageHandler should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * TelemetryHandler should be the one prior to the last middleware in the chain, because this is the one which actually collects and appends the usage flag and placing this handler * before making the actual network call ensures that the usage of all features are recorded in the flag. | ||
@@ -29,0 +29,0 @@ * * The best place for AuthenticationHandler is in the starting of the pipeline, because every other handler might have to work for multiple times for a request but the auth token for |
@@ -45,3 +45,3 @@ "use strict"; | ||
* NOTE: These are the things that we need to remember while doing modifications in the below default pipeline. | ||
* * HTTPMessageHander should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * HTTPMessageHandler should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * TelemetryHandler should be the one prior to the last middleware in the chain, because this is the one which actually collects and appends the usage flag and placing this handler * before making the actual network call ensures that the usage of all features are recorded in the flag. | ||
@@ -48,0 +48,0 @@ * * The best place for AuthenticationHandler is in the starting of the pipeline, because every other handler might have to work for multiple times for a request but the auth token for |
@@ -7,43 +7,42 @@ /** | ||
*/ | ||
export * from "./content/BatchRequestContent"; | ||
export * from "./content/BatchResponseContent"; | ||
export * from "./middleware/AuthenticationHandler"; | ||
export * from "./middleware/HTTPMessageHandler"; | ||
export * from "./middleware/IMiddleware"; | ||
export * from "./middleware/RetryHandler"; | ||
export * from "./middleware/RedirectHandler"; | ||
export * from "./middleware/TelemetryHandler"; | ||
export * from "./middleware/MiddlewareFactory"; | ||
export * from "./middleware/options/AuthenticationHandlerOptions"; | ||
export * from "./middleware/options/IMiddlewareOptions"; | ||
export * from "./middleware/options/RetryHandlerOptions"; | ||
export * from "./middleware/options/RedirectHandlerOptions"; | ||
export * from "./middleware/options/TelemetryHandlerOptions"; | ||
export * from "./middleware/options/ChaosHandlerOptions"; | ||
export * from "./middleware/options/ChaosStrategy"; | ||
export * from "./middleware/ChaosHandler"; | ||
export * from "./tasks/LargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/UploadResult"; | ||
export * from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "./tasks/FileUploadTask/Range"; | ||
export * from "./tasks/PageIterator"; | ||
export * from "./Client"; | ||
export * from "./CustomAuthenticationProvider"; | ||
export * from "./GraphError"; | ||
export * from "./GraphClientError"; | ||
export * from "./GraphRequest"; | ||
export * from "./IAuthProvider"; | ||
export * from "./IAuthenticationProvider"; | ||
export * from "./IAuthenticationProviderOptions"; | ||
export * from "./IAuthProviderCallback"; | ||
export * from "./IClientOptions"; | ||
export * from "./IContext"; | ||
export * from "./IFetchOptions"; | ||
export * from "./IGraphRequestCallback"; | ||
export * from "./IOptions"; | ||
export * from "./ResponseType"; | ||
export { BatchRequestBody, RequestData, BatchRequestContent, BatchRequestData, BatchRequestStep } from "./content/BatchRequestContent"; | ||
export { BatchResponseContent } from "./content/BatchResponseContent"; | ||
export { AuthenticationHandler } from "./middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; | ||
export { Middleware } from "./middleware/IMiddleware"; | ||
export { RetryHandler } from "./middleware/RetryHandler"; | ||
export { RedirectHandler } from "./middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "./middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "./middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "./middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "./middleware/options/IMiddlewareOptions"; | ||
export { RetryHandlerOptions, ShouldRetry } from "./middleware/options/RetryHandlerOptions"; | ||
export { RedirectHandlerOptions, ShouldRedirect } from "./middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "./middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "./middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "./middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "./middleware/ChaosHandler"; | ||
export { FileObject, LargeFileUploadSession, LargeFileUploadTask, LargeFileUploadTaskOptions, SliceType } from "./tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadOptions, OneDriveLargeFileUploadTask } from "./tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "./tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "./tasks/FileUploadTask/Range"; | ||
export { GraphRequestOptions, PageCollection, PageIterator, PageIteratorCallback } from "./tasks/PageIterator"; | ||
export { Client } from "./Client"; | ||
export { CustomAuthenticationProvider } from "./CustomAuthenticationProvider"; | ||
export { GraphError } from "./GraphError"; | ||
export { GraphClientError } from "./GraphClientError"; | ||
export { GraphRequest, URLComponents } from "./GraphRequest"; | ||
export { AuthProvider } from "./IAuthProvider"; | ||
export { AuthenticationProvider } from "./IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "./IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "./IAuthProviderCallback"; | ||
export { ClientOptions } from "./IClientOptions"; | ||
export { Context } from "./IContext"; | ||
export { FetchOptions, NodeFetchInit } from "./IFetchOptions"; | ||
export { GraphRequestCallback } from "./IGraphRequestCallback"; | ||
export { Options } from "./IOptions"; | ||
export { ResponseType } from "./ResponseType"; |
@@ -9,45 +9,62 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./content/BatchRequestContent"), exports); | ||
tslib_1.__exportStar(require("./content/BatchResponseContent"), exports); | ||
tslib_1.__exportStar(require("./middleware/AuthenticationHandler"), exports); | ||
tslib_1.__exportStar(require("./middleware/HTTPMessageHandler"), exports); | ||
tslib_1.__exportStar(require("./middleware/IMiddleware"), exports); | ||
tslib_1.__exportStar(require("./middleware/RetryHandler"), exports); | ||
tslib_1.__exportStar(require("./middleware/RedirectHandler"), exports); | ||
tslib_1.__exportStar(require("./middleware/TelemetryHandler"), exports); | ||
tslib_1.__exportStar(require("./middleware/MiddlewareFactory"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/AuthenticationHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/IMiddlewareOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/RetryHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/RedirectHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/TelemetryHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/ChaosHandlerOptions"), exports); | ||
tslib_1.__exportStar(require("./middleware/options/ChaosStrategy"), exports); | ||
tslib_1.__exportStar(require("./middleware/ChaosHandler"), exports); | ||
tslib_1.__exportStar(require("./tasks/LargeFileUploadTask"), exports); | ||
tslib_1.__exportStar(require("./tasks/OneDriveLargeFileUploadTask"), exports); | ||
tslib_1.__exportStar(require("./tasks/OneDriveLargeFileUploadTaskUtil"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/FileObjectClasses/StreamUpload"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/FileObjectClasses/FileUpload"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/FileObjectClasses/StreamUpload"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/UploadResult"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"), exports); | ||
tslib_1.__exportStar(require("./tasks/FileUploadTask/Range"), exports); | ||
tslib_1.__exportStar(require("./tasks/PageIterator"), exports); | ||
tslib_1.__exportStar(require("./Client"), exports); | ||
tslib_1.__exportStar(require("./CustomAuthenticationProvider"), exports); | ||
tslib_1.__exportStar(require("./GraphError"), exports); | ||
tslib_1.__exportStar(require("./GraphClientError"), exports); | ||
tslib_1.__exportStar(require("./GraphRequest"), exports); | ||
tslib_1.__exportStar(require("./IAuthProvider"), exports); | ||
tslib_1.__exportStar(require("./IAuthenticationProvider"), exports); | ||
tslib_1.__exportStar(require("./IAuthenticationProviderOptions"), exports); | ||
tslib_1.__exportStar(require("./IAuthProviderCallback"), exports); | ||
tslib_1.__exportStar(require("./IClientOptions"), exports); | ||
tslib_1.__exportStar(require("./IContext"), exports); | ||
tslib_1.__exportStar(require("./IFetchOptions"), exports); | ||
tslib_1.__exportStar(require("./IGraphRequestCallback"), exports); | ||
tslib_1.__exportStar(require("./IOptions"), exports); | ||
tslib_1.__exportStar(require("./ResponseType"), exports); | ||
exports.ResponseType = exports.GraphRequest = exports.GraphClientError = exports.GraphError = exports.CustomAuthenticationProvider = exports.Client = exports.PageIterator = exports.Range = exports.UploadResult = exports.FileUpload = exports.StreamUpload = exports.getValidRangeSize = exports.OneDriveLargeFileUploadTask = exports.LargeFileUploadTask = exports.ChaosHandler = exports.ChaosStrategy = exports.ChaosHandlerOptions = exports.TelemetryHandlerOptions = exports.FeatureUsageFlag = exports.RedirectHandlerOptions = exports.RetryHandlerOptions = exports.AuthenticationHandlerOptions = exports.MiddlewareFactory = exports.TelemetryHandler = exports.RedirectHandler = exports.RetryHandler = exports.HTTPMessageHandler = exports.AuthenticationHandler = exports.BatchResponseContent = exports.BatchRequestContent = void 0; | ||
var BatchRequestContent_1 = require("./content/BatchRequestContent"); | ||
Object.defineProperty(exports, "BatchRequestContent", { enumerable: true, get: function () { return BatchRequestContent_1.BatchRequestContent; } }); | ||
var BatchResponseContent_1 = require("./content/BatchResponseContent"); | ||
Object.defineProperty(exports, "BatchResponseContent", { enumerable: true, get: function () { return BatchResponseContent_1.BatchResponseContent; } }); | ||
var AuthenticationHandler_1 = require("./middleware/AuthenticationHandler"); | ||
Object.defineProperty(exports, "AuthenticationHandler", { enumerable: true, get: function () { return AuthenticationHandler_1.AuthenticationHandler; } }); | ||
var HTTPMessageHandler_1 = require("./middleware/HTTPMessageHandler"); | ||
Object.defineProperty(exports, "HTTPMessageHandler", { enumerable: true, get: function () { return HTTPMessageHandler_1.HTTPMessageHandler; } }); | ||
var RetryHandler_1 = require("./middleware/RetryHandler"); | ||
Object.defineProperty(exports, "RetryHandler", { enumerable: true, get: function () { return RetryHandler_1.RetryHandler; } }); | ||
var RedirectHandler_1 = require("./middleware/RedirectHandler"); | ||
Object.defineProperty(exports, "RedirectHandler", { enumerable: true, get: function () { return RedirectHandler_1.RedirectHandler; } }); | ||
var TelemetryHandler_1 = require("./middleware/TelemetryHandler"); | ||
Object.defineProperty(exports, "TelemetryHandler", { enumerable: true, get: function () { return TelemetryHandler_1.TelemetryHandler; } }); | ||
var MiddlewareFactory_1 = require("./middleware/MiddlewareFactory"); | ||
Object.defineProperty(exports, "MiddlewareFactory", { enumerable: true, get: function () { return MiddlewareFactory_1.MiddlewareFactory; } }); | ||
var AuthenticationHandlerOptions_1 = require("./middleware/options/AuthenticationHandlerOptions"); | ||
Object.defineProperty(exports, "AuthenticationHandlerOptions", { enumerable: true, get: function () { return AuthenticationHandlerOptions_1.AuthenticationHandlerOptions; } }); | ||
var RetryHandlerOptions_1 = require("./middleware/options/RetryHandlerOptions"); | ||
Object.defineProperty(exports, "RetryHandlerOptions", { enumerable: true, get: function () { return RetryHandlerOptions_1.RetryHandlerOptions; } }); | ||
var RedirectHandlerOptions_1 = require("./middleware/options/RedirectHandlerOptions"); | ||
Object.defineProperty(exports, "RedirectHandlerOptions", { enumerable: true, get: function () { return RedirectHandlerOptions_1.RedirectHandlerOptions; } }); | ||
var TelemetryHandlerOptions_1 = require("./middleware/options/TelemetryHandlerOptions"); | ||
Object.defineProperty(exports, "FeatureUsageFlag", { enumerable: true, get: function () { return TelemetryHandlerOptions_1.FeatureUsageFlag; } }); | ||
Object.defineProperty(exports, "TelemetryHandlerOptions", { enumerable: true, get: function () { return TelemetryHandlerOptions_1.TelemetryHandlerOptions; } }); | ||
var ChaosHandlerOptions_1 = require("./middleware/options/ChaosHandlerOptions"); | ||
Object.defineProperty(exports, "ChaosHandlerOptions", { enumerable: true, get: function () { return ChaosHandlerOptions_1.ChaosHandlerOptions; } }); | ||
var ChaosStrategy_1 = require("./middleware/options/ChaosStrategy"); | ||
Object.defineProperty(exports, "ChaosStrategy", { enumerable: true, get: function () { return ChaosStrategy_1.ChaosStrategy; } }); | ||
var ChaosHandler_1 = require("./middleware/ChaosHandler"); | ||
Object.defineProperty(exports, "ChaosHandler", { enumerable: true, get: function () { return ChaosHandler_1.ChaosHandler; } }); | ||
var LargeFileUploadTask_1 = require("./tasks/LargeFileUploadTask"); | ||
Object.defineProperty(exports, "LargeFileUploadTask", { enumerable: true, get: function () { return LargeFileUploadTask_1.LargeFileUploadTask; } }); | ||
var OneDriveLargeFileUploadTask_1 = require("./tasks/OneDriveLargeFileUploadTask"); | ||
Object.defineProperty(exports, "OneDriveLargeFileUploadTask", { enumerable: true, get: function () { return OneDriveLargeFileUploadTask_1.OneDriveLargeFileUploadTask; } }); | ||
var OneDriveLargeFileUploadTaskUtil_1 = require("./tasks/OneDriveLargeFileUploadTaskUtil"); | ||
Object.defineProperty(exports, "getValidRangeSize", { enumerable: true, get: function () { return OneDriveLargeFileUploadTaskUtil_1.getValidRangeSize; } }); | ||
var StreamUpload_1 = require("./tasks/FileUploadTask/FileObjectClasses/StreamUpload"); | ||
Object.defineProperty(exports, "StreamUpload", { enumerable: true, get: function () { return StreamUpload_1.StreamUpload; } }); | ||
var FileUpload_1 = require("./tasks/FileUploadTask/FileObjectClasses/FileUpload"); | ||
Object.defineProperty(exports, "FileUpload", { enumerable: true, get: function () { return FileUpload_1.FileUpload; } }); | ||
var UploadResult_1 = require("./tasks/FileUploadTask/UploadResult"); | ||
Object.defineProperty(exports, "UploadResult", { enumerable: true, get: function () { return UploadResult_1.UploadResult; } }); | ||
var Range_1 = require("./tasks/FileUploadTask/Range"); | ||
Object.defineProperty(exports, "Range", { enumerable: true, get: function () { return Range_1.Range; } }); | ||
var PageIterator_1 = require("./tasks/PageIterator"); | ||
Object.defineProperty(exports, "PageIterator", { enumerable: true, get: function () { return PageIterator_1.PageIterator; } }); | ||
var Client_1 = require("./Client"); | ||
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } }); | ||
var CustomAuthenticationProvider_1 = require("./CustomAuthenticationProvider"); | ||
Object.defineProperty(exports, "CustomAuthenticationProvider", { enumerable: true, get: function () { return CustomAuthenticationProvider_1.CustomAuthenticationProvider; } }); | ||
var GraphError_1 = require("./GraphError"); | ||
Object.defineProperty(exports, "GraphError", { enumerable: true, get: function () { return GraphError_1.GraphError; } }); | ||
var GraphClientError_1 = require("./GraphClientError"); | ||
Object.defineProperty(exports, "GraphClientError", { enumerable: true, get: function () { return GraphClientError_1.GraphClientError; } }); | ||
var GraphRequest_1 = require("./GraphRequest"); | ||
Object.defineProperty(exports, "GraphRequest", { enumerable: true, get: function () { return GraphRequest_1.GraphRequest; } }); | ||
var ResponseType_1 = require("./ResponseType"); | ||
Object.defineProperty(exports, "ResponseType", { enumerable: true, get: function () { return ResponseType_1.ResponseType; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -58,3 +58,3 @@ /** | ||
* @private | ||
* @param {ChaosHandlerOptions} options - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestID - request id | ||
@@ -68,3 +68,3 @@ * @param {string} requestDate - date of the request | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {Context} context - Contains the context of the request | ||
@@ -98,3 +98,3 @@ */ | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestURL - the URL for the request | ||
@@ -101,0 +101,0 @@ * @param {string} requestMethod - the API method for the request |
@@ -61,3 +61,3 @@ "use strict"; | ||
* @private | ||
* @param {ChaosHandlerOptions} options - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestID - request id | ||
@@ -94,3 +94,3 @@ * @param {string} requestDate - date of the request | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {Context} context - Contains the context of the request | ||
@@ -161,3 +161,3 @@ */ | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestURL - the URL for the request | ||
@@ -164,0 +164,0 @@ * @param {string} requestMethod - the API method for the request |
@@ -60,3 +60,3 @@ /** | ||
* To create an instance of Testing Handler Options | ||
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {ChaosStrategy} chaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {string} statusMessage - The Message to be returned in the response | ||
@@ -63,0 +63,0 @@ * @param {number?} statusCode - The statusCode to be returned in the response |
@@ -25,3 +25,3 @@ "use strict"; | ||
* To create an instance of Testing Handler Options | ||
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {ChaosStrategy} chaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {string} statusMessage - The Message to be returned in the response | ||
@@ -28,0 +28,0 @@ * @param {number?} statusCode - The statusCode to be returned in the response |
@@ -48,3 +48,3 @@ /** | ||
*/ | ||
private static defaultShouldRetry; | ||
private static defaultShouldRedirect; | ||
/** | ||
@@ -51,0 +51,0 @@ * @public |
@@ -26,3 +26,3 @@ "use strict"; | ||
if (maxRedirects === void 0) { maxRedirects = RedirectHandlerOptions.DEFAULT_MAX_REDIRECTS; } | ||
if (shouldRedirect === void 0) { shouldRedirect = RedirectHandlerOptions.defaultShouldRetry; } | ||
if (shouldRedirect === void 0) { shouldRedirect = RedirectHandlerOptions.defaultShouldRedirect; } | ||
if (maxRedirects > RedirectHandlerOptions.MAX_MAX_REDIRECTS) { | ||
@@ -57,3 +57,3 @@ var error = new Error("MaxRedirects should not be more than " + RedirectHandlerOptions.MAX_MAX_REDIRECTS); | ||
*/ | ||
RedirectHandlerOptions.defaultShouldRetry = function () { return true; }; | ||
RedirectHandlerOptions.defaultShouldRedirect = function () { return true; }; | ||
return RedirectHandlerOptions; | ||
@@ -60,0 +60,0 @@ }()); |
@@ -30,3 +30,3 @@ "use strict"; | ||
if (!content || !name || !size) { | ||
throw new GraphClientError_1.GraphClientError("Please provide the Readable Stream content, name of the file and size of the file"); | ||
throw new GraphClientError_1.GraphClientError("Please provide the upload content, name of the file and size of the file"); | ||
} | ||
@@ -33,0 +33,0 @@ } |
@@ -100,2 +100,3 @@ /** | ||
* @param {Client} client - The GraphClient instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {any} payload - The payload that needs to be sent | ||
@@ -102,0 +103,0 @@ * @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent |
@@ -62,2 +62,3 @@ "use strict"; | ||
* @param {Client} client - The GraphClient instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {any} payload - The payload that needs to be sent | ||
@@ -222,2 +223,3 @@ * @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent | ||
"Content-Range": "bytes " + range.minValue + "-" + range.maxValue + "/" + totalSize, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -248,2 +250,3 @@ .put(fileSlice)]; | ||
"Content-Range": "bytes " + range.minValue + "-" + range.maxValue + "/" + totalSize, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -250,0 +253,0 @@ .responseType(ResponseType_1.ResponseType.RAW) |
@@ -17,2 +17,4 @@ /** | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
* @property {UploadEventHandlers} [uploadEventHandlers] - UploadEventHandlers attached to an upload task | ||
*/ | ||
@@ -30,4 +32,3 @@ export interface OneDriveLargeFileUploadOptions { | ||
* @property {string} fileName - Specifies the name of a file to be uploaded (with extension) | ||
* @property {string} [path] - The path to which the file needs to be uploaded | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
*/ | ||
@@ -59,2 +60,11 @@ interface OneDriveFileUploadSessionPayLoad { | ||
/** | ||
* @private | ||
* @static | ||
* Get file information | ||
* @param {Blob | Buffer | File} file - The file entity | ||
* @param {string} fileName - The file name | ||
* @returns {FileInfo} The file information | ||
*/ | ||
private static getFileInfo; | ||
/** | ||
* @public | ||
@@ -76,3 +86,3 @@ * @static | ||
* @param {Client} client - The GraphClient instance | ||
* @param {FileObject} file - FileObject instance | ||
* @param {FileObject} fileObject - FileObject instance | ||
* @param {OneDriveLargeFileUploadOptions} options - The options for upload task | ||
@@ -89,4 +99,3 @@ * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {string} fileName - The name of a file to upload, (with extension) | ||
* @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' | ||
* @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' | ||
* @returns The promise that resolves to LargeFileUploadSession | ||
@@ -93,0 +102,0 @@ */ |
@@ -66,2 +66,31 @@ "use strict"; | ||
/** | ||
* @private | ||
* @static | ||
* Get file information | ||
* @param {Blob | Buffer | File} file - The file entity | ||
* @param {string} fileName - The file name | ||
* @returns {FileInfo} The file information | ||
*/ | ||
OneDriveLargeFileUploadTask.getFileInfo = function (file, fileName) { | ||
var content; | ||
var size; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file], fileName); | ||
size = content.size; | ||
} | ||
else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file; | ||
size = content.size; | ||
} | ||
else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
var b = file; | ||
size = b.byteLength; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
return { | ||
content: content, | ||
size: size, | ||
}; | ||
}; | ||
/** | ||
* @public | ||
@@ -78,3 +107,3 @@ * @static | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var name, content, size, b, fileObj; | ||
var fileName, fileInfo, fileObj; | ||
return tslib_1.__generator(this, function (_a) { | ||
@@ -84,17 +113,5 @@ if (!client || !file || !options) { | ||
} | ||
name = options.fileName; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file], name); | ||
size = content.size; | ||
} | ||
else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file; | ||
size = content.size; | ||
} | ||
else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
b = file; | ||
size = b.byteLength - b.byteOffset; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
fileObj = new FileUpload_1.FileUpload(content, name, size); | ||
fileName = options.fileName; | ||
fileInfo = OneDriveLargeFileUploadTask.getFileInfo(file, fileName); | ||
fileObj = new FileUpload_1.FileUpload(fileInfo.content, fileName, fileInfo.size); | ||
return [2 /*return*/, this.createTaskWithFileObject(client, fileObj, options)]; | ||
@@ -110,3 +127,3 @@ }); | ||
* @param {Client} client - The GraphClient instance | ||
* @param {FileObject} file - FileObject instance | ||
* @param {FileObject} fileObject - FileObject instance | ||
* @param {OneDriveLargeFileUploadOptions} options - The options for upload task | ||
@@ -148,4 +165,3 @@ * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {string} fileName - The name of a file to upload, (with extension) | ||
* @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' | ||
* @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' | ||
* @returns The promise that resolves to LargeFileUploadSession | ||
@@ -152,0 +168,0 @@ */ |
@@ -10,2 +10,2 @@ /** | ||
*/ | ||
export declare const PACKAGE_VERSION = "3.0.0"; | ||
export declare const PACKAGE_VERSION = "3.0.1"; |
@@ -15,3 +15,3 @@ "use strict"; | ||
*/ | ||
exports.PACKAGE_VERSION = "3.0.0"; | ||
exports.PACKAGE_VERSION = "3.0.1"; | ||
//# sourceMappingURL=Version.js.map |
{ | ||
"name": "@microsoft/microsoft-graph-client", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Microsoft Graph Client Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,46 +8,45 @@ /** | ||
export * from "../content/BatchRequestContent"; | ||
export * from "../content/BatchResponseContent"; | ||
export { BatchRequestStep, BatchRequestData, BatchRequestContent, RequestData, BatchRequestBody } from "../content/BatchRequestContent"; | ||
export { BatchResponseContent } from "../content/BatchResponseContent"; | ||
export * from "../middleware/AuthenticationHandler"; | ||
export * from "../middleware/HTTPMessageHandler"; | ||
export * from "../middleware/IMiddleware"; | ||
export * from "../middleware/RetryHandler"; | ||
export * from "../middleware/RedirectHandler"; | ||
export * from "../middleware/TelemetryHandler"; | ||
export * from "../middleware/MiddlewareFactory"; | ||
export * from "../middleware/options/AuthenticationHandlerOptions"; | ||
export * from "../middleware/options/IMiddlewareOptions"; | ||
export * from "../middleware/options/RetryHandlerOptions"; | ||
export * from "../middleware/options/RedirectHandlerOptions"; | ||
export * from "../middleware/options/TelemetryHandlerOptions"; | ||
export * from "../middleware/options/ChaosHandlerOptions"; | ||
export * from "../middleware/options/ChaosStrategy"; | ||
export * from "../middleware/ChaosHandler"; | ||
export { AuthenticationHandler } from "../middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler"; | ||
export { Middleware } from "../middleware/IMiddleware"; | ||
export { RetryHandler } from "../middleware/RetryHandler"; | ||
export { RedirectHandler } from "../middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "../middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "../middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "../middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "../middleware/options/IMiddlewareOptions"; | ||
export { ShouldRetry, RetryHandlerOptions } from "../middleware/options/RetryHandlerOptions"; | ||
export { ShouldRedirect, RedirectHandlerOptions } from "../middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "../middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "../middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "../middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "../middleware/ChaosHandler"; | ||
export * from "../tasks/LargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTask"; | ||
export * from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "../tasks/FileUploadTask/UploadResult"; | ||
export * from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "../tasks/FileUploadTask/Range"; | ||
export * from "../tasks/PageIterator"; | ||
export { SliceType, LargeFileUploadTaskOptions, LargeFileUploadTask, LargeFileUploadSession, FileObject } from "../tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadTask, OneDriveLargeFileUploadOptions } from "../tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "../tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "../tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "../tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "../tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "../tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "../tasks/FileUploadTask/Range"; | ||
export { PageIteratorCallback, PageIterator, PageCollection, GraphRequestOptions } from "../tasks/PageIterator"; | ||
export * from "../Client"; | ||
export * from "../CustomAuthenticationProvider"; | ||
export * from "../GraphError"; | ||
export * from "../GraphClientError"; | ||
export * from "../GraphRequest"; | ||
export * from "../IAuthProvider"; | ||
export * from "../IAuthenticationProvider"; | ||
export * from "../IAuthenticationProviderOptions"; | ||
export * from "../IAuthProviderCallback"; | ||
export * from "../IClientOptions"; | ||
export * from "../IContext"; | ||
export * from "../IFetchOptions"; | ||
export * from "../IGraphRequestCallback"; | ||
export * from "../IOptions"; | ||
export * from "../ResponseType"; | ||
export { Client } from "../Client"; | ||
export { CustomAuthenticationProvider } from "../CustomAuthenticationProvider"; | ||
export { GraphError } from "../GraphError"; | ||
export { GraphClientError } from "../GraphClientError"; | ||
export { GraphRequest } from "../GraphRequest"; | ||
export { AuthProvider } from "../IAuthProvider"; | ||
export { AuthenticationProvider } from "../IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "../IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "../IAuthProviderCallback"; | ||
export { ClientOptions } from "../IClientOptions"; | ||
export { Context } from "../IContext"; | ||
export { NodeFetchInit, FetchOptions } from "../IFetchOptions"; | ||
export { GraphRequestCallback } from "../IGraphRequestCallback"; | ||
export { Options } from "../IOptions"; | ||
export { ResponseType } from "../ResponseType"; |
@@ -36,3 +36,3 @@ /** | ||
* To set the GraphClientError object | ||
* @param {any} - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request | ||
* @returns GraphClientError object set to the error passed | ||
@@ -39,0 +39,0 @@ */ |
@@ -56,2 +56,4 @@ /** | ||
* @param {number} [statusCode = -1] - The status code of the error | ||
* @param {string} [message] - The message of the error | ||
* @param {Error} [baseError] - The base error | ||
* @returns An instance of GraphError | ||
@@ -58,0 +60,0 @@ */ |
@@ -117,3 +117,3 @@ /** | ||
* Throws error if the string is not a valid host/hostname and contains other url parts. | ||
* @param {string} url - The host to be verified | ||
* @param {string} host - The host to be verified | ||
*/ | ||
@@ -120,0 +120,0 @@ const isCustomHostValid = (host: string) => { |
@@ -60,3 +60,3 @@ /** | ||
* Processes the middleware array to construct the chain | ||
* and sets this.middleware property to the first middlware handler of the array | ||
* and sets this.middleware property to the first middleware handler of the array | ||
* The calling function should validate if middleware is not undefined or not empty | ||
@@ -63,0 +63,0 @@ * @param {Middleware[]} middlewareArray - The array of middleware handlers |
@@ -45,3 +45,3 @@ /** | ||
* NOTE: These are the things that we need to remember while doing modifications in the below default pipeline. | ||
* * HTTPMessageHander should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * HTTPMessageHandler should be the last one in the middleware pipeline, because this makes the actual network call of the request | ||
* * TelemetryHandler should be the one prior to the last middleware in the chain, because this is the one which actually collects and appends the usage flag and placing this handler * before making the actual network call ensures that the usage of all features are recorded in the flag. | ||
@@ -48,0 +48,0 @@ * * The best place for AuthenticationHandler is in the starting of the pipeline, because every other handler might have to work for multiple times for a request but the auth token for |
@@ -8,46 +8,45 @@ /** | ||
export * from "./content/BatchRequestContent"; | ||
export * from "./content/BatchResponseContent"; | ||
export { BatchRequestBody, RequestData, BatchRequestContent, BatchRequestData, BatchRequestStep } from "./content/BatchRequestContent"; | ||
export { BatchResponseContent } from "./content/BatchResponseContent"; | ||
export * from "./middleware/AuthenticationHandler"; | ||
export * from "./middleware/HTTPMessageHandler"; | ||
export * from "./middleware/IMiddleware"; | ||
export * from "./middleware/RetryHandler"; | ||
export * from "./middleware/RedirectHandler"; | ||
export * from "./middleware/TelemetryHandler"; | ||
export * from "./middleware/MiddlewareFactory"; | ||
export * from "./middleware/options/AuthenticationHandlerOptions"; | ||
export * from "./middleware/options/IMiddlewareOptions"; | ||
export * from "./middleware/options/RetryHandlerOptions"; | ||
export * from "./middleware/options/RedirectHandlerOptions"; | ||
export * from "./middleware/options/TelemetryHandlerOptions"; | ||
export * from "./middleware/options/ChaosHandlerOptions"; | ||
export * from "./middleware/options/ChaosStrategy"; | ||
export * from "./middleware/ChaosHandler"; | ||
export { AuthenticationHandler } from "./middleware/AuthenticationHandler"; | ||
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; | ||
export { Middleware } from "./middleware/IMiddleware"; | ||
export { RetryHandler } from "./middleware/RetryHandler"; | ||
export { RedirectHandler } from "./middleware/RedirectHandler"; | ||
export { TelemetryHandler } from "./middleware/TelemetryHandler"; | ||
export { MiddlewareFactory } from "./middleware/MiddlewareFactory"; | ||
export { AuthenticationHandlerOptions } from "./middleware/options/AuthenticationHandlerOptions"; | ||
export { MiddlewareOptions } from "./middleware/options/IMiddlewareOptions"; | ||
export { RetryHandlerOptions, ShouldRetry } from "./middleware/options/RetryHandlerOptions"; | ||
export { RedirectHandlerOptions, ShouldRedirect } from "./middleware/options/RedirectHandlerOptions"; | ||
export { FeatureUsageFlag, TelemetryHandlerOptions } from "./middleware/options/TelemetryHandlerOptions"; | ||
export { ChaosHandlerOptions } from "./middleware/options/ChaosHandlerOptions"; | ||
export { ChaosStrategy } from "./middleware/options/ChaosStrategy"; | ||
export { ChaosHandler } from "./middleware/ChaosHandler"; | ||
export * from "./tasks/LargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTask"; | ||
export * from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export * from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export * from "./tasks/FileUploadTask/UploadResult"; | ||
export * from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export * from "./tasks/FileUploadTask/Range"; | ||
export * from "./tasks/PageIterator"; | ||
export { FileObject, LargeFileUploadSession, LargeFileUploadTask, LargeFileUploadTaskOptions, SliceType } from "./tasks/LargeFileUploadTask"; | ||
export { OneDriveLargeFileUploadOptions, OneDriveLargeFileUploadTask } from "./tasks/OneDriveLargeFileUploadTask"; | ||
export { getValidRangeSize } from "./tasks/OneDriveLargeFileUploadTaskUtil"; | ||
export { StreamUpload } from "./tasks/FileUploadTask/FileObjectClasses/StreamUpload"; | ||
export { FileUpload } from "./tasks/FileUploadTask/FileObjectClasses/FileUpload"; | ||
export { UploadResult } from "./tasks/FileUploadTask/UploadResult"; | ||
export { UploadEventHandlers } from "./tasks/FileUploadTask/Interfaces/IUploadEventHandlers"; | ||
export { Range } from "./tasks/FileUploadTask/Range"; | ||
export { GraphRequestOptions, PageCollection, PageIterator, PageIteratorCallback } from "./tasks/PageIterator"; | ||
export * from "./Client"; | ||
export * from "./CustomAuthenticationProvider"; | ||
export * from "./GraphError"; | ||
export * from "./GraphClientError"; | ||
export * from "./GraphRequest"; | ||
export * from "./IAuthProvider"; | ||
export * from "./IAuthenticationProvider"; | ||
export * from "./IAuthenticationProviderOptions"; | ||
export * from "./IAuthProviderCallback"; | ||
export * from "./IClientOptions"; | ||
export * from "./IContext"; | ||
export * from "./IFetchOptions"; | ||
export * from "./IGraphRequestCallback"; | ||
export * from "./IOptions"; | ||
export * from "./ResponseType"; | ||
export { Client } from "./Client"; | ||
export { CustomAuthenticationProvider } from "./CustomAuthenticationProvider"; | ||
export { GraphError } from "./GraphError"; | ||
export { GraphClientError } from "./GraphClientError"; | ||
export { GraphRequest, URLComponents } from "./GraphRequest"; | ||
export { AuthProvider } from "./IAuthProvider"; | ||
export { AuthenticationProvider } from "./IAuthenticationProvider"; | ||
export { AuthenticationProviderOptions } from "./IAuthenticationProviderOptions"; | ||
export { AuthProviderCallback } from "./IAuthProviderCallback"; | ||
export { ClientOptions } from "./IClientOptions"; | ||
export { Context } from "./IContext"; | ||
export { FetchOptions, NodeFetchInit } from "./IFetchOptions"; | ||
export { GraphRequestCallback } from "./IGraphRequestCallback"; | ||
export { Options } from "./IOptions"; | ||
export { ResponseType } from "./ResponseType"; |
@@ -89,3 +89,3 @@ /** | ||
* @private | ||
* @param {ChaosHandlerOptions} options - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestID - request id | ||
@@ -123,3 +123,3 @@ * @param {string} requestDate - date of the request | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {Context} context - Contains the context of the request | ||
@@ -182,3 +182,3 @@ */ | ||
* @private | ||
* @param {ChaosHandlerOptions} ChaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {ChaosHandlerOptions} chaosHandlerOptions - The ChaosHandlerOptions object | ||
* @param {string} requestURL - the URL for the request | ||
@@ -185,0 +185,0 @@ * @param {string} requestMethod - the API method for the request |
@@ -69,3 +69,3 @@ /** | ||
* To create an instance of Testing Handler Options | ||
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {ChaosStrategy} chaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL | ||
* @param {string} statusMessage - The Message to be returned in the response | ||
@@ -72,0 +72,0 @@ * @param {number?} statusCode - The statusCode to be returned in the response |
@@ -56,3 +56,3 @@ /** | ||
*/ | ||
private static defaultShouldRetry: ShouldRedirect = () => true; | ||
private static defaultShouldRedirect: ShouldRedirect = () => true; | ||
@@ -67,3 +67,3 @@ /** | ||
*/ | ||
public constructor(maxRedirects: number = RedirectHandlerOptions.DEFAULT_MAX_REDIRECTS, shouldRedirect: ShouldRedirect = RedirectHandlerOptions.defaultShouldRetry) { | ||
public constructor(maxRedirects: number = RedirectHandlerOptions.DEFAULT_MAX_REDIRECTS, shouldRedirect: ShouldRedirect = RedirectHandlerOptions.defaultShouldRedirect) { | ||
if (maxRedirects > RedirectHandlerOptions.MAX_MAX_REDIRECTS) { | ||
@@ -70,0 +70,0 @@ const error = new Error(`MaxRedirects should not be more than ${RedirectHandlerOptions.MAX_MAX_REDIRECTS}`); |
@@ -28,3 +28,3 @@ /** | ||
if (!content || !name || !size) { | ||
throw new GraphClientError("Please provide the Readable Stream content, name of the file and size of the file"); | ||
throw new GraphClientError("Please provide the upload content, name of the file and size of the file"); | ||
} | ||
@@ -31,0 +31,0 @@ } |
@@ -130,2 +130,3 @@ /** | ||
* @param {Client} client - The GraphClient instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {any} payload - The payload that needs to be sent | ||
@@ -299,2 +300,3 @@ * @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent | ||
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -319,2 +321,3 @@ .put(fileSlice); | ||
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`, | ||
"Content-Type": "application/octet-stream", | ||
}) | ||
@@ -321,0 +324,0 @@ .responseType(ResponseType.RAW) |
@@ -25,2 +25,4 @@ /** | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
* @property {UploadEventHandlers} [uploadEventHandlers] - UploadEventHandlers attached to an upload task | ||
*/ | ||
@@ -39,4 +41,3 @@ export interface OneDriveLargeFileUploadOptions { | ||
* @property {string} fileName - Specifies the name of a file to be uploaded (with extension) | ||
* @property {string} [path] - The path to which the file needs to be uploaded | ||
* @property {number} [rangeSize] - Specifies the range chunk size | ||
* @property {string} [conflictBehavior] - Conflict behaviour option | ||
*/ | ||
@@ -49,2 +50,13 @@ interface OneDriveFileUploadSessionPayLoad { | ||
/** | ||
* @interface | ||
* Signature to define the file information when processing an upload task | ||
* @property {File | Buffer} content - The file content | ||
* @property {number} size - The size of file | ||
*/ | ||
interface FileInfo { | ||
content: File | Buffer; | ||
size: number; | ||
} | ||
/** | ||
* @class | ||
@@ -90,2 +102,30 @@ * Class representing OneDriveLargeFileUploadTask | ||
/** | ||
* @private | ||
* @static | ||
* Get file information | ||
* @param {Blob | Buffer | File} file - The file entity | ||
* @param {string} fileName - The file name | ||
* @returns {FileInfo} The file information | ||
*/ | ||
private static getFileInfo(file: Blob | Buffer | File, fileName: string): FileInfo { | ||
let content; | ||
let size; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file as Blob], fileName); | ||
size = content.size; | ||
} else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file as File; | ||
size = content.size; | ||
} else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
const b = file as Buffer; | ||
size = b.byteLength; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
return { | ||
content, | ||
size, | ||
}; | ||
} | ||
/** | ||
* @public | ||
@@ -104,17 +144,5 @@ * @static | ||
} | ||
const name: string = options.fileName; | ||
let content; | ||
let size; | ||
if (typeof Blob !== "undefined" && file instanceof Blob) { | ||
content = new File([file as Blob], name); | ||
size = content.size; | ||
} else if (typeof File !== "undefined" && file instanceof File) { | ||
content = file as File; | ||
size = content.size; | ||
} else if (typeof Buffer !== "undefined" && file instanceof Buffer) { | ||
const b = file as Buffer; | ||
size = b.byteLength - b.byteOffset; | ||
content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); | ||
} | ||
const fileObj = new FileUpload(content, name, size); | ||
const fileName = options.fileName; | ||
const fileInfo = OneDriveLargeFileUploadTask.getFileInfo(file, fileName); | ||
const fileObj = new FileUpload(fileInfo.content, fileName, fileInfo.size); | ||
return this.createTaskWithFileObject<Blob | ArrayBuffer | Buffer>(client, fileObj, options); | ||
@@ -129,3 +157,3 @@ } | ||
* @param {Client} client - The GraphClient instance | ||
* @param {FileObject} file - FileObject instance | ||
* @param {FileObject} fileObject - FileObject instance | ||
* @param {OneDriveLargeFileUploadOptions} options - The options for upload task | ||
@@ -158,4 +186,3 @@ * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance | ||
* @param {string} requestUrl - The URL to create the upload session | ||
* @param {string} fileName - The name of a file to upload, (with extension) | ||
* @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' | ||
* @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' | ||
* @returns The promise that resolves to LargeFileUploadSession | ||
@@ -162,0 +189,0 @@ */ |
@@ -15,2 +15,2 @@ /** | ||
export const PACKAGE_VERSION = "3.0.0"; | ||
export const PACKAGE_VERSION = "3.0.1"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1256535
22474