@itentialopensource/adapter-bitbucket 0.3.2 → 0.3.5

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.
Files changed (41) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +12 -12
  3. package/CHANGELOG.md +24 -0
  4. package/README.md +270 -68
  5. package/adapter.js +2006 -19
  6. package/adapterBase.js +544 -17
  7. package/entities/.generic/action.json +109 -0
  8. package/entities/.generic/schema.json +23 -0
  9. package/entities/.system/action.json +1 -1
  10. package/entities/Repositories/action.json +21 -0
  11. package/entities/Repositories/schema.json +2 -1
  12. package/error.json +6 -0
  13. package/package.json +46 -24
  14. package/pronghorn.json +664 -0
  15. package/propertiesSchema.json +84 -11
  16. package/refs?service=git-upload-pack +0 -0
  17. package/report/bitbucket2.0-OpenApi3Json.json +15713 -0
  18. package/report/updateReport1594060670181.json +95 -0
  19. package/report/updateReport1614703735948.json +95 -0
  20. package/report/updateReport1647122655204.json +95 -0
  21. package/sampleProperties.json +20 -5
  22. package/test/integration/adapterTestBasicGet.js +85 -0
  23. package/test/integration/adapterTestConnectivity.js +93 -0
  24. package/test/integration/adapterTestIntegration.js +30 -11
  25. package/test/unit/adapterBaseTestUnit.js +944 -0
  26. package/test/unit/adapterTestUnit.js +703 -12
  27. package/utils/addAuth.js +94 -0
  28. package/utils/artifactize.js +9 -14
  29. package/utils/basicGet.js +50 -0
  30. package/utils/checkMigrate.js +63 -0
  31. package/utils/entitiesToDB.js +224 -0
  32. package/utils/findPath.js +74 -0
  33. package/utils/modify.js +154 -0
  34. package/utils/packModificationScript.js +1 -1
  35. package/utils/patches2bundledDeps.js +90 -0
  36. package/utils/pre-commit.sh +1 -1
  37. package/utils/removeHooks.js +20 -0
  38. package/utils/tbScript.js +169 -0
  39. package/utils/tbUtils.js +451 -0
  40. package/utils/troubleshootingAdapter.js +190 -0
  41. package/gl-code-quality-report.json +0 -1
@@ -0,0 +1,109 @@
1
+ {
2
+ "actions": [
3
+ {
4
+ "name": "getGenerics",
5
+ "protocol": "REST",
6
+ "method": "GET",
7
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
8
+ "requestSchema": "schema.json",
9
+ "responseSchema": "schema.json",
10
+ "timeout": 0,
11
+ "sendEmpty": false,
12
+ "sendGetBody": false,
13
+ "requestDatatype": "JSON",
14
+ "responseDatatype": "JSON",
15
+ "headers": {},
16
+ "responseObjects": [
17
+ {
18
+ "type": "default",
19
+ "key": "",
20
+ "mockFile": ""
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "name": "createGeneric",
26
+ "protocol": "REST",
27
+ "method": "POST",
28
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
29
+ "requestSchema": "schema.json",
30
+ "responseSchema": "schema.json",
31
+ "timeout": 0,
32
+ "sendEmpty": false,
33
+ "sendGetBody": false,
34
+ "requestDatatype": "JSON",
35
+ "responseDatatype": "JSON",
36
+ "headers": {},
37
+ "responseObjects": [
38
+ {
39
+ "type": "default",
40
+ "key": "",
41
+ "mockFile": ""
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "name": "updateGeneric",
47
+ "protocol": "REST",
48
+ "method": "PUT",
49
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
50
+ "requestSchema": "schema.json",
51
+ "responseSchema": "schema.json",
52
+ "timeout": 0,
53
+ "sendEmpty": false,
54
+ "sendGetBody": false,
55
+ "requestDatatype": "JSON",
56
+ "responseDatatype": "JSON",
57
+ "headers": {},
58
+ "responseObjects": [
59
+ {
60
+ "type": "default",
61
+ "key": "",
62
+ "mockFile": ""
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "name": "patchGeneric",
68
+ "protocol": "REST",
69
+ "method": "PATCH",
70
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
71
+ "requestSchema": "schema.json",
72
+ "responseSchema": "schema.json",
73
+ "timeout": 0,
74
+ "sendEmpty": false,
75
+ "sendGetBody": false,
76
+ "requestDatatype": "JSON",
77
+ "responseDatatype": "JSON",
78
+ "headers": {},
79
+ "responseObjects": [
80
+ {
81
+ "type": "default",
82
+ "key": "",
83
+ "mockFile": ""
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "name": "deleteGeneric",
89
+ "protocol": "REST",
90
+ "method": "DELETE",
91
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
92
+ "requestSchema": "schema.json",
93
+ "responseSchema": "schema.json",
94
+ "timeout": 0,
95
+ "sendEmpty": false,
96
+ "sendGetBody": false,
97
+ "requestDatatype": "JSON",
98
+ "responseDatatype": "JSON",
99
+ "headers": {},
100
+ "responseObjects": [
101
+ {
102
+ "type": "default",
103
+ "key": "",
104
+ "mockFile": ""
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$id": "generic_schema.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": false,
6
+ "dynamicfields": true,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "getGeneric",
12
+ "enum": [
13
+ "getGenerics",
14
+ "createGeneric",
15
+ "updateGeneric",
16
+ "patchGeneric",
17
+ "deleteGeneric"
18
+ ],
19
+ "external_name": "ph_request_type"
20
+ }
21
+ },
22
+ "definitions": {}
23
+ }
@@ -4,7 +4,7 @@
4
4
  "name": "getToken",
5
5
  "protocol": "REST",
6
6
  "method": "POST",
7
- "entitypath": "{base_path}/{version}/login?{query}",
7
+ "entitypath": "{base_path}/{version}/login",
8
8
  "requestSchema": "schemaTokenReq.json",
9
9
  "responseSchema": "schemaTokenResp.json",
10
10
  "timeout": 0,
@@ -231,6 +231,27 @@
231
231
  }
232
232
  ]
233
233
  },
234
+ {
235
+ "name": "CreateACommitByUploadingAFile",
236
+ "protocol": "REST",
237
+ "method": "POST",
238
+ "entitypath": "{base_path}/{version}/repositories/{pathv1}/{pathv2}/src?{query}",
239
+ "requestSchema": "schema.json",
240
+ "responseSchema": "schema.json",
241
+ "timeout": 0,
242
+ "sendEmpty": false,
243
+ "sendGetBody": false,
244
+ "requestDatatype": "URLENCODE",
245
+ "responseDatatype": "PLAIN",
246
+ "headers": {},
247
+ "responseObjects": [
248
+ {
249
+ "type": "default",
250
+ "key": "",
251
+ "mockFile": ""
252
+ }
253
+ ]
254
+ },
234
255
  {
235
256
  "name": "putRepositoriesUsernameRepoSlug",
236
257
  "protocol": "REST",
@@ -28,7 +28,8 @@
28
28
  "putRepositoriesUsernameRepoSlugCommitNodeStatusesBuildKey",
29
29
  "getRepositoriesUsernameRepoSlugForks",
30
30
  "getRepositoriesUsernameRepoSlugPullrequestsPullRequestIdStatuses",
31
- "getRepositoriesUsernameRepoSlugWatchers"
31
+ "getRepositoriesUsernameRepoSlugWatchers",
32
+ "CreateACommitByUploadingAFile"
32
33
  ],
33
34
  "external_name": "ph_request_type"
34
35
  },
package/error.json CHANGED
@@ -168,6 +168,12 @@
168
168
  "displayString": "Failure response received for $VARIABLE$",
169
169
  "recommendation": "Check the reason for failure in the stack trace"
170
170
  },
171
+ {
172
+ "key": "Suspended Adapter",
173
+ "icode": "AD.600",
174
+ "displayString": "Adapter is suspended",
175
+ "recommendation": "Check if external system is functional and unsuspend if appropriate"
176
+ },
171
177
  {
172
178
  "key": "Caught Exception",
173
179
  "icode": "AD.900",
package/package.json CHANGED
@@ -1,19 +1,31 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-bitbucket",
3
- "version": "0.3.2",
3
+ "version": "0.3.5",
4
4
  "description": "This adapter integrates with system described as: bitbucket.",
5
5
  "main": "adapter.js",
6
- "wizardVersion": "2.41.8",
7
- "engineVersion": "1.46.3",
6
+ "wizardVersion": "2.44.7",
7
+ "engineVersion": "1.59.55",
8
8
  "scripts": {
9
9
  "artifactize": "npm i && node utils/packModificationScript.js",
10
- "preinstall": "node utils/setup.js",
11
- "lint": "eslint . --ext .json --ext .js",
10
+ "preinstall": "node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions",
11
+ "lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
12
+ "lint:errors": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet",
13
+ "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
12
14
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
13
15
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
14
16
  "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
15
- "test": "npm run test:unit && npm run test:integration",
16
- "deploy": "npm publish --registry=http://registry.npmjs.org --access=public",
17
+ "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
18
+ "adapter:install": "npm i && node utils/tbScript.js install",
19
+ "adapter:checkMigrate": "node utils/checkMigrate.js",
20
+ "adapter:findPath": "node utils/findPath.js",
21
+ "adapter:migrate": "node utils/modify.js -m",
22
+ "adapter:update": "node utils/modify.js -u",
23
+ "adapter:revert": "node utils/modify.js -r",
24
+ "troubleshoot": "node utils/tbScript.js",
25
+ "healthcheck": "node utils/tbScript.js healthcheck",
26
+ "basicget": "node utils/tbScript.js basicget",
27
+ "connectivity": "node utils/tbScript.js connectivity",
28
+ "deploy": "npm publish --registry=https://registry.npmjs.org --access=public",
17
29
  "build": "npm run deploy"
18
30
  },
19
31
  "keywords": [
@@ -30,7 +42,8 @@
30
42
  ],
31
43
  "license": "Apache-2.0",
32
44
  "engines": {
33
- "node": ">= 0.12.7"
45
+ "node": ">= 8.0.0",
46
+ "npm": ">= 6.0.0"
34
47
  },
35
48
  "repository": {
36
49
  "type": "git",
@@ -39,23 +52,32 @@
39
52
  "author": "Itential",
40
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/devops-netops/adapter-bitbucket#readme",
41
54
  "dependencies": {
42
- "@itentialopensource/adapter-utils": "^4.27.3",
43
- "ajv": "^6.10.0",
44
- "fs-extra": "^7.0.0",
45
- "package-json-validator": "^0.6.3",
46
- "readline-sync": "^1.4.9",
47
- "xmldom": "^0.1.27"
55
+ "@itentialopensource/adapter-utils": "^4.44.11",
56
+ "ajv": "^6.12.0",
57
+ "axios": "^0.21.0",
58
+ "commander": "^2.20.0",
59
+ "fs-extra": "^8.1.0",
60
+ "mocha": "^9.0.1",
61
+ "mocha-param": "^2.0.1",
62
+ "mongodb": "^4.1.0",
63
+ "network-diagnostics": "^0.5.3",
64
+ "nyc": "^15.1.0",
65
+ "readline-sync": "^1.4.10",
66
+ "semver": "^7.3.2",
67
+ "winston": "^3.3.3"
48
68
  },
49
69
  "devDependencies": {
50
- "chai": "^4.1.2",
51
- "eslint": "^5.14.1",
52
- "eslint-config-airbnb-base": "^13.1.0",
53
- "eslint-plugin-import": "^2.16.0",
54
- "eslint-plugin-json": "^1.4.0",
55
- "mocha": "^5.2.0",
56
- "nyc": "^14.1.1",
57
- "testdouble": "^3.8.1",
58
- "winston": "^2.4.0"
70
+ "chai": "^4.3.4",
71
+ "eslint": "^7.29.0",
72
+ "eslint-config-airbnb-base": "^14.2.1",
73
+ "eslint-plugin-import": "^2.23.4",
74
+ "eslint-plugin-json": "^3.0.0",
75
+ "package-json-validator": "^0.6.3",
76
+ "testdouble": "^3.16.1"
77
+ },
78
+ "resolutions": {
79
+ "minimist": "^1.2.5"
59
80
  },
60
- "private": false
81
+ "private": false,
82
+ "adapterType": "http"
61
83
  }