@itentialopensource/adapter-meraki 0.7.3 → 0.8.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/CHANGELOG.md +8 -0
- package/README.md +84 -11
- package/adapter.js +469 -1
- package/adapterBase.js +24 -2
- package/entities/.generic/action.json +5 -5
- package/error.json +6 -0
- package/package.json +18 -13
- package/pronghorn.json +192 -0
- package/propertiesSchema.json +15 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1642739939352.json +95 -0
- package/sampleProperties.json +4 -1
- package/test/integration/adapterTestIntegration.js +9 -1
- package/test/unit/adapterBaseTestUnit.js +5 -2
- package/test/unit/adapterTestUnit.js +618 -3
- package/utils/addAuth.js +94 -0
- package/utils/basicGet.js +1 -14
- package/utils/entitiesToDB.js +224 -0
- package/utils/modify.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +14 -8
- package/utils/tbUtils.js +98 -19
- package/utils/troubleshootingAdapter.js +2 -26
@@ -117,30 +117,6 @@ const VerifyHealthCheckEndpoint = (serviceItem, props, scriptFlag) => {
|
|
117
117
|
return { result, updatedAdapter };
|
118
118
|
};
|
119
119
|
|
120
|
-
const getPronghornProps = (iapDir) => {
|
121
|
-
console.log('Retrieving properties.json file...');
|
122
|
-
const rawProps = require(path.join(iapDir, 'properties.json'));
|
123
|
-
console.log('Decrypting properties...');
|
124
|
-
const { Discovery } = require('@itential/itential-utils');
|
125
|
-
const discovery = new Discovery();
|
126
|
-
const pronghornProps = utils.decryptProperties(rawProps, __dirname, discovery);
|
127
|
-
console.log('Found properties.\n');
|
128
|
-
return pronghornProps;
|
129
|
-
};
|
130
|
-
|
131
|
-
// get database connection and existing adapter config
|
132
|
-
const getAdapterConfig = async () => {
|
133
|
-
const iapDir = path.join(__dirname, '../../../../');
|
134
|
-
const pronghornProps = getPronghornProps(iapDir);
|
135
|
-
console.log('Connecting to Database...');
|
136
|
-
const database = await basicGet.connect(pronghornProps);
|
137
|
-
console.log('Connection established.');
|
138
|
-
const serviceItem = await database.collection(utils.SERVICE_CONFIGS_COLLECTION).findOne(
|
139
|
-
{ model: name }
|
140
|
-
);
|
141
|
-
return { database, serviceItem, pronghornProps };
|
142
|
-
};
|
143
|
-
|
144
120
|
const offline = async () => {
|
145
121
|
console.log('Start offline troubleshooting');
|
146
122
|
const { updatedAdapter } = VerifyHealthCheckEndpoint({ properties: sampleProperties }, {}, true);
|
@@ -159,7 +135,7 @@ const offline = async () => {
|
|
159
135
|
|
160
136
|
const troubleshoot = async (props, scriptFlag, persistFlag, adapter) => {
|
161
137
|
// get database connection and existing adapter config
|
162
|
-
const { database, serviceItem } = await getAdapterConfig();
|
138
|
+
const { database, serviceItem } = await utils.getAdapterConfig();
|
163
139
|
// where troubleshoot should start
|
164
140
|
if (serviceItem) {
|
165
141
|
if (!scriptFlag || rls.keyInYN(`Start verifying the connection and authentication properties for ${name}?`)) {
|
@@ -211,4 +187,4 @@ const troubleshoot = async (props, scriptFlag, persistFlag, adapter) => {
|
|
211
187
|
return null;
|
212
188
|
};
|
213
189
|
|
214
|
-
module.exports = { troubleshoot,
|
190
|
+
module.exports = { troubleshoot, offline };
|