@itentialopensource/adapter-db_mssql 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/CHANGELOG.md +16 -0
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +3 -148
- package/ENHANCE.md +28 -0
- package/PROPERTIES.md +111 -0
- package/SUMMARY.md +9 -0
- package/TROUBLESHOOT.md +28 -0
- package/adapter.js +44 -1
- package/error.json +12 -0
- package/metadata.json +49 -0
- package/package.json +19 -18
- package/pronghorn.json +134 -16
- package/propertiesDecorators.json +14 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/sampleProperties.json +4 -2
- package/test/integration/adapterTestIntegration.js +23 -1
- package/test/unit/adapterTestUnit.js +53 -17
- package/utils/adapterInfo.js +206 -0
- package/utils/artifactize.js +1 -1
- package/utils/packModificationScript.js +2 -2
- package/utils/removeHooks.js +20 -0
- package/utils/testRunner.js +17 -17
package/.eslintignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 1.0.0 [01-05-2024]
|
|
3
|
+
|
|
4
|
+
* Adapter Migration
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/persistence/adapter-db_mssql!5
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.4.0 [07-16-2021]
|
|
11
|
+
|
|
12
|
+
* added call that removes the record set from select returns
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/persistence/adapter-db_mssql!3
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 0.3.0 [03-26-2021]
|
|
3
19
|
|
|
4
20
|
* add domain support for connecting
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
|
|
|
8
8
|
|
|
9
9
|
Examples of behavior that contributes to creating a positive environment include:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
- Using welcoming and inclusive language
|
|
12
|
+
- Being respectful of differing viewpoints and experiences
|
|
13
|
+
- Gracefully accepting constructive criticism
|
|
14
|
+
- Focusing on what is best for the community
|
|
15
|
+
- Showing empathy towards other community members
|
|
16
16
|
|
|
17
17
|
Examples of unacceptable behavior by participants include:
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
24
|
|
|
25
25
|
## Our Responsibilities
|
|
26
26
|
|
|
@@ -34,15 +34,10 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
|
|
34
34
|
|
|
35
35
|
## Enforcement
|
|
36
36
|
|
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@itential.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
38
|
|
|
39
39
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
40
|
|
|
41
41
|
## Attribution
|
|
42
42
|
|
|
43
|
-
This Code of Conduct is adapted from the
|
|
44
|
-
|
|
45
|
-
[homepage]: http://contributor-covenant.org
|
|
46
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
|
47
|
-
|
|
48
|
-
_return to [README](../README.md)_
|
|
43
|
+
This Code of Conduct is adapted from the <a href="http://contributor-covenant.org" target="_blank">Contributor Covenant</a>, version 1.4, available at <a href="http://contributor-covenant.org/version/1/4/" target="_blank">version</a>
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,158 +1,13 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
First off, thanks for taking the time to contribute!
|
|
4
4
|
|
|
5
5
|
The following is a set of rules for contributing.
|
|
6
6
|
|
|
7
|
-
## Table Of Contents
|
|
8
|
-
|
|
9
|
-
[Code of Conduct](#code-of-conduct)
|
|
10
|
-
|
|
11
|
-
[How Can I Contribute?](#how-can-i-contribute)
|
|
12
|
-
|
|
13
|
-
* [Reporting Bugs](#reporting-bugs)
|
|
14
|
-
* [Your First Code Contribution](#your-first-code-contribution)
|
|
15
|
-
* [Merge Requests](#merge-requests)
|
|
16
|
-
|
|
17
|
-
[Styleguides](#styleguides)
|
|
18
|
-
|
|
19
|
-
* [Git Commit Messages](#git-commit-messages)
|
|
20
|
-
* [JavaScript Styleguide](#javascript-styleguide)
|
|
21
|
-
* [Tests Styleguide](#tests-styleguide)
|
|
22
|
-
* [Documentation Styleguide](#documentation-styleguide)
|
|
23
|
-
|
|
24
7
|
## Code of Conduct
|
|
25
8
|
|
|
26
|
-
This project and everyone participating in it is governed by the
|
|
9
|
+
This project and everyone participating in it is governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@itential.com.
|
|
27
10
|
|
|
28
11
|
## How to Contribute
|
|
29
12
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
This section guides you through submitting a bug report. Following these guidelines helps maintainers understand your report :pencil:, reproduce the behavior :computer: :left_right_arrow: :computer:, and find related reports :mag_right:.
|
|
33
|
-
|
|
34
|
-
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). If you have an Itential support contract, please create an Itential Service Desk ticket. If you don't have an Itential support contract, please send an email of the issue to [support@itential.com](mailto:support@itential.com).
|
|
35
|
-
|
|
36
|
-
#### Before Submitting A Bug Report
|
|
37
|
-
|
|
38
|
-
* **Check the [User Guide](README.md).** You might be able to find the cause of the problem and fix things yourself. Most importantly, check if you can reproduce the problem __in the latest version__.
|
|
39
|
-
* **Work through the troubleshooting process.** Troubleshooting will include changing the log level of Itential Automation Platform (IAP) and adapters and checking the logs to see what the issues are. These logs should be included in any ticket you open for this issue.
|
|
40
|
-
* **Check for resolutions to the issue.** Check the [Itential Knowledge Base](https://itential.atlassian.net/servicedesk/customer/kb/view/286883841?applicationId=605994d2-2cb2-3174-af59-ed5b23ff5fd5&spaceKey=PKB&src=1187380921) to see if there is a known resolution for the issue you are having.
|
|
41
|
-
* **Ask around in chat if you are an Itential employee** to see if others are experiencing the same issue.
|
|
42
|
-
|
|
43
|
-
#### How to Submit a (Good) Bug Report
|
|
44
|
-
|
|
45
|
-
Bugs are tracked through the Itential Service Desk. Explain the problem and include additional details to help maintainers reproduce the problem:
|
|
46
|
-
|
|
47
|
-
* **Use a clear and descriptive title** for the issue to identify the problem.
|
|
48
|
-
* **Describe the exact steps which reproduce the problem** in as much detail as possible. For example, start by explaining how you configured the adapter (e.g., which properties you used and how they were set) or how you are using an artifact.
|
|
49
|
-
* **Provide specific examples to demonstrate the steps**. Include logs, or copy/paste snippets, in your examples.
|
|
50
|
-
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
|
51
|
-
* **Explain which behavior you expected to see instead and why.**
|
|
52
|
-
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows. Use [this tool](https://github.com/colinkeenan/silentcast) or [program](https://github.com/rhcarvalho/byzanz-guiz) on Linux.
|
|
53
|
-
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
|
|
54
|
-
|
|
55
|
-
Provide more context by answering these questions:
|
|
56
|
-
|
|
57
|
-
* **Did the problem start happening recently** (e.g. after updating to a new version/tag) or was this always a problem?
|
|
58
|
-
* If the problem started happening recently, **can you reproduce the problem in an older version/tag?** What's the most recent version in which the problem does not happen?
|
|
59
|
-
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
|
|
60
|
-
|
|
61
|
-
Include details about your configuration and environment:
|
|
62
|
-
|
|
63
|
-
* **Which version of the adapter/artifact are you using?** You can get the exact version by checking the project version in the package.json file.
|
|
64
|
-
* **What's the name and version of the OS you're using**?
|
|
65
|
-
* **Are you running or using IAP in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and guest?
|
|
66
|
-
* **Are there firewalls between IAP and any other system you are integrating with?** If so, have you tried running curl from the system IAP is on to the other system to verify you have connectivity between the systems?
|
|
67
|
-
|
|
68
|
-
### Your First Code Contribution
|
|
69
|
-
|
|
70
|
-
#### Local development
|
|
71
|
-
|
|
72
|
-
This project can be developed locally on all operating systems. For instructions on how to do this, follow the steps highlighted in the [User Guide](README.md). The [User Guide](README.md)provides many more details on cloning the repository for local development, how to lint and test your changes.
|
|
73
|
-
|
|
74
|
-
#### Development Process
|
|
75
|
-
|
|
76
|
-
The following provides a local copy of the repository along with dependencies.
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
go to the repository you are interested in working on
|
|
80
|
-
click on the Clone button to get the link(s) you can use to clone the repository
|
|
81
|
-
git clone <link to clone the project>
|
|
82
|
-
npm install
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Prior to making changes you should create a branch to work in. The branch should be named with the type of change (major, minor or patch) and then a Jira issue number or a description of the issue.
|
|
86
|
-
|
|
87
|
-
```json
|
|
88
|
-
git checkout -b <name_of_your_new_branch>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Make all of the desired changes.
|
|
92
|
-
|
|
93
|
-
> **Note:** All code changes should be accompanied by additional Unit and Integration tests to minimize the likelihood that any changes will negatively impact the adapter/artifact as well as to ensure the desired functionality is achieved.
|
|
94
|
-
|
|
95
|
-
| Files | Changes |
|
|
96
|
-
| ------- | ------- |
|
|
97
|
-
| .codeclimate.yml, .eslintignore, .eslintrc.js, .gitignore, .gitlab-ci.yml, .jshintrc, .npmignore | These are foundational files that are used in linting and building of the adapter. Changes to these files are heavily scrutinized and may be implemented in a different manner so that the changes can be implemented across all adapters.|
|
|
98
|
-
| CODE_OF_CONDUCT.md, CONTRIBUTING.md, LICENSE, README.md | These are license and process files for the repository. Changes to these files may require legal review and may also be implemented in a different manner so that the changes can be implemented across all adapters.|
|
|
99
|
-
| utils/*, adapterBase.js | Changes to these files will rarely be accepted. These are process files that need to be changed through the builder process and migration.|
|
|
100
|
-
| adapter.js | Changes to this file are code changes. They should be accompanied by the appropriate unit and integration tests. If new methods are added, they should also be added to the pronghorn.json file, otherwise integration tests are likely to fail.|
|
|
101
|
-
| error.json, propertiesSchema.json | These files are utilized by the Itential Runtime libraries. You can make changes to these files, but the changes should be appending of new errors or properties. Removal of errors and properties can result in rejection of the changes.|
|
|
102
|
-
| pacakge.json, package-lock.json | The package-lock.json is automatically generated and should only be updated when the dependencies inside of the package.json are modified. You can make changes to the package.json to add additional scripts, add new dependencies, modify names, etc. However, changing the scripts or dependencies that are Itential specific will be overriden during the acceptance process.|
|
|
103
|
-
| pronghorn.json | Changes to this file are made for integration into IAP. The most common change here is adding new methods that shoud be exposed to the IAP Workflow.|
|
|
104
|
-
| entities/* | Changes to these files include adding new capabilities, updating existing capabilities, or removing deprecated capabilities in the adapter. Translation configuration can also be modified here.|
|
|
105
|
-
| test/* | Changes to these files include adding, updating, or removing unit and integration tests in the adapter. Tests should never be removed unless the methods that are being tested are removed also. Both the unit and integration test file should have a marker that identifies where modification can take place. Modifications above that marker are likely to be rejected or implemented in a different manner.|
|
|
106
|
-
|
|
107
|
-
> **Note:** It is a best practice to lint and test your code prior to committing changes into the repository. You can lint your code by running **npm run lint** and test it by running **node utils/testRunner.sh**. However, there are pre-commit hooks that will run these scripts when you commit your changes.
|
|
108
|
-
|
|
109
|
-
Commit the changes to the repository.
|
|
110
|
-
|
|
111
|
-
```json
|
|
112
|
-
git commit -a -m "<descriptive message>"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
> **Note:** There are pre-commit hooks in place. If the pre-commit hooks fail, you will need to address those issues before moving forward.
|
|
116
|
-
|
|
117
|
-
Push the changes into the repository. This should only be done after the commit has successfully completed.
|
|
118
|
-
|
|
119
|
-
```json
|
|
120
|
-
git push origin <name_of_your_new_branch>
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Create a [Merge Request](#merge-request).
|
|
124
|
-
|
|
125
|
-
### Merge Requests
|
|
126
|
-
|
|
127
|
-
* Fill out the provided merge request template.
|
|
128
|
-
* Reference related issues and merge requests liberally.
|
|
129
|
-
* Include screenshots and animated GIFs in your merge request whenever possible.
|
|
130
|
-
* Follow the project [Styleguide](#styleguides).
|
|
131
|
-
* End all files with a newline.
|
|
132
|
-
|
|
133
|
-
## Styleguide
|
|
134
|
-
|
|
135
|
-
### Git Commit Messages
|
|
136
|
-
|
|
137
|
-
* Use the present tense ("Add feature" not "Added feature")
|
|
138
|
-
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
139
|
-
* Consider starting the commit message with an applicable emoji _(not required)_:
|
|
140
|
-
* :art: `:art:` When improving the format/structure of the code.
|
|
141
|
-
* :racehorse: `:racehorse:` When improving performance
|
|
142
|
-
* :non-potable_water: `:non-potable_water:` When plugging memory leaks.
|
|
143
|
-
* :memo: `:memo:` When writing documentation.
|
|
144
|
-
* :penguin: `:penguin:` When fixing something on Linux.
|
|
145
|
-
* :apple: `:apple:` When fixing something on macOS.
|
|
146
|
-
* :checkered_flag: `:checkered_flag:` When fixing something on Windows.
|
|
147
|
-
* :bug: `:bug:` When fixing a bug.
|
|
148
|
-
* :fire: `:fire:` When removing code or files.
|
|
149
|
-
* :green_heart: `:green_heart:` When fixing the CI build.
|
|
150
|
-
* :white_check_mark: `:white_check_mark:` When adding tests,
|
|
151
|
-
* :lock: `:lock:` When dealing with security.
|
|
152
|
-
* :arrow_up: `:arrow_up:` When upgrading dependencies.
|
|
153
|
-
* :arrow_down: `:arrow_down:` When downgrading dependencies.
|
|
154
|
-
* :shirt: `:shirt:` When removing linter warnings.
|
|
155
|
-
|
|
156
|
-
__Avoid installing unnecessary packages.__ Do not install packages just because they might be "nice to have". Itential Opensource projects are supposed to be minimal, specific, and compact by design.
|
|
157
|
-
|
|
158
|
-
_return to [README](./README.md)_
|
|
13
|
+
Follow the contributing guide (here)[https://gitlab.com/itentialopensource/adapters/contributing-guide]
|
package/ENHANCE.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Enhancements
|
|
2
|
+
|
|
3
|
+
### Adding a Second Instance of an Adapter
|
|
4
|
+
|
|
5
|
+
You can add a second instance of this adapter without adding new code on the file system. To do this go into the IAP Admin Essentials and add a new service config for this adapter. The two instances of the adapter should have unique ids. In addition, they should point to different instances (unique host and port) of the other system.
|
|
6
|
+
|
|
7
|
+
### Adding Adapter Properties
|
|
8
|
+
|
|
9
|
+
While changing adapter properties is done in the service instance configuration section of IAP, adding properties has to be done in the adapter. To add a property you should edit the propertiesSchema.json with the proper information for the property. In addition, you should modify the sampleProperties to have the new property in it.
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Files to update
|
|
13
|
+
* propertiesSchema.json: add the new property and how it is defined
|
|
14
|
+
* sampleProperties: add the new property with a default value
|
|
15
|
+
* test/unit/adapterTestUnit.js (optional but best practice): add the property to the global properties
|
|
16
|
+
* test/integration/adapterTestIntegration.js (optional but best practice): add the property to the global properties
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Enhancing Adapter Integration Tests
|
|
20
|
+
|
|
21
|
+
The adapter integration tests are written to be able to test in either stub (standalone) mode or integrated to the other system. However, if integrating to the other system, you may need to provide better data than what the adapter provides by default as that data is likely to fail for create and update. To provide better data, edit the adapter integration test file. Make sure you do not remove the marker and keep custom code below the marker so you do not impact future migrations. Once the edits are complete, run the integration test as it instructs you to above. When you run integrated to the other system, you can also save mockdata for future use by changing the isSaveMockData flag to true.
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Files to update
|
|
25
|
+
* test/integration/adapterTestIntegration.js: add better data for the create and update calls so that they will not fail.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
As mentioned previously, for most of these changes as well as other possible changes, there is more information on how to work on an adapter in the <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a> on our Documentation Site.
|
package/PROPERTIES.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
## Configuration
|
|
2
|
+
|
|
3
|
+
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or IAP are provided in the sampleProperties.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"id": "ALL ADAPTER PROPERTIES!!!",
|
|
8
|
+
"properties": {
|
|
9
|
+
"database": "test",
|
|
10
|
+
"host": "system.access.resolved",
|
|
11
|
+
"port": 443,
|
|
12
|
+
"encrypt": false,
|
|
13
|
+
"authentication": {
|
|
14
|
+
"dbAuth": true,
|
|
15
|
+
"username": "username",
|
|
16
|
+
"password": "password",
|
|
17
|
+
"domain": "domain"
|
|
18
|
+
},
|
|
19
|
+
"ssl": {
|
|
20
|
+
"enabled": false,
|
|
21
|
+
"accept_invalid_cert": false,
|
|
22
|
+
"ca_file": ""
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"type": "YOUR ADAPTER CLASS"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Connection Properties
|
|
30
|
+
|
|
31
|
+
These base properties are used to connect to MicrosoftSQL upon the adapter initially coming up. It is important to set these properties appropriately.
|
|
32
|
+
|
|
33
|
+
<table border="1" class="bordered-table">
|
|
34
|
+
<tr>
|
|
35
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
36
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td style="padding:15px">database</td>
|
|
40
|
+
<td style="padding:15px">Required. The name of the database.</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td style="padding:15px">host</td>
|
|
44
|
+
<td style="padding:15px">Required. A fully qualified domain name or IP address.</td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td style="padding:15px">port</td>
|
|
48
|
+
<td style="padding:15px">Required. Used to connect to the server.</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<td style="padding:15px">encrypt</td>
|
|
52
|
+
<td style="padding:15px">Optional. Used to tell the adapter to encrypt the data. The default behavior is to encrypt.</td>
|
|
53
|
+
</tr>
|
|
54
|
+
</table>
|
|
55
|
+
<br>
|
|
56
|
+
|
|
57
|
+
A connectivity check tells IAP the adapter has loaded successfully.
|
|
58
|
+
|
|
59
|
+
### Authentication Properties
|
|
60
|
+
|
|
61
|
+
The following properties are used to define the authentication process to MicrosoftSQL.
|
|
62
|
+
|
|
63
|
+
>**Note**: Depending on the method that is used to authenticate with MicrosoftSQL, you may not need to set all of the authentication properties.
|
|
64
|
+
|
|
65
|
+
<table border="1" class="bordered-table">
|
|
66
|
+
<tr>
|
|
67
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
68
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
69
|
+
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td style="padding:15px">dbAuth</td>
|
|
72
|
+
<td style="padding:15px">Optional. Used to tell the adapter to authenticate. The default behavior is unauthenticated.</td>
|
|
73
|
+
</tr>
|
|
74
|
+
<tr>
|
|
75
|
+
<td style="padding:15px">username</td>
|
|
76
|
+
<td style="padding:15px">Used to authenticate with MicrosoftSQL on every request or when pulling a token that will be used in subsequent requests.</td>
|
|
77
|
+
</tr>
|
|
78
|
+
<tr>
|
|
79
|
+
<td style="padding:15px">password</td>
|
|
80
|
+
<td style="padding:15px">Used to authenticate with MicrosoftSQL on every request or when pulling a token that will be used in subsequent requests.</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<td style="padding:15px">domain</td>
|
|
84
|
+
<td style="padding:15px">Domain of the user used when authentication is enabled.</td>
|
|
85
|
+
</tr>
|
|
86
|
+
</table>
|
|
87
|
+
<br>
|
|
88
|
+
|
|
89
|
+
### SSL Properties
|
|
90
|
+
|
|
91
|
+
The SSL section defines the properties utilized for ssl authentication with MicrosoftSQL. SSL can work two different ways: set the `accept\_invalid\_certs` flag to true (only recommended for lab environments), or provide a `ca\_file`.
|
|
92
|
+
|
|
93
|
+
<table border="1" class="bordered-table">
|
|
94
|
+
<tr>
|
|
95
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
96
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<td style="padding:15px">enabled</td>
|
|
100
|
+
<td style="padding:15px">If SSL is required, set to true.</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td style="padding:15px">accept_invalid_certs</td>
|
|
104
|
+
<td style="padding:15px">Defines if the adapter should accept invalid certificates (only recommended for lab environments). Required if SSL is enabled. Default is false.</td>
|
|
105
|
+
</tr>
|
|
106
|
+
<tr>
|
|
107
|
+
<td style="padding:15px">ca_file</td>
|
|
108
|
+
<td style="padding:15px">Defines the path name to the CA file used for SSL. If SSL is enabled and the accept invalid certifications is false, then ca_file is required.</td>
|
|
109
|
+
</tr>
|
|
110
|
+
</table>
|
|
111
|
+
<br>
|
package/SUMMARY.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
This adapter is used to integrate the Itential Automation Platform (IAP) with the MicrosoftSQL System. The API that was used to build the adapter for MicrosoftSQL is usually available in the report directory of this adapter. The adapter utilizes the MicrosoftSQL API to provide the integrations that are deemed pertinent to IAP. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
|
4
|
+
|
|
5
|
+
>**Note**: It is possible that some integrations will be supported through the MicrosoftSQL adapter while other integrations will not. If you need additional API calls, you can use the Update capabilities provided by the Adapter Builder or request Itential to add them if the Adapter is an Itential opensourced adapter.
|
|
6
|
+
|
|
7
|
+
Itential provides information on all of its product adapters in the Customer Knowledge Base. Information in the <a href="https://itential.atlassian.net/servicedesk/customer/portals" target="_blank">Customer Knowledge Base</a> is consistently maintained and goes through documentation reviews. As a result, it should be the first place to go for information.
|
|
8
|
+
|
|
9
|
+
For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into IAP.
|
package/TROUBLESHOOT.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Troubleshoot
|
|
2
|
+
|
|
3
|
+
### Connectivity Issues
|
|
4
|
+
|
|
5
|
+
1. Verify the adapter properties are set up correctly.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Go into the Itential Platform GUI and verify/update the properties
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
2. Verify there is connectivity between the Itential Platform Server and MicrosoftSQL Server.
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
ping the ip address of MicrosoftSQL server
|
|
15
|
+
try telnet to the ip address port of MicrosoftSQL
|
|
16
|
+
execute a curl command to the other system
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. Verify the credentials provided for MicrosoftSQL.
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
login to MicrosoftSQL using the provided credentials
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Functional Issues
|
|
27
|
+
|
|
28
|
+
Adapter logs are located in `/var/log/pronghorn`. In older releases of the Itential Platform, there is a `pronghorn.log` file which contains logs for all of the Itential Platform. In newer versions, adapters can be configured to log into their own files.
|
package/adapter.js
CHANGED
|
@@ -413,7 +413,7 @@ class MicrosoftSQL extends EventEmitter {
|
|
|
413
413
|
const meth = 'adapter-select';
|
|
414
414
|
const origin = `${this.id}-${meth}`;
|
|
415
415
|
log.trace(origin);
|
|
416
|
-
log.trace(`mssql
|
|
416
|
+
log.trace(`mssql select started with sql: ${sql}`);
|
|
417
417
|
|
|
418
418
|
try {
|
|
419
419
|
// verify the required data has been provided
|
|
@@ -435,6 +435,49 @@ class MicrosoftSQL extends EventEmitter {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
+
/**
|
|
439
|
+
* Call to select item from MicrosoftSQL server but not return the recordSet
|
|
440
|
+
* RecordSet is supposedly the first record in the recordSets so it makes it look like
|
|
441
|
+
* duplicate data is returned.
|
|
442
|
+
* @function selectNoRecordSet
|
|
443
|
+
* @param sql - a sql string (required)
|
|
444
|
+
* @param callback - a callback function to return a result
|
|
445
|
+
*/
|
|
446
|
+
selectNoRecordSet(sql, callback) {
|
|
447
|
+
const meth = 'adapter-selectNoRecordSet';
|
|
448
|
+
const origin = `${this.id}-${meth}`;
|
|
449
|
+
log.trace(origin);
|
|
450
|
+
log.trace(`mssql select started with sql: ${sql}`);
|
|
451
|
+
|
|
452
|
+
try {
|
|
453
|
+
// verify the required data has been provided
|
|
454
|
+
if (!sql) {
|
|
455
|
+
const errorObj = formatErrorObject(origin, 'Missing Data', ['sql'], null, null, null);
|
|
456
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
457
|
+
return callback(null, errorObj);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (!sql.toLowerCase().startsWith('select')) {
|
|
461
|
+
return callback(null, 'SQL statement must start with "SELECT"');
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
this.query(sql, (results, error) => {
|
|
465
|
+
if (error) {
|
|
466
|
+
return callback(null, error);
|
|
467
|
+
}
|
|
468
|
+
const tresults = results;
|
|
469
|
+
if (tresults && tresults.response && tresults.response.recordset) {
|
|
470
|
+
delete tresults.response.recordset;
|
|
471
|
+
}
|
|
472
|
+
return callback(tresults);
|
|
473
|
+
});
|
|
474
|
+
} catch (ex) {
|
|
475
|
+
const errorObj = formatErrorObject(origin, 'Caught Exception', null, null, null, ex);
|
|
476
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
477
|
+
return callback(null, errorObj);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
438
481
|
/**
|
|
439
482
|
* Call to insert item into MicrosoftSQL server.
|
|
440
483
|
* @function insert
|
package/error.json
CHANGED
|
@@ -96,6 +96,12 @@
|
|
|
96
96
|
"displayString": "Invalid properties: $VARIABLE$",
|
|
97
97
|
"recommendation": "Verify the properties for the adapter"
|
|
98
98
|
},
|
|
99
|
+
{
|
|
100
|
+
"key": "Missing Properties",
|
|
101
|
+
"icode": "AD.306",
|
|
102
|
+
"displayString": "Property $VARIABLE$ is required",
|
|
103
|
+
"recommendation": "Please provide the required property"
|
|
104
|
+
},
|
|
99
105
|
{
|
|
100
106
|
"key": "Query Not Translated",
|
|
101
107
|
"icode": "AD.310",
|
|
@@ -168,6 +174,12 @@
|
|
|
168
174
|
"displayString": "Failure response received for $VARIABLE$",
|
|
169
175
|
"recommendation": "Check the reason for failure in the stack trace"
|
|
170
176
|
},
|
|
177
|
+
{
|
|
178
|
+
"key": "Suspended Adapter",
|
|
179
|
+
"icode": "AD.600",
|
|
180
|
+
"displayString": "Adapter is suspended",
|
|
181
|
+
"recommendation": "Check if external system is functional and unsuspend if appropriate"
|
|
182
|
+
},
|
|
171
183
|
{
|
|
172
184
|
"key": "Caught Exception",
|
|
173
185
|
"icode": "AD.900",
|
package/metadata.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "adapter-db_mssql",
|
|
3
|
+
"webName": "Adapter for Integration to Microsoft SQL Database",
|
|
4
|
+
"vendor": "Microsoft",
|
|
5
|
+
"product": "MSSQL",
|
|
6
|
+
"osVersion": [],
|
|
7
|
+
"apiVersions": [],
|
|
8
|
+
"iapVersions": [
|
|
9
|
+
"2021.1.x",
|
|
10
|
+
"2021.2.x",
|
|
11
|
+
"2022.1.x",
|
|
12
|
+
"2023.1.x"
|
|
13
|
+
],
|
|
14
|
+
"method": "Library",
|
|
15
|
+
"type": "Adapter",
|
|
16
|
+
"domains": [
|
|
17
|
+
"Data Storage"
|
|
18
|
+
],
|
|
19
|
+
"tags": [],
|
|
20
|
+
"useCases": [],
|
|
21
|
+
"deprecated": {
|
|
22
|
+
"isDeprecated": false
|
|
23
|
+
},
|
|
24
|
+
"brokerSince": "",
|
|
25
|
+
"documentation": {
|
|
26
|
+
"storeLink": "",
|
|
27
|
+
"npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-db_mssql",
|
|
28
|
+
"repoLink": "https://gitlab.com/itentialopensource/adapters/persistence/adapter-db_mssql",
|
|
29
|
+
"docLink": "",
|
|
30
|
+
"demoLinks": [],
|
|
31
|
+
"trainingLinks": [],
|
|
32
|
+
"faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
|
|
33
|
+
"contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
|
|
34
|
+
"issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
|
|
35
|
+
"webLink": "https://www.itential.com/adapters/microsoftsql/",
|
|
36
|
+
"vendorLink": "",
|
|
37
|
+
"productLink": "",
|
|
38
|
+
"apiLinks": []
|
|
39
|
+
},
|
|
40
|
+
"assets": [],
|
|
41
|
+
"relatedItems": {
|
|
42
|
+
"adapters": [],
|
|
43
|
+
"integrations": [],
|
|
44
|
+
"ecosystemApplications": [],
|
|
45
|
+
"workflowProjects": [],
|
|
46
|
+
"transformationProjects": [],
|
|
47
|
+
"exampleProjects": []
|
|
48
|
+
}
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itentialopensource/adapter-db_mssql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Itential adapter to connect to mssql",
|
|
5
5
|
"main": "adapter.js",
|
|
6
|
-
"wizardVersion": "2.
|
|
7
|
-
"engineVersion": "1.
|
|
6
|
+
"wizardVersion": "2.44.7",
|
|
7
|
+
"engineVersion": "1.67.14",
|
|
8
|
+
"adapterType": "library",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"artifactize": "npm i && node utils/packModificationScript.js",
|
|
10
11
|
"preinstall": "node utils/setup.js",
|
|
11
|
-
"
|
|
12
|
+
"deinstall": "node utils/removeHooks.js",
|
|
13
|
+
"lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
|
|
14
|
+
"lint:errors": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet",
|
|
12
15
|
"test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
|
|
13
16
|
"test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
|
|
14
17
|
"test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
|
|
15
18
|
"test": "npm run test:unit && npm run test:integration",
|
|
16
|
-
"deploy": "npm publish --registry=
|
|
19
|
+
"deploy": "npm publish --registry=https://registry.npmjs.org --access=public",
|
|
17
20
|
"build": "npm run deploy"
|
|
18
21
|
},
|
|
19
22
|
"keywords": [
|
|
@@ -38,22 +41,20 @@
|
|
|
38
41
|
"author": "Itential",
|
|
39
42
|
"homepage": "https://gitlab.com/itentialopensource/adapters/persistence/adapter-db_mssql#readme",
|
|
40
43
|
"dependencies": {
|
|
41
|
-
"ajv": "^
|
|
42
|
-
"fs-extra": "^
|
|
43
|
-
"mssql": "^
|
|
44
|
-
"
|
|
45
|
-
"readline-sync": "^1.4.10",
|
|
46
|
-
"uuid": "^3.0.1"
|
|
44
|
+
"ajv": "^8.12.0",
|
|
45
|
+
"fs-extra": "^11.1.1",
|
|
46
|
+
"mssql": "^10.0.1",
|
|
47
|
+
"readline-sync": "^1.4.10"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"chai": "^4.
|
|
50
|
-
"eslint": "^
|
|
51
|
-
"eslint-config-airbnb-base": "^
|
|
52
|
-
"eslint-plugin-import": "^2.
|
|
53
|
-
"eslint-plugin-json": "^
|
|
54
|
-
"mocha": "^
|
|
50
|
+
"chai": "^4.3.7",
|
|
51
|
+
"eslint": "^8.44.0",
|
|
52
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
53
|
+
"eslint-plugin-import": "^2.27.5",
|
|
54
|
+
"eslint-plugin-json": "^3.1.0",
|
|
55
|
+
"mocha": "^9.0.1",
|
|
55
56
|
"nyc": "^15.1.0",
|
|
56
|
-
"testdouble": "^3.
|
|
57
|
+
"testdouble": "^3.18.0",
|
|
57
58
|
"winston": "^3.3.3"
|
|
58
59
|
},
|
|
59
60
|
"private": false
|