@basis-theory-labs/cli 1.13.0 → 2.1.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/README.md +166 -87
- package/dist/applications/management.d.ts +8 -10
- package/dist/applications/management.js +14 -10
- package/dist/base.d.ts +2 -2
- package/dist/base.js +27 -14
- package/dist/commands/applications/create.js +6 -3
- package/dist/commands/applications/index.js +3 -1
- package/dist/commands/proxies/create.d.ts +17 -1
- package/dist/commands/proxies/create.js +84 -8
- package/dist/commands/proxies/index.js +3 -2
- package/dist/commands/proxies/logs.js +2 -1
- package/dist/commands/proxies/update.d.ts +17 -1
- package/dist/commands/proxies/update.js +66 -6
- package/dist/commands/reactors/create.d.ts +11 -1
- package/dist/commands/reactors/create.js +70 -8
- package/dist/commands/reactors/index.js +3 -2
- package/dist/commands/reactors/logs.js +2 -1
- package/dist/commands/reactors/update.d.ts +11 -1
- package/dist/commands/reactors/update.js +45 -5
- package/dist/logs/connect.d.ts +5 -5
- package/dist/logs/connect.js +1 -2
- package/dist/logs/index.d.ts +3 -3
- package/dist/logs/server.js +1 -2
- package/dist/proxies/management.d.ts +7 -7
- package/dist/proxies/management.js +16 -9
- package/dist/proxies/runtime.d.ts +5 -0
- package/dist/proxies/runtime.js +66 -0
- package/dist/proxies/utils.d.ts +26 -5
- package/dist/proxies/utils.js +78 -7
- package/dist/reactors/management.d.ts +7 -7
- package/dist/reactors/management.js +16 -9
- package/dist/reactors/runtime.d.ts +3 -0
- package/dist/reactors/runtime.js +27 -0
- package/dist/reactors/utils.d.ts +16 -5
- package/dist/reactors/utils.js +4 -1
- package/dist/runtime/flags.d.ts +10 -0
- package/dist/runtime/flags.js +37 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +20 -0
- package/dist/runtime/state.d.ts +6 -0
- package/dist/runtime/state.js +86 -0
- package/dist/runtime/utils.d.ts +34 -0
- package/dist/runtime/utils.js +132 -0
- package/dist/utils.d.ts +12 -2
- package/dist/utils.js +44 -4
- package/oclif.manifest.json +333 -122
- package/package.json +4 -3
- package/dist/commands/reactorFormulas/index.d.ts +0 -10
- package/dist/commands/reactorFormulas/index.js +0 -27
- package/dist/commands/reactorFormulas/update.d.ts +0 -18
- package/dist/commands/reactorFormulas/update.js +0 -71
- package/dist/reactorFormulas/management.d.ts +0 -5
- package/dist/reactorFormulas/management.js +0 -54
- package/dist/reactorFormulas/utils.d.ts +0 -26
- package/dist/reactorFormulas/utils.js +0 -49
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "2.1.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"applications:create": {
|
|
5
5
|
"id": "applications:create",
|
|
@@ -204,7 +204,22 @@
|
|
|
204
204
|
"pluginType": "core",
|
|
205
205
|
"aliases": [],
|
|
206
206
|
"examples": [
|
|
207
|
-
|
|
207
|
+
{
|
|
208
|
+
"description": "Create a proxy without transforms",
|
|
209
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Proxy\" --destination-url https://api.example.com"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"description": "Create a proxy with legacy runtime transforms",
|
|
213
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Proxy\" --destination-url https://api.example.com --request-transform-code ./request.js --request-transform-image node-bt --application-id <application-id>"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"description": "Create a proxy with node22 transforms",
|
|
217
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Proxy\" --destination-url https://api.example.com --request-transform-code ./request.js --request-transform-image node22 --response-transform-code ./response.js --response-transform-image node22"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"description": "Create a proxy with node22 transforms and all runtime options",
|
|
221
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Proxy\" --destination-url https://api.example.com --configuration ./config.env --require-auth --request-transform-code ./request.js --request-transform-image node22 --request-transform-timeout 10 --request-transform-warm-concurrency 0 --request-transform-resources standard --request-transform-dependencies ./deps.json --request-transform-permissions token:read --response-transform-code ./response.js --response-transform-image node22 --response-transform-timeout 10 --response-transform-warm-concurrency 0 --response-transform-resources standard --response-transform-dependencies ./deps.json --response-transform-permissions token:read"
|
|
222
|
+
}
|
|
208
223
|
],
|
|
209
224
|
"flags": {
|
|
210
225
|
"management-key": {
|
|
@@ -270,6 +285,102 @@
|
|
|
270
285
|
"char": "a",
|
|
271
286
|
"description": "whether the Proxy requires Basis Theory authentication to be invoked. Default: true",
|
|
272
287
|
"allowNo": true
|
|
288
|
+
},
|
|
289
|
+
"request-transform-image": {
|
|
290
|
+
"name": "request-transform-image",
|
|
291
|
+
"type": "option",
|
|
292
|
+
"description": "request-transform runtime image (node-bt|node22)",
|
|
293
|
+
"multiple": false,
|
|
294
|
+
"options": [
|
|
295
|
+
"node-bt",
|
|
296
|
+
"node22"
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"request-transform-dependencies": {
|
|
300
|
+
"name": "request-transform-dependencies",
|
|
301
|
+
"type": "option",
|
|
302
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
303
|
+
"multiple": false
|
|
304
|
+
},
|
|
305
|
+
"request-transform-timeout": {
|
|
306
|
+
"name": "request-transform-timeout",
|
|
307
|
+
"type": "option",
|
|
308
|
+
"description": "request-transform timeout in seconds, 1-30 (node22 only)",
|
|
309
|
+
"multiple": false
|
|
310
|
+
},
|
|
311
|
+
"request-transform-warm-concurrency": {
|
|
312
|
+
"name": "request-transform-warm-concurrency",
|
|
313
|
+
"type": "option",
|
|
314
|
+
"description": "request-transform warm concurrency, 0-1 (node22 only)",
|
|
315
|
+
"multiple": false
|
|
316
|
+
},
|
|
317
|
+
"request-transform-resources": {
|
|
318
|
+
"name": "request-transform-resources",
|
|
319
|
+
"type": "option",
|
|
320
|
+
"description": "request-transform resource tier (node22 only)",
|
|
321
|
+
"multiple": false,
|
|
322
|
+
"options": [
|
|
323
|
+
"standard",
|
|
324
|
+
"large",
|
|
325
|
+
"xlarge"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"request-transform-permissions": {
|
|
329
|
+
"name": "request-transform-permissions",
|
|
330
|
+
"type": "option",
|
|
331
|
+
"description": "request-transform permission to grant, repeatable (node22 only)",
|
|
332
|
+
"multiple": true
|
|
333
|
+
},
|
|
334
|
+
"response-transform-image": {
|
|
335
|
+
"name": "response-transform-image",
|
|
336
|
+
"type": "option",
|
|
337
|
+
"description": "response-transform runtime image (node-bt|node22)",
|
|
338
|
+
"multiple": false,
|
|
339
|
+
"options": [
|
|
340
|
+
"node-bt",
|
|
341
|
+
"node22"
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
"response-transform-dependencies": {
|
|
345
|
+
"name": "response-transform-dependencies",
|
|
346
|
+
"type": "option",
|
|
347
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
348
|
+
"multiple": false
|
|
349
|
+
},
|
|
350
|
+
"response-transform-timeout": {
|
|
351
|
+
"name": "response-transform-timeout",
|
|
352
|
+
"type": "option",
|
|
353
|
+
"description": "response-transform timeout in seconds, 1-30 (node22 only)",
|
|
354
|
+
"multiple": false
|
|
355
|
+
},
|
|
356
|
+
"response-transform-warm-concurrency": {
|
|
357
|
+
"name": "response-transform-warm-concurrency",
|
|
358
|
+
"type": "option",
|
|
359
|
+
"description": "response-transform warm concurrency, 0-1 (node22 only)",
|
|
360
|
+
"multiple": false
|
|
361
|
+
},
|
|
362
|
+
"response-transform-resources": {
|
|
363
|
+
"name": "response-transform-resources",
|
|
364
|
+
"type": "option",
|
|
365
|
+
"description": "response-transform resource tier (node22 only)",
|
|
366
|
+
"multiple": false,
|
|
367
|
+
"options": [
|
|
368
|
+
"standard",
|
|
369
|
+
"large",
|
|
370
|
+
"xlarge"
|
|
371
|
+
]
|
|
372
|
+
},
|
|
373
|
+
"response-transform-permissions": {
|
|
374
|
+
"name": "response-transform-permissions",
|
|
375
|
+
"type": "option",
|
|
376
|
+
"description": "response-transform permission to grant, repeatable (node22 only)",
|
|
377
|
+
"multiple": true
|
|
378
|
+
},
|
|
379
|
+
"async": {
|
|
380
|
+
"name": "async",
|
|
381
|
+
"type": "boolean",
|
|
382
|
+
"description": "do not wait for proxy to be ready (requires at least one transform with node22)",
|
|
383
|
+
"allowNo": false
|
|
273
384
|
}
|
|
274
385
|
},
|
|
275
386
|
"args": {}
|
|
@@ -409,10 +520,22 @@
|
|
|
409
520
|
"pluginType": "core",
|
|
410
521
|
"aliases": [],
|
|
411
522
|
"examples": [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
523
|
+
{
|
|
524
|
+
"description": "Update a proxy destination URL",
|
|
525
|
+
"command": "<%= config.bin %> <%= command.id %> <proxy-id> --destination-url https://api.example.com"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"description": "Update a proxy with legacy runtime transforms",
|
|
529
|
+
"command": "<%= config.bin %> <%= command.id %> <proxy-id> --request-transform-code ./request.js --request-transform-image node-bt --application-id <application-id>"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"description": "Update a proxy with node22 transforms",
|
|
533
|
+
"command": "<%= config.bin %> <%= command.id %> <proxy-id> --request-transform-code ./request.js --request-transform-image node22 --response-transform-code ./response.js --response-transform-image node22"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"description": "Update a proxy with node22 transforms and all runtime options",
|
|
537
|
+
"command": "<%= config.bin %> <%= command.id %> <proxy-id> --name \"My Proxy\" --destination-url https://api.example.com --configuration ./config.env --require-auth --request-transform-code ./request.js --request-transform-image node22 --request-transform-timeout 10 --request-transform-warm-concurrency 0 --request-transform-resources standard --request-transform-dependencies ./deps.json --request-transform-permissions token:read --response-transform-code ./response.js --response-transform-image node22 --response-transform-timeout 10 --response-transform-warm-concurrency 0 --response-transform-resources standard --response-transform-dependencies ./deps.json --response-transform-permissions token:read"
|
|
538
|
+
}
|
|
416
539
|
],
|
|
417
540
|
"flags": {
|
|
418
541
|
"management-key": {
|
|
@@ -479,143 +602,101 @@
|
|
|
479
602
|
"description": "whether the Proxy requires Basis Theory authentication to be invoked. Default: true",
|
|
480
603
|
"allowNo": true
|
|
481
604
|
},
|
|
482
|
-
"
|
|
483
|
-
"name": "
|
|
484
|
-
"type": "
|
|
485
|
-
"
|
|
486
|
-
"
|
|
487
|
-
"
|
|
488
|
-
|
|
605
|
+
"request-transform-image": {
|
|
606
|
+
"name": "request-transform-image",
|
|
607
|
+
"type": "option",
|
|
608
|
+
"description": "request-transform runtime image (node-bt|node22)",
|
|
609
|
+
"multiple": false,
|
|
610
|
+
"options": [
|
|
611
|
+
"node-bt",
|
|
612
|
+
"node22"
|
|
613
|
+
]
|
|
489
614
|
},
|
|
490
|
-
"
|
|
491
|
-
"name": "
|
|
492
|
-
"type": "boolean",
|
|
493
|
-
"char": "l",
|
|
494
|
-
"description": "Start logs server after update",
|
|
495
|
-
"required": false,
|
|
496
|
-
"allowNo": false
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
"args": {
|
|
500
|
-
"id": {
|
|
501
|
-
"name": "id",
|
|
502
|
-
"description": "Proxy id to update",
|
|
503
|
-
"required": true
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
"reactorFormulas": {
|
|
508
|
-
"id": "reactorFormulas",
|
|
509
|
-
"description": "[Deprecated] List Reactor Formulas. Requires `reactor:read` Management Application permission",
|
|
510
|
-
"strict": true,
|
|
511
|
-
"pluginName": "@basis-theory-labs/cli",
|
|
512
|
-
"pluginAlias": "@basis-theory-labs/cli",
|
|
513
|
-
"pluginType": "core",
|
|
514
|
-
"aliases": [],
|
|
515
|
-
"examples": [
|
|
516
|
-
"<%= config.bin %> <%= command.id %>"
|
|
517
|
-
],
|
|
518
|
-
"flags": {
|
|
519
|
-
"management-key": {
|
|
520
|
-
"name": "management-key",
|
|
615
|
+
"request-transform-dependencies": {
|
|
616
|
+
"name": "request-transform-dependencies",
|
|
521
617
|
"type": "option",
|
|
522
|
-
"
|
|
523
|
-
"description": "management key used for connecting with the reactor / proxy",
|
|
524
|
-
"required": true,
|
|
618
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
525
619
|
"multiple": false
|
|
526
620
|
},
|
|
527
|
-
"
|
|
528
|
-
"name": "
|
|
621
|
+
"request-transform-timeout": {
|
|
622
|
+
"name": "request-transform-timeout",
|
|
529
623
|
"type": "option",
|
|
530
|
-
"description": "
|
|
531
|
-
"hidden": true,
|
|
624
|
+
"description": "request-transform timeout in seconds, 1-30 (node22 only)",
|
|
532
625
|
"multiple": false
|
|
533
626
|
},
|
|
534
|
-
"
|
|
535
|
-
"name": "
|
|
627
|
+
"request-transform-warm-concurrency": {
|
|
628
|
+
"name": "request-transform-warm-concurrency",
|
|
536
629
|
"type": "option",
|
|
537
|
-
"
|
|
538
|
-
"description": "Reactors formulas list page to fetch",
|
|
539
|
-
"multiple": false,
|
|
540
|
-
"default": 1
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
|
-
"args": {}
|
|
544
|
-
},
|
|
545
|
-
"reactorFormulas:update": {
|
|
546
|
-
"id": "reactorFormulas:update",
|
|
547
|
-
"description": "[Deprecated] Updates an existing Reactor Formula. Requires `reactor:update` Management Application permission",
|
|
548
|
-
"strict": true,
|
|
549
|
-
"pluginName": "@basis-theory-labs/cli",
|
|
550
|
-
"pluginAlias": "@basis-theory-labs/cli",
|
|
551
|
-
"pluginType": "core",
|
|
552
|
-
"aliases": [],
|
|
553
|
-
"examples": [
|
|
554
|
-
"<%= config.bin %> <%= command.id %> 03858bf5-32d3-4a2e-b74b-daeea0883bca",
|
|
555
|
-
"<%= config.bin %> <%= command.id %> 03858bf5-32d3-4a2e-b74b-daeea0883bca --code ./formula.js",
|
|
556
|
-
"<%= config.bin %> <%= command.id %> 03858bf5-32d3-4a2e-b74b-daeea0883bca --code ./formula.js -w"
|
|
557
|
-
],
|
|
558
|
-
"flags": {
|
|
559
|
-
"management-key": {
|
|
560
|
-
"name": "management-key",
|
|
561
|
-
"type": "option",
|
|
562
|
-
"char": "x",
|
|
563
|
-
"description": "management key used for connecting with the reactor / proxy",
|
|
564
|
-
"required": true,
|
|
630
|
+
"description": "request-transform warm concurrency, 0-1 (node22 only)",
|
|
565
631
|
"multiple": false
|
|
566
632
|
},
|
|
567
|
-
"
|
|
568
|
-
"name": "
|
|
633
|
+
"request-transform-resources": {
|
|
634
|
+
"name": "request-transform-resources",
|
|
569
635
|
"type": "option",
|
|
570
|
-
"description": "
|
|
571
|
-
"
|
|
572
|
-
"
|
|
636
|
+
"description": "request-transform resource tier (node22 only)",
|
|
637
|
+
"multiple": false,
|
|
638
|
+
"options": [
|
|
639
|
+
"standard",
|
|
640
|
+
"large",
|
|
641
|
+
"xlarge"
|
|
642
|
+
]
|
|
573
643
|
},
|
|
574
|
-
"
|
|
575
|
-
"name": "
|
|
644
|
+
"request-transform-permissions": {
|
|
645
|
+
"name": "request-transform-permissions",
|
|
576
646
|
"type": "option",
|
|
577
|
-
"
|
|
578
|
-
"
|
|
579
|
-
"required": true,
|
|
580
|
-
"multiple": false
|
|
647
|
+
"description": "request-transform permission to grant, repeatable (node22 only)",
|
|
648
|
+
"multiple": true
|
|
581
649
|
},
|
|
582
|
-
"
|
|
583
|
-
"name": "
|
|
650
|
+
"response-transform-image": {
|
|
651
|
+
"name": "response-transform-image",
|
|
584
652
|
"type": "option",
|
|
585
|
-
"
|
|
586
|
-
"
|
|
587
|
-
"
|
|
653
|
+
"description": "response-transform runtime image (node-bt|node22)",
|
|
654
|
+
"multiple": false,
|
|
655
|
+
"options": [
|
|
656
|
+
"node-bt",
|
|
657
|
+
"node22"
|
|
658
|
+
]
|
|
588
659
|
},
|
|
589
|
-
"
|
|
590
|
-
"name": "
|
|
660
|
+
"response-transform-dependencies": {
|
|
661
|
+
"name": "response-transform-dependencies",
|
|
591
662
|
"type": "option",
|
|
592
|
-
"
|
|
593
|
-
"description": "icon of the Reactor Formula",
|
|
663
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
594
664
|
"multiple": false
|
|
595
665
|
},
|
|
596
|
-
"
|
|
597
|
-
"name": "
|
|
666
|
+
"response-transform-timeout": {
|
|
667
|
+
"name": "response-transform-timeout",
|
|
598
668
|
"type": "option",
|
|
599
|
-
"
|
|
600
|
-
"description": "path to JavaScript file containing code",
|
|
601
|
-
"required": true,
|
|
669
|
+
"description": "response-transform timeout in seconds, 1-30 (node22 only)",
|
|
602
670
|
"multiple": false
|
|
603
671
|
},
|
|
604
|
-
"
|
|
605
|
-
"name": "
|
|
672
|
+
"response-transform-warm-concurrency": {
|
|
673
|
+
"name": "response-transform-warm-concurrency",
|
|
606
674
|
"type": "option",
|
|
607
|
-
"
|
|
608
|
-
"description": "path to configuration definition to use in the Reactor Formula",
|
|
609
|
-
"required": true,
|
|
675
|
+
"description": "response-transform warm concurrency, 0-1 (node22 only)",
|
|
610
676
|
"multiple": false
|
|
611
677
|
},
|
|
612
|
-
"
|
|
613
|
-
"name": "
|
|
678
|
+
"response-transform-resources": {
|
|
679
|
+
"name": "response-transform-resources",
|
|
614
680
|
"type": "option",
|
|
615
|
-
"
|
|
616
|
-
"
|
|
617
|
-
"
|
|
618
|
-
|
|
681
|
+
"description": "response-transform resource tier (node22 only)",
|
|
682
|
+
"multiple": false,
|
|
683
|
+
"options": [
|
|
684
|
+
"standard",
|
|
685
|
+
"large",
|
|
686
|
+
"xlarge"
|
|
687
|
+
]
|
|
688
|
+
},
|
|
689
|
+
"response-transform-permissions": {
|
|
690
|
+
"name": "response-transform-permissions",
|
|
691
|
+
"type": "option",
|
|
692
|
+
"description": "response-transform permission to grant, repeatable (node22 only)",
|
|
693
|
+
"multiple": true
|
|
694
|
+
},
|
|
695
|
+
"async": {
|
|
696
|
+
"name": "async",
|
|
697
|
+
"type": "boolean",
|
|
698
|
+
"description": "do not wait for proxy to be ready (requires at least one transform with node22)",
|
|
699
|
+
"allowNo": false
|
|
619
700
|
},
|
|
620
701
|
"watch": {
|
|
621
702
|
"name": "watch",
|
|
@@ -624,12 +705,20 @@
|
|
|
624
705
|
"description": "Watch for changes in informed files",
|
|
625
706
|
"required": false,
|
|
626
707
|
"allowNo": false
|
|
708
|
+
},
|
|
709
|
+
"logs": {
|
|
710
|
+
"name": "logs",
|
|
711
|
+
"type": "boolean",
|
|
712
|
+
"char": "l",
|
|
713
|
+
"description": "Start logs server after update",
|
|
714
|
+
"required": false,
|
|
715
|
+
"allowNo": false
|
|
627
716
|
}
|
|
628
717
|
},
|
|
629
718
|
"args": {
|
|
630
719
|
"id": {
|
|
631
720
|
"name": "id",
|
|
632
|
-
"description": "
|
|
721
|
+
"description": "Proxy id to update",
|
|
633
722
|
"required": true
|
|
634
723
|
}
|
|
635
724
|
}
|
|
@@ -643,7 +732,18 @@
|
|
|
643
732
|
"pluginType": "core",
|
|
644
733
|
"aliases": [],
|
|
645
734
|
"examples": [
|
|
646
|
-
|
|
735
|
+
{
|
|
736
|
+
"description": "Create a reactor with legacy runtime",
|
|
737
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Reactor\" --code ./reactor.js --image node-bt --application-id <application-id>"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"description": "Create a reactor with node22 runtime",
|
|
741
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Reactor\" --code ./reactor.js --image node22"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"description": "Create a reactor with node22 and all runtime options",
|
|
745
|
+
"command": "<%= config.bin %> <%= command.id %> --name \"My Reactor\" --code ./reactor.js --configuration ./config.env --image node22 --timeout 10 --warm-concurrency 0 --resources standard --dependencies ./deps.json --permissions token:read --permissions token:create"
|
|
746
|
+
}
|
|
647
747
|
],
|
|
648
748
|
"flags": {
|
|
649
749
|
"management-key": {
|
|
@@ -688,6 +788,57 @@
|
|
|
688
788
|
"char": "r",
|
|
689
789
|
"description": "path to JavaScript file containing the Reactor code",
|
|
690
790
|
"multiple": false
|
|
791
|
+
},
|
|
792
|
+
"image": {
|
|
793
|
+
"name": "image",
|
|
794
|
+
"type": "option",
|
|
795
|
+
"description": "runtime image (node-bt|node22)",
|
|
796
|
+
"multiple": false,
|
|
797
|
+
"options": [
|
|
798
|
+
"node-bt",
|
|
799
|
+
"node22"
|
|
800
|
+
]
|
|
801
|
+
},
|
|
802
|
+
"dependencies": {
|
|
803
|
+
"name": "dependencies",
|
|
804
|
+
"type": "option",
|
|
805
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
806
|
+
"multiple": false
|
|
807
|
+
},
|
|
808
|
+
"timeout": {
|
|
809
|
+
"name": "timeout",
|
|
810
|
+
"type": "option",
|
|
811
|
+
"description": "timeout in seconds, 1-30 (node22 only, default: 10)",
|
|
812
|
+
"multiple": false
|
|
813
|
+
},
|
|
814
|
+
"warm-concurrency": {
|
|
815
|
+
"name": "warm-concurrency",
|
|
816
|
+
"type": "option",
|
|
817
|
+
"description": "number of warm instances, 0-1 (node22 only, default: 0)",
|
|
818
|
+
"multiple": false
|
|
819
|
+
},
|
|
820
|
+
"resources": {
|
|
821
|
+
"name": "resources",
|
|
822
|
+
"type": "option",
|
|
823
|
+
"description": "resource tier (node22 only, default: standard)",
|
|
824
|
+
"multiple": false,
|
|
825
|
+
"options": [
|
|
826
|
+
"standard",
|
|
827
|
+
"large",
|
|
828
|
+
"xlarge"
|
|
829
|
+
]
|
|
830
|
+
},
|
|
831
|
+
"permissions": {
|
|
832
|
+
"name": "permissions",
|
|
833
|
+
"type": "option",
|
|
834
|
+
"description": "permission to grant, repeatable (node22 only)",
|
|
835
|
+
"multiple": true
|
|
836
|
+
},
|
|
837
|
+
"async": {
|
|
838
|
+
"name": "async",
|
|
839
|
+
"type": "boolean",
|
|
840
|
+
"description": "do not wait for resource to be ready (node22 only)",
|
|
841
|
+
"allowNo": false
|
|
691
842
|
}
|
|
692
843
|
},
|
|
693
844
|
"args": {}
|
|
@@ -827,9 +978,18 @@
|
|
|
827
978
|
"pluginType": "core",
|
|
828
979
|
"aliases": [],
|
|
829
980
|
"examples": [
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
981
|
+
{
|
|
982
|
+
"description": "Update a reactor with legacy runtime",
|
|
983
|
+
"command": "<%= config.bin %> <%= command.id %> <reactor-id> --code ./reactor.js --image node-bt --application-id <application-id>"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"description": "Update a reactor with node22 runtime",
|
|
987
|
+
"command": "<%= config.bin %> <%= command.id %> <reactor-id> --code ./reactor.js --image node22"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"description": "Update a reactor with node22 and all runtime options",
|
|
991
|
+
"command": "<%= config.bin %> <%= command.id %> <reactor-id> --name \"My Reactor\" --code ./reactor.js --configuration ./config.env --image node22 --timeout 10 --warm-concurrency 0 --resources standard --dependencies ./deps.json --permissions token:read --permissions token:create"
|
|
992
|
+
}
|
|
833
993
|
],
|
|
834
994
|
"flags": {
|
|
835
995
|
"management-key": {
|
|
@@ -875,6 +1035,57 @@
|
|
|
875
1035
|
"description": "path to JavaScript file containing the Reactor code",
|
|
876
1036
|
"multiple": false
|
|
877
1037
|
},
|
|
1038
|
+
"image": {
|
|
1039
|
+
"name": "image",
|
|
1040
|
+
"type": "option",
|
|
1041
|
+
"description": "runtime image (node-bt|node22)",
|
|
1042
|
+
"multiple": false,
|
|
1043
|
+
"options": [
|
|
1044
|
+
"node-bt",
|
|
1045
|
+
"node22"
|
|
1046
|
+
]
|
|
1047
|
+
},
|
|
1048
|
+
"dependencies": {
|
|
1049
|
+
"name": "dependencies",
|
|
1050
|
+
"type": "option",
|
|
1051
|
+
"description": "path to JSON file with npm dependencies, e.g. {\"axios\": \"1.7.9\", \"lodash\": \"4.17.21\"} (node22 only)",
|
|
1052
|
+
"multiple": false
|
|
1053
|
+
},
|
|
1054
|
+
"timeout": {
|
|
1055
|
+
"name": "timeout",
|
|
1056
|
+
"type": "option",
|
|
1057
|
+
"description": "timeout in seconds, 1-30 (node22 only, default: 10)",
|
|
1058
|
+
"multiple": false
|
|
1059
|
+
},
|
|
1060
|
+
"warm-concurrency": {
|
|
1061
|
+
"name": "warm-concurrency",
|
|
1062
|
+
"type": "option",
|
|
1063
|
+
"description": "number of warm instances, 0-1 (node22 only, default: 0)",
|
|
1064
|
+
"multiple": false
|
|
1065
|
+
},
|
|
1066
|
+
"resources": {
|
|
1067
|
+
"name": "resources",
|
|
1068
|
+
"type": "option",
|
|
1069
|
+
"description": "resource tier (node22 only, default: standard)",
|
|
1070
|
+
"multiple": false,
|
|
1071
|
+
"options": [
|
|
1072
|
+
"standard",
|
|
1073
|
+
"large",
|
|
1074
|
+
"xlarge"
|
|
1075
|
+
]
|
|
1076
|
+
},
|
|
1077
|
+
"permissions": {
|
|
1078
|
+
"name": "permissions",
|
|
1079
|
+
"type": "option",
|
|
1080
|
+
"description": "permission to grant, repeatable (node22 only)",
|
|
1081
|
+
"multiple": true
|
|
1082
|
+
},
|
|
1083
|
+
"async": {
|
|
1084
|
+
"name": "async",
|
|
1085
|
+
"type": "boolean",
|
|
1086
|
+
"description": "do not wait for resource to be ready (node22 only)",
|
|
1087
|
+
"allowNo": false
|
|
1088
|
+
},
|
|
878
1089
|
"watch": {
|
|
879
1090
|
"name": "watch",
|
|
880
1091
|
"type": "boolean",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basis-theory-labs/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Basis Theory CLI tool",
|
|
5
5
|
"author": "Davi Aquino @djejaquino",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"/oclif.manifest.json"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@basis-theory/
|
|
20
|
+
"@basis-theory/node-sdk": "5.0.0",
|
|
21
21
|
"@inquirer/checkbox": "^1.5.0",
|
|
22
22
|
"@inquirer/confirm": "^2.0.15",
|
|
23
23
|
"@inquirer/input": "^1.2.14",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@types/lodash.groupby": "^4.6.9",
|
|
54
54
|
"@types/mocha": "^9.0.0",
|
|
55
55
|
"@types/node": "^16.18.36",
|
|
56
|
+
"@types/sinon": "^21.0.0",
|
|
56
57
|
"chai": "^4",
|
|
57
58
|
"eslint": "^7.32.0",
|
|
58
59
|
"eslint-config-oclif": "^4",
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
"prettier": "^2.8.8",
|
|
63
64
|
"semantic-release": "^21.0.5",
|
|
64
65
|
"shx": "^0.3.3",
|
|
66
|
+
"sinon": "^21.0.1",
|
|
65
67
|
"ts-node": "^10.9.1",
|
|
66
68
|
"tslib": "^2.5.3",
|
|
67
69
|
"typescript": "^4.9.5"
|
|
@@ -85,7 +87,6 @@
|
|
|
85
87
|
"build": "shx rm -rf dist && tsc -b",
|
|
86
88
|
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
87
89
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
88
|
-
"posttest": "yarn lint",
|
|
89
90
|
"prepack": "yarn build && oclif manifest && oclif readme",
|
|
90
91
|
"version": "yarn build && oclif readme",
|
|
91
92
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class ReactorFormulas extends BaseCommand {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
page: import("@oclif/core/lib/interfaces/parser").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
-
};
|
|
8
|
-
static args: {};
|
|
9
|
-
run(): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const base_1 = require("../../base");
|
|
5
|
-
const management_1 = require("../../reactorFormulas/management");
|
|
6
|
-
class ReactorFormulas extends base_1.BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
this.log('WARNING: Reactor Formulas are being deprecated and will be removed in a future release.');
|
|
9
|
-
const { bt, flags: { page }, } = await this.parse(ReactorFormulas);
|
|
10
|
-
const formula = await (0, management_1.selectReactorFormula)(bt, page);
|
|
11
|
-
if (!formula) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.default = ReactorFormulas;
|
|
18
|
-
ReactorFormulas.description = '[Deprecated] List Reactor Formulas. Requires `reactor:read` Management Application permission';
|
|
19
|
-
ReactorFormulas.examples = ['<%= config.bin %> <%= command.id %>'];
|
|
20
|
-
ReactorFormulas.flags = {
|
|
21
|
-
page: core_1.Flags.integer({
|
|
22
|
-
char: 'p',
|
|
23
|
-
description: 'Reactors formulas list page to fetch',
|
|
24
|
-
default: 1,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
ReactorFormulas.args = {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Update extends BaseCommand {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
watch: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
7
|
-
name: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
-
description: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
icon: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
-
code: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
configuration: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
'request-parameters': import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
};
|
|
14
|
-
static args: {
|
|
15
|
-
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
16
|
-
};
|
|
17
|
-
run(): Promise<void>;
|
|
18
|
-
}
|