postman-cli-completion 1.57.0 → 1.58.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/completions/bash/postman.bash +318 -9
- package/completions/fish/postman.fish +244 -55
- package/completions/zsh/_postman +392 -47
- package/package.json +1 -1
package/completions/zsh/_postman
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#compdef postman
|
|
2
2
|
compdef _postman postman
|
|
3
|
-
# Zsh completion for Postman CLI (postman v1.
|
|
3
|
+
# Zsh completion for Postman CLI (postman v1.58.0)
|
|
4
4
|
# Auto-generated by scripts/generate.mjs — DO NOT EDIT
|
|
5
5
|
# Source: spec/commands.json
|
|
6
6
|
# https://github.com/yokawasa/postman-cli-completion
|
|
@@ -24,6 +24,7 @@ _postman() {
|
|
|
24
24
|
signup) _postman_signup ;;
|
|
25
25
|
logout) _postman_logout ;;
|
|
26
26
|
init) _postman_init ;;
|
|
27
|
+
whoami) _postman_whoami ;;
|
|
27
28
|
skills) _postman_skills ;;
|
|
28
29
|
collection) _postman_collection ;;
|
|
29
30
|
environment) _postman_environment ;;
|
|
@@ -58,14 +59,15 @@ _postman_commands() {
|
|
|
58
59
|
'signup:Sign up to keep the work you created as a guest (claims your guest workspace). By default prints a single-use sign-up URL to open in a browser; --browser signs up in a browser and signs this CLI in.'
|
|
59
60
|
'logout:Delete the stored Postman API key.'
|
|
60
61
|
'init:Set up Postman artifacts and agent instructions in a repository.'
|
|
62
|
+
'whoami:Show the Postman account or guest session this CLI session is using.'
|
|
61
63
|
'skills:Check and update the agent skills in this repository.'
|
|
62
64
|
'collection:Run and test your Postman collections directly from the command line.'
|
|
63
65
|
'environment:Work with local Postman environments from the command line. Also read cloud environments by ID.'
|
|
64
66
|
'globals:Work with local Postman globals from the command line.'
|
|
65
67
|
'api:Publish and test your APIs directly from the command line'
|
|
66
|
-
'runner:
|
|
68
|
+
'runner:Where your monitors execute\: run and inspect your own self-hosted runners, and list the Postman-operated regions available to your team'
|
|
67
69
|
'spec:Lint and validate Specifications from the command line'
|
|
68
|
-
'monitor:
|
|
70
|
+
'monitor:Run and manage Postman monitors.'
|
|
69
71
|
'workspace:Manage workspace resources.'
|
|
70
72
|
'ws:Alias for workspace'
|
|
71
73
|
'performance:Manage performance tests on your collections.'
|
|
@@ -73,7 +75,7 @@ _postman_commands() {
|
|
|
73
75
|
'fl:Alias for flows'
|
|
74
76
|
'request:Send HTTP requests from the command line with full Postman capabilities including authentication, environment variables, assertions, retries, and detailed output control.'
|
|
75
77
|
'sdk:Generate and manage your SDKs directly from the command line.'
|
|
76
|
-
'mock:
|
|
78
|
+
'mock:Create, run, and manage Postman mocks — in your repository or in Postman cloud.'
|
|
77
79
|
'application:Application-level commands\: initialise config and run tests.'
|
|
78
80
|
'app:Alias for application'
|
|
79
81
|
'simulate:Start mock servers with simulated failure scenarios.'
|
|
@@ -122,6 +124,12 @@ _postman_init() {
|
|
|
122
124
|
'*:path:_files -g "*.json"'
|
|
123
125
|
}
|
|
124
126
|
|
|
127
|
+
_postman_whoami() {
|
|
128
|
+
_arguments \
|
|
129
|
+
'--json[Print current identity as machine-readable JSON.]' \
|
|
130
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
131
|
+
}
|
|
132
|
+
|
|
125
133
|
_postman_skills() {
|
|
126
134
|
local context state state_descr line
|
|
127
135
|
typeset -A opt_args
|
|
@@ -256,9 +264,9 @@ _postman_collection_run() {
|
|
|
256
264
|
'--cookie-jar[Specify the path to a custom cookie jar (serialized tough-cookie JSON)]:path:_files -g "*.json"' \
|
|
257
265
|
'--export-cookie-jar[Exports the cookie jar to a file after completing the run]:path:_files -g "*.json"' \
|
|
258
266
|
'--verbose[Show detailed information of collection run and each request sent]' \
|
|
259
|
-
'--mock[Start a mock server
|
|
260
|
-
'--port[Port for the --mock server
|
|
261
|
-
'--use-mock[Redirect requests for a URL or {{variable}} to a mock during the run. Format\: "<url> mock|mock-server\:<path|id> \[scenario\]". Repeat the flag to redirect
|
|
267
|
+
'--mock[Start a mock server for the run, its path if it lives in your repository (relative or absolute, e.g. ./postman/mocks/orders) or its id if it lives in Postman cloud (fetched then run locally). An id needs `postman login` (or --postman-api-key).]:pathOrId:_files -g "*.json"' \
|
|
268
|
+
'--port[Port for the --mock server (e.g. 4010), or "auto" for a free one. Defaults to the mock'\''s configured port. Only valid with --mock.]:port' \
|
|
269
|
+
'--use-mock[Redirect requests for a URL or {{variable}} to a mock during the run. Format\: "<url> mock|mock-server\:<path|id> \[scenario\]". Repeat the flag to redirect several URLs (one --use-mock each). Use "mock\:<path>" for a mock in your repository (path relative or absolute, e.g. ./postman/mocks/orders), "mock\:<id>" for a mock in Postman cloud (fetched then run locally), or "mock-server\:<id>" to send requests to a deployed mock server. An id needs `postman login` (or --postman-api-key). The optional third field picks a scenario (defaults to "default"). (default\: \[\])]:mapping' \
|
|
262
270
|
'--simulate[Start mock servers with fault-injection scenarios from a .sim.yaml file]:path:_files -g "*.(sim.yaml|yaml|yml)"' \
|
|
263
271
|
'--report-events[Upload results for git-native v3 collection runs. Analytics are sent by default]' \
|
|
264
272
|
'--no-report-events[Do not send analytics to Postman]' \
|
|
@@ -368,6 +376,7 @@ _postman_environment_var_get() {
|
|
|
368
376
|
'(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
|
|
369
377
|
'--verbose[Verbose output]' \
|
|
370
378
|
'--json[JSON output]' \
|
|
379
|
+
'--show-secrets[Show secret variable values in output]' \
|
|
371
380
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
372
381
|
'*:key:_files -g "*.json"'
|
|
373
382
|
}
|
|
@@ -479,6 +488,8 @@ _postman_runner() {
|
|
|
479
488
|
args)
|
|
480
489
|
case $words[1] in
|
|
481
490
|
start) _postman_runner_start ;;
|
|
491
|
+
list) _postman_runner_list ;;
|
|
492
|
+
regions) _postman_runner_regions ;;
|
|
482
493
|
esac
|
|
483
494
|
;;
|
|
484
495
|
esac
|
|
@@ -488,6 +499,8 @@ _postman_runner_commands() {
|
|
|
488
499
|
local -a sub
|
|
489
500
|
sub=(
|
|
490
501
|
'start:Start a runner'
|
|
502
|
+
'list:List the team'\''s registered self-hosted runners'
|
|
503
|
+
'regions:List the region and private-runner values valid for monitor create/update --runner, including a static IP where configured'
|
|
491
504
|
)
|
|
492
505
|
_describe -t commands 'runner command' sub
|
|
493
506
|
}
|
|
@@ -508,6 +521,20 @@ _postman_runner_start() {
|
|
|
508
521
|
'(-h --help)'{-h,--help}'[display help for command]'
|
|
509
522
|
}
|
|
510
523
|
|
|
524
|
+
_postman_runner_list() {
|
|
525
|
+
_arguments \
|
|
526
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
527
|
+
'--json[Output the runner list as JSON instead of a table]' \
|
|
528
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
_postman_runner_regions() {
|
|
532
|
+
_arguments \
|
|
533
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
534
|
+
'--json[Output the region list as JSON instead of a table]' \
|
|
535
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
536
|
+
}
|
|
537
|
+
|
|
511
538
|
_postman_spec() {
|
|
512
539
|
local context state state_descr line
|
|
513
540
|
typeset -A opt_args
|
|
@@ -522,6 +549,8 @@ _postman_spec() {
|
|
|
522
549
|
ai-readiness) _postman_spec_ai_readiness ;;
|
|
523
550
|
list) _postman_spec_list ;;
|
|
524
551
|
get) _postman_spec_get ;;
|
|
552
|
+
file) _postman_spec_file ;;
|
|
553
|
+
create) _postman_spec_create ;;
|
|
525
554
|
esac
|
|
526
555
|
;;
|
|
527
556
|
esac
|
|
@@ -534,6 +563,8 @@ _postman_spec_commands() {
|
|
|
534
563
|
'ai-readiness:Score an OpenAPI specification for AI readiness by ID or local file path.'
|
|
535
564
|
'list:List local spec files under a path, or (no path) a workspace'\''s cloud specs.'
|
|
536
565
|
'get:Read a spec definition, including every file of a multi-file spec.'
|
|
566
|
+
'file:Add, update, or remove files in a spec (cloud ID or local directory).'
|
|
567
|
+
'create:Create a new spec in a workspace, or (with path) scaffold a local spec file.'
|
|
537
568
|
)
|
|
538
569
|
_describe -t commands 'spec command' sub
|
|
539
570
|
}
|
|
@@ -574,6 +605,71 @@ _postman_spec_get() {
|
|
|
574
605
|
'*:spec...:'
|
|
575
606
|
}
|
|
576
607
|
|
|
608
|
+
_postman_spec_file() {
|
|
609
|
+
local context state state_descr line
|
|
610
|
+
typeset -A opt_args
|
|
611
|
+
_arguments -C \
|
|
612
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
613
|
+
'1: :_postman_spec_file_commands' \
|
|
614
|
+
'*::arg:->args'
|
|
615
|
+
case $state in
|
|
616
|
+
args)
|
|
617
|
+
case $words[1] in
|
|
618
|
+
add) _postman_spec_file_add ;;
|
|
619
|
+
update) _postman_spec_file_update ;;
|
|
620
|
+
rm) _postman_spec_file_rm ;;
|
|
621
|
+
esac
|
|
622
|
+
;;
|
|
623
|
+
esac
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
_postman_spec_file_commands() {
|
|
627
|
+
local -a sub
|
|
628
|
+
sub=(
|
|
629
|
+
'add:Add a new file to a spec.'
|
|
630
|
+
'update:Update an existing file in a spec.'
|
|
631
|
+
'rm:Remove a file from a spec.'
|
|
632
|
+
)
|
|
633
|
+
_describe -t commands 'file command' sub
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
_postman_spec_file_add() {
|
|
637
|
+
_arguments \
|
|
638
|
+
'(-c --content)'{-c,--content}'[File content (reads from stdin if omitted)]:content' \
|
|
639
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
640
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
641
|
+
'*:filePath:_files -g "*.json"'
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
_postman_spec_file_update() {
|
|
645
|
+
_arguments \
|
|
646
|
+
'(-c --content)'{-c,--content}'[New file content (reads from stdin if omitted)]:content' \
|
|
647
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
648
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
649
|
+
'*:filePath:_files -g "*.json"'
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
_postman_spec_file_rm() {
|
|
653
|
+
_arguments \
|
|
654
|
+
'(-y --yes)'{-y,--yes}'[Skip confirmation prompt]' \
|
|
655
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
656
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
657
|
+
'*:filePath:_files -g "*.json"'
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
_postman_spec_create() {
|
|
661
|
+
_arguments \
|
|
662
|
+
'(-n --name)'{-n,--name}'[Specification name / title]:name' \
|
|
663
|
+
'(-t --type)'{-t,--type}'[Spec type\: openapi, asyncapi, graphql, protobuf, smithy (default\: openapi) (default\: "openapi")]:type' \
|
|
664
|
+
'--spec-version[Spec version (e.g. 3.1 for openapi, 3 for protobuf)]:ver' \
|
|
665
|
+
'(-f --format)'{-f,--format}'[File format\: yaml or json (openapi/asyncapi only, default\: yaml) (default\: "yaml")]:fmt' \
|
|
666
|
+
'(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud create, defaults to .postman/resources.yaml)]:id' \
|
|
667
|
+
'--force[Overwrite an existing local file]' \
|
|
668
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
669
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
670
|
+
'*:path:_files -g "*.json"'
|
|
671
|
+
}
|
|
672
|
+
|
|
577
673
|
_postman_monitor() {
|
|
578
674
|
local context state state_descr line
|
|
579
675
|
typeset -A opt_args
|
|
@@ -585,6 +681,15 @@ _postman_monitor() {
|
|
|
585
681
|
args)
|
|
586
682
|
case $words[1] in
|
|
587
683
|
run) _postman_monitor_run ;;
|
|
684
|
+
create) _postman_monitor_create ;;
|
|
685
|
+
update) _postman_monitor_update ;;
|
|
686
|
+
delete) _postman_monitor_delete ;;
|
|
687
|
+
jobs) _postman_monitor_jobs ;;
|
|
688
|
+
runs) _postman_monitor_runs ;;
|
|
689
|
+
list) _postman_monitor_list ;;
|
|
690
|
+
get) _postman_monitor_get ;;
|
|
691
|
+
pause) _postman_monitor_pause ;;
|
|
692
|
+
resume) _postman_monitor_resume ;;
|
|
588
693
|
esac
|
|
589
694
|
;;
|
|
590
695
|
esac
|
|
@@ -594,14 +699,215 @@ _postman_monitor_commands() {
|
|
|
594
699
|
local -a sub
|
|
595
700
|
sub=(
|
|
596
701
|
'run:Invoke a monitor run and display results.'
|
|
702
|
+
'create:Create a collection-based monitor.'
|
|
703
|
+
'update:Update a monitor'\''s schedule, runner, notifications or run options.'
|
|
704
|
+
'delete:Permanently delete a monitor. Prompts for confirmation unless --yes is passed.'
|
|
705
|
+
'jobs:Inspect a monitor'\''s jobs and their per-region runs.'
|
|
706
|
+
'runs:Inspect a monitor run'\''s attempts.'
|
|
707
|
+
'list:List the monitors visible to you.'
|
|
708
|
+
'get:Show a monitor'\''s configuration.'
|
|
709
|
+
'pause:Pause a monitor, so it stops firing on schedule.'
|
|
710
|
+
'resume:Resume a paused monitor, so it fires on schedule again.'
|
|
597
711
|
)
|
|
598
712
|
_describe -t commands 'monitor command' sub
|
|
599
713
|
}
|
|
600
714
|
|
|
601
715
|
_postman_monitor_run() {
|
|
602
716
|
_arguments \
|
|
717
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
603
718
|
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
604
719
|
'(-t --timeout)'{-t,--timeout}'[Maximum wait time for run completion in milliseconds (default\: 15 minutes) (default\: 900000)]:ms' \
|
|
720
|
+
'--async[Submit the run and return immediately with its job id and Postman URL, without waiting for completion]' \
|
|
721
|
+
'--json[Output the run'\''s verdict as JSON instead of a table, printing nothing else]' \
|
|
722
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
723
|
+
'*:monitorId:'
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
_postman_monitor_create() {
|
|
727
|
+
_arguments \
|
|
728
|
+
'(-c --collection)'{-c,--collection}'[Collection to monitor -- accepts the id shown in the Postman app, prefixed or bare]:id' \
|
|
729
|
+
'--name[Monitor name (defaults to the linked collection'\''s own name)]:name' \
|
|
730
|
+
'--environment[Environment to run the monitored collection with]:id' \
|
|
731
|
+
'(-w --workspace)'{-w,--workspace}'[Workspace to create the monitor in (defaults to the workspace named in the local .postman/resources.yaml manifest; required if neither is available)]:id' \
|
|
732
|
+
'--schedule[Cron expression for the monitor'\''s schedule]:cron' \
|
|
733
|
+
'--timezone[Time zone for --schedule, e.g. America/New_York (defaults to the host machine'\''s own zone)]:tz' \
|
|
734
|
+
'--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable) (default\: \[\])]:value' \
|
|
735
|
+
'--notify-email[Email to notify on a run failure or error (repeatable) (default\: \[\])]:email' \
|
|
736
|
+
'--notification-limit[Cap consecutive notifications before they are muted (service range\: 1-99)]:n' \
|
|
737
|
+
'--retry[Retries on a failed run (service caps this at 2)]:n' \
|
|
738
|
+
'--timeout[Request timeout in milliseconds]:ms' \
|
|
739
|
+
'--delay[Delay between requests in milliseconds]:ms' \
|
|
740
|
+
'--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
|
|
741
|
+
'--insecure[Skip TLS certificate verification for the monitored target]' \
|
|
742
|
+
'--follow-redirects[Follow HTTP redirects during the run]' \
|
|
743
|
+
'--block-redirects[Do not follow HTTP redirects during the run]' \
|
|
744
|
+
'--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
|
|
745
|
+
'--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
|
|
746
|
+
'--iteration-count[Number of iterations to run]:n' \
|
|
747
|
+
'--iteration-strategy[How iteration data is consumed, e.g. round_robin, repeat_last, stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
|
|
748
|
+
'--no-run-now[Do not trigger an immediate run after creating the monitor]' \
|
|
749
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
750
|
+
'--json[Output as JSON instead of a table]' \
|
|
751
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
_postman_monitor_update() {
|
|
755
|
+
_arguments \
|
|
756
|
+
'--name[New monitor name]:name' \
|
|
757
|
+
'--schedule[New cron expression for the monitor'\''s schedule]:cron' \
|
|
758
|
+
'--timezone[Time zone for --schedule, e.g. America/New_York (defaults to the host machine'\''s own zone)]:tz' \
|
|
759
|
+
'--runner[A Postman region name (see `postman runner regions`) or the id of a self-hosted runner created in Postman (list existing ones with `postman runner list`) to run from (repeatable; replaces the current set) (default\: \[\])]:value' \
|
|
760
|
+
'--notify-email[Email to notify on a run failure or error (repeatable; replaces the current list) (default\: \[\])]:email' \
|
|
761
|
+
'--clear-notifications[Remove every notification recipient]' \
|
|
762
|
+
'--notification-limit[Cap consecutive notifications before they are muted (service range\: 1-99)]:n' \
|
|
763
|
+
'--retry[Retries on a failed run (service caps this at 2)]:n' \
|
|
764
|
+
'--timeout[Request timeout in milliseconds]:ms' \
|
|
765
|
+
'--delay[Delay between requests in milliseconds]:ms' \
|
|
766
|
+
'--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
|
|
767
|
+
'--insecure[Skip TLS certificate verification for the monitored target]' \
|
|
768
|
+
'--follow-redirects[Follow HTTP redirects during the run]' \
|
|
769
|
+
'--block-redirects[Do not follow HTTP redirects during the run]' \
|
|
770
|
+
'--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
|
|
771
|
+
'--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
|
|
772
|
+
'--iteration-count[Number of iterations to run]:n' \
|
|
773
|
+
'--iteration-strategy[How iteration data is consumed, e.g. round_robin, repeat_last, stop_at_end (requires --iteration-count, --dataset-id and --dataset-view-id)]:strategy' \
|
|
774
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
775
|
+
'--json[Output as JSON instead of a table]' \
|
|
776
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
777
|
+
'*:monitorId:'
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
_postman_monitor_delete() {
|
|
781
|
+
_arguments \
|
|
782
|
+
'(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
|
|
783
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
784
|
+
'--json[Output the outcome, including any failure, as JSON instead of a plain message]' \
|
|
785
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
786
|
+
'*:monitorId:'
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
_postman_monitor_jobs() {
|
|
790
|
+
local context state state_descr line
|
|
791
|
+
typeset -A opt_args
|
|
792
|
+
_arguments -C \
|
|
793
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
794
|
+
'1: :_postman_monitor_jobs_commands' \
|
|
795
|
+
'*::arg:->args'
|
|
796
|
+
case $state in
|
|
797
|
+
args)
|
|
798
|
+
case $words[1] in
|
|
799
|
+
list) _postman_monitor_jobs_list ;;
|
|
800
|
+
get) _postman_monitor_jobs_get ;;
|
|
801
|
+
esac
|
|
802
|
+
;;
|
|
803
|
+
esac
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
_postman_monitor_jobs_commands() {
|
|
807
|
+
local -a sub
|
|
808
|
+
sub=(
|
|
809
|
+
'list:List a monitor'\''s recent jobs.'
|
|
810
|
+
'get:Report one job'\''s terminal state and its per-region run outcomes.'
|
|
811
|
+
)
|
|
812
|
+
_describe -t commands 'jobs command' sub
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
_postman_monitor_jobs_list() {
|
|
816
|
+
_arguments \
|
|
817
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
818
|
+
'--result[Filter by outcome, e.g. success, failure, error, abort (server-validated, not a fixed list)]:value' \
|
|
819
|
+
'--trigger[Filter by trigger, e.g. api, schedule, webhook, postman-cli (server-validated, not a fixed list)]:value' \
|
|
820
|
+
'--since[Only jobs that finished at or after this ISO 8601 date-time]:dateTime' \
|
|
821
|
+
'--limit[Maximum number of jobs to return]:n' \
|
|
822
|
+
'--cursor[Opaque pagination cursor]:token' \
|
|
823
|
+
'--json[Output as JSON instead of a table]' \
|
|
824
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
825
|
+
'*:monitorId:'
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
_postman_monitor_jobs_get() {
|
|
829
|
+
_arguments \
|
|
830
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
831
|
+
'--json[Output as JSON instead of a table]' \
|
|
832
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
833
|
+
'*:jobId:'
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
_postman_monitor_runs() {
|
|
837
|
+
local context state state_descr line
|
|
838
|
+
typeset -A opt_args
|
|
839
|
+
_arguments -C \
|
|
840
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
841
|
+
'1: :_postman_monitor_runs_commands' \
|
|
842
|
+
'*::arg:->args'
|
|
843
|
+
case $state in
|
|
844
|
+
args)
|
|
845
|
+
case $words[1] in
|
|
846
|
+
get) _postman_monitor_runs_get ;;
|
|
847
|
+
esac
|
|
848
|
+
;;
|
|
849
|
+
esac
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
_postman_monitor_runs_commands() {
|
|
853
|
+
local -a sub
|
|
854
|
+
sub=(
|
|
855
|
+
'get:Report which test assertions ran during one attempt of a run, which failed, and why.'
|
|
856
|
+
)
|
|
857
|
+
_describe -t commands 'runs command' sub
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
_postman_monitor_runs_get() {
|
|
861
|
+
_arguments \
|
|
862
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
863
|
+
'--attempt[Which attempt of the run to show, counting from 0 (default\: the latest)]:n' \
|
|
864
|
+
'--failed-only[Show only failed assertions]' \
|
|
865
|
+
'--json[Output as JSON instead of a table]' \
|
|
866
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
867
|
+
'*:runId:'
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
_postman_monitor_list() {
|
|
871
|
+
_arguments \
|
|
872
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
873
|
+
'(-w --workspace)'{-w,--workspace}'[Filter to monitors in this workspace]:id' \
|
|
874
|
+
'(-c --collection)'{-c,--collection}'[Filter to monitors on this collection]:id' \
|
|
875
|
+
'--environment[Filter to monitors on this environment]:id' \
|
|
876
|
+
'--runner[Filter to a Self-Hosted Runner ID (not a Postman Region). Cannot be combined with --workspace, --collection, --environment, --owner, --team or --active.]:id' \
|
|
877
|
+
'--owner[Filter to monitors created by this user id (shown in the Owner column)]:id' \
|
|
878
|
+
'--team[Filter to monitors owned by your own team]' \
|
|
879
|
+
'--active[Filter by active state]:true|false' \
|
|
880
|
+
'--limit[Max monitors to return. The service caps page size and rejects a value above it with its own error.]:n' \
|
|
881
|
+
'--offset[Not supported\: the service accepts this parameter and silently ignores it. Refused locally. Use --cursor instead.]:n' \
|
|
882
|
+
'--cursor[Pagination cursor from a previous page'\''s response.]:token' \
|
|
883
|
+
'--columns[Comma-separated columns to show. Defaults to Name, Status, ID, Schedule, Owner, Collection. Also available\: State, Notifications, Environment, Runners.]:names' \
|
|
884
|
+
'--no-headers[Omit the header row]' \
|
|
885
|
+
'(-f --filter)'{-f,--filter}'[Show only monitors whose name contains this text (applies to the returned page, case-insensitive)]:text' \
|
|
886
|
+
'--sort[Sort the returned page by "name" or "active"]:field' \
|
|
887
|
+
'--json[Output as JSON instead of a table]' \
|
|
888
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
_postman_monitor_get() {
|
|
892
|
+
_arguments \
|
|
893
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
894
|
+
'--json[Output as JSON instead of a table]' \
|
|
895
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
896
|
+
'*:monitorId:'
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
_postman_monitor_pause() {
|
|
900
|
+
_arguments \
|
|
901
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
902
|
+
'--json[Output as JSON instead of a table]' \
|
|
903
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
904
|
+
'*:monitorId:'
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
_postman_monitor_resume() {
|
|
908
|
+
_arguments \
|
|
909
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
910
|
+
'--json[Output as JSON instead of a table]' \
|
|
605
911
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
606
912
|
'*:monitorId:'
|
|
607
913
|
}
|
|
@@ -1103,6 +1409,7 @@ _postman_mock() {
|
|
|
1103
1409
|
case $words[1] in
|
|
1104
1410
|
generate) _postman_mock_generate ;;
|
|
1105
1411
|
run) _postman_mock_run ;;
|
|
1412
|
+
push) _postman_mock_push ;;
|
|
1106
1413
|
deploy) _postman_mock_deploy ;;
|
|
1107
1414
|
get) _postman_mock_get ;;
|
|
1108
1415
|
list) _postman_mock_list ;;
|
|
@@ -1116,26 +1423,27 @@ _postman_mock() {
|
|
|
1116
1423
|
_postman_mock_commands() {
|
|
1117
1424
|
local -a sub
|
|
1118
1425
|
sub=(
|
|
1119
|
-
'generate:Generate a
|
|
1120
|
-
'run:Start a
|
|
1121
|
-
'
|
|
1122
|
-
'
|
|
1123
|
-
'
|
|
1124
|
-
'
|
|
1125
|
-
'
|
|
1426
|
+
'generate:Generate a mock from a Postman collection or an OpenAPI file, or from a built-in sample shopping-cart mock (POST /cart/items, GET /cart, POST /checkout). Writes a local mock by default, or a cloud mock with --workspace.'
|
|
1427
|
+
'run:Start a mock using its path if it lives in your repository, or its id if it lives in Postman cloud (fetched and run locally).'
|
|
1428
|
+
'push:Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).'
|
|
1429
|
+
'deploy:Turn a mock in Postman cloud into a live mock server others can call over the internet.'
|
|
1430
|
+
'get:Show a mock'\''s details using its path if it lives in your repository, or its id if it lives in Postman cloud.'
|
|
1431
|
+
'list:List the mocks in your Postman cloud workspace, or — with a folder path — the mocks in that folder in your repository.'
|
|
1432
|
+
'log:Show the requests a live mock server has received and the responses it sent, using its id.'
|
|
1433
|
+
'delete:Delete a mock using its path if it lives in your repository, or its id if it lives in Postman cloud. Cannot be undone.'
|
|
1126
1434
|
)
|
|
1127
1435
|
_describe -t commands 'mock command' sub
|
|
1128
1436
|
}
|
|
1129
1437
|
|
|
1130
1438
|
_postman_mock_generate() {
|
|
1131
1439
|
_arguments \
|
|
1132
|
-
'(-o --output)'{-o,--output}'[
|
|
1133
|
-
'(-n --name)'{-n,--name}'[
|
|
1134
|
-
'--port[Port the mock
|
|
1135
|
-
'--force[Overwrite the
|
|
1136
|
-
'(-u --update)'{-u,--update}'[Update an existing mock
|
|
1137
|
-
'(-w --workspace)'{-w,--workspace}'[
|
|
1138
|
-
'--api-key[Postman API key
|
|
1440
|
+
'(-o --output)'{-o,--output}'[Folder to save the mock in. Relative or absolute, e.g. ./postman/mocks/orders. Defaults to postman/mocks/<name>.]:dir:_files -g "*.json"' \
|
|
1441
|
+
'(-n --name)'{-n,--name}'[Name for the mock. Taken from the source when you provide one; required for the sample.]:name' \
|
|
1442
|
+
'--port[Port the mock runs on (e.g. 4010) (default\: 4500)]:port' \
|
|
1443
|
+
'--force[Overwrite the mock'\''s files if the target folder already has one]' \
|
|
1444
|
+
'(-u --update)'{-u,--update}'[Update an existing mock from the source instead of creating a new one. Path to the mock, relative or absolute, e.g. ./postman/mocks/orders. Cannot be used with --output.]:mockPath:_files -g "*.json"' \
|
|
1445
|
+
'(-w --workspace)'{-w,--workspace}'[Save the mock to this Postman cloud workspace (by id) instead of your repository. Cannot be used with --output, --force, or --update.]:id' \
|
|
1446
|
+
'--api-key[Postman API key to use with --workspace (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1139
1447
|
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Always exit with code 0, even on failure]' \
|
|
1140
1448
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1141
1449
|
'*:sourcePath:'
|
|
@@ -1143,62 +1451,70 @@ _postman_mock_generate() {
|
|
|
1143
1451
|
|
|
1144
1452
|
_postman_mock_run() {
|
|
1145
1453
|
_arguments \
|
|
1146
|
-
'(-e --environment)'{-e,--environment}'[Path to
|
|
1147
|
-
'(-g --globals)'{-g,--globals}'[Path to a
|
|
1148
|
-
'(-p --port)'{-p,--port}'[
|
|
1149
|
-
'--api-key[Postman API key
|
|
1454
|
+
'(-e --environment)'{-e,--environment}'[Path to a file of environment variables for the mock. Relative or absolute, e.g. ./postman/environments/dev.json]:path:_files -g "*.json"' \
|
|
1455
|
+
'(-g --globals)'{-g,--globals}'[Path to a file of global variables for the mock. Relative or absolute, e.g. ./globals.json]:path:_files -g "*.json"' \
|
|
1456
|
+
'(-p --port)'{-p,--port}'[Port to run on (e.g. 4010), or "auto" for a free one. Defaults to the mock'\''s configured port.]:port' \
|
|
1457
|
+
'--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1150
1458
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1151
1459
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1152
1460
|
}
|
|
1153
1461
|
|
|
1462
|
+
_postman_mock_push() {
|
|
1463
|
+
_arguments \
|
|
1464
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1465
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1466
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1467
|
+
'*:mockPath:_files -g "*.json"'
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1154
1470
|
_postman_mock_deploy() {
|
|
1155
1471
|
_arguments \
|
|
1156
|
-
'(-w --workspace)'{-w,--workspace}'[
|
|
1157
|
-
'(-n --name)'{-n,--name}'[
|
|
1158
|
-
'(-s --slug)'{-s,--slug}'[
|
|
1159
|
-
'--public[
|
|
1160
|
-
'--auto-deploy[
|
|
1161
|
-
'(-y --yes)'{-y,--yes}'[
|
|
1162
|
-
'--api-key[Postman API key (defaults to
|
|
1472
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1473
|
+
'(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
|
|
1474
|
+
'(-s --slug)'{-s,--slug}'[Short label used in the server'\''s web address, e.g. "my-mock" (you are asked for one if you skip this)]:slug' \
|
|
1475
|
+
'--public[Let anyone with the link reach the server. Private by default (callers must send a Postman API key).]' \
|
|
1476
|
+
'--auto-deploy[Update the live server automatically whenever the mock changes (off by default)]' \
|
|
1477
|
+
'(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (private, no auto-deploy)]' \
|
|
1478
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1163
1479
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1164
1480
|
'*:mockId:_files -g "*.json"'
|
|
1165
1481
|
}
|
|
1166
1482
|
|
|
1167
1483
|
_postman_mock_get() {
|
|
1168
1484
|
_arguments \
|
|
1169
|
-
'--api-key[Postman API key (defaults to
|
|
1170
|
-
'--json[
|
|
1485
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1486
|
+
'--json[Print the details as machine-readable data instead of a table]' \
|
|
1171
1487
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1172
1488
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1173
1489
|
}
|
|
1174
1490
|
|
|
1175
1491
|
_postman_mock_list() {
|
|
1176
1492
|
_arguments \
|
|
1177
|
-
'(-w --workspace)'{-w,--workspace}'[
|
|
1178
|
-
'--api-key[Postman API key (defaults to
|
|
1179
|
-
'--json[
|
|
1493
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose mocks to list, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1494
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1495
|
+
'--json[Print the list as machine-readable data instead of a table]' \
|
|
1180
1496
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1181
1497
|
'*:pathOrDir:_files -g "*.json"'
|
|
1182
1498
|
}
|
|
1183
1499
|
|
|
1184
1500
|
_postman_mock_log() {
|
|
1185
1501
|
_arguments \
|
|
1186
|
-
'--limit[
|
|
1187
|
-
'--method[
|
|
1188
|
-
'--status[
|
|
1189
|
-
'--path[
|
|
1190
|
-
'--since[Show
|
|
1191
|
-
'--until[
|
|
1192
|
-
'--api-key[Postman API key (defaults to
|
|
1193
|
-
'--json[
|
|
1502
|
+
'--limit[Most entries to show (defaults to 50 when printing machine-readable output)]:n' \
|
|
1503
|
+
'--method[Show only requests of this type (e.g. GET, POST)]:method' \
|
|
1504
|
+
'--status[Show only these response codes (e.g. 404, or 5xx for any 500-series)]:code|range' \
|
|
1505
|
+
'--path[Show only requests to matching addresses (use * and ? as wildcards, e.g. /users/*)]:pattern' \
|
|
1506
|
+
'--since[Show entries from this long ago until now (e.g. 2h = the last 2 hours)]:duration' \
|
|
1507
|
+
'--until[Hide entries newer than this (e.g. 30m = skip the most recent 30 minutes)]:duration' \
|
|
1508
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1509
|
+
'--json[Print entries as machine-readable data instead of the scrollable view]' \
|
|
1194
1510
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1195
1511
|
'*:mockServerId:_files -g "*.json"'
|
|
1196
1512
|
}
|
|
1197
1513
|
|
|
1198
1514
|
_postman_mock_delete() {
|
|
1199
1515
|
_arguments \
|
|
1200
|
-
'(-y --yes)'{-y,--yes}'[
|
|
1201
|
-
'--api-key[Postman API key
|
|
1516
|
+
'(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
|
|
1517
|
+
'--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1202
1518
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1203
1519
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1204
1520
|
}
|
|
@@ -2143,6 +2459,9 @@ _postman_dependency() {
|
|
|
2143
2459
|
args)
|
|
2144
2460
|
case $words[1] in
|
|
2145
2461
|
add) _postman_dependency_add ;;
|
|
2462
|
+
list) _postman_dependency_list ;;
|
|
2463
|
+
install) _postman_dependency_install ;;
|
|
2464
|
+
update) _postman_dependency_update ;;
|
|
2146
2465
|
esac
|
|
2147
2466
|
;;
|
|
2148
2467
|
esac
|
|
@@ -2152,6 +2471,9 @@ _postman_dependency_commands() {
|
|
|
2152
2471
|
local -a sub
|
|
2153
2472
|
sub=(
|
|
2154
2473
|
'add:Add a Postman collection, environment, or mock as a workspace dependency.'
|
|
2474
|
+
'list:List the workspace dependencies declared in .postman/resources.yaml.'
|
|
2475
|
+
'install:Materialise the dependencies declared in .postman/resources.yaml (all, or one).'
|
|
2476
|
+
'update:Refresh declared dependencies to the latest content from their source (all, or one).'
|
|
2155
2477
|
)
|
|
2156
2478
|
_describe -t commands 'dependency command' sub
|
|
2157
2479
|
}
|
|
@@ -2165,6 +2487,29 @@ _postman_dependency_add() {
|
|
|
2165
2487
|
'*:nameOrId:'
|
|
2166
2488
|
}
|
|
2167
2489
|
|
|
2490
|
+
_postman_dependency_list() {
|
|
2491
|
+
_arguments \
|
|
2492
|
+
'--type[Only list dependencies of this type (collection, environment, or mock).]:type' \
|
|
2493
|
+
'--json[Output the result as JSON.]' \
|
|
2494
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
_postman_dependency_install() {
|
|
2498
|
+
_arguments \
|
|
2499
|
+
'--type[Only install dependencies of this type (collection, environment, or mock).]:type' \
|
|
2500
|
+
'--json[Output the result as JSON.]' \
|
|
2501
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
2502
|
+
'*:nameOrId:'
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
_postman_dependency_update() {
|
|
2506
|
+
_arguments \
|
|
2507
|
+
'--type[Only update dependencies of this type (collection, environment, or mock).]:type' \
|
|
2508
|
+
'--json[Output the result as JSON.]' \
|
|
2509
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
2510
|
+
'*:nameOrId:'
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2168
2513
|
# When loaded via fpath + compinit, the file body becomes the function body of
|
|
2169
2514
|
# `_postman`. In that case `funcstack[1]` is `_postman` and we must actually
|
|
2170
2515
|
# invoke the completion. When sourced directly, this is a no-op — `_postman`
|