@itentialopensource/adapter-bitbucket 0.3.4 → 0.3.7
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 +24 -0
- package/README.md +90 -17
- package/adapter.js +577 -8
- package/adapterBase.js +25 -3
- package/entities/.generic/action.json +5 -5
- package/entities/Repositories/action.json +22 -1
- package/entities/Repositories/schema.json +2 -1
- package/error.json +6 -0
- package/package.json +19 -14
- package/pronghorn.json +286 -0
- package/propertiesSchema.json +15 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1647122655204.json +95 -0
- package/sampleProperties.json +10 -7
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +10 -2
- package/test/unit/adapterBaseTestUnit.js +6 -3
- package/test/unit/adapterTestUnit.js +684 -4
- 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/packModificationScript.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
|
@@ -13,7 +13,10 @@ const winston = require('winston');
|
|
|
13
13
|
const { expect } = require('chai');
|
|
14
14
|
const { use } = require('chai');
|
|
15
15
|
const td = require('testdouble');
|
|
16
|
+
const util = require('util');
|
|
17
|
+
const pronghorn = require('../../pronghorn.json');
|
|
16
18
|
|
|
19
|
+
pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
|
|
17
20
|
const anything = td.matchers.anything();
|
|
18
21
|
|
|
19
22
|
// stub and attemptTimeout are used throughout the code so set them here
|
|
@@ -63,7 +66,10 @@ global.pronghornProps = {
|
|
|
63
66
|
token_cache: 'local',
|
|
64
67
|
auth_field: 'header.headers.Authorization',
|
|
65
68
|
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
66
|
-
auth_logging: false
|
|
69
|
+
auth_logging: false,
|
|
70
|
+
client_id: '',
|
|
71
|
+
client_secret: '',
|
|
72
|
+
grant_type: ''
|
|
67
73
|
},
|
|
68
74
|
healthcheck: {
|
|
69
75
|
type: 'none',
|
|
@@ -310,7 +316,7 @@ function saveMockData(entityName, actionName, descriptor, responseData) {
|
|
|
310
316
|
}
|
|
311
317
|
|
|
312
318
|
// require the adapter that we are going to be using
|
|
313
|
-
const Bitbucket = require('../../adapter
|
|
319
|
+
const Bitbucket = require('../../adapter');
|
|
314
320
|
|
|
315
321
|
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
316
322
|
describe('[integration] Bitbucket Adapter Test', () => {
|
|
@@ -341,6 +347,8 @@ describe('[integration] Bitbucket Adapter Test', () => {
|
|
|
341
347
|
try {
|
|
342
348
|
assert.notEqual(null, a);
|
|
343
349
|
assert.notEqual(undefined, a);
|
|
350
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
351
|
+
assert.equal(checkId, a.id);
|
|
344
352
|
assert.notEqual(null, a.allProps);
|
|
345
353
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
346
354
|
assert.equal(check, a.healthcheckType);
|
|
@@ -61,7 +61,10 @@ global.pronghornProps = {
|
|
|
61
61
|
token_cache: 'local',
|
|
62
62
|
auth_field: 'header.headers.Authorization',
|
|
63
63
|
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
64
|
-
auth_logging: false
|
|
64
|
+
auth_logging: false,
|
|
65
|
+
client_id: '',
|
|
66
|
+
client_secret: '',
|
|
67
|
+
grant_type: ''
|
|
65
68
|
},
|
|
66
69
|
healthcheck: {
|
|
67
70
|
type: 'none',
|
|
@@ -194,7 +197,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
// require the adapter that we are going to be using
|
|
197
|
-
const AdapterBase = require('../../adapterBase
|
|
200
|
+
const AdapterBase = require('../../adapterBase');
|
|
198
201
|
|
|
199
202
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
200
203
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -314,7 +317,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
314
317
|
});
|
|
315
318
|
it('should return a list of functions', (done) => {
|
|
316
319
|
const returnedFunctions = ['addEntityCache', 'capabilityResults', 'checkActionFiles', 'checkProperties', 'connect', 'encryptProperty',
|
|
317
|
-
'entityInList', 'findPath', 'getAllCapabilities', 'getAllFunctions', 'getQueue', 'getWorkflowFunctions', 'healthCheck',
|
|
320
|
+
'entityInList', 'findPath', 'getAllCapabilities', 'getAllFunctions', 'getQueue', 'getWorkflowFunctions', 'healthCheck', 'moveEntitiesToDB',
|
|
318
321
|
'refreshProperties', 'runBasicGet', 'runConnectivity', 'runHealthcheck', 'suspend', 'troubleshoot', 'unsuspend', 'updateAdapterConfiguration', 'addListener',
|
|
319
322
|
'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener',
|
|
320
323
|
'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|