Skip to content

Release-2.2.0 #360

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

Merged
merged 82 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
f48ed18
updated broken link in README
krototype Aug 16, 2019
8178222
Merge pull request #218 from microsoftgraph/abhsriva/updateREADME
krototype Aug 22, 2019
2ec9a2f
Merge branch 'master' into dev
muthurathinam-msft Aug 27, 2019
32daeb8
Post request with empty body, now working fine.
krototype Sep 16, 2019
eed1515
Merge branch 'dev' into abhsriva/emptyPostRequest
krototype Sep 16, 2019
6850658
updated the tests for this case
krototype Sep 16, 2019
f7c333b
Merge branch 'abhsriva/emptyPostRequest' of https://github.com/micros…
krototype Sep 17, 2019
2ebf666
made change to use undefined instead of null as classname
krototype Sep 17, 2019
7baaf98
Merge pull request #229 from microsoftgraph/abhsriva/emptyPostRequest
krototype Oct 3, 2019
834fcf3
added functionality to simplify building middleware chain
krototype Oct 15, 2019
b2f7d3b
Merge branch 'dev' into build_middleware_chain
krototype Oct 15, 2019
de8a55b
Merge pull request #239 from microsoftgraph/build_middleware_chain
krototype Oct 18, 2019
072bed1
Updated GraphRequest.ts for .count() scenario
krototype Oct 22, 2019
b9a66b4
Merge pull request #243 from microsoftgraph/abhsriva/update-count
krototype Oct 25, 2019
c3e0ef3
Bumped version to '2.1.0-Preview.1'
muthurathinam-msft Oct 25, 2019
0374959
Adding the Modifying middleware chain samples
krototype Nov 12, 2019
f825b1b
- fixes broken link to client instance
baywet Nov 18, 2019
c4e43a8
Updated the example to the correct return type
Nov 19, 2019
f2b418e
Merge pull request #247 from microsoftgraph/abhsriva/customMiddleware…
krototype Nov 26, 2019
42cf768
Merge branch 'dev' into patch-1
krototype Nov 26, 2019
704d5e3
Merge pull request #250 from baywet/patch-1
krototype Nov 26, 2019
b9a3225
Merge branch 'dev' into patch-1
Nov 27, 2019
73e0b1e
fix casing on filename
gidsg Nov 29, 2019
ea88e47
Merge branch 'dev' into fix-case
muthurathinam Dec 9, 2019
da8d0f3
Merge pull request #251 from warreee/patch-1
muthurathinam Dec 9, 2019
e920fad
Merge branch 'dev' into fix-case
muthurathinam Dec 9, 2019
4a70b05
Merge pull request #255 from gidsg/fix-case
muthurathinam Dec 9, 2019
db7403d
Update package.json
nmetulev Dec 11, 2019
ea5f4ab
Merge pull request #257 from nmetulev/patch-2
muthurathinam Dec 12, 2019
9da92e1
Designed ChaosHandler
krototype Dec 12, 2019
f37b583
Merge pull request #258 from microsoftgraph/abhsriva/ChaosHandler
krototype Dec 12, 2019
aa17391
Removing the set and get middleware chain method
krototype Dec 12, 2019
3b95f44
Merge pull request #259 from microsoftgraph/removeSetMiddleware
krototype Dec 12, 2019
183cf62
Update README
behnammodi Jun 9, 2020
4d59843
Update README
behnammodi Jun 9, 2020
a4d34d6
Merge pull request #290 from behnammodi/dev
ddyett Jun 9, 2020
42ee7aa
Bump lodash from 4.17.15 to 4.17.19 in /samples/browser
dependabot[bot] Jul 16, 2020
870477b
Merge pull request #299 from microsoftgraph/dependabot/npm_and_yarn/s…
ddyett Jul 16, 2020
6e890cc
Changed parsepath and query functions to split query params on first …
nikithauc Jul 28, 2020
6813139
Correcting spelling in comments, setting the param key directlyand re…
nikithauc Jul 29, 2020
72adfd0
Adding a buildheaders function to conditionally set content type and …
nikithauc Jul 29, 2020
b946955
Altering condition to be optimal
nikithauc Jul 29, 2020
d5bb8c4
Adding formdata to the node project, setting the esModuleInterop conf…
nikithauc Aug 4, 2020
6c68a75
Adding a private query parsing function and more validations
nikithauc Aug 4, 2020
4a63220
Adding tests for url parsing and comments to the private url parsing …
nikithauc Aug 5, 2020
35c804d
Adding more information in the return comments for functions returnin…
nikithauc Aug 5, 2020
099fa02
Adding unit test for serializecontent testing if content is null, cha…
nikithauc Aug 5, 2020
1f342bf
Changing the conditional expression to check for undefined or null he…
nikithauc Aug 5, 2020
36b0cc9
Adding the missing return
nikithauc Aug 5, 2020
d8a1ff9
Removing the try catch block from the test case
nikithauc Aug 5, 2020
2b0d381
Removing the try catch block from the test case
nikithauc Aug 5, 2020
ed902ec
Merge pull request #306 from microsoftgraph/JS_Issue_291_URLParsingCo…
MIchaelMainer Aug 7, 2020
45727eb
Returning if the content-type is present else setting content-type as…
nikithauc Aug 7, 2020
cff1a71
Merge branch 'dev' into JS-Issue-293-298-Emptybody-Content-type
nikithauc Aug 7, 2020
3f9412d
Uninstalling formdata, restoring the tsconfigs and removing the condi…
nikithauc Aug 12, 2020
354b215
Merge branch 'JS-Issue-293-298-Emptybody-Content-type' of https://git…
nikithauc Aug 12, 2020
5dd2a1d
Restoring file
nikithauc Aug 12, 2020
62b5f8c
Reverting the package json changes
nikithauc Aug 12, 2020
1ee7bd8
Merge pull request #309 from microsoftgraph/JS-Issue-293-298-Emptybod…
MIchaelMainer Aug 14, 2020
3138966
Bump yargs-parser from 13.1.1 to 13.1.2 in /samples/browser (#321)
dependabot[bot] Sep 9, 2020
9e25f05
Bump mixin-deep from 1.3.1 to 1.3.2 in /scripts (#301)
dependabot[bot] Sep 9, 2020
ab824f7
Bump http-proxy from 1.17.0 to 1.18.1 in /samples/browser (#319)
dependabot[bot] Sep 9, 2020
aaf142e
Update OneDriveLargeFileUploadTask.ts (#325)
hasridha Sep 17, 2020
a2742b3
Use correct class name (#284)
mattdenkers Sep 24, 2020
8089cd0
Typo in documentation example. (#270)
lewgordon Sep 24, 2020
130f3c0
Enhancement/#311 page iterator request options (#318)
nikithauc Sep 25, 2020
bdaf597
Sorting parameter list - chaoshandleroptions (#334)
nikithauc Oct 1, 2020
f99d0ff
Client init with middleware array (#333)
nikithauc Oct 5, 2020
ad4399b
Make GraphError real Error (#335)
OlivierCuyp Oct 5, 2020
a95a762
Using ternary shorthand, upgrade preview 2.1.0-2 (#337)
nikithauc Oct 6, 2020
343bb2f
HB of localized readme files (#268)
OfficeGlobal Oct 12, 2020
363d4ab
Bump node-fetch from 2.5.0 to 2.6.1 in /spec (#323)
dependabot[bot] Oct 12, 2020
2c97e58
Bump lodash from 4.17.11 to 4.17.19 (#300)
dependabot[bot] Oct 12, 2020
66a4181
Bump acorn from 6.1.1 to 6.4.1 (#273)
dependabot[bot] Oct 12, 2020
2ac83f1
Nikithauc/merge release 2.1.0 dev (#345)
nikithauc Oct 23, 2020
a745e31
Adding missing exports (#348)
nikithauc Oct 30, 2020
daa00ca
Adding/Deleting authorization and telemetry headers (#351)
nikithauc Nov 11, 2020
3372ee0
Preview release/2.2.0 preview.1 (#356)
nikithauc Nov 18, 2020
c1b957f
Checking if the request object url is a graph url (#357)
nikithauc Nov 18, 2020
e238f15
merging with master
nikithauc Nov 18, 2020
ff5df0c
Merge pull request #358 from microsoftgraph/nikithauc/merge-master-dev
nikithauc Nov 19, 2020
e6be3d6
update to version 2.2.0
nikithauc Nov 30, 2020
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
228 changes: 228 additions & 0 deletions README-Localized/README-es-es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
# Biblioteca cliente de JavaScript de Microsoft Graph

[![npm version badge](https://img.shields.io/npm/v/@microsoft/microsoft-graph-client.svg?maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) [![Travis](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript.svg?maxAge=86400)](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript) [![Known Vulnerabilities](https://snyk.io/test/github/microsoftgraph/msgraph-sdk-javascript/badge.svg?maxAge=86400)](https://snyk.io/test/github/microsoftgraph/msgraph-sdk-javascript) [![Licence](https://img.shields.io/github/license/microsoftgraph/msgraph-sdk-javascript.svg)](https://github.com/microsoftgraph/msgraph-sdk-javascript) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/microsoftgraph/msgraph-sdk-javascript) [![Downloads](https://img.shields.io/npm/dm/@microsoft/microsoft-graph-client.svg?maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client)

La biblioteca cliente de JavaScript de Microsoft Graph es un envase reducido en torno a la API de Microsoft Graph que puede usarse en el lado del servidor y en el explorador.

**¿Busca IntelliSense en los modelos (usuarios, grupos, etc.)? Vea el repositorio de [tipos de Microsoft Graph](https://github.com/microsoftgraph/msgraph-typescript-typings).**

[![Demostración de TypeScript](https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-javascript/master/types-demo.PNG)](https://github.com/microsoftgraph/msgraph-typescript-typings)

## Instalación

### Mediante npm

```cmd
npm install @microsoft/microsoft-graph-client
```

importe `@microsoft/microsoft-graph-client` en el módulo y también necesitará polyfills para capturar como [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch).

```typescript
import "isomorphic-fetch";
import { Client } from "@microsoft/microsoft-graph-client";
```

### Mediante etiqueta de script

Incluya [graph-js-sdk.js](https://cdn.jsdelivr.net/npm/@microsoft/microsoft-graph-client/lib/graph-js-sdk.js) en la página HTML.

```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@microsoft/microsoft-graph-client/lib/graph-js-sdk.js"></script>
```

En caso de que el explorador no sea compatible con [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) \[[support](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#Browser_compatibility)] o [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) \[[support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Browser_compatibility)], deberá usar polyfills como [github/fetch](https://github.com/github/fetch) para fetch y [es6-promise](https://github.com/stefanpenner/es6-promise) para promise.

```HTML
<!-- polyfilling promise -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.min.js"></script>

<!-- polyfilling fetch -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/whatwg-fetch/dist/fetch.umd.min.js"></script>

<!-- depending on your browser you might wanna include babel polyfill -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@babel/[email protected]/dist/polyfill.min.js"></script>
```

## Introducción

### 1. Registrar su aplicación

Registre su aplicación para usar la API de Microsoft Graph con uno de los siguientes portales de autenticación compatibles:

- [Portal de registro de aplicaciones de Microsoft](https://apps.dev.microsoft.com): Registre una nueva aplicación que funcione con cuentas de Microsoft y/o cuentas de la organización con el punto de conexión de autenticación V2 unificado.
- [Microsoft Azure Active Directory](https://manage.windowsazure.com): Registre una nueva aplicación en el espacio empresarial de Active Directory para dar soporte a los usuarios de cuentas profesionales o educativas de su espacio empresarial, o a varios espacios empresariales.

### 2. Autenticarse para el servicio de Microsoft Graph

La biblioteca cliente de JavaScript de Microsoft Graph tiene una implementación de adaptador ([ImplicitMSALAuthenticationProvider](src/ImplicitMSALAuthenticationProvider.ts)) para [MSAL](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core) (biblioteca de autenticación de Microsoft) que se ocupa de recibir el `accessToken`. La biblioteca MSAL no se incluye con esta biblioteca, el usuario debe incluirla de forma externa (para incluir MSAL, consulte [esto](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core#installation)).

> **Nota importante:** MSAL solo es compatible con las aplicaciones front-end, para la autenticación en el servidor tiene que implementar su propio AuthenticationProvider. Obtenga información acerca de cómo puede crear un [proveedor de autenticación personalizado](./docs/CustomAuthenticationProvider.md).

#### Creación de una instancia de ImplicitMSALAuthenticationProvider en un entorno de explorador

Consulte devDependencies en [package.json](./package.json) para ver la versión compatible de msal y actualícela a continuación.

```html
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/<version>/js/msal.min.js"></script>
```

```typescript
// Configuration options for MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL.js-1.0.0-api-release#configuration-options
const msalConfig = {
auth: {
clientId: "your_client_id", // Client Id of the registered application
redirectUri: "your_redirect_uri",
},
};
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes

// Important Note: This library implements loginPopup and acquireTokenPopup flow, remember this while initializing the msal
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js#1-instantiate-the-useragentapplication
const msalApplication = new Msal.UserAgentApplication(msalConfig);
const options = new MicrosoftGraph.MSALAuthenticationProviderOptions(graphScopes);
const authProvider = new MicrosoftGraph.ImplicitMSALAuthenticationProvider(msalApplication, options);
```

#### Creación de una instancia de ImplicitMSALAuthenticationProvider en un entorno de nodo

Consulte devDependencies en [package.json](./package.json) para ver la versión compatible de msal y actualícela a continuación.

```cmd
npm install msal@<version>
```

```typescript
import { UserAgentApplication } from "msal";

import { ImplicitMSALAuthenticationProvider } from "./node_modules/@microsoft/microsoft-graph-client/lib/src/ImplicitMSALAuthenticationProvider";

// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
const msalConfig = {
auth: {
clientId: "your_client_id", // Client Id of the registered application
redirectUri: "your_redirect_uri",
},
};
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes

// Important Note: This library implements loginPopup and acquireTokenPopup flow, remember this while initializing the msal
// Initialize the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js#1-instantiate-the-useragentapplication
const msalApplication = new UserAgentApplication(msalConfig);
const options = new MicrosoftGraph.MSALAuthenticationProviderOptions(graphScopes);
const authProvider = new ImplicitMSALAuthenticationProvider(msalApplication, options);
```

El usuario puede integrar la biblioteca de autenticación preferida mediante la implementación de `IAuthenticationProvider` interfaz. Consulte la implementación de un [proveedor de autenticación personalizada](./docs/CustomAuthenticationProvider.md).

### 3. Inicializar un objeto de cliente de Microsoft Graph con un proveedor de autenticación

Una instancia de la clase **cliente** controla las solicitudes a la API de Microsoft Graph y procesa las respuestas. Para crear una nueva instancia de esta clase, tiene que proporcionar una instancia de [`IAuthenticationProvider`](src/IAuthenticationProvider.ts) que necesita pasarse como un valor para la clave `authProvider` en [`ClientOptions`](src/IClientOptions.ts) a un método de inicializador estático `Client.initWithMiddleware`.

#### Para entornos de navegador

```typescript
const options = {
authProvider, // An instance created from previous step
};
const Client = MicrosoftGraph.Client;
const client = Client.initWithMiddleware(options);
```

#### Para entornos de nodo

```typescript
import { Client } from "@microsoft/microsoft-graph-client";

const options = {
authProvider, // An instance created from previous step
};
const client = Client.initWithMiddleware(options);
```

Para obtener más información sobre cómo inicializar el cliente, consulte [este documento](./docs/CreatingClientInstance.md).

### 4. Realizar solicitudes a Graph

Una vez que haya configurado la autenticación y una instancia del cliente, puede empezar a realizar llamadas al servicio. Todas las solicitudes deberían empezar con `client.api(path)` y terminar con una [acción](./docs/Actions.md).

Obtención de detalles de usuario

```typescript
try {
let userDetails = await client.api("/me").get();
console.log(userDetails);
} catch (error) {
throw error;
}
```

Enviar un correo electrónico a los destinatarios

```typescript
// Construct email object
const mail = {
subject: "Microsoft Graph JavaScript Sample",
toRecipients: [
{
emailAddress: {
address: "[email protected]",
},
},
],
body: {
content: "<h1>MicrosoftGraph JavaScript Sample</h1>Check out https://github.com/microsoftgraph/msgraph-sdk-javascript",
contentType: "html",
},
};
try {
let response = await client.api("/me/sendMail").post({ message: mail });
console.log(response);
} catch (error) {
throw error;
}
```

Para obtener más información, consulte: [Patrón de llamada](docs/CallingPattern.md), [acciones](docs/Actions.md), [parámetros de consulta](docs/QueryParameters.md), [métodos de la API](docs/OtherAPIs.md) y [más](docs/).

## Documentación

- [Procesamiento por lotes](docs/content/Batching.md)
- [Tarea de carga de archivos de gran tamaño](docs/tasks/LargeFileUploadTask.md)
- [Iterador de páginas](docs/tasks/PageIterator.md)
- [Acciones](docs/Actions.md)
- [Parámetros de consulta](docs/QueryParameters.md)
- [Otras API](docs/OtherAPIs.md)
- [Obtener respuesta sin procesar](docs/GettingRawResponse.md)

## Preguntas y comentarios

Nos encantaría recibir sus comentarios sobre la biblioteca cliente de JavaScript de Microsoft Graph. Puede enviarnos sus preguntas y sugerencias a través de la sección [Problemas](https://github.com/microsoftgraph/msgraph-sdk-javascript/issues) de este repositorio.

## Colaboradores

Vea la [directrices de contribución](CONTRIBUTING.md).

## Recursos adicionales

- [Sitio web de Microsoft Graph](https://graph.microsoft.io)
- [Tipos de TypeScript de Microsoft Graph](https://github.com/microsoftgraph/msgraph-typescript-typings/)
- [Crear aplicaciones de página única en Angular con Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-angularspa)
- [Crear aplicaciones Node.js Express con Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-nodeexpressapp)
- [Centro para desarrolladores de Office](http://dev.office.com/)

## Avisos de terceros

Consulte [avisos de terceros](./THIRD%20PARTY%20NOTICES) para obtener información sobre los paquetes que se incluyen en [package.json](./package.json)

## Informes de seguridad

Si encuentra un problema de seguridad con nuestras bibliotecas o servicios, informe a [[email protected]](mailto:[email protected]) 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.

## Licencia

Copyright (c) Microsoft Corporation. Todos los derechos reservados. Publicado bajo la licencia MIT (la "[Licencia](./LICENSE)").

## Valoramos y nos adherimos al Código de conducta de código abierto de Microsoft

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 [[email protected]](mailto:[email protected]) si tiene otras preguntas o comentarios.
Loading