@itentialopensource/adapter-sendgrid 0.1.2 → 0.2.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 (44) 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 +9 -5
  12. package/TROUBLESHOOT.md +10 -1
  13. package/UTILITIES.md +473 -0
  14. package/adapter.js +12 -12
  15. package/adapterBase.js +52 -16
  16. package/package.json +25 -29
  17. package/pronghorn.json +349 -347
  18. package/propertiesSchema.json +196 -43
  19. package/report/adapterInfo.json +7 -7
  20. package/report/updateReport1748553308645.json +120 -0
  21. package/sampleProperties.json +4 -0
  22. package/test/integration/adapterTestBasicGet.js +88 -54
  23. package/test/integration/adapterTestConnectivity.js +15 -16
  24. package/test/integration/adapterTestIntegration.js +1 -38
  25. package/test/unit/adapterBaseTestUnit.js +641 -39
  26. package/test/unit/adapterTestUnit.js +23 -54
  27. package/utils/adapterInfo.js +114 -164
  28. package/utils/argParser.js +44 -0
  29. package/utils/checkMigrate.js +77 -38
  30. package/utils/entitiesToDB.js +53 -42
  31. package/utils/logger.js +26 -0
  32. package/utils/modify.js +56 -55
  33. package/utils/mongoDbConnection.js +79 -0
  34. package/utils/mongoUtils.js +162 -0
  35. package/utils/taskMover.js +31 -32
  36. package/utils/tbScript.js +36 -172
  37. package/utils/tbUtils.js +84 -226
  38. package/utils/troubleshootingAdapter.js +68 -84
  39. package/utils/updateAdapterConfig.js +158 -0
  40. package/utils/addAuth.js +0 -94
  41. package/utils/artifactize.js +0 -146
  42. package/utils/basicGet.js +0 -50
  43. package/utils/packModificationScript.js +0 -35
  44. package/utils/patches2bundledDeps.js +0 -90
@@ -83,10 +83,10 @@
83
83
  "https"
84
84
  ]
85
85
  },
86
- "service" : {
87
- "type" : "string",
86
+ "service": {
87
+ "type": "string",
88
88
  "description": "Service we are integrating with -- used with AWS Authentication",
89
- "examples" : [
89
+ "examples": [
90
90
  "ec2",
91
91
  "route53"
92
92
  ]
@@ -290,7 +290,9 @@
290
290
  "description": "the protocol to request token from system",
291
291
  "default": "",
292
292
  "enum": [
293
- "http", "https", ""
293
+ "http",
294
+ "https",
295
+ ""
294
296
  ]
295
297
  },
296
298
  "host": {
@@ -329,7 +331,7 @@
329
331
  "responseFields": {
330
332
  "type": "object",
331
333
  "description": "The fields from the step result"
332
- },
334
+ },
333
335
  "successfullResponseCode": {
334
336
  "type": "integer",
335
337
  "description": "Expected response code for given step, if not set any successfull http response is accepted",
@@ -762,6 +764,14 @@
762
764
  "security/ca.pem"
763
765
  ]
764
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
+ },
765
775
  "key_file": {
766
776
  "type": "string",
767
777
  "description": "The fully qualified path name to the key file used for SSL",
@@ -851,32 +861,48 @@
851
861
  "mongo": {
852
862
  "type": "object",
853
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
+ },
854
873
  "host": {
855
874
  "type": "string",
856
- "description": "host where mongo database can be found",
875
+ "description": "Host information for the Mongo server",
857
876
  "default": "",
858
877
  "examples": [
859
- "localhost"
878
+ "localhost",
879
+ "cluster0.xxxxx.mongodb.net",
880
+ "my-cluster.example.com"
860
881
  ]
861
882
  },
862
883
  "port": {
863
884
  "type": "integer",
864
- "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",
865
886
  "default": 443,
866
887
  "minimum": 0,
867
888
  "maximum": 65535
868
889
  },
869
890
  "database": {
870
891
  "type": "string",
871
- "description": "The name of the database to store adapter information in",
892
+ "description": "The database for the adapter to use for its data.",
872
893
  "default": "",
873
894
  "examples": [
874
895
  "adapter-xyz"
875
896
  ]
876
897
  },
898
+ "dbAuth": {
899
+ "type": "boolean",
900
+ "description": "Whether to use authentication for MongoDB connection. Default is false.",
901
+ "default": false
902
+ },
877
903
  "username": {
878
904
  "type": "string",
879
- "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.",
880
906
  "default": "",
881
907
  "examples": [
882
908
  "username"
@@ -884,7 +910,7 @@
884
910
  },
885
911
  "password": {
886
912
  "type": "string",
887
- "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.",
888
914
  "default": "",
889
915
  "examples": [
890
916
  "password"
@@ -892,12 +918,17 @@
892
918
  },
893
919
  "replSet": {
894
920
  "type": "string",
895
- "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",
896
922
  "default": "",
897
923
  "examples": [
898
924
  "my_repolica_set"
899
925
  ]
900
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
+ },
901
932
  "db_ssl": {
902
933
  "type": "object",
903
934
  "description": "SSL for mongo database connection",
@@ -938,6 +969,38 @@
938
969
  }
939
970
  }
940
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
+ }
941
1004
  }
942
1005
  },
943
1006
  "devicebroker": {
@@ -968,21 +1031,30 @@
968
1031
  "type": "object",
969
1032
  "description": "The json object with query parameters of the call to getDevice",
970
1033
  "additionalProperties": {
971
- "type": ["string", "number"]
1034
+ "type": [
1035
+ "string",
1036
+ "number"
1037
+ ]
972
1038
  }
973
1039
  },
974
1040
  "body": {
975
1041
  "type": "object",
976
1042
  "description": "The json object with body of the call to getDevice",
977
1043
  "additionalProperties": {
978
- "type": ["string", "number"]
1044
+ "type": [
1045
+ "string",
1046
+ "number"
1047
+ ]
979
1048
  }
980
1049
  },
981
1050
  "headers": {
982
1051
  "type": "object",
983
1052
  "description": "The json object with headers of the call to getDevice",
984
1053
  "additionalProperties": {
985
- "type": ["string", "number"]
1054
+ "type": [
1055
+ "string",
1056
+ "number"
1057
+ ]
986
1058
  }
987
1059
  },
988
1060
  "handleFailure": {
@@ -998,7 +1070,10 @@
998
1070
  "type": "object",
999
1071
  "description": "The json object with response fields of the call to getDevice",
1000
1072
  "additionalProperties": {
1001
- "type": ["string", "number"]
1073
+ "type": [
1074
+ "string",
1075
+ "number"
1076
+ ]
1002
1077
  },
1003
1078
  "properties": {}
1004
1079
  },
@@ -1011,7 +1086,10 @@
1011
1086
  "type": "object",
1012
1087
  "description": "The json object with response fields of the call to getDevice",
1013
1088
  "additionalProperties": {
1014
- "type": ["string", "number"]
1089
+ "type": [
1090
+ "string",
1091
+ "number"
1092
+ ]
1015
1093
  },
1016
1094
  "properties": {
1017
1095
  "name": {
@@ -1096,21 +1174,30 @@
1096
1174
  "type": "object",
1097
1175
  "description": "The json object with query parameters of the call to getDevicesFiltered",
1098
1176
  "additionalProperties": {
1099
- "type": ["string", "number"]
1177
+ "type": [
1178
+ "string",
1179
+ "number"
1180
+ ]
1100
1181
  }
1101
1182
  },
1102
1183
  "body": {
1103
1184
  "type": "object",
1104
1185
  "description": "The json object with body of the call to getDevicesFiltered",
1105
1186
  "additionalProperties": {
1106
- "type": ["string", "number"]
1187
+ "type": [
1188
+ "string",
1189
+ "number"
1190
+ ]
1107
1191
  }
1108
1192
  },
1109
1193
  "headers": {
1110
1194
  "type": "object",
1111
1195
  "description": "The json object with headers of the call to getDevicesFiltered",
1112
1196
  "additionalProperties": {
1113
- "type": ["string", "number"]
1197
+ "type": [
1198
+ "string",
1199
+ "number"
1200
+ ]
1114
1201
  }
1115
1202
  },
1116
1203
  "handleFailure": {
@@ -1126,7 +1213,10 @@
1126
1213
  "type": "object",
1127
1214
  "description": "The json object with response fields of the call to getDevice",
1128
1215
  "additionalProperties": {
1129
- "type": ["string", "number"]
1216
+ "type": [
1217
+ "string",
1218
+ "number"
1219
+ ]
1130
1220
  },
1131
1221
  "properties": {}
1132
1222
  },
@@ -1139,7 +1229,10 @@
1139
1229
  "type": "object",
1140
1230
  "description": "The json object with response fields of the call to getDevicesFiltered",
1141
1231
  "additionalProperties": {
1142
- "type": ["string", "number"]
1232
+ "type": [
1233
+ "string",
1234
+ "number"
1235
+ ]
1143
1236
  },
1144
1237
  "properties": {
1145
1238
  "name": {
@@ -1192,21 +1285,30 @@
1192
1285
  "type": "object",
1193
1286
  "description": "The json object with query parameters of the call to isAlive",
1194
1287
  "additionalProperties": {
1195
- "type": ["string", "number"]
1288
+ "type": [
1289
+ "string",
1290
+ "number"
1291
+ ]
1196
1292
  }
1197
1293
  },
1198
1294
  "body": {
1199
1295
  "type": "object",
1200
1296
  "description": "The json object with body of the call to isAlive",
1201
1297
  "additionalProperties": {
1202
- "type": ["string", "number"]
1298
+ "type": [
1299
+ "string",
1300
+ "number"
1301
+ ]
1203
1302
  }
1204
1303
  },
1205
1304
  "headers": {
1206
1305
  "type": "object",
1207
1306
  "description": "The json object with headers of the call to isAlive",
1208
1307
  "additionalProperties": {
1209
- "type": ["string", "number"]
1308
+ "type": [
1309
+ "string",
1310
+ "number"
1311
+ ]
1210
1312
  }
1211
1313
  },
1212
1314
  "handleFailure": {
@@ -1222,7 +1324,10 @@
1222
1324
  "type": "object",
1223
1325
  "description": "The json object with response fields of the call to getDevice",
1224
1326
  "additionalProperties": {
1225
- "type": ["string", "number"]
1327
+ "type": [
1328
+ "string",
1329
+ "number"
1330
+ ]
1226
1331
  },
1227
1332
  "properties": {}
1228
1333
  },
@@ -1235,7 +1340,10 @@
1235
1340
  "type": "object",
1236
1341
  "description": "The json object with response fields of the call to isAlive",
1237
1342
  "additionalProperties": {
1238
- "type": ["string", "number"]
1343
+ "type": [
1344
+ "string",
1345
+ "number"
1346
+ ]
1239
1347
  },
1240
1348
  "properties": {
1241
1349
  "status": {
@@ -1273,21 +1381,30 @@
1273
1381
  "type": "object",
1274
1382
  "description": "The json object with query parameters of the call to getConfig",
1275
1383
  "additionalProperties": {
1276
- "type": ["string", "number"]
1384
+ "type": [
1385
+ "string",
1386
+ "number"
1387
+ ]
1277
1388
  }
1278
1389
  },
1279
1390
  "body": {
1280
1391
  "type": "object",
1281
1392
  "description": "The json object with body of the call to getConfig",
1282
1393
  "additionalProperties": {
1283
- "type": ["string", "number"]
1394
+ "type": [
1395
+ "string",
1396
+ "number"
1397
+ ]
1284
1398
  }
1285
1399
  },
1286
1400
  "headers": {
1287
1401
  "type": "object",
1288
1402
  "description": "The json object with headers of the call to getConfig",
1289
1403
  "additionalProperties": {
1290
- "type": ["string", "number"]
1404
+ "type": [
1405
+ "string",
1406
+ "number"
1407
+ ]
1291
1408
  }
1292
1409
  },
1293
1410
  "handleFailure": {
@@ -1303,7 +1420,10 @@
1303
1420
  "type": "object",
1304
1421
  "description": "The json object with response fields of the call to getDevice",
1305
1422
  "additionalProperties": {
1306
- "type": ["string", "number"]
1423
+ "type": [
1424
+ "string",
1425
+ "number"
1426
+ ]
1307
1427
  },
1308
1428
  "properties": {}
1309
1429
  },
@@ -1316,7 +1436,10 @@
1316
1436
  "type": "object",
1317
1437
  "description": "The json object with response fields of the call to getConfig",
1318
1438
  "additionalProperties": {
1319
- "type": ["string", "number"]
1439
+ "type": [
1440
+ "string",
1441
+ "number"
1442
+ ]
1320
1443
  },
1321
1444
  "properties": {}
1322
1445
  }
@@ -1343,21 +1466,30 @@
1343
1466
  "type": "object",
1344
1467
  "description": "The json object with query parameters of the call to getCount",
1345
1468
  "additionalProperties": {
1346
- "type": ["string", "number"]
1469
+ "type": [
1470
+ "string",
1471
+ "number"
1472
+ ]
1347
1473
  }
1348
1474
  },
1349
1475
  "body": {
1350
1476
  "type": "object",
1351
1477
  "description": "The json object with body of the call to getCount",
1352
1478
  "additionalProperties": {
1353
- "type": ["string", "number"]
1479
+ "type": [
1480
+ "string",
1481
+ "number"
1482
+ ]
1354
1483
  }
1355
1484
  },
1356
1485
  "headers": {
1357
1486
  "type": "object",
1358
1487
  "description": "The json object with headers of the call to getCount",
1359
1488
  "additionalProperties": {
1360
- "type": ["string", "number"]
1489
+ "type": [
1490
+ "string",
1491
+ "number"
1492
+ ]
1361
1493
  }
1362
1494
  },
1363
1495
  "handleFailure": {
@@ -1373,7 +1505,10 @@
1373
1505
  "type": "object",
1374
1506
  "description": "The json object with response fields of the call to getDevice",
1375
1507
  "additionalProperties": {
1376
- "type": ["string", "number"]
1508
+ "type": [
1509
+ "string",
1510
+ "number"
1511
+ ]
1377
1512
  },
1378
1513
  "properties": {}
1379
1514
  },
@@ -1386,7 +1521,10 @@
1386
1521
  "type": "object",
1387
1522
  "description": "The json object with response fields of the call to getConfig",
1388
1523
  "additionalProperties": {
1389
- "type": ["string", "number"]
1524
+ "type": [
1525
+ "string",
1526
+ "number"
1527
+ ]
1390
1528
  },
1391
1529
  "properties": {}
1392
1530
  }
@@ -1492,21 +1630,30 @@
1492
1630
  "type": "object",
1493
1631
  "description": "The json object with query parameters of the call to getDevice",
1494
1632
  "additionalProperties": {
1495
- "type": ["string", "number"]
1633
+ "type": [
1634
+ "string",
1635
+ "number"
1636
+ ]
1496
1637
  }
1497
1638
  },
1498
1639
  "body": {
1499
1640
  "type": "object",
1500
1641
  "description": "The json object with body of the call to getDevice",
1501
1642
  "additionalProperties": {
1502
- "type": ["string", "number"]
1643
+ "type": [
1644
+ "string",
1645
+ "number"
1646
+ ]
1503
1647
  }
1504
1648
  },
1505
1649
  "headers": {
1506
1650
  "type": "object",
1507
1651
  "description": "The json object with headers of the call to getDevice",
1508
1652
  "additionalProperties": {
1509
- "type": ["string", "number"]
1653
+ "type": [
1654
+ "string",
1655
+ "number"
1656
+ ]
1510
1657
  }
1511
1658
  },
1512
1659
  "handleFailure": {
@@ -1522,7 +1669,10 @@
1522
1669
  "type": "object",
1523
1670
  "description": "The json object with response fields of the call to getDevice",
1524
1671
  "additionalProperties": {
1525
- "type": ["string", "number"]
1672
+ "type": [
1673
+ "string",
1674
+ "number"
1675
+ ]
1526
1676
  },
1527
1677
  "properties": {}
1528
1678
  },
@@ -1535,7 +1685,10 @@
1535
1685
  "type": "object",
1536
1686
  "description": "The json object with response fields of the call to getDevice",
1537
1687
  "additionalProperties": {
1538
- "type": ["string", "number"]
1688
+ "type": [
1689
+ "string",
1690
+ "number"
1691
+ ]
1539
1692
  }
1540
1693
  }
1541
1694
  }
@@ -1571,4 +1724,4 @@
1571
1724
  }
1572
1725
  }
1573
1726
  }
1574
- }
1727
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.0",
3
- "configLines": 19081,
4
- "scriptLines": 1783,
5
- "codeLines": 39487,
6
- "testLines": 19020,
7
- "testCases": 1001,
8
- "totalCodeLines": 60290,
2
+ "version": "0.1.2",
3
+ "configLines": 29218,
4
+ "scriptLines": 2498,
5
+ "codeLines": 39523,
6
+ "testLines": 19587,
7
+ "testCases": 1014,
8
+ "totalCodeLines": 61608,
9
9
  "wfTasks": 359
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 15
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 19
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "5.10.16"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 79
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 345
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 662
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 57
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 8661
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 589
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 9063
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 343
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1489
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 37
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 19213
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 932
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -95,18 +95,22 @@
95
95
  "enabled": false,
96
96
  "accept_invalid_cert": false,
97
97
  "ca_file": "",
98
+ "ca_file_content": "",
98
99
  "key_file": "",
99
100
  "cert_file": "",
100
101
  "secure_protocol": "",
101
102
  "ciphers": ""
102
103
  },
103
104
  "mongo": {
105
+ "url": "",
104
106
  "host": "",
105
107
  "port": 0,
106
108
  "database": "",
109
+ "dbAuth": false,
107
110
  "username": "",
108
111
  "password": "",
109
112
  "replSet": "",
113
+ "addSrv": false,
110
114
  "db_ssl": {
111
115
  "enabled": false,
112
116
  "accept_invalid_cert": false,