ms-graph-types 2.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ # Microsoft Open Source Code of Conduct
2
+
3
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4
+
5
+ Resources:
6
+
7
+ - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8
+ - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9
+ - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10
+ - Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
@@ -0,0 +1,216 @@
1
+ Contribute to this documentation
2
+
3
+ Thank you for your interest in our documentation!
4
+
5
+ * [Ways to contribute](#ways-to-contribute)
6
+ * [Contribute using GitHub](#contribute-using-github)
7
+ * [Contribute using Git](#contribute-using-git)
8
+ * [How to use Markdown to format your topic](#how-to-use-markdown-to-format-your-topic)
9
+ * [FAQ](#faq)
10
+ * [More resources](#more-resources)
11
+
12
+ ## Ways to contribute
13
+
14
+ Here are some ways you can contribute to this documentation:
15
+
16
+ * To make small changes to an article, [Contribute using GitHub](#contribute-using-github).
17
+ * To make large changes, or changes that involve code, [Contribute using Git](#contribute-using-git).
18
+ * Report documentation bugs via GitHub Issues
19
+ * Request new documentation at the [Office Developer Platform UserVoice](http://officespdev.uservoice.com) site.
20
+
21
+ ## Contribute using GitHub
22
+
23
+ Use GitHub to contribute to this documentation without having to clone the repo to your desktop. This is the easiest way to create a pull request in this repository. Use this method to make a minor change that doesn't involve code changes.
24
+
25
+ **Note** Using this method allows you to contribute to one article at a time.
26
+
27
+ ### To Contribute using GitHub
28
+
29
+ 1. Find the article you want to contribute to on GitHub.
30
+
31
+ If the article is in MSDN, choose the **suggest and submit changes** link in the **Contribute to this content** section and you'll be taken to the same article on GitHub.
32
+ 2. Once you are on the article in GitHub, sign in to GitHub (get a free account [Join GitHub](https://github.com/join).
33
+ 3. Choose the **pencil icon** (edit the file in your fork of this project) and make your changes in the **<>Edit file** window.
34
+ 4. Scroll to the bottom and enter a description.
35
+ 5. Choose **Propose file change**>**Create pull request**.
36
+
37
+ You now have successfully submitted a pull request. Pull requests are typically reviewed within 10 business days.
38
+
39
+
40
+ ## Contribute using Git
41
+
42
+ Use Git to contribute substantive changes, such as:
43
+
44
+ * Contributing code.
45
+ * Contributing changes that affect meaning.
46
+ * Contributing large changes to text.
47
+ * Adding new topics.
48
+
49
+ ### To Contribute using Git
50
+
51
+ 1. If you don't have a GitHub account, set one up at [GitHub](https://github.com/join).
52
+ 2. After you have an account, install Git on your computer. Follow the steps in [Setting up Git Tutorial](https://help.github.com/articles/set-up-git/).
53
+ 3. To submit a pull request using Git, follow the steps in [Use GitHub, Git, and this repository](#use-github-git-and-this-repository).
54
+ 4. You will be asked to sign the Contributor's License Agreement if you are:
55
+
56
+ * A member of the Microsoft Open Technologies group.
57
+ * A contributors who doesn't work for Microsoft.
58
+
59
+ As a community member, you must sign the Contribution License Agreement (CLA) before you can contribute large submissions to a project. You only need to complete and submit the documentation once. Carefully review the document. You may be required to have your employer sign the document.
60
+
61
+ Signing the CLA does not grant you rights to commit to the main repository, but it does mean that the Office Developer and Office Developer Content Publishing teams will be able to review and approve your contributions. You will be credited for your submissions.
62
+
63
+ Pull requests are typically reviewed within 10 business days.
64
+
65
+ ## Use GitHub, Git, and this repository
66
+
67
+ **Note:** Most of the information in this section can be found in [GitHub Help] articles. If you're familiar with Git and GitHub, skip to the **Contribute and edit content** section for the specifics of the code/content flow of this repository.
68
+
69
+ ### To set up your fork of the repository
70
+
71
+ 1. Set up a GitHub account so you can contribute to this project. If you haven't done this, go to [GitHub](https://github.com/join) and do it now.
72
+ 2. Install Git on your computer. Follow the steps in the [Setting up Git Tutorial] [Set Up Git].
73
+ 3. Create your own fork of this repository. To do this, at the top of the page, choose the **Fork** button.
74
+ 4. Copy your fork to your computer. To do this, open Git Bash. At the command prompt enter:
75
+
76
+ git clone https://github.com/<your user name>/<repo name>.git
77
+
78
+ Next, create a reference to the root repository by entering these commands:
79
+
80
+ cd <repo name>
81
+ git remote add upstream https://github.com/microsoftgraph/<repo name>.git
82
+ git fetch upstream
83
+
84
+ Congratulations! You've now set up your repository. You won't need to repeat these steps again.
85
+
86
+ ### Contribute and edit content
87
+
88
+ To make the contribution process as seamless as possible, follow these steps.
89
+
90
+ #### To contribute and edit content
91
+
92
+ 1. Create a new branch.
93
+ 2. Add new content or edit existing content.
94
+ 3. Submit a pull request to the main repository.
95
+ 4. Delete the branch.
96
+
97
+ **Important** Limit each branch to a single concept/article to streamline the work flow and reduce the chance of merge conflicts. Content appropriate for a new branch includes:
98
+
99
+ * A new article.
100
+ * Spelling and grammar edits.
101
+ * Applying a single formatting change across a large set of articles (for example, applying a new copyright footer).
102
+
103
+ #### To create a new branch
104
+
105
+ 1. Open Git Bash.
106
+ 2. At the Git Bash command prompt, type `git pull upstream master:<new branch name>`. This creates a new branch locally that is copied from the latest MicrosoftGraph master branch.
107
+ 3. At the Git Bash command prompt, type `git push origin <new branch name>`. This alerts GitHub to the new branch. You should now see the new branch in your fork of the repository on GitHub.
108
+ 4. At the Git Bash command prompt, type `git checkout <new branch name>` to switch to your new branch.
109
+
110
+ #### Add new content or edit existing content
111
+
112
+ You navigate to the repository on your computer by using File Explorer. The repository files are in `C:\Users\<yourusername>\<repo name>`.
113
+
114
+ To edit files, open them in an editor of your choice and modify them. To create a new file, use the editor of your choice and save the new file in the appropriate location in your local copy of the repository. While working, save your work frequently.
115
+
116
+ The files in `C:\Users\<yourusername>\<repo name>` are a working copy of the new branch that you created in your local repository. Changing anything in this folder doesn't affect the local repository until you commit a change. To commit a change to the local repository, type the following commands in GitBash:
117
+
118
+ git add .
119
+ git commit -v -a -m "<Describe the changes made in this commit>"
120
+
121
+ The `add` command adds your changes to a staging area in preparation for committing them to the repository. The period after the `add` command specifies that you want to stage all of the files that you added or modified, checking subfolders recursively. (If you don't want to commit all of the changes, you can add specific files. You can also undo a commit. For help, type `git add -help` or `git status`.)
122
+
123
+ The `commit` command applies the staged changes to the repository. The switch `-m` means you are providing the commit comment in the command line. The -v and -a switches can be omitted. The -v switch is for verbose output from the command, and -a does what you already did with the add command.
124
+
125
+ You can commit multiple times while you are doing your work, or you can commit once when you're done.
126
+
127
+ #### Submit a pull request to the main repository
128
+
129
+ When you're finished with your work and are ready to have it merged into the main repository, follow these steps.
130
+
131
+ #### To submit a pull request to the main repository
132
+
133
+ 1. In the Git Bash command prompt, type `git push origin <new branch name>`. In your local repository, `origin` refers to your GitHub repository that you cloned the local repository from. This command pushes the current state of your new branch, including all commits made in the previous steps, to your GitHub fork.
134
+ 2. On the GitHub site, navigate in your fork to the new branch.
135
+ 3. Choose the **Pull Request** button at the top of the page.
136
+ 4. Verify the Base branch is `microsoftgraph/<repo name>@master` and the Head branch is `<your username>/<repo name>@<branch name>`.
137
+ 5. Choose the **Update Commit Range** button.
138
+ 6. Add a title to your pull request, and describe all the changes you're making.
139
+ 7. Submit the pull request.
140
+
141
+ One of the site administrators will process your pull request. Your pull request will surface on the microsoftgraph/<repo name> site under Issues. When the pull request is accepted, the issue will be resolved.
142
+
143
+ #### Create a new branch after merge
144
+
145
+ After a branch is successfully merged (that is, your pull request is accepted), don't continue working in that local branch. This can lead to merge conflicts if you submit another pull request. To do another update, create a new local branch from the successfully merged upstream branch, and then delete your initial local branch.
146
+
147
+ For example, if your local branch X was successfully merged into the OfficeDev/microsoft-graph-docs master branch and you want to make additional updates to the content that was merged. Create a new local branch, X2, from the OfficeDev/microsoft-graph-docs master branch. To do this, open GitBash and execute the following commands:
148
+
149
+ cd microsoft-graph-docs
150
+ git pull upstream master:X2
151
+ git push origin X2
152
+
153
+ You now have local copies (in a new local branch) of the work that you submitted in branch X. The X2 branch also contains all the work other writers have merged, so if your work depends on others' work (for example, shared images), it is available in the new branch. You can verify that your previous work (and others' work) is in the branch by checking out the new branch...
154
+
155
+ git checkout X2
156
+
157
+ ...and verifying the content. (The `checkout` command updates the files in `C:\Users\<yourusername>\microsoft-graph-docs` to the current state of the X2 branch.) Once you check out the new branch, you can make updates to the content and commit them as usual. However, to avoid working in the merged branch (X) by mistake, it's best to delete it (see the following **Delete a branch** section).
158
+
159
+ #### Delete a branch
160
+
161
+ Once your changes are successfully merged into the main repository, delete the branch you used because you no longer need it. Any additional work should be done in a new branch.
162
+
163
+ #### To delete a branch
164
+
165
+ 1. In the Git Bash command prompt, type `git checkout master`. This ensures that you aren't in the branch to be deleted (which isn't allowed).
166
+ 2. Next, at the command prompt, type `git branch -d <branch name>`. This deletes the branch on your computer only if it has been successfully merged to the upstream repository. (You can override this behavior with the `–D` flag, but first be sure you want to do this.)
167
+ 3. Finally, type `git push origin :<branch name>` at the command prompt (a space before the colon and no space after it). This will delete the branch on your github fork.
168
+
169
+ Congratulations, you have successfully contributed to the project!
170
+
171
+ ## How to use Markdown to format your topic
172
+
173
+ ### Article template
174
+
175
+ The [markdown template](/articles/0-markdown-template-for-new-articles.md) contains the basic Markdown for a topic that includes a table of contents, sections with subheadings, links to other Office developer topics, links to other sites, bold text, italic text, numbered and bulleted lists, code snippets, and images.
176
+
177
+
178
+ ### Standard Markdown
179
+
180
+ All of the articles in this repository use Markdown. A complete introduction (and listing of all the syntax) can be found at [Markdown Home] [].
181
+
182
+ ## FAQ
183
+
184
+ ### How do I get a GitHub account?
185
+
186
+ Fill out the form at [Join GitHub](https://github.com/join) to open a free GitHub account.
187
+
188
+ ### Where do I get a Contributor's License Agreement?
189
+
190
+ You will automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA) if your pull request requires one.
191
+
192
+ As a community member, **you must sign the Contribution License Agreement (CLA) before you can contribute large submissions to this project**. You only need complete and submit the documentation once. Carefully review the document. You may be required to have your employer sign the document.
193
+
194
+ ### What happens with my contributions?
195
+
196
+ When you submit your changes, via a pull request, our team will be notified and will review your pull request. You will receive notifications about your pull request from GitHub; you may also be notified by someone from our team if we need more information. We reserve the right to edit your submission for legal, style, clarity, or other issues.
197
+
198
+ ### Can I become an approver for this repository's GitHub pull requests?
199
+
200
+ Currently, we are not allowing external contributors to approve pull requests in this repository.
201
+
202
+ ### How soon will I get a response about my change request or issue?
203
+
204
+ We typically review pull requests and respond to issues within 10 business days.
205
+
206
+ ## More resources
207
+
208
+ * To learn more about Markdown, go to the Git creator's site [Daring Fireball].
209
+ * To learn more about using Git and GitHub, first check out the [GitHub Help section] [GitHub Help].
210
+
211
+ [GitHub Home]: http://github.com
212
+ [GitHub Help]: http://help.github.com/
213
+ [Set Up Git]: http://help.github.com/win-set-up-git/
214
+ [Markdown Home]: http://daringfireball.net/projects/markdown/
215
+ [Daring Fireball]: http://daringfireball.net/
216
+
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ Microsoft Graph TypeScript Typings
2
+
3
+ Copyright 2015 Microsoft Corporation
4
+
5
+ All right reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
@@ -0,0 +1,152 @@
1
+ [![identificador de versión npm](https://img.shields.io/npm/v/@microsoft/microsoft-graph-types.svg)](https://www.npmjs.com/package/@microsoft/microsoft-graph-types)
2
+
3
+ # Tipos de TypeScript de Microsoft Graph
4
+ Las definiciones de TypeScript de Microsoft Graph permiten a los editores ofrecer IntelliSense en objetos de Microsoft Graph, como usuarios, mensajes y grupos.
5
+
6
+ ## Instalación
7
+
8
+ Se recomienda incluir el archivo .d.ts al descargar este paquete a través de [npm](https://www.npmjs.com/).
9
+
10
+ ```bash
11
+
12
+ # Install types and save in package.json as a development dependency
13
+ npm install @microsoft/microsoft-graph-types --save-dev
14
+
15
+ ```
16
+
17
+
18
+ ![GIF que muestra IntelliSense y finalización automática para entidades de Microsoft Graph en Visual Studio Code ](https://github.com/microsoftgraph/msgraph-typescript-typings/raw/master/typings-demo.gif)
19
+ ## Ejemplos
20
+ En los ejemplos siguientes se presupone que el usuario tiene un token de acceso válido. Hemos usado [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch) para realizar solicitudes, pero también puede usar [nuestra biblioteca cliente de JavaScript](https://github.com/microsoftgraph/msgraph-sdk-javascript) u otras bibliotecas.
21
+ ```typescript
22
+ import * as MicrosoftGraph from "@microsoft/microsoft-graph-types"
23
+
24
+ import * from 'isomorphic-fetch';
25
+ const accessToken:string = "";
26
+ ```
27
+ ### Mostrar mis mensajes recientes
28
+ ```typescript
29
+ let url = "https://graph.microsoft.com/v1.0/me/messages";
30
+ let request = new Request(url, {
31
+ method: "GET",
32
+ headers: new Headers({
33
+ "Authorization": "Bearer " + accessToken
34
+ })
35
+ });
36
+
37
+ fetch(request)
38
+ .then((response) => {
39
+ response.json().then((res) => {
40
+ let messages:[MicrosoftGraph.Message] = res.value;
41
+ for (let msg of messages) { //iterate through the recent messages
42
+ console.log(msg.subject);
43
+ console.log(msg.toRecipients[0].emailAddress.address);
44
+ }
45
+ });
46
+
47
+ })
48
+ .catch((error) => {
49
+ console.error(error);
50
+ });
51
+ ```
52
+ ### Enviar un correo electrónico como el usuario conectado
53
+ ```typescript
54
+ // Create the message object
55
+
56
+ // Note that all the properties must follow the interface definitions.
57
+ // For example, this will not compile if you try to type "xml" instead of "html" for contentType.
58
+
59
+ let mail:MicrosoftGraph.Message = {
60
+ subject: "Microsoft Graph TypeScript Sample",
61
+ toRecipients: [{
62
+ emailAddress: {
63
+ address: "microsoftgraph@example.com"
64
+ }
65
+ }],
66
+ body: {
67
+ content: "<h1>Microsoft Graph TypeScript Sample</h1>Try modifying the sample",
68
+ contentType: "html"
69
+ }
70
+ }
71
+ // send the email by sending a POST request to the Microsoft Graph
72
+ let url = "https://graph.microsoft.com/v1.0/users/me/sendMail";
73
+ let request = new Request(
74
+ url, {
75
+ method: "POST",
76
+ body: JSON.stringify({
77
+ message: mail
78
+ }),
79
+ headers: new Headers({
80
+ "Authorization": "Bearer " + accessToken,
81
+ 'Content-Type': 'application/json'
82
+ })
83
+ }
84
+ );
85
+
86
+ fetch(request)
87
+ .then((response) => {
88
+ if(response.ok === true) {
89
+ console.log("Mail sent successfully..!!");
90
+ }
91
+ })
92
+ .catch((err) => {
93
+ console.error(err);
94
+ });
95
+
96
+ ```
97
+ ## Soporte de Microsoft Graph beta
98
+ Si desea probar los puntos de conexión de la versión beta de Microsoft Graph, puede usar esos tipos simultáneamente con los tipos v1.0.
99
+
100
+ Actualice el archivo package.json con lo siguiente:
101
+
102
+ ```javascript
103
+ "devDependencies": {
104
+ // import published v1.0 types with a version from NPM
105
+ "@microsoft/microsoft-graph-types": "^0.4.0",
106
+
107
+ // import beta types from the beta branch on the GitHub repo
108
+ "@microsoft/microsoft-graph-types-beta": "microsoftgraph/msgraph-typescript-typings#beta"
109
+ }
110
+ }
111
+ ```
112
+
113
+ Import the beta types from `@microsoft/microsoft-graph-types-beta`
114
+ ```typescript
115
+ // import individual entities
116
+ import {User as BetaUser} from "@microsoft/microsoft-graph-types-beta"
117
+
118
+ // or import everything under MicrosoftGraphBeta
119
+ import * as MicrosoftGraphBeta from "@microsoft/microsoft-graph-types-beta"
120
+ ```
121
+
122
+ ## Editores admitidos
123
+ Cualquier proyecto TypeScript puede usar estos tipos al usar al menos TypeScript 2.0 Hemos probado a incluir los tipos como dependencia en los siguientes editores.
124
+ * Visual Studio Code
125
+ * WebStorm
126
+ * Atom with the [atom-typescript](https://atom.io/packages/atom-typescript) plugin
127
+
128
+ ## Preguntas y comentarios
129
+
130
+ Nos encantaría recibir sus comentarios sobre el proyecto de definiciones de TypeScript. Puede enviarnos sus preguntas y sugerencias a través de la sección [Problemas](https://github.com/microsoftgraph/msgraph-typescript-typings/issues) de este repositorio.
131
+
132
+
133
+ ## Colaboradores
134
+ Vea la [directrices de contribución](CONTRIBUTING.md).
135
+
136
+ ## Recursos adicionales
137
+
138
+ * [Microsoft Graph](https://graph.microsoft.io)
139
+ * [Centro para desarrolladores de Office](http://dev.office.com/)
140
+ * [Biblioteca cliente de JavaScript de Microsoft Graph](https://github.com/microsoftgraph/msgraph-sdk-javascript)
141
+
142
+ ## Informes de seguridad
143
+
144
+ Si encuentra un problema de seguridad con nuestras bibliotecas o servicios, informe a [secure@microsoft.com](mailto:secure@microsoft.com) con todos los detalles posibles. Es posible que el envío pueda optar a una recompensa a través del programa [Microsoft Bounty](http://aka.ms/bugbounty). No publique problemas de seguridad en problemas de GitHub ni ningún otro sitio público. Nos pondremos en contacto con usted rápidamente tras recibir la información. Le animamos a que obtenga notificaciones de los incidentes de seguridad que se produzcan; para ello, visite [esta página](https://technet.microsoft.com/en-us/security/dd252948) y suscríbase a las alertas de avisos de seguridad.
145
+
146
+ ## Licencia
147
+
148
+ Copyright (c) Microsoft Corporation. Todos los derechos reservados. Publicado bajo la licencia MIT (la "Licencia").
149
+
150
+ ## Valoramos y nos adherimos al Código de conducta de código abierto de Microsoft
151
+
152
+ Este proyecto ha adoptado el [Código de conducta de código abierto de Microsoft](https://opensource.microsoft.com/codeofconduct/). Para obtener más información, vea [Preguntas frecuentes sobre el código de conducta](https://opensource.microsoft.com/codeofconduct/faq/) o póngase en contacto con [opencode@microsoft.com](mailto:opencode@microsoft.com) si tiene otras preguntas o comentarios.
@@ -0,0 +1,152 @@
1
+ [![Badge de version npm](https://img.shields.io/npm/v/@microsoft/microsoft-graph-types.svg)](https://www.npmjs.com/package/@microsoft/microsoft-graph-types)
2
+
3
+ # Types TypeScript Microsoft Graph
4
+ Les définitions TypeScript Microsoft Graph permettent aux éditeurs de fournir des fonctionnalités IntelliSense sur les objets Microsoft Graph, notamment les utilisateurs, les messages et les groupes.
5
+
6
+ ## Installation
7
+
8
+ Nous vous recommandons d’inclure le fichier .d.ts en téléchargeant ce package via [npm](https://www.npmjs.com/).
9
+
10
+ ```bash
11
+
12
+ # Install types and save in package.json as a development dependency
13
+ npm install @microsoft/microsoft-graph-types --save-dev
14
+
15
+ ```
16
+
17
+
18
+ ![Image GIF montrant IntelliSense et la saisie semi-automatique des entités Microsoft Graph dans Visual Studio Code](https://github.com/microsoftgraph/msgraph-typescript-typings/raw/master/typings-demo.gif)
19
+ ## Exemples
20
+ Les exemples suivants partent du principe que vous possédez un jeton d’accès valide. Nous avons utilisé [isomorphic-FETCH](https://www.npmjs.com/package/isomorphic-fetch) pour effectuer des requêtes, mais vous pouvez utiliser [notre bibliothèque cliente JavaScript](https://github.com/microsoftgraph/msgraph-sdk-javascript) ou d’autres bibliothèques également.
21
+ ```typescript
22
+ import * as MicrosoftGraph from "@microsoft/microsoft-graph-types"
23
+
24
+ import * from 'isomorphic-fetch';
25
+ const accessToken:string = "";
26
+ ```
27
+ ### Répertorier mes messages récents
28
+ ```typescript
29
+ let url = "https://graph.microsoft.com/v1.0/me/messages";
30
+ let request = new Request(url, {
31
+ method: "GET",
32
+ headers: new Headers({
33
+ "Authorization": "Bearer " + accessToken
34
+ })
35
+ });
36
+
37
+ fetch(request)
38
+ .then((response) => {
39
+ response.json().then((res) => {
40
+ let messages:[MicrosoftGraph.Message] = res.value;
41
+ for (let msg of messages) { //iterate through the recent messages
42
+ console.log(msg.subject);
43
+ console.log(msg.toRecipients[0].emailAddress.address);
44
+ }
45
+ });
46
+
47
+ })
48
+ .catch((error) => {
49
+ console.error(error);
50
+ });
51
+ ```
52
+ ### Envoyer un e-mail en tant qu’utilisateur connecté
53
+ ```typescript
54
+ // Create the message object
55
+
56
+ // Note that all the properties must follow the interface definitions.
57
+ // For example, this will not compile if you try to type "xml" instead of "html" for contentType.
58
+
59
+ let mail:MicrosoftGraph.Message = {
60
+ subject: "Microsoft Graph TypeScript Sample",
61
+ toRecipients: [{
62
+ emailAddress: {
63
+ address: "microsoftgraph@example.com"
64
+ }
65
+ }],
66
+ body: {
67
+ content: "<h1>Microsoft Graph TypeScript Sample</h1>Try modifying the sample",
68
+ contentType: "html"
69
+ }
70
+ }
71
+ // send the email by sending a POST request to the Microsoft Graph
72
+ let url = "https://graph.microsoft.com/v1.0/users/me/sendMail";
73
+ let request = new Request(
74
+ url, {
75
+ method: "POST",
76
+ body: JSON.stringify({
77
+ message: mail
78
+ }),
79
+ headers: new Headers({
80
+ "Authorization": "Bearer " + accessToken,
81
+ 'Content-Type': 'application/json'
82
+ })
83
+ }
84
+ );
85
+
86
+ fetch(request)
87
+ .then((response) => {
88
+ if(response.ok === true) {
89
+ console.log("Mail sent successfully..!!");
90
+ }
91
+ })
92
+ .catch((err) => {
93
+ console.error(err);
94
+ });
95
+
96
+ ```
97
+ ## Prise en charge de Microsoft Graph bêta
98
+ Si vous voulez tester les points de terminaison Microsoft Graph bêta, vous pouvez utiliser ces types simultanément avec les types v 1.0.
99
+
100
+ Mettez à jour votre fichier package.json avec ce qui suit :
101
+
102
+ ```javascript
103
+ "devDependencies": {
104
+ // import published v1.0 types with a version from NPM
105
+ "@microsoft/microsoft-graph-types": "^0.4.0",
106
+
107
+ // import beta types from the beta branch on the GitHub repo
108
+ "@microsoft/microsoft-graph-types-beta": "microsoftgraph/msgraph-typescript-typings#beta"
109
+ }
110
+ }
111
+ ```
112
+
113
+ Importez des types bêta de `@microsoft/microsoft-graph-types-beta`
114
+ ```typescript
115
+ // import individual entities
116
+ import {User as BetaUser} from "@microsoft/microsoft-graph-types-beta"
117
+
118
+ // or import everything under MicrosoftGraphBeta
119
+ import * as MicrosoftGraphBeta from "@microsoft/microsoft-graph-types-beta"
120
+ ```
121
+
122
+ ## Éditeurs pris en charge
123
+ Tout projet TypeScript peut utiliser ces types avec au moins TypeScript 2.0. Nous avons testé l’inclusion des types en tant que dépendances dans les éditeurs suivants.
124
+ * Visual Studio Code
125
+ * WebStorm
126
+ * Atom avec le plug-in [atom-typescript](https://atom.io/packages/atom-typescript)
127
+
128
+ ## Questions et commentaires
129
+
130
+ Nous serions ravis de connaître votre opinion sur le projet de définitions TypeScript. Vous pouvez nous faire part de vos questions et suggestions dans la rubrique [Problèmes](https://github.com/microsoftgraph/msgraph-typescript-typings/issues) de ce référentiel.
131
+
132
+
133
+ ## Contribution
134
+ Reportez-vous aux [instructions sur la contribution](CONTRIBUTING.md).
135
+
136
+ ## Ressources supplémentaires
137
+
138
+ * [Microsoft Graph](https://graph.microsoft.io)
139
+ * [Centre des développeurs Office](http://dev.office.com/)
140
+ * [Bibliothèque cliente JavaScript Microsoft Graph](https://github.com/microsoftgraph/msgraph-sdk-javascript)
141
+
142
+ ## Génération de rapports de sécurité
143
+
144
+ Si vous rencontrez un problème de sécurité avec nos bibliothèques ou services, signalez-le à l’adresse [secure@microsoft.com](mailto:secure@microsoft.com) avec autant de détails que possible. Votre envoi vous donnera sans doute droit à une prime via le programme [Bounty de Microsoft](http://aka.ms/bugbounty). Merci de ne pas publier de problèmes de sécurité sur le site des problèmes GitHub ou sur un autre site public. Nous vous contacterons rapidement dès réception des informations. Nous vous encourageons à activer les notifications d’incidents de sécurité en vous rendant sur [cette page](https://technet.microsoft.com/en-us/security/dd252948) et en vous abonnant aux alertes d’avis de sécurité.
145
+
146
+ ## Licence
147
+
148
+ Copyright (c) Microsoft Corporation. Tous droits réservés. Soumis à la licence MIT (la "Licence") ;
149
+
150
+ ## Nous respectons le code de conduite Open Source de Microsoft.
151
+
152
+ Ce projet a adopté le [code de conduite Open Source de Microsoft](https://opensource.microsoft.com/codeofconduct/). Pour en savoir plus, reportez-vous à la [FAQ relative au code de conduite](https://opensource.microsoft.com/codeofconduct/faq/) ou contactez [opencode@microsoft.com](mailto:opencode@microsoft.com) pour toute question ou tout commentaire.