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.
package/README.md ADDED
@@ -0,0 +1,117 @@
1
+ [![npm version badge](https://img.shields.io/npm/v/@microsoft/microsoft-graph-types.svg)](https://www.npmjs.com/package/@microsoft/microsoft-graph-types)
2
+
3
+ # Microsoft Graph TypeScript Types
4
+ The Microsoft Graph TypeScript definitions enable editors to provide intellisense on Microsoft Graph objects including users, messages, and groups.
5
+
6
+ > **_NOTE:_** The **Microsoft Graph TypeScript Types Beta** [npm package](https://www.npmjs.com/package/@microsoft/microsoft-graph-types-beta) and [GitHub repo](https://github.com/microsoftgraph/msgraph-beta-typescript-typings) is now available. Imports from the `microsoftgraph/msgraph-typescript-typings#beta` branch will no longer be supported.
7
+
8
+ ## Installation
9
+
10
+ We recommend including the .d.ts file by downloading this package through [npm](https://www.npmjs.com/).
11
+
12
+ ```bash
13
+
14
+ # Install types and save in package.json as a development dependency
15
+ npm install @microsoft/microsoft-graph-types --save-dev
16
+
17
+ ```
18
+
19
+ ![GIF showing intellisense and autocompletion for Microsoft Graph entities in Visual Studio Code ](https://github.com/microsoftgraph/msgraph-typescript-typings/raw/master/typings-demo.gif)
20
+
21
+ ## Examples
22
+ The following examples assume that you have a valid access token. The following example uses [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch) and [Microsoft Graph JavaScript client library](https://github.com/microsoftgraph/msgraph-sdk-javascript) -
23
+
24
+ ```typescript
25
+ import { User } from "@microsoft/microsoft-graph-types-beta";
26
+
27
+ import { Client } from "@microsoft/microsoft-graph-client";
28
+
29
+ import 'isomorphic-fetch';
30
+
31
+ const client = Client.initWithMiddleware({
32
+ defaultVersion: 'beta',
33
+ ...
34
+ });
35
+
36
+ const response = await client.api("/me").get();
37
+ const user = response as User;
38
+ ```
39
+
40
+ ### Example of creating an object
41
+ ```typescript
42
+ // Create the message object
43
+
44
+ // Note that all the properties must follow the interface definitions.
45
+ // For example, this will not compile if you try to type "xml" instead of "html" for contentType.
46
+
47
+ let mail:MicrosoftGraphBeta.Message = {
48
+ subject: "Microsoft Graph TypeScript Sample",
49
+ toRecipients: [{
50
+ emailAddress: {
51
+ address: "microsoftgraph@example.com"
52
+ }
53
+ }],
54
+ body: {
55
+ content: "<h1>Microsoft Graph TypeScript Sample</h1>Try modifying the sample",
56
+ contentType: "html"
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## Example of using v1 types and beta types together
62
+ ```json
63
+ "devDependencies": {
64
+ // import published v1.0 types with a version from NPM
65
+ "@microsoft/microsoft-graph-types": "^0.4.0",
66
+ // import beta types with a version from NPM
67
+ "@microsoft/microsoft-graph-types-beta": "^0.1.0-preview"
68
+ }
69
+ }
70
+ ```
71
+
72
+ ```typescript
73
+ import * as MicrosoftGraph from "@microsoft/microsoft-graph-types"
74
+
75
+ import * as MicrosoftGraphBeta from "@microsoft/microsoft-graph-types-beta"
76
+
77
+ const v1User: MicrosoftGraph.User = {
78
+ givenName: "V1 User"
79
+ }
80
+
81
+ const betaUser: MicrosoftGraphBeta.User = {
82
+ givenName: "Beta User"
83
+ }
84
+
85
+ ```
86
+
87
+ ## Supported editors
88
+ Any TypeScript project can consume these types when using at least TypeScript 2.0. We've tested including the types as a dependency in the following editors.
89
+ * Visual Studio Code
90
+ * WebStorm
91
+ * Atom with the [atom-typescript](https://atom.io/packages/atom-typescript) plugin
92
+
93
+ ## Questions and comments
94
+
95
+ We'd love to get your feedback about the TypeScript definitions project. You can send your questions and suggestions to us in the [Issues](https://github.com/microsoftgraph/msgraph-typescript-typings/issues) section of this repository.
96
+
97
+
98
+ ## Contributing
99
+ Please see the [contributing guidelines](CONTRIBUTING.md).
100
+
101
+ ## Additional resources
102
+
103
+ * [Microsoft Graph](https://graph.microsoft.io)
104
+ * [Office Dev Center](http://dev.office.com/)
105
+ * [Microsoft Graph JavaScript Client Library](https://github.com/microsoftgraph/msgraph-sdk-javascript)
106
+
107
+ ## Security Reporting
108
+
109
+ If you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
110
+
111
+ ## License
112
+
113
+ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
114
+
115
+ ## We Value and Adhere to the Microsoft Open Source Code of Conduct
116
+
117
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
package/SECURITY.md ADDED
@@ -0,0 +1,41 @@
1
+ <!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
2
+
3
+ ## Security
4
+
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
+
7
+ If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8
+
9
+ ## Reporting Security Issues
10
+
11
+ **Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+ Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14
+
15
+ If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16
+
17
+ You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18
+
19
+ Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+ * Full paths of source file(s) related to the manifestation of the issue
23
+ * The location of the affected source code (tag/branch/commit or direct URL)
24
+ * Any special configuration required to reproduce the issue
25
+ * Step-by-step instructions to reproduce the issue
26
+ * Proof-of-concept or exploit code (if possible)
27
+ * Impact of the issue, including how an attacker might exploit the issue
28
+
29
+ This information will help us triage your report more quickly.
30
+
31
+ If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32
+
33
+ ## Preferred Languages
34
+
35
+ We prefer all communications to be in English.
36
+
37
+ ## Policy
38
+
39
+ Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40
+
41
+ <!-- END MICROSOFT SECURITY.MD BLOCK -->