@itentialopensource/adapter-hyas_protect 0.3.6 → 0.4.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 +5 -5
  15. package/adapterBase.js +52 -16
  16. package/package.json +24 -28
  17. package/pronghorn.json +17 -15
  18. package/propertiesSchema.json +68 -7
  19. package/report/auto-adapter-openapi.json +695 -0
  20. package/report/updateReport1748551673197.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 +17 -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
@@ -0,0 +1,695 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "",
5
+ "version": "1.0.0"
6
+ },
7
+ "paths": {
8
+ "/aggregates": {
9
+ "post": {
10
+ "tags": [
11
+ "Overview"
12
+ ],
13
+ "operationId": "newcastleProtectTopChartsAggregates",
14
+ "description": "The parameters and request body are for method: newcastleProtectTopChartsAggregates. Same endpoint also used in methods:",
15
+ "responses": {
16
+ "200": {
17
+ "description": "Successful operation",
18
+ "content": {
19
+ "application/json": {
20
+ "schema": {
21
+ "type": "object",
22
+ "properties": {
23
+ "query_type": {
24
+ "type": "string"
25
+ },
26
+ "top_items": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "properties": {
31
+ "current_doc_count": {
32
+ "type": "number"
33
+ },
34
+ "key": {
35
+ "type": "string"
36
+ },
37
+ "previous_doc_count": {
38
+ "type": "number"
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ },
45
+ "example": {
46
+ "query_type": "fqdn",
47
+ "top_items": [
48
+ {
49
+ "current_doc_count": 9116,
50
+ "key": "debug.opendns.com",
51
+ "previous_doc_count": 7151
52
+ },
53
+ {
54
+ "current_doc_count": 9116,
55
+ "key": "debug.opendns.com",
56
+ "previous_doc_count": 7151
57
+ },
58
+ {
59
+ "current_doc_count": 9116,
60
+ "key": "debug.opendns.com",
61
+ "previous_doc_count": 7151
62
+ },
63
+ {
64
+ "current_doc_count": 9116,
65
+ "key": "debug.opendns.com",
66
+ "previous_doc_count": 7151
67
+ },
68
+ {
69
+ "current_doc_count": 9116,
70
+ "key": "debug.opendns.com",
71
+ "previous_doc_count": 7151
72
+ },
73
+ {
74
+ "current_doc_count": 9116,
75
+ "key": "debug.opendns.com",
76
+ "previous_doc_count": 7151
77
+ },
78
+ {
79
+ "current_doc_count": 9116,
80
+ "key": "debug.opendns.com",
81
+ "previous_doc_count": 7151
82
+ },
83
+ {
84
+ "current_doc_count": 9116,
85
+ "key": "debug.opendns.com",
86
+ "previous_doc_count": 7151
87
+ },
88
+ {
89
+ "current_doc_count": 9116,
90
+ "key": "debug.opendns.com",
91
+ "previous_doc_count": 7151
92
+ },
93
+ {
94
+ "current_doc_count": 9116,
95
+ "key": "debug.opendns.com",
96
+ "previous_doc_count": 7151
97
+ }
98
+ ]
99
+ }
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "requestBody": {
105
+ "description": "indeterminate body object",
106
+ "content": {
107
+ "application/json": {
108
+ "schema": {
109
+ "type": "object"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "/bar": {
117
+ "post": {
118
+ "tags": [
119
+ "Overview"
120
+ ],
121
+ "operationId": "newcastleProtectBarChartsBar",
122
+ "description": "The parameters and request body are for method: newcastleProtectBarChartsBar. Same endpoint also used in methods:",
123
+ "responses": {
124
+ "200": {
125
+ "description": "Successful operation",
126
+ "content": {
127
+ "application/json": {
128
+ "schema": {
129
+ "type": "object",
130
+ "properties": {
131
+ "query_type": {
132
+ "type": "string"
133
+ },
134
+ "top_items": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "object",
138
+ "properties": {
139
+ "current_doc_count": {
140
+ "type": "number"
141
+ },
142
+ "key": {
143
+ "type": "string"
144
+ },
145
+ "previous_doc_count": {
146
+ "type": "number"
147
+ },
148
+ "previous_key": {
149
+ "type": "string"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "example": {
157
+ "query_type": "no_answer_queries",
158
+ "top_items": [
159
+ {
160
+ "current_doc_count": 369,
161
+ "key": "2021-09-20 00:00:00",
162
+ "previous_doc_count": 303,
163
+ "previous_key": "2021-09-13 00:00:00"
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "requestBody": {
172
+ "description": "indeterminate body object",
173
+ "content": {
174
+ "application/json": {
175
+ "schema": {
176
+ "type": "object"
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ },
183
+ "/histogram": {
184
+ "post": {
185
+ "tags": [
186
+ "Overview"
187
+ ],
188
+ "operationId": "newcastleProtectHistogramsHistogram",
189
+ "description": "The parameters and request body are for method: newcastleProtectHistogramsHistogram. Same endpoint also used in methods:",
190
+ "responses": {
191
+ "200": {
192
+ "description": "Successful operation",
193
+ "content": {
194
+ "application/json": {
195
+ "schema": {
196
+ "type": "object",
197
+ "properties": {
198
+ "query_type": {
199
+ "type": "string"
200
+ },
201
+ "top_items": {
202
+ "type": "array",
203
+ "items": {
204
+ "type": "object",
205
+ "properties": {
206
+ "current_doc_count": {
207
+ "type": "number"
208
+ },
209
+ "key": {
210
+ "type": "string"
211
+ },
212
+ "previous_doc_count": {
213
+ "type": "number"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ },
220
+ "example": {
221
+ "query_type": "queries",
222
+ "top_items": [
223
+ {
224
+ "current_doc_count": 9116,
225
+ "key": "debug.opendns.com",
226
+ "previous_doc_count": 7151
227
+ }
228
+ ]
229
+ }
230
+ }
231
+ }
232
+ }
233
+ },
234
+ "requestBody": {
235
+ "description": "indeterminate body object",
236
+ "content": {
237
+ "application/json": {
238
+ "schema": {
239
+ "type": "object"
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ },
246
+ "/summary": {
247
+ "post": {
248
+ "tags": [
249
+ "Overview"
250
+ ],
251
+ "operationId": "newcastleProtectSummariesSummary",
252
+ "description": "The parameters and request body are for method: newcastleProtectSummariesSummary. Same endpoint also used in methods:",
253
+ "responses": {
254
+ "200": {
255
+ "description": "Successful operation",
256
+ "content": {
257
+ "application/json": {
258
+ "schema": {
259
+ "type": "object",
260
+ "properties": {
261
+ "day_count": {
262
+ "type": "number"
263
+ },
264
+ "query_type": {
265
+ "type": "string"
266
+ },
267
+ "total_count": {
268
+ "type": "number"
269
+ }
270
+ }
271
+ },
272
+ "example": {
273
+ "day_count": 1,
274
+ "query_type": "blocked",
275
+ "total_count": 5
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
281
+ "requestBody": {
282
+ "description": "indeterminate body object",
283
+ "content": {
284
+ "application/json": {
285
+ "schema": {
286
+ "type": "object"
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ "/histogram/artifact": {
294
+ "post": {
295
+ "tags": [
296
+ "Logs"
297
+ ],
298
+ "operationId": "newcastleProtectHistogramsHistogramArtifact",
299
+ "description": "The parameters and request body are for method: newcastleProtectHistogramsHistogramArtifact. Same endpoint also used in methods:",
300
+ "responses": {
301
+ "200": {
302
+ "description": "Successful operation",
303
+ "content": {
304
+ "application/json": {
305
+ "schema": {
306
+ "type": "object",
307
+ "properties": {
308
+ "days": {
309
+ "type": "number"
310
+ },
311
+ "query_type": {
312
+ "type": "string"
313
+ }
314
+ }
315
+ },
316
+ "example": {
317
+ "days": 7,
318
+ "query_type": "string"
319
+ }
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "requestBody": {
325
+ "description": "indeterminate body object",
326
+ "content": {
327
+ "application/json": {
328
+ "schema": {
329
+ "type": "object"
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
335
+ },
336
+ "/logs": {
337
+ "post": {
338
+ "tags": [
339
+ "Logs"
340
+ ],
341
+ "operationId": "newcastleProtectLogsLogs",
342
+ "description": "The parameters and request body are for method: newcastleProtectLogsLogs. Same endpoint also used in methods:",
343
+ "responses": {
344
+ "200": {
345
+ "description": "Successful operation",
346
+ "content": {
347
+ "application/json": {
348
+ "schema": {
349
+ "type": "object",
350
+ "properties": {
351
+ "aggregates": {
352
+ "type": "object",
353
+ "properties": {
354
+ "queries": {
355
+ "type": "array",
356
+ "items": {
357
+ "type": "object",
358
+ "properties": {
359
+ "count": {
360
+ "type": "number"
361
+ },
362
+ "key": {
363
+ "type": "string"
364
+ },
365
+ "name": {
366
+ "type": "string"
367
+ }
368
+ }
369
+ }
370
+ },
371
+ "responses": {
372
+ "type": "array",
373
+ "items": {
374
+ "type": "object",
375
+ "properties": {
376
+ "count": {
377
+ "type": "number"
378
+ },
379
+ "key": {
380
+ "type": "string"
381
+ },
382
+ "name": {
383
+ "type": "string"
384
+ }
385
+ }
386
+ }
387
+ }
388
+ }
389
+ },
390
+ "total_count": {
391
+ "type": "number"
392
+ }
393
+ }
394
+ },
395
+ "example": {
396
+ "aggregates": {
397
+ "queries": [
398
+ {
399
+ "count": 2058,
400
+ "key": "AAAA",
401
+ "name": "AAAA"
402
+ },
403
+ {
404
+ "count": 2058,
405
+ "key": "AAAA",
406
+ "name": "AAAA"
407
+ },
408
+ {
409
+ "count": 2058,
410
+ "key": "AAAA",
411
+ "name": "AAAA"
412
+ },
413
+ {
414
+ "count": 2058,
415
+ "key": "AAAA",
416
+ "name": "AAAA"
417
+ },
418
+ {
419
+ "count": 2058,
420
+ "key": "AAAA",
421
+ "name": "AAAA"
422
+ },
423
+ {
424
+ "count": 2058,
425
+ "key": "AAAA",
426
+ "name": "AAAA"
427
+ }
428
+ ],
429
+ "responses": [
430
+ {
431
+ "count": 8980,
432
+ "key": "NoError",
433
+ "name": "NoError"
434
+ },
435
+ {
436
+ "count": 8980,
437
+ "key": "NoError",
438
+ "name": "NoError"
439
+ },
440
+ {
441
+ "count": 8980,
442
+ "key": "NoError",
443
+ "name": "NoError"
444
+ },
445
+ {
446
+ "count": 8980,
447
+ "key": "NoError",
448
+ "name": "NoError"
449
+ },
450
+ {
451
+ "count": 8980,
452
+ "key": "NoError",
453
+ "name": "NoError"
454
+ }
455
+ ]
456
+ },
457
+ "total_count": 197
458
+ }
459
+ }
460
+ }
461
+ }
462
+ },
463
+ "requestBody": {
464
+ "description": "indeterminate body object",
465
+ "content": {
466
+ "application/json": {
467
+ "schema": {
468
+ "type": "object"
469
+ }
470
+ }
471
+ }
472
+ }
473
+ }
474
+ },
475
+ "/passthrough": {
476
+ "post": {
477
+ "tags": [
478
+ "Passthrough"
479
+ ],
480
+ "operationId": "newcastleProtectPassthroughPassthrough",
481
+ "description": "The parameters and request body are for method: newcastleProtectPassthroughPassthrough. Same endpoint also used in methods:",
482
+ "responses": {
483
+ "200": {
484
+ "description": "Successful operation",
485
+ "content": {
486
+ "application/json": {
487
+ "schema": {
488
+ "type": "object",
489
+ "properties": {
490
+ "logs": {
491
+ "type": "array",
492
+ "items": {
493
+ "type": "object",
494
+ "properties": {
495
+ "alt_status": {
496
+ "type": "string"
497
+ },
498
+ "artifact": {
499
+ "type": "string"
500
+ },
501
+ "hyas_status": {
502
+ "type": "string"
503
+ },
504
+ "last_seen": {
505
+ "type": "string"
506
+ },
507
+ "query_count": {
508
+ "type": "number"
509
+ }
510
+ }
511
+ }
512
+ },
513
+ "total_count": {
514
+ "type": "number"
515
+ }
516
+ }
517
+ },
518
+ "example": {
519
+ "logs": [
520
+ {
521
+ "alt_status": "allow",
522
+ "artifact": "google.com",
523
+ "hyas_status": "blocked",
524
+ "last_seen": "2021-11-05T05:00:00",
525
+ "query_count": 100
526
+ }
527
+ ],
528
+ "total_count": 197
529
+ }
530
+ }
531
+ }
532
+ }
533
+ },
534
+ "requestBody": {
535
+ "description": "indeterminate body object",
536
+ "content": {
537
+ "application/json": {
538
+ "schema": {
539
+ "type": "object"
540
+ }
541
+ }
542
+ }
543
+ }
544
+ }
545
+ },
546
+ "/report": {
547
+ "post": {
548
+ "tags": [
549
+ "Reports"
550
+ ],
551
+ "operationId": "newcastleProtectReportsGetReport",
552
+ "description": "The parameters and request body are for method: newcastleProtectReportsGetReport. Same endpoint also used in methods:",
553
+ "responses": {
554
+ "200": {
555
+ "description": "Successful operation",
556
+ "content": {
557
+ "application/json": {
558
+ "schema": {
559
+ "title": "result",
560
+ "type": "object"
561
+ }
562
+ }
563
+ }
564
+ }
565
+ },
566
+ "requestBody": {
567
+ "description": "indeterminate body object",
568
+ "content": {
569
+ "application/json": {
570
+ "schema": {
571
+ "type": "object"
572
+ }
573
+ }
574
+ }
575
+ }
576
+ }
577
+ },
578
+ "/reports": {
579
+ "post": {
580
+ "tags": [
581
+ "Reports"
582
+ ],
583
+ "operationId": "newcastleProtectReportsGetReports",
584
+ "description": "The parameters and request body are for method: newcastleProtectReportsGetReports. Same endpoint also used in methods:",
585
+ "responses": {
586
+ "200": {
587
+ "description": "Successful operation",
588
+ "content": {
589
+ "application/json": {
590
+ "schema": {
591
+ "type": "object",
592
+ "properties": {
593
+ "reports": {
594
+ "type": "array",
595
+ "items": {
596
+ "type": "object",
597
+ "properties": {
598
+ "client_id": {
599
+ "type": "string"
600
+ },
601
+ "datetime": {
602
+ "type": "string"
603
+ },
604
+ "datetime_end": {
605
+ "type": "string"
606
+ },
607
+ "datetime_start": {
608
+ "type": "string"
609
+ },
610
+ "report_id": {
611
+ "type": "string"
612
+ }
613
+ }
614
+ }
615
+ },
616
+ "total_count": {
617
+ "type": "number"
618
+ }
619
+ }
620
+ },
621
+ "example": {
622
+ "reports": [
623
+ {
624
+ "client_id": "string",
625
+ "datetime": "string",
626
+ "datetime_end": "string",
627
+ "datetime_start": "string",
628
+ "report_id": "string"
629
+ },
630
+ {
631
+ "client_id": "string",
632
+ "datetime": "string",
633
+ "datetime_end": "string",
634
+ "datetime_start": "string",
635
+ "report_id": "string"
636
+ },
637
+ {
638
+ "client_id": "string",
639
+ "datetime": "string",
640
+ "datetime_end": "string",
641
+ "datetime_start": "string",
642
+ "report_id": "string"
643
+ },
644
+ {
645
+ "client_id": "string",
646
+ "datetime": "string",
647
+ "datetime_end": "string",
648
+ "datetime_start": "string",
649
+ "report_id": "string"
650
+ },
651
+ {
652
+ "client_id": "string",
653
+ "datetime": "string",
654
+ "datetime_end": "string",
655
+ "datetime_start": "string",
656
+ "report_id": "string"
657
+ },
658
+ {
659
+ "client_id": "string",
660
+ "datetime": "string",
661
+ "datetime_end": "string",
662
+ "datetime_start": "string",
663
+ "report_id": "string"
664
+ },
665
+ {
666
+ "client_id": "string",
667
+ "datetime": "string",
668
+ "datetime_end": "string",
669
+ "datetime_start": "string",
670
+ "report_id": "string"
671
+ }
672
+ ],
673
+ "total_count": 4
674
+ }
675
+ }
676
+ }
677
+ }
678
+ },
679
+ "requestBody": {
680
+ "content": {
681
+ "application/json": {
682
+ "schema": {
683
+ "type": "object"
684
+ },
685
+ "example": {}
686
+ }
687
+ }
688
+ }
689
+ }
690
+ }
691
+ },
692
+ "components": {
693
+ "schemas": {}
694
+ }
695
+ }