@itentialopensource/adapter-aws_lambda 0.1.2 → 0.2.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/.eslintignore CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  .nyc_output/*
3
2
  backup/*
4
3
  coverage/*
package/.jshintrc CHANGED
@@ -0,0 +1,3 @@
1
+ {
2
+ "esversion": 6
3
+ }
package/PROPERTIES.md CHANGED
@@ -29,7 +29,10 @@ This section defines **all** the properties that are available for the adapter,
29
29
  "auth_logging": false,
30
30
  "client_id": "",
31
31
  "client_secret": "",
32
- "grant_type": ""
32
+ "grant_type": "",
33
+ "auth_request_datatype": "",
34
+ "auth_response_datatype": "",
35
+ "token_response_placement": ""
33
36
  },
34
37
  "healthcheck": {
35
38
  "type": "startup",
@@ -283,6 +286,18 @@ The following properties are used to define the authentication process to Aws_la
283
286
  <td style="padding:15px">grant_type</td>
284
287
  <td style="padding:15px">Provide a grant type when needed, this is common on some types of OAuth.</td>
285
288
  </tr>
289
+ <tr>
290
+ <td style="padding:15px">auth_request_datatype</td>
291
+ <td style="padding:15px">Override the request data type for token authentication requests. When set, this overrides the schema's requestDatatype (JSON, JSON2XML, PLAIN, XML, URLENCODE, URLQUERY, FORM).</td>
292
+ </tr>
293
+ <tr>
294
+ <td style="padding:15px">auth_response_datatype</td>
295
+ <td style="padding:15px">Override the response data type for token authentication requests. When set, this overrides the schema's responseDatatype (JSON, XML2JSON, PLAIN, XML, URLENCODE).</td>
296
+ </tr>
297
+ <tr>
298
+ <td style="padding:15px">token_response_placement</td>
299
+ <td style="padding:15px">Override where to extract the token from the authentication response (HEADER or BODY). When set, this overrides the schema's token placement setting.</td>
300
+ </tr>
286
301
  </table>
287
302
  <br>
288
303
 
package/adapterBase.js CHANGED
@@ -1246,6 +1246,44 @@ class AdapterBase extends EventEmitterCl {
1246
1246
  return this.requestHandlerInst.iapGetDeviceCountAuth(callOptions, callback);
1247
1247
  }
1248
1248
 
1249
+ /**
1250
+ * @summary Parse and merge iapMetadata fields into reqObj
1251
+ *
1252
+ * @function parseIapMetadata
1253
+ * @param {Object} reqObj - the request object to merge metadata into
1254
+ * @param {Object} iapMetadata - the metadata object to parse and merge
1255
+ */
1256
+ parseIapMetadata(reqObj, iapMetadata) {
1257
+ const reqFields = ['payload', 'uriPathVars', 'uriQuery', 'uriOptions', 'addlHeaders', 'authData', 'callProperties', 'filter', 'priority', 'event'];
1258
+
1259
+ const result = { ...reqObj };
1260
+
1261
+ // Merge and add new iapMetadata fields in result
1262
+ Object.keys(iapMetadata).forEach((iapField) => {
1263
+ if (reqFields.includes(iapField) && iapMetadata[iapField]) {
1264
+ if (Array.isArray(result[iapField]) && Array.isArray(iapMetadata[iapField])) {
1265
+ result[iapField] = result[iapField].concat(iapMetadata[iapField]); // Merge arrays
1266
+ } else if (
1267
+ result[iapField]
1268
+ && iapMetadata[iapField]
1269
+ && typeof result[iapField] === 'object'
1270
+ && typeof iapMetadata[iapField] === 'object'
1271
+ && !Array.isArray(result[iapField])
1272
+ && !Array.isArray(iapMetadata[iapField])
1273
+ ) {
1274
+ result[iapField] = { ...result[iapField], ...iapMetadata[iapField] }; // Merge objects
1275
+ } else {
1276
+ // Otherwise, add new iapMetadata fields to result
1277
+ result[iapField] = iapMetadata[iapField];
1278
+ }
1279
+ }
1280
+ });
1281
+ // Add iapMetadata to result for further work
1282
+ result.iapMetadata = iapMetadata;
1283
+
1284
+ return result;
1285
+ }
1286
+
1249
1287
  /* ********************************************** */
1250
1288
  /* */
1251
1289
  /* EXPOSES GENERIC HANDLER */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-aws_lambda",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "This adapter integrates with system described as: awsLambda.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Aws_lambda",
7
- "wizardVersion": "3.3.12",
8
- "engineVersion": "1.70.1",
7
+ "wizardVersion": "3.8.0",
8
+ "engineVersion": "1.79.2",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
11
  "preinstall": "node utils/setup.js",
@@ -49,10 +49,10 @@
49
49
  "author": "Itential",
50
50
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-aws_lambda#readme",
51
51
  "dependencies": {
52
- "@itentialopensource/adapter-utils": "5.10.28",
52
+ "@itentialopensource/adapter-utils": "6.0.2",
53
53
  "acorn": "8.14.1",
54
54
  "ajv": "8.17.1",
55
- "axios": "1.12.0",
55
+ "axios": "1.12.2",
56
56
  "commander": "11.1.0",
57
57
  "fs-extra": "11.3.0",
58
58
  "json-query": "2.2.2",
@@ -7,6 +7,10 @@
7
7
  "type": "encryption",
8
8
  "pointer": "/authentication/token"
9
9
  },
10
+ {
11
+ "type": "encryption",
12
+ "pointer": "/authentication/client_secret"
13
+ },
10
14
  {
11
15
  "type": "encryption",
12
16
  "pointer": "/mongo/password"
@@ -77,16 +77,16 @@
77
77
  "protocol": {
78
78
  "type": "string",
79
79
  "description": "the protocol to use to connect to server",
80
- "default": "http",
80
+ "default": "https",
81
81
  "enum": [
82
82
  "http",
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
  ]
@@ -274,6 +274,44 @@
274
274
  "description": "The grant type for OAuth requests - can also provide in schema",
275
275
  "default": ""
276
276
  },
277
+ "auth_request_datatype": {
278
+ "type": "string",
279
+ "description": "Override the request data type for token authentication requests. When set, this overrides the schema's requestDatatype",
280
+ "default": "",
281
+ "enum": [
282
+ "",
283
+ "JSON",
284
+ "JSON2XML",
285
+ "PLAIN",
286
+ "XML",
287
+ "URLENCODE",
288
+ "URLQUERY",
289
+ "FORM"
290
+ ]
291
+ },
292
+ "auth_response_datatype": {
293
+ "type": "string",
294
+ "description": "Override the response data type for token authentication requests. When set, this overrides the schema's responseDatatype",
295
+ "default": "",
296
+ "enum": [
297
+ "",
298
+ "JSON",
299
+ "XML2JSON",
300
+ "PLAIN",
301
+ "XML",
302
+ "URLENCODE"
303
+ ]
304
+ },
305
+ "token_response_placement": {
306
+ "type": "string",
307
+ "description": "Override where to extract the token from the authentication response (HEADER or BODY). When set, this overrides the schema's token placement setting",
308
+ "default": "",
309
+ "enum": [
310
+ "",
311
+ "HEADER",
312
+ "BODY"
313
+ ]
314
+ },
277
315
  "sensitive": {
278
316
  "type": "array",
279
317
  "description": "List of sensitive keys to search and hide values from being logged",
@@ -290,7 +328,9 @@
290
328
  "description": "the protocol to request token from system",
291
329
  "default": "",
292
330
  "enum": [
293
- "http", "https", ""
331
+ "http",
332
+ "https",
333
+ ""
294
334
  ]
295
335
  },
296
336
  "host": {
@@ -329,7 +369,7 @@
329
369
  "responseFields": {
330
370
  "type": "object",
331
371
  "description": "The fields from the step result"
332
- },
372
+ },
333
373
  "successfullResponseCode": {
334
374
  "type": "integer",
335
375
  "description": "Expected response code for given step, if not set any successfull http response is accepted",
@@ -690,7 +730,7 @@
690
730
  "protocol": {
691
731
  "type": "string",
692
732
  "description": "the protocol to use to connect to the proxy",
693
- "default": "http",
733
+ "default": "https",
694
734
  "enum": [
695
735
  "http",
696
736
  "https",
@@ -1029,21 +1069,30 @@
1029
1069
  "type": "object",
1030
1070
  "description": "The json object with query parameters of the call to getDevice",
1031
1071
  "additionalProperties": {
1032
- "type": ["string", "number"]
1072
+ "type": [
1073
+ "string",
1074
+ "number"
1075
+ ]
1033
1076
  }
1034
1077
  },
1035
1078
  "body": {
1036
1079
  "type": "object",
1037
1080
  "description": "The json object with body of the call to getDevice",
1038
1081
  "additionalProperties": {
1039
- "type": ["string", "number"]
1082
+ "type": [
1083
+ "string",
1084
+ "number"
1085
+ ]
1040
1086
  }
1041
1087
  },
1042
1088
  "headers": {
1043
1089
  "type": "object",
1044
1090
  "description": "The json object with headers of the call to getDevice",
1045
1091
  "additionalProperties": {
1046
- "type": ["string", "number"]
1092
+ "type": [
1093
+ "string",
1094
+ "number"
1095
+ ]
1047
1096
  }
1048
1097
  },
1049
1098
  "handleFailure": {
@@ -1059,7 +1108,10 @@
1059
1108
  "type": "object",
1060
1109
  "description": "The json object with response fields of the call to getDevice",
1061
1110
  "additionalProperties": {
1062
- "type": ["string", "number"]
1111
+ "type": [
1112
+ "string",
1113
+ "number"
1114
+ ]
1063
1115
  },
1064
1116
  "properties": {}
1065
1117
  },
@@ -1072,7 +1124,10 @@
1072
1124
  "type": "object",
1073
1125
  "description": "The json object with response fields of the call to getDevice",
1074
1126
  "additionalProperties": {
1075
- "type": ["string", "number"]
1127
+ "type": [
1128
+ "string",
1129
+ "number"
1130
+ ]
1076
1131
  },
1077
1132
  "properties": {
1078
1133
  "name": {
@@ -1157,21 +1212,30 @@
1157
1212
  "type": "object",
1158
1213
  "description": "The json object with query parameters of the call to getDevicesFiltered",
1159
1214
  "additionalProperties": {
1160
- "type": ["string", "number"]
1215
+ "type": [
1216
+ "string",
1217
+ "number"
1218
+ ]
1161
1219
  }
1162
1220
  },
1163
1221
  "body": {
1164
1222
  "type": "object",
1165
1223
  "description": "The json object with body of the call to getDevicesFiltered",
1166
1224
  "additionalProperties": {
1167
- "type": ["string", "number"]
1225
+ "type": [
1226
+ "string",
1227
+ "number"
1228
+ ]
1168
1229
  }
1169
1230
  },
1170
1231
  "headers": {
1171
1232
  "type": "object",
1172
1233
  "description": "The json object with headers of the call to getDevicesFiltered",
1173
1234
  "additionalProperties": {
1174
- "type": ["string", "number"]
1235
+ "type": [
1236
+ "string",
1237
+ "number"
1238
+ ]
1175
1239
  }
1176
1240
  },
1177
1241
  "handleFailure": {
@@ -1187,7 +1251,10 @@
1187
1251
  "type": "object",
1188
1252
  "description": "The json object with response fields of the call to getDevice",
1189
1253
  "additionalProperties": {
1190
- "type": ["string", "number"]
1254
+ "type": [
1255
+ "string",
1256
+ "number"
1257
+ ]
1191
1258
  },
1192
1259
  "properties": {}
1193
1260
  },
@@ -1200,7 +1267,10 @@
1200
1267
  "type": "object",
1201
1268
  "description": "The json object with response fields of the call to getDevicesFiltered",
1202
1269
  "additionalProperties": {
1203
- "type": ["string", "number"]
1270
+ "type": [
1271
+ "string",
1272
+ "number"
1273
+ ]
1204
1274
  },
1205
1275
  "properties": {
1206
1276
  "name": {
@@ -1253,21 +1323,30 @@
1253
1323
  "type": "object",
1254
1324
  "description": "The json object with query parameters of the call to isAlive",
1255
1325
  "additionalProperties": {
1256
- "type": ["string", "number"]
1326
+ "type": [
1327
+ "string",
1328
+ "number"
1329
+ ]
1257
1330
  }
1258
1331
  },
1259
1332
  "body": {
1260
1333
  "type": "object",
1261
1334
  "description": "The json object with body of the call to isAlive",
1262
1335
  "additionalProperties": {
1263
- "type": ["string", "number"]
1336
+ "type": [
1337
+ "string",
1338
+ "number"
1339
+ ]
1264
1340
  }
1265
1341
  },
1266
1342
  "headers": {
1267
1343
  "type": "object",
1268
1344
  "description": "The json object with headers of the call to isAlive",
1269
1345
  "additionalProperties": {
1270
- "type": ["string", "number"]
1346
+ "type": [
1347
+ "string",
1348
+ "number"
1349
+ ]
1271
1350
  }
1272
1351
  },
1273
1352
  "handleFailure": {
@@ -1283,7 +1362,10 @@
1283
1362
  "type": "object",
1284
1363
  "description": "The json object with response fields of the call to getDevice",
1285
1364
  "additionalProperties": {
1286
- "type": ["string", "number"]
1365
+ "type": [
1366
+ "string",
1367
+ "number"
1368
+ ]
1287
1369
  },
1288
1370
  "properties": {}
1289
1371
  },
@@ -1296,7 +1378,10 @@
1296
1378
  "type": "object",
1297
1379
  "description": "The json object with response fields of the call to isAlive",
1298
1380
  "additionalProperties": {
1299
- "type": ["string", "number"]
1381
+ "type": [
1382
+ "string",
1383
+ "number"
1384
+ ]
1300
1385
  },
1301
1386
  "properties": {
1302
1387
  "status": {
@@ -1334,21 +1419,30 @@
1334
1419
  "type": "object",
1335
1420
  "description": "The json object with query parameters of the call to getConfig",
1336
1421
  "additionalProperties": {
1337
- "type": ["string", "number"]
1422
+ "type": [
1423
+ "string",
1424
+ "number"
1425
+ ]
1338
1426
  }
1339
1427
  },
1340
1428
  "body": {
1341
1429
  "type": "object",
1342
1430
  "description": "The json object with body of the call to getConfig",
1343
1431
  "additionalProperties": {
1344
- "type": ["string", "number"]
1432
+ "type": [
1433
+ "string",
1434
+ "number"
1435
+ ]
1345
1436
  }
1346
1437
  },
1347
1438
  "headers": {
1348
1439
  "type": "object",
1349
1440
  "description": "The json object with headers of the call to getConfig",
1350
1441
  "additionalProperties": {
1351
- "type": ["string", "number"]
1442
+ "type": [
1443
+ "string",
1444
+ "number"
1445
+ ]
1352
1446
  }
1353
1447
  },
1354
1448
  "handleFailure": {
@@ -1364,7 +1458,10 @@
1364
1458
  "type": "object",
1365
1459
  "description": "The json object with response fields of the call to getDevice",
1366
1460
  "additionalProperties": {
1367
- "type": ["string", "number"]
1461
+ "type": [
1462
+ "string",
1463
+ "number"
1464
+ ]
1368
1465
  },
1369
1466
  "properties": {}
1370
1467
  },
@@ -1377,7 +1474,10 @@
1377
1474
  "type": "object",
1378
1475
  "description": "The json object with response fields of the call to getConfig",
1379
1476
  "additionalProperties": {
1380
- "type": ["string", "number"]
1477
+ "type": [
1478
+ "string",
1479
+ "number"
1480
+ ]
1381
1481
  },
1382
1482
  "properties": {}
1383
1483
  }
@@ -1404,21 +1504,30 @@
1404
1504
  "type": "object",
1405
1505
  "description": "The json object with query parameters of the call to getCount",
1406
1506
  "additionalProperties": {
1407
- "type": ["string", "number"]
1507
+ "type": [
1508
+ "string",
1509
+ "number"
1510
+ ]
1408
1511
  }
1409
1512
  },
1410
1513
  "body": {
1411
1514
  "type": "object",
1412
1515
  "description": "The json object with body of the call to getCount",
1413
1516
  "additionalProperties": {
1414
- "type": ["string", "number"]
1517
+ "type": [
1518
+ "string",
1519
+ "number"
1520
+ ]
1415
1521
  }
1416
1522
  },
1417
1523
  "headers": {
1418
1524
  "type": "object",
1419
1525
  "description": "The json object with headers of the call to getCount",
1420
1526
  "additionalProperties": {
1421
- "type": ["string", "number"]
1527
+ "type": [
1528
+ "string",
1529
+ "number"
1530
+ ]
1422
1531
  }
1423
1532
  },
1424
1533
  "handleFailure": {
@@ -1434,7 +1543,10 @@
1434
1543
  "type": "object",
1435
1544
  "description": "The json object with response fields of the call to getDevice",
1436
1545
  "additionalProperties": {
1437
- "type": ["string", "number"]
1546
+ "type": [
1547
+ "string",
1548
+ "number"
1549
+ ]
1438
1550
  },
1439
1551
  "properties": {}
1440
1552
  },
@@ -1447,7 +1559,10 @@
1447
1559
  "type": "object",
1448
1560
  "description": "The json object with response fields of the call to getConfig",
1449
1561
  "additionalProperties": {
1450
- "type": ["string", "number"]
1562
+ "type": [
1563
+ "string",
1564
+ "number"
1565
+ ]
1451
1566
  },
1452
1567
  "properties": {}
1453
1568
  }
@@ -1553,21 +1668,30 @@
1553
1668
  "type": "object",
1554
1669
  "description": "The json object with query parameters of the call to getDevice",
1555
1670
  "additionalProperties": {
1556
- "type": ["string", "number"]
1671
+ "type": [
1672
+ "string",
1673
+ "number"
1674
+ ]
1557
1675
  }
1558
1676
  },
1559
1677
  "body": {
1560
1678
  "type": "object",
1561
1679
  "description": "The json object with body of the call to getDevice",
1562
1680
  "additionalProperties": {
1563
- "type": ["string", "number"]
1681
+ "type": [
1682
+ "string",
1683
+ "number"
1684
+ ]
1564
1685
  }
1565
1686
  },
1566
1687
  "headers": {
1567
1688
  "type": "object",
1568
1689
  "description": "The json object with headers of the call to getDevice",
1569
1690
  "additionalProperties": {
1570
- "type": ["string", "number"]
1691
+ "type": [
1692
+ "string",
1693
+ "number"
1694
+ ]
1571
1695
  }
1572
1696
  },
1573
1697
  "handleFailure": {
@@ -1583,7 +1707,10 @@
1583
1707
  "type": "object",
1584
1708
  "description": "The json object with response fields of the call to getDevice",
1585
1709
  "additionalProperties": {
1586
- "type": ["string", "number"]
1710
+ "type": [
1711
+ "string",
1712
+ "number"
1713
+ ]
1587
1714
  },
1588
1715
  "properties": {}
1589
1716
  },
@@ -1596,7 +1723,10 @@
1596
1723
  "type": "object",
1597
1724
  "description": "The json object with response fields of the call to getDevice",
1598
1725
  "additionalProperties": {
1599
- "type": ["string", "number"]
1726
+ "type": [
1727
+ "string",
1728
+ "number"
1729
+ ]
1600
1730
  }
1601
1731
  }
1602
1732
  }
@@ -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": 17
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "6.0.2"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 82
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": 677
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": 3953
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 233
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2104
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 73
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1527
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": 7584
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 306
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -28,6 +28,9 @@
28
28
  "client_id": "",
29
29
  "client_secret": "",
30
30
  "grant_type": "",
31
+ "auth_request_datatype": "",
32
+ "auth_response_datatype": "",
33
+ "token_response_placement": "",
31
34
  "sensitive": [],
32
35
  "sso": {
33
36
  "protocol": "",
@@ -271,4 +274,4 @@
271
274
  "brokers": [],
272
275
  "logLevel": "none",
273
276
  "timeout": 120000
274
- }
277
+ }
@@ -387,7 +387,7 @@ describe('[unit] Adapter Base Test', () => {
387
387
  'healthCheck', 'iapActivateTasks', 'iapDeactivateTasks', 'iapExpandedGenericAdapterRequest', 'iapFindAdapterPath', 'iapGetAdapterInventory', 'iapGetAdapterQueue',
388
388
  'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapGetDeviceCountAuth', 'iapMoveAdapterEntitiesToDB', 'iapPopulateEntityCache', 'iapRetrieveEntitiesCache',
389
389
  'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapRunAdapterLint', 'iapRunAdapterTests', 'iapSuspendAdapter', 'iapTroubleshootAdapter',
390
- 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
390
+ 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'parseIapMetadata', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
391
391
  'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
392
392
  try {
393
393
  const expectedFunctions = a.getAllFunctions();
@@ -956,14 +956,16 @@ describe('[unit] Adapter Base Test', () => {
956
956
  });
957
957
  it('should get information for all of the requests currently in the queue', (done) => {
958
958
  try {
959
- const expectedFunctions = a.iapGetAdapterQueue();
960
- try {
961
- assert.equal(0, expectedFunctions.length);
962
- done();
963
- } catch (err) {
964
- log.error(`Test Failure: ${err}`);
965
- done(err);
966
- }
959
+ a.iapGetAdapterQueue((data, error) => {
960
+ try {
961
+ assert.notEqual(null, data);
962
+ assert.equal(0, data.length);
963
+ done();
964
+ } catch (err) {
965
+ log.error(`Test Failure: ${err}`);
966
+ done(err);
967
+ }
968
+ });
967
969
  } catch (error) {
968
970
  log.error(`Adapter Exception: ${error}`);
969
971
  done(error);
@@ -245,6 +245,7 @@ describe('[unit] Aws_lambda Adapter Test', () => {
245
245
  assert.notEqual(undefined, packageDotJson.scripts);
246
246
  assert.notEqual(null, packageDotJson.scripts);
247
247
  assert.notEqual('', packageDotJson.scripts);
248
+ assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
248
249
  assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
249
250
  assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
250
251
  assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
@@ -263,6 +264,9 @@ describe('[unit] Aws_lambda Adapter Test', () => {
263
264
  assert.notEqual(undefined, packageDotJson.repository);
264
265
  assert.notEqual(null, packageDotJson.repository);
265
266
  assert.notEqual('', packageDotJson.repository);
267
+ assert.equal('git', packageDotJson.repository.type);
268
+ assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
269
+ assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
266
270
  done();
267
271
  } catch (error) {
268
272
  log.error(`Test Failure: ${error}`);
@@ -276,7 +280,7 @@ describe('[unit] Aws_lambda Adapter Test', () => {
276
280
  assert.notEqual(null, packageDotJson.dependencies);
277
281
  assert.notEqual('', packageDotJson.dependencies);
278
282
  assert.equal('8.17.1', packageDotJson.dependencies.ajv);
279
- assert.equal('1.12.0', packageDotJson.dependencies.axios);
283
+ assert.equal('1.12.2', packageDotJson.dependencies.axios);
280
284
  assert.equal('11.1.0', packageDotJson.dependencies.commander);
281
285
  assert.equal('11.3.0', packageDotJson.dependencies['fs-extra']);
282
286
  assert.equal('10.8.2', packageDotJson.dependencies.mocha);
@@ -575,6 +579,9 @@ describe('[unit] Aws_lambda Adapter Test', () => {
575
579
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
576
580
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
577
581
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
582
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_request_datatype.type);
583
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_response_datatype.type);
584
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_response_placement.type);
578
585
  assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
579
586
  assert.notEqual(null, propertiesDotJson.definitions.ssl);
580
587
  assert.notEqual('', propertiesDotJson.definitions.ssl);
@@ -765,6 +772,9 @@ describe('[unit] Aws_lambda Adapter Test', () => {
765
772
  assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
766
773
  assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
767
774
  assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
775
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_request_datatype);
776
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_response_datatype);
777
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_response_placement);
768
778
  assert.notEqual(undefined, sampleDotJson.properties.ssl);
769
779
  assert.notEqual(null, sampleDotJson.properties.ssl);
770
780
  assert.notEqual('', sampleDotJson.properties.ssl);