@itentialopensource/adapter-jira 2.4.6 → 2.5.1

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 (45) hide show
  1. package/.eslintrc.js +1 -0
  2. package/AUTH.md +4 -4
  3. package/BROKER.md +4 -4
  4. package/CALLS.md +9 -9
  5. package/ENHANCE.md +3 -3
  6. package/PROPERTIES.md +24 -9
  7. package/README.md +24 -23
  8. package/SUMMARY.md +2 -2
  9. package/SYSTEMINFO.md +1 -1
  10. package/TAB1.md +2 -2
  11. package/TAB2.md +10 -6
  12. package/TROUBLESHOOT.md +10 -1
  13. package/UTILITIES.md +473 -0
  14. package/adapter.js +5 -5
  15. package/adapterBase.js +52 -16
  16. package/package.json +24 -28
  17. package/pronghorn.json +77 -44
  18. package/propertiesSchema.json +68 -7
  19. package/report/adapterInfo.json +7 -7
  20. package/report/auto-adapter-openapi.json +46082 -0
  21. package/report/updateReport1748556332709.json +120 -0
  22. package/sampleProperties.json +5 -1
  23. package/test/integration/adapterTestBasicGet.js +88 -54
  24. package/test/integration/adapterTestConnectivity.js +15 -16
  25. package/test/integration/adapterTestIntegration.js +1 -38
  26. package/test/unit/adapterBaseTestUnit.js +641 -39
  27. package/test/unit/adapterTestUnit.js +17 -54
  28. package/utils/adapterInfo.js +114 -164
  29. package/utils/argParser.js +44 -0
  30. package/utils/checkMigrate.js +77 -38
  31. package/utils/entitiesToDB.js +53 -42
  32. package/utils/logger.js +26 -0
  33. package/utils/modify.js +56 -55
  34. package/utils/mongoDbConnection.js +79 -0
  35. package/utils/mongoUtils.js +162 -0
  36. package/utils/taskMover.js +31 -32
  37. package/utils/tbScript.js +36 -172
  38. package/utils/tbUtils.js +84 -226
  39. package/utils/troubleshootingAdapter.js +68 -84
  40. package/utils/updateAdapterConfig.js +158 -0
  41. package/utils/addAuth.js +0 -94
  42. package/utils/artifactize.js +0 -146
  43. package/utils/basicGet.js +0 -50
  44. package/utils/packModificationScript.js +0 -35
  45. package/utils/patches2bundledDeps.js +0 -90
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-jira",
3
- "version": "2.4.6",
3
+ "version": "2.5.1",
4
4
  "description": "This adapter integrates with system Jira",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Jira",
7
7
  "wizardVersion": "2.44.7",
8
- "engineVersion": "1.68.2",
8
+ "engineVersion": "1.69.14",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
- "artifactize": "npm i && node utils/packModificationScript.js",
12
11
  "preinstall": "node utils/setup.js",
13
12
  "deinstall": "node utils/removeHooks.js",
14
13
  "lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
@@ -18,7 +17,6 @@
18
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
19
18
  "test:system": "nyc --reporter html --reporter text mocha test/integration/adapterTestIntegration.js --LOG=error -g \"System Integration Tests\"",
20
19
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
21
- "adapter:install": "npm i && node utils/tbScript.js install",
22
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
23
21
  "adapter:findPath": "node utils/findPath.js",
24
22
  "adapter:migrate": "node utils/modify.js -m",
@@ -33,10 +31,9 @@
33
31
  },
34
32
  "keywords": [
35
33
  "Itential",
36
- "IAP",
34
+ "Itential Platform",
37
35
  "Automation",
38
36
  "Integration",
39
- "App-Artifacts",
40
37
  "Adapter",
41
38
  "ITSM",
42
39
  "Testing",
@@ -55,30 +52,29 @@
55
52
  "author": "Itential",
56
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-jira#readme",
57
54
  "dependencies": {
58
- "@itentialopensource/adapter-utils": "^5.9.4",
59
- "acorn": "^8.12.1",
60
- "ajv": "^8.17.1",
61
- "axios": "^1.8.2",
62
- "commander": "^11.0.0",
63
- "dns-lookup-promise": "^1.0.4",
64
- "fs-extra": "^11.2.0",
65
- "json-query": "^2.2.2",
66
- "mocha": "^10.7.3",
67
- "mocha-param": "^2.0.1",
68
- "mongodb": "^4.16.0",
69
- "ping": "^0.4.4",
70
- "prompts": "^2.4.2",
71
- "readline-sync": "^1.4.10",
72
- "semver": "^7.6.3",
73
- "winston": "^3.14.2"
55
+ "@itentialopensource/adapter-utils": "5.10.19",
56
+ "acorn": "8.14.1",
57
+ "ajv": "8.17.1",
58
+ "axios": "1.9.0",
59
+ "commander": "11.1.0",
60
+ "fs-extra": "11.3.0",
61
+ "json-query": "2.2.2",
62
+ "mocha": "10.8.2",
63
+ "mocha-param": "2.0.1",
64
+ "mongodb": "4.17.2",
65
+ "ping": "0.4.4",
66
+ "prompts": "2.4.2",
67
+ "readline-sync": "1.4.10",
68
+ "semver": "7.7.2",
69
+ "winston": "3.17.0"
74
70
  },
75
71
  "devDependencies": {
76
- "chai": "^4.3.7",
77
- "eslint": "^8.44.0",
78
- "eslint-config-airbnb-base": "^15.0.0",
79
- "eslint-plugin-import": "^2.27.5",
80
- "eslint-plugin-json": "^3.1.0",
81
- "testdouble": "^3.18.0"
72
+ "chai": "4.5.0",
73
+ "eslint": "8.57.0",
74
+ "eslint-config-airbnb-base": "15.0.0",
75
+ "eslint-plugin-import": "2.31.0",
76
+ "eslint-plugin-json": "3.1.0",
77
+ "testdouble": "3.18.0"
82
78
  },
83
79
  "private": false
84
80
  }
package/pronghorn.json CHANGED
@@ -226,16 +226,6 @@
226
226
  "title": "props",
227
227
  "type": "object"
228
228
  }
229
- },
230
- {
231
- "name": "persistFlag",
232
- "type": "boolean",
233
- "info": "Whether the input properties should be saved",
234
- "required": true,
235
- "schema": {
236
- "title": "persistFlag",
237
- "type": "boolean"
238
- }
239
229
  }
240
230
  ],
241
231
  "output": {
@@ -306,7 +296,19 @@
306
296
  "name": "iapRunAdapterBasicGet",
307
297
  "summary": "Runs basicGet script for adapter",
308
298
  "description": "Runs basicGet script for adapter",
309
- "input": [],
299
+ "input": [
300
+ {
301
+ "name": "maxCalls",
302
+ "required": false,
303
+ "type": "number",
304
+ "info": "How many GET endpoints to test (defaults to 5)",
305
+ "schema": {
306
+ "title": "maxCalls",
307
+ "type": "number",
308
+ "default": 5
309
+ }
310
+ }
311
+ ],
310
312
  "output": {
311
313
  "name": "result",
312
314
  "type": "object",
@@ -327,8 +329,8 @@
327
329
  },
328
330
  {
329
331
  "name": "iapMoveAdapterEntitiesToDB",
330
- "summary": "Moves entities from an adapter into the IAP database",
331
- "description": "Moves entities from an adapter into the IAP database",
332
+ "summary": "Moves entities from an adapter into the Itential Platform database",
333
+ "description": "Moves entities from an adapter into the Itential Platform database",
332
334
  "input": [],
333
335
  "output": {
334
336
  "name": "res",
@@ -42716,7 +42718,8 @@
42716
42718
  },
42717
42719
  "additionalProperties": false,
42718
42720
  "description": "Configuration of the announcement banner.",
42719
- "writeOnly": true }
42721
+ "writeOnly": true
42722
+ }
42720
42723
  }
42721
42724
  ],
42722
42725
  "output": {
@@ -42890,7 +42893,8 @@
42890
42893
  }
42891
42894
  },
42892
42895
  "additionalProperties": false,
42893
- "description": "Details of the settings for a dashboard gadget." }
42896
+ "description": "Details of the settings for a dashboard gadget."
42897
+ }
42894
42898
  }
42895
42899
  ],
42896
42900
  "output": {
@@ -42976,7 +42980,8 @@
42976
42980
  }
42977
42981
  },
42978
42982
  "additionalProperties": false,
42979
- "description": "The details of the gadget to update." }
42983
+ "description": "The details of the gadget to update."
42984
+ }
42980
42985
  }
42981
42986
  ],
42982
42987
  "output": {
@@ -43157,7 +43162,8 @@
43157
43162
  },
43158
43163
  "additionalProperties": false,
43159
43164
  "description": "The account ID of the new owner.",
43160
- "writeOnly": true }
43165
+ "writeOnly": true
43166
+ }
43161
43167
  }
43162
43168
  ],
43163
43169
  "output": {
@@ -43256,7 +43262,8 @@
43256
43262
  }
43257
43263
  },
43258
43264
  "additionalProperties": true,
43259
- "description": "Issue security scheme and it's details" }
43265
+ "description": "Issue security scheme and it's details"
43266
+ }
43260
43267
  }
43261
43268
  ],
43262
43269
  "output": {
@@ -43393,7 +43400,8 @@
43393
43400
  }
43394
43401
  },
43395
43402
  "additionalProperties": true,
43396
- "description": "Details of new default levels." }
43403
+ "description": "Details of new default levels."
43404
+ }
43397
43405
  }
43398
43406
  ],
43399
43407
  "output": {
@@ -43657,7 +43665,8 @@
43657
43665
  "description": "The name of the security scheme scheme. Must be unique."
43658
43666
  }
43659
43667
  },
43660
- "additionalProperties": false }
43668
+ "additionalProperties": false
43669
+ }
43661
43670
  }
43662
43671
  ],
43663
43672
  "output": {
@@ -43786,7 +43795,8 @@
43786
43795
  }
43787
43796
  }
43788
43797
  },
43789
- "additionalProperties": false }
43798
+ "additionalProperties": false
43799
+ }
43790
43800
  }
43791
43801
  ],
43792
43802
  "output": {
@@ -43852,7 +43862,8 @@
43852
43862
  }
43853
43863
  },
43854
43864
  "additionalProperties": true,
43855
- "description": "Details of issue security scheme level." }
43865
+ "description": "Details of issue security scheme level."
43866
+ }
43856
43867
  }
43857
43868
  ],
43858
43869
  "output": {
@@ -43987,7 +43998,8 @@
43987
43998
  }
43988
43999
  },
43989
44000
  "additionalProperties": false,
43990
- "description": "Details of issue security scheme level new members." }
44001
+ "description": "Details of issue security scheme level new members."
44002
+ }
43991
44003
  }
43992
44004
  ],
43993
44005
  "output": {
@@ -44106,7 +44118,8 @@
44106
44118
  },
44107
44119
  "additionalProperties": false,
44108
44120
  "description": "The list of JQL queries to sanitize for the given account IDs.",
44109
- "writeOnly": true }
44121
+ "writeOnly": true
44122
+ }
44110
44123
  }
44111
44124
  ],
44112
44125
  "output": {
@@ -44236,7 +44249,8 @@
44236
44249
  },
44237
44250
  "additionalProperties": false,
44238
44251
  "description": "List of pairs (id and value) for precomputation updates.",
44239
- "writeOnly": true }
44252
+ "writeOnly": true
44253
+ }
44240
44254
  }
44241
44255
  ],
44242
44256
  "output": {
@@ -44403,7 +44417,8 @@
44403
44417
  }
44404
44418
  },
44405
44419
  "additionalProperties": true,
44406
- "description": "Details of an notification scheme." }
44420
+ "description": "Details of an notification scheme."
44421
+ }
44407
44422
  }
44408
44423
  ],
44409
44424
  "output": {
@@ -44521,7 +44536,8 @@
44521
44536
  }
44522
44537
  },
44523
44538
  "additionalProperties": true,
44524
- "description": "Details of a notification scheme." }
44539
+ "description": "Details of a notification scheme."
44540
+ }
44525
44541
  }
44526
44542
  ],
44527
44543
  "output": {
@@ -44631,7 +44647,8 @@
44631
44647
  }
44632
44648
  },
44633
44649
  "additionalProperties": true,
44634
- "description": "Details of notifications which should be added to the notification scheme." }
44650
+ "description": "Details of notifications which should be added to the notification scheme."
44651
+ }
44635
44652
  }
44636
44653
  ],
44637
44654
  "output": {
@@ -44780,7 +44797,8 @@
44780
44797
  }
44781
44798
  },
44782
44799
  "additionalProperties": true,
44783
- "description": "Details of an issue priority." }
44800
+ "description": "Details of an issue priority."
44801
+ }
44784
44802
  }
44785
44803
  ],
44786
44804
  "output": {
@@ -44822,7 +44840,8 @@
44822
44840
  }
44823
44841
  },
44824
44842
  "additionalProperties": false,
44825
- "description": "The new default issue priority." }
44843
+ "description": "The new default issue priority."
44844
+ }
44826
44845
  }
44827
44846
  ],
44828
44847
  "output": {
@@ -44877,7 +44896,8 @@
44877
44896
  }
44878
44897
  },
44879
44898
  "additionalProperties": false,
44880
- "description": "Change the order of issue priorities." }
44899
+ "description": "Change the order of issue priorities."
44900
+ }
44881
44901
  }
44882
44902
  ],
44883
44903
  "output": {
@@ -45017,7 +45037,8 @@
45017
45037
  }
45018
45038
  },
45019
45039
  "additionalProperties": true,
45020
- "description": "Details of an issue priority." }
45040
+ "description": "Details of an issue priority."
45041
+ }
45021
45042
  }
45022
45043
  ],
45023
45044
  "output": {
@@ -45110,7 +45131,8 @@
45110
45131
  }
45111
45132
  },
45112
45133
  "additionalProperties": true,
45113
- "description": "Details of an issue resolution." }
45134
+ "description": "Details of an issue resolution."
45135
+ }
45114
45136
  }
45115
45137
  ],
45116
45138
  "output": {
@@ -45152,7 +45174,8 @@
45152
45174
  }
45153
45175
  },
45154
45176
  "additionalProperties": false,
45155
- "description": "The new default issue resolution." }
45177
+ "description": "The new default issue resolution."
45178
+ }
45156
45179
  }
45157
45180
  ],
45158
45181
  "output": {
@@ -45207,7 +45230,8 @@
45207
45230
  }
45208
45231
  },
45209
45232
  "additionalProperties": false,
45210
- "description": "Change the order of issue resolutions." }
45233
+ "description": "Change the order of issue resolutions."
45234
+ }
45211
45235
  }
45212
45236
  ],
45213
45237
  "output": {
@@ -45329,7 +45353,8 @@
45329
45353
  }
45330
45354
  },
45331
45355
  "additionalProperties": true,
45332
- "description": "Details of an issue resolution." }
45356
+ "description": "Details of an issue resolution."
45357
+ }
45333
45358
  }
45334
45359
  ],
45335
45360
  "output": {
@@ -45588,7 +45613,8 @@
45588
45613
  }
45589
45614
  },
45590
45615
  "additionalProperties": false,
45591
- "description": "The list of statuses that will be updated." }
45616
+ "description": "The list of statuses that will be updated."
45617
+ }
45592
45618
  }
45593
45619
  ],
45594
45620
  "output": {
@@ -45694,7 +45720,8 @@
45694
45720
  }
45695
45721
  },
45696
45722
  "additionalProperties": false,
45697
- "description": "Details of the statuses being created and their scope." }
45723
+ "description": "Details of the statuses being created and their scope."
45724
+ }
45698
45725
  }
45699
45726
  ],
45700
45727
  "output": {
@@ -46052,7 +46079,8 @@
46052
46079
  }
46053
46080
  },
46054
46081
  "additionalProperties": false,
46055
- "description": "The details of a UI modification." }
46082
+ "description": "The details of a UI modification."
46083
+ }
46056
46084
  }
46057
46085
  ],
46058
46086
  "output": {
@@ -46148,7 +46176,8 @@
46148
46176
  }
46149
46177
  },
46150
46178
  "additionalProperties": false,
46151
- "description": "The details of a UI modification." }
46179
+ "description": "The details of a UI modification."
46180
+ }
46152
46181
  }
46153
46182
  ],
46154
46183
  "output": {
@@ -46559,7 +46588,8 @@
46559
46588
  "key": "dynamic-select-field"
46560
46589
  }
46561
46590
  ]
46562
- } }
46591
+ }
46592
+ }
46563
46593
  }
46564
46594
  ],
46565
46595
  "output": {
@@ -46686,7 +46716,8 @@
46686
46716
  },
46687
46717
  "additionalProperties": false,
46688
46718
  "description": "Details of updates for a custom field.",
46689
- "writeOnly": true }
46719
+ "writeOnly": true
46720
+ }
46690
46721
  }
46691
46722
  ],
46692
46723
  "output": {
@@ -46733,7 +46764,8 @@
46733
46764
  "type": "array",
46734
46765
  "items": {
46735
46766
  "type": "object"
46736
- } }
46767
+ }
46768
+ }
46737
46769
  }
46738
46770
  ],
46739
46771
  "output": {
@@ -46793,7 +46825,8 @@
46793
46825
  "example": "a498d711-685d-428d-8c3e-bc03bb450ea7"
46794
46826
  }
46795
46827
  },
46796
- "description": "Details of the workflow and its transition rules." }
46828
+ "description": "Details of the workflow and its transition rules."
46829
+ }
46797
46830
  }
46798
46831
  ],
46799
46832
  "output": {
@@ -764,6 +764,14 @@
764
764
  "security/ca.pem"
765
765
  ]
766
766
  },
767
+ "ca_file_content": {
768
+ "type": "string",
769
+ "description": "The content of the CA file used for SSL",
770
+ "default": "",
771
+ "examples": [
772
+ "-----BEGIN CERTIFICATE-----"
773
+ ]
774
+ },
767
775
  "key_file": {
768
776
  "type": "string",
769
777
  "description": "The fully qualified path name to the key file used for SSL",
@@ -853,32 +861,48 @@
853
861
  "mongo": {
854
862
  "type": "object",
855
863
  "properties": {
864
+ "url": {
865
+ "type": "string",
866
+ "description": "Mongo's complete connection URL. This property overrides host, port, database, username, password and replSet settings.",
867
+ "examples": [
868
+ "mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]",
869
+ "mongodb+srv://[username:password@]cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]",
870
+ "mongodb+srv://cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]"
871
+ ]
872
+ },
856
873
  "host": {
857
874
  "type": "string",
858
- "description": "host where mongo database can be found",
875
+ "description": "Host information for the Mongo server",
859
876
  "default": "",
860
877
  "examples": [
861
- "localhost"
878
+ "localhost",
879
+ "cluster0.xxxxx.mongodb.net",
880
+ "my-cluster.example.com"
862
881
  ]
863
882
  },
864
883
  "port": {
865
884
  "type": "integer",
866
- "description": "port on which to connect to the mongo database",
885
+ "description": "Port information for the Mongo server. Not used when using mongodb+srv:// protocol",
867
886
  "default": 443,
868
887
  "minimum": 0,
869
888
  "maximum": 65535
870
889
  },
871
890
  "database": {
872
891
  "type": "string",
873
- "description": "The name of the database to store adapter information in",
892
+ "description": "The database for the adapter to use for its data.",
874
893
  "default": "",
875
894
  "examples": [
876
895
  "adapter-xyz"
877
896
  ]
878
897
  },
898
+ "dbAuth": {
899
+ "type": "boolean",
900
+ "description": "Whether to use authentication for MongoDB connection. Default is false.",
901
+ "default": false
902
+ },
879
903
  "username": {
880
904
  "type": "string",
881
- "description": "The user to connect to the database with",
905
+ "description": "If credentials are required to access Mongo, this is the user to login as.",
882
906
  "default": "",
883
907
  "examples": [
884
908
  "username"
@@ -886,7 +910,7 @@
886
910
  },
887
911
  "password": {
888
912
  "type": "string",
889
- "description": "The password to connect to the database with",
913
+ "description": "If credentials are required to access Mongo, this is the password to login with.",
890
914
  "default": "",
891
915
  "examples": [
892
916
  "password"
@@ -894,12 +918,17 @@
894
918
  },
895
919
  "replSet": {
896
920
  "type": "string",
897
- "description": "The replica set for the database",
921
+ "description": "If the database is set up to use replica sets, define it here so it can be added to the database connection. Not used when using mongodb+srv:// protocol",
898
922
  "default": "",
899
923
  "examples": [
900
924
  "my_repolica_set"
901
925
  ]
902
926
  },
927
+ "addSrv": {
928
+ "type": "boolean",
929
+ "description": "Whether the connection requires the mongodb+srv:// protocol. If true, uses mongodb+srv:// protocol. Note: mongodb+srv:// can also be used for non-Atlas deployments that support DNS SRV records",
930
+ "default": false
931
+ },
903
932
  "db_ssl": {
904
933
  "type": "object",
905
934
  "description": "SSL for mongo database connection",
@@ -940,6 +969,38 @@
940
969
  }
941
970
  }
942
971
  }
972
+ },
973
+ "dependencies": {
974
+ "dbAuth": {
975
+ "oneOf": [
976
+ {
977
+ "properties": {
978
+ "dbAuth": {
979
+ "const": false
980
+ }
981
+ }
982
+ },
983
+ {
984
+ "properties": {
985
+ "dbAuth": {
986
+ "const": true
987
+ },
988
+ "username": {
989
+ "type": "string",
990
+ "minLength": 1
991
+ },
992
+ "password": {
993
+ "type": "string",
994
+ "minLength": 1
995
+ }
996
+ },
997
+ "required": [
998
+ "username",
999
+ "password"
1000
+ ]
1001
+ }
1002
+ ]
1003
+ }
943
1004
  }
944
1005
  },
945
1006
  "devicebroker": {
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "2.4.2",
3
- "configLines": 48673,
4
- "scriptLines": 1783,
5
- "codeLines": 39944,
6
- "testLines": 37264,
7
- "testCases": 1747,
8
- "totalCodeLines": 78991,
2
+ "version": "2.4.6",
3
+ "configLines": 61983,
4
+ "scriptLines": 2498,
5
+ "codeLines": 39980,
6
+ "testLines": 37825,
7
+ "testCases": 1760,
8
+ "totalCodeLines": 80303,
9
9
  "wfTasks": 528
10
10
  }