(No longer maintained!)
Easily authenticate with Dynamics CRM built-in services from a Node app.
import { ICrmService, CrmService, CrmResponse, CrmConnectionConfig, CrmO365ConnectionConfig, CrmAdConnectionConfig } from "node-dcrm-service";
const parameters =
{
baseUrl: "https://testorg.crm.dynamics.com",
webApiHost: "testorg.api.crm.dynamics.com",
tenant: "testorg.onmicrosoft.com",
apiVersion: "8.2",
username: "testuser@testorg.onmicrosoft.com",
password: "password",
appId: "16cd08d5-b6f1-475e-90a3-d40d83e26bbc",
clientId: "Ao+cz9J6MNe/tyizLZR5ili3Oth/vBoZzTr5DqS6r+o="
}
onlineConfig = new CrmO365ConnectionConfig(parameters);
onlineCrmService = new CrmService(onlineConfig);
await onlineCrmService.initialise();
const whoAmIResponse = await onlineCrmService.get("WhoAmI()");
console.log(whoAmIResponse.body.UserId)));
The following blog post explains this library in a bit more detail: link.
- Added: exposed the
CrmService
interface - Added: append
/api/data/v8.2/
URL prefix by default - Added: parameterised the Web API service version
- Improved: internally switched to
async/await
instead of explicit promises - Fixed:
undefined
error when request fails
- Improved: switched to 'request' library to improve response handling
- Improved: wrapped the response into a new class for type checking
- Fixed: standardised response/error object
- Added: 'data' parameter to post, put, and patch
- Changed: exposed
CrmConnectionConfig
to be used for polymorphism
- Added: example code
- Added: Wiki entry for getting a Client ID
- Removed: Node package dependency
- Fixed: packaging issues
- Initial release
Copyright © by Ahmed el-Sawalhy (Yagasoft) -- GPL v3 Licence