1.0.24 • Published 2 months ago

@connectiv-ms/connection-config-generator v1.0.24

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

Usage

The ConnectionConfigGenerator can be used to create connections.config[.json] files from scratch via CLI options or an interactive shell. The connections.config[.json] file is used to facilitate authentication for various @connectiv-ms tools.

This tool works for regular and application users and can also be used to update existing connections.config[.json] files. It will create new <ConnectionDetail> elements per unique combination of username and unique instance name. If an entry is found that has the same username and unique organization name, it will be overwritten.

There are a few ways to run this tool, namely:

1. Executing via NPX

npx @connectiv-ms/connection-config-generator downloads and executes the tool in your current working directory.

2. Executing after Global NPM Install

After installing the package with the -g flag (See Installation), you can run the tool via the generate-connection-config command in the terminal.

3. Running the executable directly

You can also run the executable directly at <root>/bin/Connectiv.ConnectionConfigGenerator.exe where <root> is the installation directory of the npm package.

Wizard

If you run the tool without any options (except --format), it will run in an interactive mode that guides you through the configuration. Please note, that the process differs slightly between application users and regular users.

  1. You will be prompted for your credentials first. You can enter a username of a regular user (e.g. connectiv@customer.onmicrosoft.com) or the client id of an application user (eg. a59135d0-2e1a-4490-a270-d3d69aa959c4). Afterwards, when asked for a password, you need to enter the user password for regular users and the client secret for application users.
  2. Regular UserChoose any number of instances from the list of available instances. You can navigate between entries with your up and down arrow keys , select and deselect entries with the spacebar Space and confirm with Enter . At least one entry needs to be selected.Application UserEnter an instance URI or domain name and confirm with Enter . You can enter multiple instance URIs / domain names this way. Confirm your set of instance URIs / domain names by not entering any characters and hitting Enter .
  3. The wizard will now ask you to provide unique solution names per instance that you specified in the previous step. This is optional, but strongly recommended for the DEV environments.
  4. In the final step, you are asked to provide a path to the directory where the connections.config[.json] file will be stored. You can either enter an absolute path, or a path relative to your current working directory (The one that you launched this tool from). Use the root directory of a client project for this one, or the config will probably not be picked up.

    🧙 You're a wizard, Harry!

Options

The tool does not necessarily need options to run. If none are provided, a wizard is launched that will prompt you for the information. Flags can be provided according to the table below described in the table below. Some options offer a shorthand version, which can be used via -x <value>. The full option name can be supplied with double dashes --fullName <value>. For boolean options, also called flags, the value can be omitted.

Examples: Use the generate-connection-config command after installing this package globally. Login as an application user and generate connection details for the companies with the specified instance URIs. Use the solution Development_40 for the first instance, do not use a solution for the second and third one.

generate-connection-config --userName a59135d0-2e1a-4490-a270-d3d69aa959c4 --password AweS0M3cL1enT5eCR3t_yo= --instances https://companybase.crm4.dynamics.com,companydev,https://companyqa.crm4.dynamics.com --solutions Development_40

Login with connectiv@contoso.onmicrosoft.com and pass1234 and generate a connection detail for every available instance without providing solution names.

npx @connectiv-ms/connection-config-generator -u connectiv@contoso.onmicrosoft.com -p pass1234
OptionShorthandDescriptionDefault
formatfIf format is specified as json or .json, the config file will be generated with json format instead of xml..xml
userNameu(Required) The username used to log into the CRM Organization.
passwordp(Required) The password used to log into the CRM Organization.
destinationdThe path to the folder that should contain the connections.config[.json] file.If no path is not provided, the tool will use the directory from which it is launched.
instancesiA comma separated list of instance urls (https://myorg.crm4.dynamics.com) or domain names (myorg) from instances that should be included in the connections.config[.json].For regular users, all instances available to this user will be added. Application users need to supply at least one instance URI.
solutionssA comma separated list of unique solution names. These are case-sensitive! The solution names will be matched to the instance urls with the same position (e.g. --instanceUris https://base.crm4.dynamics.com,https://development.crm4.dynamics.com,https://qa.crm4.dynamics.com --solutions Base_10,Development_40 will match the Base_10 solution to the base instance and the Development_40 solution to the development instance. No solution is matched to the qa instance.). You can also omit solutions if you do not want to generate the solution flag for one of the instances.No solution flags will be provided.

Installation

Install either via npm i -D @connectiv-ms/connection-config-generator as a Dev-Dependency in your project, or install it globally via + npm i -g @connectiv-ms/connection-config-generator. Alternatively, this can also be executed via npx @connectiv-ms/connection-config-generator, which installs the package and executes it immediately but will not add it to the Dev-Dependencies.

If you cannot use the npm commands, you can also copy the output of the C# project to your project folder and run the executable from there.

1.0.24

2 months ago

1.0.22

4 months ago

1.0.23

4 months ago

1.0.19

4 months ago

1.0.20

4 months ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago