@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
package/pronghorn.json CHANGED
@@ -8,6 +8,576 @@
8
8
  "admin"
9
9
  ],
10
10
  "methods": [
11
+ {
12
+ "name": "updateAdapterConfiguration",
13
+ "summary": "Updates the adapter configuration",
14
+ "description": "Updates the adapter configuration file with the provided changes",
15
+ "input": [
16
+ {
17
+ "name": "configFile",
18
+ "type": "string",
19
+ "info": "The name of the file to change",
20
+ "required": true,
21
+ "schema": {
22
+ "title": "configFile",
23
+ "type": "string"
24
+ }
25
+ },
26
+ {
27
+ "name": "changes",
28
+ "type": "object",
29
+ "info": "JSON object containing the configuration changes",
30
+ "required": true,
31
+ "schema": {
32
+ "title": "changes",
33
+ "type": "object"
34
+ }
35
+ },
36
+ {
37
+ "name": "entity",
38
+ "type": "string",
39
+ "info": "The entity in which the changes are being made",
40
+ "required": false,
41
+ "schema": {
42
+ "title": "entity",
43
+ "type": "string"
44
+ }
45
+ },
46
+ {
47
+ "name": "type",
48
+ "type": "string",
49
+ "info": "The type of file to change - action, schema, or mock",
50
+ "required": false,
51
+ "schema": {
52
+ "title": "type",
53
+ "type": "string"
54
+ }
55
+ },
56
+ {
57
+ "name": "action",
58
+ "type": "string",
59
+ "info": "The action to be changed",
60
+ "required": false,
61
+ "schema": {
62
+ "title": "action",
63
+ "type": "string"
64
+ }
65
+ }
66
+ ],
67
+ "output": {
68
+ "name": "result",
69
+ "type": "object",
70
+ "description": "A JSON Object containing status, code and the result",
71
+ "schema": {
72
+ "title": "result",
73
+ "type": "object"
74
+ }
75
+ },
76
+ "roles": [
77
+ "admin"
78
+ ],
79
+ "route": {
80
+ "verb": "POST",
81
+ "path": "/updateAdapterConfiguration"
82
+ },
83
+ "task": true
84
+ },
85
+ {
86
+ "name": "findPath",
87
+ "summary": "Provides the ability to see if a particular API path is supported by the adapter",
88
+ "description": "Provides the ability to see if a particular API path is supported by the adapter",
89
+ "input": [
90
+ {
91
+ "name": "apiPath",
92
+ "type": "string",
93
+ "info": "The API Path you want to check - make sure to not include base path and version",
94
+ "description": "The API Path you want to check - make sure to not include base path and version",
95
+ "schema": {
96
+ "title": "apiPath",
97
+ "type": "string"
98
+ },
99
+ "required": true
100
+ }
101
+ ],
102
+ "output": {
103
+ "name": "result",
104
+ "type": "object",
105
+ "description": "A JSON Object containing the result",
106
+ "schema": {
107
+ "title": "result",
108
+ "type": "object"
109
+ }
110
+ },
111
+ "roles": [
112
+ "admin"
113
+ ],
114
+ "route": {
115
+ "verb": "POST",
116
+ "path": "/findPath"
117
+ },
118
+ "task": true
119
+ },
120
+ {
121
+ "name": "troubleshoot",
122
+ "summary": "Runs troubleshoot script for adapter",
123
+ "description": "Runs troubleshoot script for adapter",
124
+ "input": [
125
+ {
126
+ "name": "props",
127
+ "type": "object",
128
+ "info": "Object containing configuration, healthcheck and auth properties {'connProps':{'host': 'api.service.com', 'base_path': '/', 'protocol': 'http', 'port': 443, 'version': 'v1'},'healthCheckEndpoint': '/healthcheck', 'auth': {'auth_method': 'no authentication', 'username': 'username', 'password': 'password'}}",
129
+ "required": true,
130
+ "schema": {
131
+ "title": "props",
132
+ "type": "object"
133
+ }
134
+ },
135
+ {
136
+ "name": "persistFlag",
137
+ "type": "boolean",
138
+ "info": "Whether the input properties should be saved",
139
+ "required": true
140
+ }
141
+ ],
142
+ "output": {
143
+ "name": "result",
144
+ "type": "object",
145
+ "description": "A JSON Object containing the test results",
146
+ "schema": {
147
+ "title": "result",
148
+ "type": "object"
149
+ }
150
+ },
151
+ "roles": [
152
+ "admin"
153
+ ],
154
+ "route": {
155
+ "verb": "POST",
156
+ "path": "/troubleshoot"
157
+ },
158
+ "task": true
159
+ },
160
+ {
161
+ "name": "runHealthcheck",
162
+ "summary": "Runs healthcheck script for adapter",
163
+ "description": "Runs healthcheck script for adapter",
164
+ "input": [],
165
+ "output": {
166
+ "name": "result",
167
+ "type": "boolean",
168
+ "description": "Whether healthcheck passed or failed"
169
+ },
170
+ "roles": [
171
+ "admin"
172
+ ],
173
+ "route": {
174
+ "verb": "POST",
175
+ "path": "/runHealthcheck"
176
+ },
177
+ "task": true
178
+ },
179
+ {
180
+ "name": "runConnectivity",
181
+ "summary": "Runs connectivity check script for adapter",
182
+ "description": "Runs connectivity check script for adapter",
183
+ "input": [],
184
+ "output": {
185
+ "name": "result",
186
+ "type": "object",
187
+ "description": "A JSON Object containing the test results",
188
+ "schema": {
189
+ "title": "result",
190
+ "type": "object"
191
+ }
192
+ },
193
+ "roles": [
194
+ "admin"
195
+ ],
196
+ "route": {
197
+ "verb": "POST",
198
+ "path": "/runConnectivity"
199
+ },
200
+ "task": true
201
+ },
202
+ {
203
+ "name": "runBasicGet",
204
+ "summary": "Runs basicGet script for adapter",
205
+ "description": "Runs basicGet script for adapter",
206
+ "input": [],
207
+ "output": {
208
+ "name": "result",
209
+ "type": "object",
210
+ "description": "A JSON Object containing the test results",
211
+ "schema": {
212
+ "title": "result",
213
+ "type": "object"
214
+ }
215
+ },
216
+ "roles": [
217
+ "admin"
218
+ ],
219
+ "route": {
220
+ "verb": "POST",
221
+ "path": "/runBasicGet"
222
+ },
223
+ "task": true
224
+ },
225
+ {
226
+ "name": "suspend",
227
+ "summary": "Suspends the adapter",
228
+ "description": "Suspends the adapter",
229
+ "input": [
230
+ {
231
+ "name": "mode",
232
+ "type": "enum",
233
+ "enumerals": [
234
+ "pause",
235
+ "error"
236
+ ],
237
+ "info": "How incoming requests are handled. Defaults to 'pause'",
238
+ "description": "How incoming requests are handled. Defaults to 'pause'",
239
+ "schema": {
240
+ "title": "mode",
241
+ "type": "string"
242
+ },
243
+ "required": false
244
+ }
245
+ ],
246
+ "output": {
247
+ "name": "result",
248
+ "type": "object",
249
+ "description": "A JSON Object containing the adapter suspended status",
250
+ "schema": {
251
+ "title": "result",
252
+ "type": "object"
253
+ }
254
+ },
255
+ "roles": [
256
+ "admin"
257
+ ],
258
+ "route": {
259
+ "verb": "POST",
260
+ "path": "/suspend"
261
+ },
262
+ "task": true
263
+ },
264
+ {
265
+ "name": "unsuspend",
266
+ "summary": "Unsuspends the adapter",
267
+ "description": "Unsuspends the adapter",
268
+ "input": [],
269
+ "output": {
270
+ "name": "result",
271
+ "type": "object",
272
+ "description": "A JSON Object containing the adapter suspended status",
273
+ "schema": {
274
+ "title": "result",
275
+ "type": "object"
276
+ }
277
+ },
278
+ "roles": [
279
+ "admin"
280
+ ],
281
+ "route": {
282
+ "verb": "POST",
283
+ "path": "/unsuspend"
284
+ },
285
+ "task": true
286
+ },
287
+ {
288
+ "name": "getQueue",
289
+ "summary": "Return the requests that are waiting in the queue if throttling is enabled",
290
+ "description": "Return the requests that are waiting in the queue if throttling is enabled",
291
+ "input": [],
292
+ "output": {
293
+ "name": "result",
294
+ "type": "object",
295
+ "description": "A JSON Object containing the adapter queue",
296
+ "schema": {
297
+ "title": "result",
298
+ "type": "object"
299
+ }
300
+ },
301
+ "roles": [
302
+ "admin"
303
+ ],
304
+ "route": {
305
+ "verb": "POST",
306
+ "path": "/getQueue"
307
+ },
308
+ "task": true
309
+ },
310
+ {
311
+ "name": "genericAdapterRequest",
312
+ "summary": "Makes the requested generic call",
313
+ "description": "Makes the requested generic call",
314
+ "input": [
315
+ {
316
+ "name": "uriPath",
317
+ "type": "string",
318
+ "info": "the path of the api call - do not include the host, port, base path or version",
319
+ "description": "the path of the api call",
320
+ "schema": {
321
+ "title": "uriPath",
322
+ "type": "string"
323
+ },
324
+ "required": true
325
+ },
326
+ {
327
+ "name": "restMethod",
328
+ "type": "string",
329
+ "info": "the rest method (GET, POST, PUT, PATCH, DELETE)",
330
+ "description": "the rest method (GET, POST, PUT, PATCH, DELETE)",
331
+ "schema": {
332
+ "title": "restMethod",
333
+ "type": "string"
334
+ },
335
+ "required": true
336
+ },
337
+ {
338
+ "name": "queryData",
339
+ "type": "object",
340
+ "info": "the query parameters to be put on the url (optional)",
341
+ "description": "the query parameters to be put on the url (optional)",
342
+ "schema": {
343
+ "title": "queryData",
344
+ "type": "object"
345
+ },
346
+ "required": false
347
+ },
348
+ {
349
+ "name": "requestBody",
350
+ "type": "object",
351
+ "info": "the payload to be sent with the request (optional)",
352
+ "description": "the payload to be sent with the request (optional)",
353
+ "schema": {
354
+ "title": "requestBody",
355
+ "type": "object"
356
+ },
357
+ "required": false
358
+ },
359
+ {
360
+ "name": "addlHeaders",
361
+ "type": "object",
362
+ "info": "additional headers to be put on the call (optional)",
363
+ "description": "additional headers to be put on the call (optional)",
364
+ "schema": {
365
+ "title": "addlHeaders",
366
+ "type": "object"
367
+ },
368
+ "required": false
369
+ }
370
+ ],
371
+ "output": {
372
+ "name": "result",
373
+ "type": "object",
374
+ "description": "A JSON Object containing status, code and the result",
375
+ "schema": {
376
+ "title": "result",
377
+ "type": "object"
378
+ }
379
+ },
380
+ "roles": [
381
+ "admin"
382
+ ],
383
+ "route": {
384
+ "verb": "POST",
385
+ "path": "/genericAdapterRequest"
386
+ },
387
+ "task": true
388
+ },
389
+ {
390
+ "name": "moveEntitiesToDB",
391
+ "summary": "Moves entities from an adapter into the IAP database",
392
+ "description": "Moves entities from an adapter into the IAP database",
393
+ "input": [],
394
+ "output": {
395
+ "name": "res",
396
+ "type": "object",
397
+ "description": "A JSON Object containing status, code and the response from the mongo transaction",
398
+ "schema": {
399
+ "title": "res",
400
+ "type": "object"
401
+ }
402
+ },
403
+ "roles": [
404
+ "admin"
405
+ ],
406
+ "route": {
407
+ "verb": "POST",
408
+ "path": "/moveEntitiesToDB"
409
+ },
410
+ "task": true
411
+ },
412
+ {
413
+ "name": "getDevice",
414
+ "summary": "Get the Appliance",
415
+ "description": "Get the Appliance",
416
+ "input": [
417
+ {
418
+ "name": "deviceName",
419
+ "type": "string",
420
+ "info": "An Appliance Device Name",
421
+ "required": true,
422
+ "schema": {
423
+ "title": "deviceName",
424
+ "type": "string"
425
+ }
426
+ }
427
+ ],
428
+ "output": {
429
+ "name": "result",
430
+ "type": "object",
431
+ "description": "A JSON Object containing status, code and the result",
432
+ "schema": {
433
+ "title": "result",
434
+ "type": "object"
435
+ }
436
+ },
437
+ "roles": [
438
+ "admin"
439
+ ],
440
+ "route": {
441
+ "verb": "POST",
442
+ "path": "/getDevice"
443
+ },
444
+ "task": false
445
+ },
446
+ {
447
+ "name": "getDevicesFiltered",
448
+ "summary": "Get Appliances that match the filter",
449
+ "description": "Get Appliances that match the filter",
450
+ "input": [
451
+ {
452
+ "name": "options",
453
+ "type": "object",
454
+ "info": "options - e.g. { 'start': 1, 'limit': 20, 'filter': { 'name': 'abc123' } }",
455
+ "required": true,
456
+ "schema": {
457
+ "title": "options",
458
+ "type": "object"
459
+ }
460
+ }
461
+ ],
462
+ "output": {
463
+ "name": "result",
464
+ "type": "array",
465
+ "description": "A JSON Object containing status, code and the result",
466
+ "schema": {
467
+ "title": "result",
468
+ "type": "array"
469
+ }
470
+ },
471
+ "roles": [
472
+ "admin"
473
+ ],
474
+ "route": {
475
+ "verb": "POST",
476
+ "path": "/getDevicesFiltered"
477
+ },
478
+ "task": false
479
+ },
480
+ {
481
+ "name": "isAlive",
482
+ "summary": "Checks the status for the provided Appliance",
483
+ "description": "Checks the status for the provided Appliance",
484
+ "input": [
485
+ {
486
+ "name": "deviceName",
487
+ "type": "string",
488
+ "info": "An Appliance Device Name",
489
+ "required": true,
490
+ "schema": {
491
+ "title": "deviceName",
492
+ "type": "string"
493
+ }
494
+ }
495
+ ],
496
+ "output": {
497
+ "name": "result",
498
+ "type": "boolean",
499
+ "description": "A JSON Object containing status, code and the result",
500
+ "schema": {
501
+ "title": "result",
502
+ "type": "boolean"
503
+ }
504
+ },
505
+ "roles": [
506
+ "admin"
507
+ ],
508
+ "route": {
509
+ "verb": "POST",
510
+ "path": "/isAlive"
511
+ },
512
+ "task": false
513
+ },
514
+ {
515
+ "name": "getConfig",
516
+ "summary": "Gets a config for the provided Appliance",
517
+ "description": "Gets a config for the provided Appliance",
518
+ "input": [
519
+ {
520
+ "name": "deviceName",
521
+ "type": "string",
522
+ "info": "An Appliance Device Name",
523
+ "required": true,
524
+ "schema": {
525
+ "title": "deviceName",
526
+ "type": "string"
527
+ }
528
+ },
529
+ {
530
+ "name": "format",
531
+ "type": "string",
532
+ "info": "The format to be returned - this is ignored as we always return json",
533
+ "required": false,
534
+ "schema": {
535
+ "title": "format",
536
+ "type": "string"
537
+ }
538
+ }
539
+ ],
540
+ "output": {
541
+ "name": "result",
542
+ "type": "object",
543
+ "description": "A JSON Object containing status, code and the result",
544
+ "schema": {
545
+ "title": "result",
546
+ "type": "object"
547
+ }
548
+ },
549
+ "roles": [
550
+ "admin"
551
+ ],
552
+ "route": {
553
+ "verb": "POST",
554
+ "path": "/getConfig"
555
+ },
556
+ "task": false
557
+ },
558
+ {
559
+ "name": "getCount",
560
+ "summary": "Gets a device count from the system",
561
+ "description": "Gets a device count from the system",
562
+ "input": [],
563
+ "output": {
564
+ "name": "result",
565
+ "type": "object",
566
+ "description": "A JSON Object containing status, code and the result",
567
+ "schema": {
568
+ "title": "result",
569
+ "type": "object"
570
+ }
571
+ },
572
+ "roles": [
573
+ "admin"
574
+ ],
575
+ "route": {
576
+ "verb": "POST",
577
+ "path": "/getCount"
578
+ },
579
+ "task": false
580
+ },
11
581
  {
12
582
  "name": "deleteAddon",
13
583
  "summary": "",
@@ -916,6 +1486,100 @@
916
1486
  },
917
1487
  "task": true
918
1488
  },
1489
+ {
1490
+ "name": "CreateACommitByUploadingAFile",
1491
+ "summary": "This endpoint is used to create new commits in the repository by uploading files.",
1492
+ "description": "This endpoint is used to create new commits in the repository by uploading files.",
1493
+ "input": [
1494
+ {
1495
+ "name": "username",
1496
+ "type": "string",
1497
+ "info": "This can either be the username or the UUID of the user,\nsurrounded by curly-braces, for example: `{user UUID}`.",
1498
+ "required": true,
1499
+ "schema": {
1500
+ "title": "username",
1501
+ "type": "string"
1502
+ }
1503
+ },
1504
+ {
1505
+ "name": "repoSlug",
1506
+ "type": "string",
1507
+ "info": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.",
1508
+ "required": true,
1509
+ "schema": {
1510
+ "title": "repoSlug",
1511
+ "type": "string"
1512
+ }
1513
+ },
1514
+ {
1515
+ "name": "message",
1516
+ "type": "string",
1517
+ "info": "The commit message. When omitted, Bitbucket uses a canned string.",
1518
+ "required": false,
1519
+ "schema": {
1520
+ "title": "message",
1521
+ "type": "string"
1522
+ }
1523
+ },
1524
+ {
1525
+ "name": "author",
1526
+ "type": "string",
1527
+ "info": "The raw string to be used as the new commit's author.",
1528
+ "required": false,
1529
+ "schema": {
1530
+ "title": "author",
1531
+ "type": "string"
1532
+ }
1533
+ },
1534
+ {
1535
+ "name": "parents",
1536
+ "type": "string",
1537
+ "info": "A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.",
1538
+ "required": false,
1539
+ "schema": {
1540
+ "title": "parents",
1541
+ "type": "string"
1542
+ }
1543
+ },
1544
+ {
1545
+ "name": "files",
1546
+ "type": "object",
1547
+ "info": "Optional field that declares the files that the request is manipulating. ex. {'path/to/file.txt':'Contents of File'}",
1548
+ "required": false,
1549
+ "schema": {
1550
+ "title": "file",
1551
+ "type": "object"
1552
+ }
1553
+ },
1554
+ {
1555
+ "name": "branch",
1556
+ "type": "object",
1557
+ "info": "The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.",
1558
+ "required": false,
1559
+ "schema": {
1560
+ "title": "branch",
1561
+ "type": "object"
1562
+ }
1563
+ }
1564
+ ],
1565
+ "output": {
1566
+ "name": "result",
1567
+ "type": "object",
1568
+ "description": "A JSON Object containing status, code and the result",
1569
+ "schema": {
1570
+ "title": "result",
1571
+ "type": "object"
1572
+ }
1573
+ },
1574
+ "roles": [
1575
+ "admin"
1576
+ ],
1577
+ "route": {
1578
+ "verb": "POST",
1579
+ "path": "/postRepositoriesUsernameRepoSlugSrc"
1580
+ },
1581
+ "task": true
1582
+ },
919
1583
  {
920
1584
  "name": "putRepositoriesUsernameRepoSlug",
921
1585
  "summary": "Since this endpoint can be used to both update and to create a\nrepository, the request body depends on the intent.\n### Creation\nSee the POST documentation for the repository endpoint for an example\nof the request body.\n### Update\nNote: Changing the `name` of the repository will cause the location to\nbe changed. This is because the URL of the repo is derived from the\nname (a process called slugification). In such a scenario, it is\npossible for the request to fail if the newly created slug conflic...(description truncated)",