From d2b4d988bf14857f6dab7ee6529a703728da873a Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Sun, 18 Nov 2018 08:49:55 -0800 Subject: [PATCH] office-js: Add AsyncResult.diagnostics (#30593) * office-js-Add AsyncResult.diagnostics * Minor update * Updates based on feedback from Ankush * Updates based on feedback from Alex --- types/office-js/index.d.ts | 43 ++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index a7dcc33f6c..bbbaccf209 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -551,6 +551,37 @@ declare namespace Office { */ asyncContext: any; /** + * Gets an object that may provide additional information if an error occurred. + * + * @remarks + * + * **Support details** + * + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. + * + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * + * *Supported hosts, by platform* + * + * + * + *
Office for Windows desktop Office Online (in browser) Office for iPad OWA for Devices Office for Mac
Outlook Y (Mailbox Preview)
+ * + * *Supported APIs* + * + * `Office.context.mailbox.item.getCallbackTokenAsync`, `Office.context.mailbox.item.getUserIdentityTokenAsync` + * + * *Supported errors* + * + * + * + * + *
`AsyncResult.error.name` `AsyncResult.error.message` Description of diagnostics object returned
HTTPRequestFailure The request has failed. Please look at the diagnostics object for the HTTP error code. The HTTP error code in a JSON object e.g., `{"HTTPCode":"401"}`
InternalServerErrorThe Exchange server returned an error. Please look at the diagnostics object for more information.The error message from the Exchange server in a JSON object e.g., `{"ErrorText": "The mailbox database is temporarily unavailable"}`
+ */ + diagnostics: any; + /** * Gets an {@link Office.Error} object that provides a description of the error, if any error occurred. * * @remarks @@ -15381,7 +15412,8 @@ declare namespace Office { * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. + * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. */ getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** @@ -15408,7 +15440,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * The token is provided as a string in the asyncResult.value property. + * The token is provided as a string in the `asyncResult.value` property. + * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. */ getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; /** @@ -15435,7 +15468,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. + * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; @@ -15457,7 +15491,8 @@ declare namespace Office { * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. - * The token is provided as a string in the asyncResult.value property. + * The token is provided as a string in the `asyncResult.value` property. + * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext Optional. Any state data that is passed to the asynchronous method.| */ getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;