{"id":15984646,"url":"https://github.com/aappddeevv/dynamics-client","last_synced_at":"2025-03-27T03:30:45.827Z","repository":{"id":57093986,"uuid":"113685591","full_name":"aappddeevv/dynamics-client","owner":"aappddeevv","description":"Dynamics Xrm CLI and browser/server client library.","archived":false,"fork":false,"pushed_at":"2018-11-19T20:41:24.000Z","size":4042,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T09:26:51.298Z","etag":null,"topics":["365","crm","dynamics","microsoft","scala","scala-js","xrm"],"latest_commit_sha":null,"homepage":"https://aappddeevv.github.io/dynamics-client/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aappddeevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-09T16:55:22.000Z","updated_at":"2019-03-01T19:58:24.000Z","dependencies_parsed_at":"2022-08-22T21:40:45.773Z","dependency_job_id":null,"html_url":"https://github.com/aappddeevv/dynamics-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fdynamics-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fdynamics-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fdynamics-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fdynamics-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aappddeevv","download_url":"https://codeload.github.com/aappddeevv/dynamics-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245778339,"owners_count":20670682,"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":["365","crm","dynamics","microsoft","scala","scala-js","xrm"],"created_at":"2024-10-08T02:09:59.349Z","updated_at":"2025-03-27T03:30:45.173Z","avatar_url":"https://github.com/aappddeevv.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"dynamicscli - a nodejs CLI application and client framework for working with\nonline Microsoft Dynamics applications. The application will not currently\nauthenticate with on-premise systems (or at least I do not think so).\n\ndynamicscli uses the ODatav4 REST data api which means that you must register\nthe application with Azure Active Directory to allow the CLI to connect to the\nserver. Registering is easy to do, but you need Admin access to create the\nregistration. You can use any application registration that allows your userid\naccess to the data and has an application id. You can follow the simple\ninstructions\n[here](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/walkthrough-register-dynamics-365-app-azure-active-directory)\nto create a registration. The new administrative portal for managing application\nregistrations does not know about dynamics yet so you need to register directly\nin your own azure active directory portal (https://aad.portal.azure.com). The\ndeprecated SOAP library did not need this extra step. The application\nregistration is good for any copy of this CLI that runs. Since you still provide\nyour own login credentials, creating the application registration, is equivalent\nto authorizing any application to access the dynamics server. You can also setup\na service account (choose Web / API registration type) and create a client\nsecret that runs independent of your personal credentials.\n\ndynamics-client two personalities:\n* A CLI that can be used from any OS. While one could use PowerShell for\n  everything, its much easier to add commands or make commands robust using an\n  application directly that has advanced support. To do anything interesting in\n  powershell you would have to write a .dll anyway and load it.\n* An extensive client library that is performant on the nodejs platform. You can\n  use this as a framework for developing small Dynamics applications like ETL or\n  platform management. For example, I added a command to help manage the\n  dynamics platform in around 30 minutes and it worked the first time.\n\ndynamicscli is written in scala.js which is a small language similar to\ntypescript with more type-safety, immutability and greater consistency. It is a\ngreat language for writing logic and \"effects\" heavy code. Where needed,\ndynamics-client uses extensive asynchronous programming constructs. You can load\nmillions of data items per hour.\n\nWhy nodejs? nodejs has an extensive array of web oriented resources and is\nlightweight on memory while still being fast enough. You could also use the\nclient framework for CRM web applications directly. You can also use it for\nhot-reload, local development that seamlessly integrates with CRM so you get\neasy development of new CRM UI extensions. Running a nodejs instance on azure\nalso means that you can deploy dynamicscli to azure and have a continuously\nrunning Dynamics platform processing platform ready to go. The web apis provided\nby Microsoft Dynamics allows one to use nearly any platform.\n\ndynamicscli automatically handles paging through multi-paged results from\ndynamics as well as automatic retry.\n\n## Installing\nCurrently, you need to build the solution from github. We will publish the CLI\nprogarm on npm shortly.\n\n```sh\nnpm i -g dynamics-client\n```\n\n## Running\nThe script can be run, assuming it is on the path:\n```sh\ndynamicscli --help\n```\nIf you need to run directly with node,\n```sh\nnode /path/to/dynamicscli \u003cargs for dynamicscli\u003e\n```\n\n## CRM Connection Parameters\n\nDynamics connection parameters should be placed in a json file. The default is\ncrm.json. The file should look like below. Some typical values are also shown\nbut you must find the values that match your application.\n\n```javascript\n{\n    \"tenant\" : \"\u003cyourorgname\u003e.onmicrosoft.com\",\n    \"authorityHostUrl\" : \"https://login.windows.net\",\n    \"username\" : \"\u003cuserid\u003e@\u003ctenant\u003e\",\n    \"password\" : \"\u003cyourpassword\u003e\",\n    \"applicationId\" : \"\u003cappid\u003e\",\n    \"dataUrl\": \"https://\u003cyourorgname\u003e.api.crm.dynamics.com/api/data/v8.2/\",\n    \"acquireTokenResource\": \"https://\u003cyourorg\u003e.crm.dynamics.com\"\n}\n```\n\nYour password can also be in the environment variable `DYNAMICS_PASSWORD` as you\nshould avoid passwords in config files that may get checked into version\ncontrol.\n\nThe above shows the domain name to be `\u003cyourorg\u003e.onmicrosoft.com` but the domain\nvaries, It could be `mycompany.com`. The `dataUrl` can be obtained from\nDevelopers page in the CRM application's Settings area. `applicationId` can only\nbe obtained from our Azure Active Directory application's registration\npage. Sometimes, applicationId is called clientId. `authorityHostUrl` should\nonly be changed if you know that you should change it, otherwise, leave it the\nsame as the value above.\n\nSome information can be inferred if left out. For example, the tenant can be\ninferred from username and the dataUrl can be inferred from acquireTokenResource\nbut its best to specify them directly.\n\nOnce you have created your connection file, use it with the `-c\n\u003cconnectionfile\u003e` option. If you connect to several organizations just name the\nconnection file after the organization e.g. myorg1.json or myorg2.json then use\nit `-c myorg1.json`. Or, specify the config file in `DYNAMICS_CRMCONFIG` and\nskip providing the option on the command line.\n\nIf you are using Graph via the GraphClient, use the following parameters:\n\n```javascript\n{\n ...\n \"authorityHostUrl\" : \"https://login.microsoftonline.com\",\n \"dataUrl\": \"https://graph.microsoft.com/v1.0\",\n \"acquireTokenResource\": \"https://graph.microsoft.com\",\n  ...\n}\n```\n\nYou could also use `https://outlook.office.com` to access the outlook API\ndirectly at `https://outlook.office.com/api/v2.0` for the data url.\n\n## Commands\nThe general CLI usage is `dynamics command [subcommand] [opts]`.\n\nUse `dynamics --help` to print out help and see the commands.\n\n## What can you do?\nSome of the things you can do with the CLI include:\n\n* Create a fully automated instance deployment.\n* List and manage:\n   * Publishers\n   * Solutions\n   * System jobs\n   * Import maps\n   * Execute actions (bound and unbound)\n   * plugins (one-time or watch) update an assembly (.dll) that is already registered.\n   * Option sets\n   * Processes - Workflows\n      * List/activate/deactivate/run (against a query)\n   * SDK Messages\n      * List/activate/deactivate\n   * themes\n   * applications\n* Webresources\n   * List and manage\n   * Upload / update / download\n   * Watch a local filesystem and create/update/delete on the remote server\n* Settings\n   * Set unsettable settings\n* Update records generically\n   * By exporting the data using this CLI, you can move configuration or entity data to a new organization.\n* Run data imports using standard Dynamics data import capabilities.\n   * Upload local files and use import maps just like the UI data import wizard but via the command line.\n   * If you split your files before hand and upload in parallel, e.g. linux's parallel utilities, you can load 1M rec/hour.\n* Export data\n   * Export entity datasets easily and quickly. CSV or json.\n* Export metadata of various kinds.\n* Token\n   * Export a single, new auth token.\n   * Continuously export a valid, refreshed token to a specific file.\n\nSee [dynamics-client](https://aappddeevv.github.io/dynamics-client) for details.\n\nIngredients for packaging up parts of a solution deployment are here so you can\ncreate your own scripted solution deployer by just creating a directory and a\nstandard script.\n\nYou can use the general `GraphClient` to connect and run processing against much\nof the Microsoft app universe.\n\n## Credit\n\nAll work sponsored by The Trapelo Group.\n\n## License\n\nMIT license. See the LICENSE file.\n\nCopyright 2017 The Trapelo Group LLC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fdynamics-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faappddeevv%2Fdynamics-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fdynamics-client/lists"}