Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Admin] Publish #2090

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions docs/code-snippets/office-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4126,102 +4126,6 @@ Office.Settings#set:member(1):
function setMySetting() {
Office.context.document.settings.set('mySetting', 'mySetting value');
}
Office.SharedProperties:interface:
- |-
function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;

// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";

$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
Office.SharedProperties#delegatePermissions:member:
- |-
function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;

// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";

$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
Office.TableBinding#addColumnsAsync:member(1):
- |-
// The following example adds a single column with three rows to a bound table with the id "myTable"
Expand Down
16 changes: 16 additions & 0 deletions docs/code-snippets/outlook-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,22 @@ Office.MailboxEnums.AttachmentStatus:enum:
}

Office.context.mailbox.item.addHandlerAsync(Office.EventType.AttachmentsChanged, myHandlerFunction, myCallback);
Office.MailboxEnums.DelegatePermissions:enum:
- |-
Office.context.mailbox.item.getSharedPropertiesAsync((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error("The current folder or mailbox isn't shared.");
return;
}

const delegatePermissions = result.value.delegatePermissions;

// Check if the user has write permissions to the shared resource.
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
console.log("User has write permissions to the shared resource.");
// Perform the necessary operations.
}
});
Office.MailboxEnums.InfobarActionType:enum:
- |-
/*
Expand Down
3 changes: 3 additions & 0 deletions docs/docs-ref-autogen/office/office/office.dialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ methods:
- If the `messageOptions` parameter is used, [DialogOrigin
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets) is also
required.


Although classic Outlook on Mac doesn't support Mailbox 1.9, it does support DialogApi 1.2.
isPreview: false
isDeprecated: false
syntax:
Expand Down
6 changes: 6 additions & 0 deletions docs/docs-ref-autogen/office/office/office.ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,18 @@ methods:
fullName: 'messageParent(message, messageOptions)'
summary: Delivers a message from the dialog box to its parent/opener page.
remarks: >-
**Applications**: Excel, Outlook, PowerPoint, Word


**Requirement sets**:


- [DialogAPI](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets)


- [Mailbox 1.4](https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets)


- If the `messageOptions` parameter is used, [DialogOrigin
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets) is also
required.
Expand Down
3 changes: 3 additions & 0 deletions docs/docs-ref-autogen/office_release/office/office.dialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ methods:
- If the `messageOptions` parameter is used, [DialogOrigin
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets) is also
required.


Although classic Outlook on Mac doesn't support Mailbox 1.9, it does support DialogApi 1.2.
isPreview: false
isDeprecated: false
syntax:
Expand Down
6 changes: 6 additions & 0 deletions docs/docs-ref-autogen/office_release/office/office.ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,18 @@ methods:
fullName: 'messageParent(message, messageOptions)'
summary: Delivers a message from the dialog box to its parent/opener page.
remarks: >-
**Applications**: Excel, Outlook, PowerPoint, Word


**Requirement sets**:


- [DialogAPI](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets)


- [Mailbox 1.4](https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets)


- If the `messageOptions` parameter is used, [DialogOrigin
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets) is also
required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ remarks: >-
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Compose or Read


#### Examples


```TypeScript

Office.context.mailbox.item.getSharedPropertiesAsync((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error("The current folder or mailbox isn't shared.");
return;
}

const delegatePermissions = result.value.delegatePermissions;

// Check if the user has write permissions to the shared resource.
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
console.log("User has write permissions to the shared resource.");
// Perform the necessary operations.
}
});

```
isPreview: false
isDeprecated: false
fields:
Expand Down
113 changes: 14 additions & 99 deletions docs/docs-ref-autogen/outlook/outlook/office.sharedproperties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,52 +29,20 @@ remarks: >-

```TypeScript

function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;

// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";

$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-properties.yaml


Office.context.mailbox.item.getSharedPropertiesAsync((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error("The current folder or mailbox isn't shared.");
return;
}
const sharedProperties = result.value;
console.log(`Owner: ${sharedProperties.owner}`);
console.log(`Permissions: ${sharedProperties.delegatePermissions}`);
console.log(`Target mailbox: ${sharedProperties.targetMailbox}`);
});

```
isPreview: false
Expand All @@ -93,59 +61,6 @@ properties:
content: 'delegatePermissions: MailboxEnums.DelegatePermissions;'
return:
type: '<xref uid="outlook!Office.MailboxEnums.DelegatePermissions:enum" />'
description: |-


#### Examples

```TypeScript
function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;

// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";

$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
```
- name: owner
uid: 'outlook!Office.SharedProperties#owner:member'
package: outlook!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ remarks: >-
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Compose or Read


#### Examples


```TypeScript

Office.context.mailbox.item.getSharedPropertiesAsync((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error("The current folder or mailbox isn't shared.");
return;
}

const delegatePermissions = result.value.delegatePermissions;

// Check if the user has write permissions to the shared resource.
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
console.log("User has write permissions to the shared resource.");
// Perform the necessary operations.
}
});

```
isPreview: false
isDeprecated: false
fields:
Expand Down
Loading