{"id":13603143,"url":"https://github.com/microsoftgraph/msgraph-typescript-typings","last_synced_at":"2025-04-11T13:33:03.636Z","repository":{"id":37612127,"uuid":"64412047","full_name":"microsoftgraph/msgraph-typescript-typings","owner":"microsoftgraph","description":"Microsoft Graph TypeScript Type Definitions","archived":false,"fork":false,"pushed_at":"2024-10-29T11:05:53.000Z","size":8561,"stargazers_count":119,"open_issues_count":31,"forks_count":35,"subscribers_count":30,"default_branch":"main","last_synced_at":"2024-10-29T21:26:49.135Z","etag":null,"topics":["devxeng","intellisense","microsoft-graph-models","microsoft-graph-typescript","typescript-definitions"],"latest_commit_sha":null,"homepage":"https://graph.microsoft.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoftgraph.png","metadata":{"files":{"readme":"README-Localized/README-es-es.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-28T16:40:41.000Z","updated_at":"2024-10-28T12:19:57.000Z","dependencies_parsed_at":"2024-10-08T16:33:00.099Z","dependency_job_id":"2f20a903-fe72-4f1e-83c7-2a9a8bd0d002","html_url":"https://github.com/microsoftgraph/msgraph-typescript-typings","commit_stats":{"total_commits":250,"total_committers":22,"mean_commits":"11.363636363636363","dds":0.752,"last_synced_commit":"d176e5c37044144f114fc481263dc746116f395c"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-typescript-typings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-typescript-typings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-typescript-typings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-typescript-typings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoftgraph","download_url":"https://codeload.github.com/microsoftgraph/msgraph-typescript-typings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470482,"owners_count":17150555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devxeng","intellisense","microsoft-graph-models","microsoft-graph-typescript","typescript-definitions"],"created_at":"2024-08-01T18:01:53.387Z","updated_at":"2025-04-11T13:33:03.622Z","avatar_url":"https://github.com/microsoftgraph.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"[![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)\n\n# Tipos de TypeScript de Microsoft Graph\nLas definiciones de TypeScript de Microsoft Graph permiten a los editores ofrecer IntelliSense en objetos de Microsoft Graph, como usuarios, mensajes y grupos.\n\n## Instalación\n\nSe recomienda incluir el archivo .d.ts al descargar este paquete a través de [npm](https://www.npmjs.com/).\n\n```bash\n\n# Install types and save in package.json as a development dependency\nnpm install @microsoft/microsoft-graph-types --save-dev\n\n```\n\n\n![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)\n## Ejemplos\nEn 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.\n```typescript\nimport * as MicrosoftGraph from \"@microsoft/microsoft-graph-types\"\n\nimport * from 'isomorphic-fetch';\nconst accessToken:string = \"\";\n```\n### Mostrar mis mensajes recientes\n```typescript\nlet url = \"https://graph.microsoft.com/v1.0/me/messages\";\nlet request = new Request(url, {\n    method: \"GET\",\n    headers: new Headers({\n        \"Authorization\": \"Bearer \" + accessToken\n    })\n});\n\nfetch(request)\n.then((response) =\u003e {\n    response.json().then((res) =\u003e {\n        let messages:[MicrosoftGraph.Message] = res.value;\n        for (let msg of messages) { //iterate through the recent messages\n            console.log(msg.subject);\n            console.log(msg.toRecipients[0].emailAddress.address);\n        }\n    });\n\n})\n.catch((error) =\u003e {\n    console.error(error);\n});\n```\n### Enviar un correo electrónico como el usuario conectado\n```typescript\n// Create the message object\n\n// Note that all the properties must follow the interface definitions.\n// For example, this will not compile if you try to type \"xml\" instead of \"html\" for contentType. \n\nlet mail:MicrosoftGraph.Message = {\n    subject: \"Microsoft Graph TypeScript Sample\",\n    toRecipients: [{\n        emailAddress: {\n            address: \"microsoftgraph@example.com\"\n        }\n    }],\n    body: {\n        content: \"\u003ch1\u003eMicrosoft Graph TypeScript Sample\u003c/h1\u003eTry modifying the sample\",\n        contentType: \"html\"\n    }\n}\n// send the email by sending a POST request to the Microsoft Graph\nlet url = \"https://graph.microsoft.com/v1.0/users/me/sendMail\";\nlet request = new Request(\n            url, {\n                method: \"POST\",\n                body: JSON.stringify({\n                    message: mail\n                }),\n                headers: new Headers({\n                    \"Authorization\": \"Bearer \" + accessToken,\n                    'Content-Type': 'application/json'\n                })\n            }\n        );\n        \nfetch(request)\n.then((response) =\u003e {\n    if(response.ok === true) {\n        console.log(\"Mail sent successfully..!!\");\n    }\n})\n.catch((err) =\u003e {\n    console.error(err);\n});\n\n```\n## Soporte de Microsoft Graph beta\nSi 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.\n\nActualice el archivo package.json con lo siguiente:\n\n```javascript\n  \"devDependencies\": {\n    // import published v1.0 types with a version from NPM\n    \"@microsoft/microsoft-graph-types\": \"^0.4.0\",\n\n    // import beta types from the beta branch on the GitHub repo\n    \"@microsoft/microsoft-graph-types-beta\": \"microsoftgraph/msgraph-typescript-typings#beta\"\n  }\n}\n```\n\nImport the beta types from `@microsoft/microsoft-graph-types-beta`\n```typescript\n// import individual entities\nimport {User as BetaUser} from \"@microsoft/microsoft-graph-types-beta\"\n\n// or import everything under MicrosoftGraphBeta\nimport * as MicrosoftGraphBeta from \"@microsoft/microsoft-graph-types-beta\"\n```\n\n## Editores admitidos\nCualquier 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.\n* Visual Studio Code\n* WebStorm\n* Atom with the [atom-typescript](https://atom.io/packages/atom-typescript) plugin\n\n## Preguntas y comentarios\n\nNos 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.\n\n\n## Colaboradores\nVea la [directrices de contribución](CONTRIBUTING.md).\n\n## Recursos adicionales\n\n* [Microsoft Graph](https://graph.microsoft.io)\n* [Centro para desarrolladores de Office](http://dev.office.com/)\n* [Biblioteca cliente de JavaScript de Microsoft Graph](https://github.com/microsoftgraph/msgraph-sdk-javascript)\n\n## Informes de seguridad\n\nSi 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.\n\n## Licencia\n\nCopyright (c) Microsoft Corporation. Todos los derechos reservados. Publicado bajo la licencia MIT (la \"Licencia\").\n\n## Valoramos y nos adherimos al Código de conducta de código abierto de Microsoft\n\nEste 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-typescript-typings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-typescript-typings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-typescript-typings/lists"}