postman-cli-completion 1.57.0 → 1.59.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 +434 -14
- package/completions/fish/postman.fish +331 -73
- package/completions/zsh/_postman +526 -49
- 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.59.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,8 @@ _postman() {
|
|
|
24
24
|
signup) _postman_signup ;;
|
|
25
25
|
logout) _postman_logout ;;
|
|
26
26
|
init) _postman_init ;;
|
|
27
|
+
whoami) _postman_whoami ;;
|
|
28
|
+
update) _postman_update ;;
|
|
27
29
|
skills) _postman_skills ;;
|
|
28
30
|
collection) _postman_collection ;;
|
|
29
31
|
environment) _postman_environment ;;
|
|
@@ -55,17 +57,19 @@ _postman_commands() {
|
|
|
55
57
|
local -a commands
|
|
56
58
|
commands=(
|
|
57
59
|
'login:Authenticate with Postman to access your resources.'
|
|
58
|
-
'signup:Sign up to keep the work you created as a guest (claims your guest workspace).
|
|
60
|
+
'signup:Sign up to keep the work you created as a guest (claims your guest workspace). Waits and signs this CLI in once the sign-up is completed in a browser — opening that browser here on a terminal, or printing the URL to hand over when output is piped.'
|
|
59
61
|
'logout:Delete the stored Postman API key.'
|
|
60
62
|
'init:Set up Postman artifacts and agent instructions in a repository.'
|
|
63
|
+
'whoami:Show the Postman account or guest session this CLI session is using.'
|
|
64
|
+
'update:Update Postman CLI using the original installation method.'
|
|
61
65
|
'skills:Check and update the agent skills in this repository.'
|
|
62
66
|
'collection:Run and test your Postman collections directly from the command line.'
|
|
63
67
|
'environment:Work with local Postman environments from the command line. Also read cloud environments by ID.'
|
|
64
68
|
'globals:Work with local Postman globals from the command line.'
|
|
65
69
|
'api:Publish and test your APIs directly from the command line'
|
|
66
|
-
'runner:
|
|
70
|
+
'runner:Where your monitors execute\: run and inspect your own self-hosted runners, and list the Postman-operated regions available to your team'
|
|
67
71
|
'spec:Lint and validate Specifications from the command line'
|
|
68
|
-
'monitor:
|
|
72
|
+
'monitor:Run and manage Postman monitors.'
|
|
69
73
|
'workspace:Manage workspace resources.'
|
|
70
74
|
'ws:Alias for workspace'
|
|
71
75
|
'performance:Manage performance tests on your collections.'
|
|
@@ -73,7 +77,7 @@ _postman_commands() {
|
|
|
73
77
|
'fl:Alias for flows'
|
|
74
78
|
'request:Send HTTP requests from the command line with full Postman capabilities including authentication, environment variables, assertions, retries, and detailed output control.'
|
|
75
79
|
'sdk:Generate and manage your SDKs directly from the command line.'
|
|
76
|
-
'mock:
|
|
80
|
+
'mock:Create, run, and manage Postman mocks — in your repository or in Postman cloud.'
|
|
77
81
|
'application:Application-level commands\: initialise config and run tests.'
|
|
78
82
|
'app:Alias for application'
|
|
79
83
|
'simulate:Start mock servers with simulated failure scenarios.'
|
|
@@ -98,7 +102,9 @@ _postman_login() {
|
|
|
98
102
|
|
|
99
103
|
_postman_signup() {
|
|
100
104
|
_arguments \
|
|
101
|
-
'--browser[
|
|
105
|
+
'--browser[Always open the sign-up URL in a browser here, rather than printing it.]' \
|
|
106
|
+
'--wait[Wait for the sign-up to complete even if no local browser is detected.]' \
|
|
107
|
+
'--no-wait[Print the sign-up URL and exit without waiting. Leaves this CLI a guest.]' \
|
|
102
108
|
'--json[Print the sign-up details as machine-readable JSON.]' \
|
|
103
109
|
'(-h --help)'{-h,--help}'[display help for command]'
|
|
104
110
|
}
|
|
@@ -122,6 +128,17 @@ _postman_init() {
|
|
|
122
128
|
'*:path:_files -g "*.json"'
|
|
123
129
|
}
|
|
124
130
|
|
|
131
|
+
_postman_whoami() {
|
|
132
|
+
_arguments \
|
|
133
|
+
'--json[Print current identity as machine-readable JSON.]' \
|
|
134
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_postman_update() {
|
|
138
|
+
_arguments \
|
|
139
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
140
|
+
}
|
|
141
|
+
|
|
125
142
|
_postman_skills() {
|
|
126
143
|
local context state state_descr line
|
|
127
144
|
typeset -A opt_args
|
|
@@ -175,9 +192,12 @@ _postman_collection() {
|
|
|
175
192
|
case $state in
|
|
176
193
|
args)
|
|
177
194
|
case $words[1] in
|
|
195
|
+
new) _postman_collection_new ;;
|
|
178
196
|
migrate) _postman_collection_migrate ;;
|
|
179
197
|
lint) _postman_collection_lint ;;
|
|
180
198
|
ai-readiness) _postman_collection_ai_readiness ;;
|
|
199
|
+
get) _postman_collection_get ;;
|
|
200
|
+
list) _postman_collection_list ;;
|
|
181
201
|
run) _postman_collection_run ;;
|
|
182
202
|
esac
|
|
183
203
|
;;
|
|
@@ -187,14 +207,27 @@ _postman_collection() {
|
|
|
187
207
|
_postman_collection_commands() {
|
|
188
208
|
local -a sub
|
|
189
209
|
sub=(
|
|
210
|
+
'new:Scaffold a v3 collection on disk, or create one in a cloud Postman workspace with --workspace.'
|
|
190
211
|
'migrate:Migrate a v2.1 collection to the v3 format'
|
|
191
212
|
'lint:Run linting on a local v3 collection at the given file or directory path.'
|
|
192
213
|
'ai-readiness:Score a Postman collection for AI readiness by ID, local file path, or local-mode directory.'
|
|
214
|
+
'get:Fetch a Postman collection in the V3 format and print it.'
|
|
215
|
+
'list:List collections\: your local project'\''s collections by default, or a Postman cloud workspace'\''s collections with --workspace.'
|
|
193
216
|
'run:Initiate a Postman collection run from a given ID or path.'
|
|
194
217
|
)
|
|
195
218
|
_describe -t commands 'collection command' sub
|
|
196
219
|
}
|
|
197
220
|
|
|
221
|
+
_postman_collection_new() {
|
|
222
|
+
_arguments \
|
|
223
|
+
'(-w --workspace)'{-w,--workspace}'[Create the collection in a cloud Postman workspace instead of scaffolding it locally. Required when the current directory is not a local Postman workspace.]:workspaceId' \
|
|
224
|
+
'--force[Rewrite the definition of an existing local collection. Existing request files are left alone.]' \
|
|
225
|
+
'--verbose[Verbose output]' \
|
|
226
|
+
'--json[JSON output]' \
|
|
227
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
228
|
+
'*:name:'
|
|
229
|
+
}
|
|
230
|
+
|
|
198
231
|
_postman_collection_migrate() {
|
|
199
232
|
_arguments \
|
|
200
233
|
'(-o --output)'{-o,--output}'[Output directory (default\: ./<collection-name>)]:dir:_files -g "*.json"' \
|
|
@@ -218,6 +251,24 @@ _postman_collection_ai_readiness() {
|
|
|
218
251
|
'*:collectionId/Path:_files -g "*.json"'
|
|
219
252
|
}
|
|
220
253
|
|
|
254
|
+
_postman_collection_get() {
|
|
255
|
+
_arguments \
|
|
256
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
257
|
+
'--json[Print the collection as machine-readable V3 JSON instead of a table]' \
|
|
258
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
259
|
+
'*:id:'
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
_postman_collection_list() {
|
|
263
|
+
_arguments \
|
|
264
|
+
'(-w --workspace)'{-w,--workspace}'[List a Postman cloud workspace'\''s collections by id. Omit to list the local project'\''s collections.]:workspaceId' \
|
|
265
|
+
'(-f --filter)'{-f,--filter}'[Filter collections by name.]:name' \
|
|
266
|
+
'--verbose[Verbose output]' \
|
|
267
|
+
'--debug[Debug output]' \
|
|
268
|
+
'--json[JSON output]' \
|
|
269
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
270
|
+
}
|
|
271
|
+
|
|
221
272
|
_postman_collection_run() {
|
|
222
273
|
_arguments \
|
|
223
274
|
'(-e --environment)'{-e,--environment}'[Specify an Id or path to a Postman Environment]:path:_files -g "*.json"' \
|
|
@@ -256,9 +307,9 @@ _postman_collection_run() {
|
|
|
256
307
|
'--cookie-jar[Specify the path to a custom cookie jar (serialized tough-cookie JSON)]:path:_files -g "*.json"' \
|
|
257
308
|
'--export-cookie-jar[Exports the cookie jar to a file after completing the run]:path:_files -g "*.json"' \
|
|
258
309
|
'--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
|
|
310
|
+
'--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"' \
|
|
311
|
+
'--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' \
|
|
312
|
+
'--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
313
|
'--simulate[Start mock servers with fault-injection scenarios from a .sim.yaml file]:path:_files -g "*.(sim.yaml|yaml|yml)"' \
|
|
263
314
|
'--report-events[Upload results for git-native v3 collection runs. Analytics are sent by default]' \
|
|
264
315
|
'--no-report-events[Do not send analytics to Postman]' \
|
|
@@ -287,6 +338,7 @@ _postman_environment() {
|
|
|
287
338
|
case $state in
|
|
288
339
|
args)
|
|
289
340
|
case $words[1] in
|
|
341
|
+
new) _postman_environment_new ;;
|
|
290
342
|
list) _postman_environment_list ;;
|
|
291
343
|
get) _postman_environment_get ;;
|
|
292
344
|
var) _postman_environment_var ;;
|
|
@@ -299,6 +351,7 @@ _postman_environment() {
|
|
|
299
351
|
_postman_environment_commands() {
|
|
300
352
|
local -a sub
|
|
301
353
|
sub=(
|
|
354
|
+
'new:Scaffold a local environment file, or create one in a Postman workspace with --workspace.'
|
|
302
355
|
'list:List environments in a Postman workspace.'
|
|
303
356
|
'get:Read an environment by ID or local environment file path.'
|
|
304
357
|
'var:Read and update environment variables.'
|
|
@@ -307,6 +360,16 @@ _postman_environment_commands() {
|
|
|
307
360
|
_describe -t commands 'environment command' sub
|
|
308
361
|
}
|
|
309
362
|
|
|
363
|
+
_postman_environment_new() {
|
|
364
|
+
_arguments \
|
|
365
|
+
'(-w --workspace)'{-w,--workspace}'[Create the environment in a cloud Postman workspace instead of scaffolding it locally. Required when the current directory is not a local Postman workspace.]:workspaceId' \
|
|
366
|
+
'--force[Overwrite an existing local environment file.]' \
|
|
367
|
+
'--verbose[Verbose output]' \
|
|
368
|
+
'--json[JSON output]' \
|
|
369
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
370
|
+
'*:name:'
|
|
371
|
+
}
|
|
372
|
+
|
|
310
373
|
_postman_environment_list() {
|
|
311
374
|
_arguments \
|
|
312
375
|
'(-w --workspace)'{-w,--workspace}'[Workspace ID to list environments from.]:workspaceId' \
|
|
@@ -368,6 +431,7 @@ _postman_environment_var_get() {
|
|
|
368
431
|
'(-e --environment)'{-e,--environment}'[Cloud Environment ID or local environment file path.]:environment:_files -g "*.json"' \
|
|
369
432
|
'--verbose[Verbose output]' \
|
|
370
433
|
'--json[JSON output]' \
|
|
434
|
+
'--show-secrets[Show secret variable values in output]' \
|
|
371
435
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
372
436
|
'*:key:_files -g "*.json"'
|
|
373
437
|
}
|
|
@@ -479,6 +543,8 @@ _postman_runner() {
|
|
|
479
543
|
args)
|
|
480
544
|
case $words[1] in
|
|
481
545
|
start) _postman_runner_start ;;
|
|
546
|
+
list) _postman_runner_list ;;
|
|
547
|
+
regions) _postman_runner_regions ;;
|
|
482
548
|
esac
|
|
483
549
|
;;
|
|
484
550
|
esac
|
|
@@ -488,6 +554,8 @@ _postman_runner_commands() {
|
|
|
488
554
|
local -a sub
|
|
489
555
|
sub=(
|
|
490
556
|
'start:Start a runner'
|
|
557
|
+
'list:List the team'\''s registered self-hosted runners'
|
|
558
|
+
'regions:List the region and private-runner values valid for monitor create/update --runner, including a static IP where configured'
|
|
491
559
|
)
|
|
492
560
|
_describe -t commands 'runner command' sub
|
|
493
561
|
}
|
|
@@ -508,6 +576,21 @@ _postman_runner_start() {
|
|
|
508
576
|
'(-h --help)'{-h,--help}'[display help for command]'
|
|
509
577
|
}
|
|
510
578
|
|
|
579
|
+
_postman_runner_list() {
|
|
580
|
+
_arguments \
|
|
581
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
582
|
+
'(-w --workspace)'{-w,--workspace}'[Filter to runners in this workspace]:id' \
|
|
583
|
+
'--json[Output the runner list as JSON instead of a table]' \
|
|
584
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
_postman_runner_regions() {
|
|
588
|
+
_arguments \
|
|
589
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
590
|
+
'--json[Output the region list as JSON instead of a table]' \
|
|
591
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
592
|
+
}
|
|
593
|
+
|
|
511
594
|
_postman_spec() {
|
|
512
595
|
local context state state_descr line
|
|
513
596
|
typeset -A opt_args
|
|
@@ -522,6 +605,9 @@ _postman_spec() {
|
|
|
522
605
|
ai-readiness) _postman_spec_ai_readiness ;;
|
|
523
606
|
list) _postman_spec_list ;;
|
|
524
607
|
get) _postman_spec_get ;;
|
|
608
|
+
file) _postman_spec_file ;;
|
|
609
|
+
create) _postman_spec_create ;;
|
|
610
|
+
generate) _postman_spec_generate ;;
|
|
525
611
|
esac
|
|
526
612
|
;;
|
|
527
613
|
esac
|
|
@@ -534,6 +620,9 @@ _postman_spec_commands() {
|
|
|
534
620
|
'ai-readiness:Score an OpenAPI specification for AI readiness by ID or local file path.'
|
|
535
621
|
'list:List local spec files under a path, or (no path) a workspace'\''s cloud specs.'
|
|
536
622
|
'get:Read a spec definition, including every file of a multi-file spec.'
|
|
623
|
+
'file:Add, update, or remove files in a spec (cloud ID or local directory).'
|
|
624
|
+
'create:Create a new spec in a workspace, or (with path) scaffold a local spec file.'
|
|
625
|
+
'generate:Generate artifacts from a specification.'
|
|
537
626
|
)
|
|
538
627
|
_describe -t commands 'spec command' sub
|
|
539
628
|
}
|
|
@@ -574,6 +663,105 @@ _postman_spec_get() {
|
|
|
574
663
|
'*:spec...:'
|
|
575
664
|
}
|
|
576
665
|
|
|
666
|
+
_postman_spec_file() {
|
|
667
|
+
local context state state_descr line
|
|
668
|
+
typeset -A opt_args
|
|
669
|
+
_arguments -C \
|
|
670
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
671
|
+
'1: :_postman_spec_file_commands' \
|
|
672
|
+
'*::arg:->args'
|
|
673
|
+
case $state in
|
|
674
|
+
args)
|
|
675
|
+
case $words[1] in
|
|
676
|
+
add) _postman_spec_file_add ;;
|
|
677
|
+
update) _postman_spec_file_update ;;
|
|
678
|
+
rm) _postman_spec_file_rm ;;
|
|
679
|
+
esac
|
|
680
|
+
;;
|
|
681
|
+
esac
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
_postman_spec_file_commands() {
|
|
685
|
+
local -a sub
|
|
686
|
+
sub=(
|
|
687
|
+
'add:Add a new file to a spec.'
|
|
688
|
+
'update:Update an existing file in a spec.'
|
|
689
|
+
'rm:Remove a file from a spec.'
|
|
690
|
+
)
|
|
691
|
+
_describe -t commands 'file command' sub
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
_postman_spec_file_add() {
|
|
695
|
+
_arguments \
|
|
696
|
+
'(-c --content)'{-c,--content}'[File content (reads from stdin if omitted)]:content' \
|
|
697
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
698
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
699
|
+
'*:filePath:_files -g "*.json"'
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
_postman_spec_file_update() {
|
|
703
|
+
_arguments \
|
|
704
|
+
'(-c --content)'{-c,--content}'[New file content (reads from stdin if omitted)]:content' \
|
|
705
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
706
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
707
|
+
'*:filePath:_files -g "*.json"'
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
_postman_spec_file_rm() {
|
|
711
|
+
_arguments \
|
|
712
|
+
'(-y --yes)'{-y,--yes}'[Skip confirmation prompt]' \
|
|
713
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
714
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
715
|
+
'*:filePath:_files -g "*.json"'
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
_postman_spec_create() {
|
|
719
|
+
_arguments \
|
|
720
|
+
'(-n --name)'{-n,--name}'[Specification name / title]:name' \
|
|
721
|
+
'(-t --type)'{-t,--type}'[Spec type\: openapi, asyncapi, graphql, protobuf, smithy (default\: openapi) (default\: "openapi")]:type' \
|
|
722
|
+
'--spec-version[Spec version (e.g. 3.1 for openapi, 3 for protobuf)]:ver' \
|
|
723
|
+
'(-f --format)'{-f,--format}'[File format\: yaml or json (openapi/asyncapi only, default\: yaml) (default\: "yaml")]:fmt' \
|
|
724
|
+
'(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud create, defaults to .postman/resources.yaml)]:id' \
|
|
725
|
+
'--force[Overwrite an existing local file]' \
|
|
726
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
727
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
728
|
+
'*:path:_files -g "*.json"'
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
_postman_spec_generate() {
|
|
732
|
+
local context state state_descr line
|
|
733
|
+
typeset -A opt_args
|
|
734
|
+
_arguments -C \
|
|
735
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
736
|
+
'1: :_postman_spec_generate_commands' \
|
|
737
|
+
'*::arg:->args'
|
|
738
|
+
case $state in
|
|
739
|
+
args)
|
|
740
|
+
case $words[1] in
|
|
741
|
+
collection) _postman_spec_generate_collection ;;
|
|
742
|
+
esac
|
|
743
|
+
;;
|
|
744
|
+
esac
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
_postman_spec_generate_commands() {
|
|
748
|
+
local -a sub
|
|
749
|
+
sub=(
|
|
750
|
+
'collection:Generate a Postman collection from a specification.'
|
|
751
|
+
)
|
|
752
|
+
_describe -t commands 'generate command' sub
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
_postman_spec_generate_collection() {
|
|
756
|
+
_arguments \
|
|
757
|
+
'(-n --name)'{-n,--name}'[Collection name]:name' \
|
|
758
|
+
'--folder-strategy[Folder strategy\: Paths or Tags (default\: Paths) (default\: "Paths")]:strategy' \
|
|
759
|
+
'(-w --workspace)'{-w,--workspace}'[Workspace ID (cloud mode)]:id' \
|
|
760
|
+
'--api-key[Postman API key]:key:_files -g "*.(pem|crt|key)"' \
|
|
761
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
762
|
+
'*:spec:'
|
|
763
|
+
}
|
|
764
|
+
|
|
577
765
|
_postman_monitor() {
|
|
578
766
|
local context state state_descr line
|
|
579
767
|
typeset -A opt_args
|
|
@@ -585,6 +773,16 @@ _postman_monitor() {
|
|
|
585
773
|
args)
|
|
586
774
|
case $words[1] in
|
|
587
775
|
run) _postman_monitor_run ;;
|
|
776
|
+
create) _postman_monitor_create ;;
|
|
777
|
+
update) _postman_monitor_update ;;
|
|
778
|
+
delete) _postman_monitor_delete ;;
|
|
779
|
+
jobs) _postman_monitor_jobs ;;
|
|
780
|
+
runs) _postman_monitor_runs ;;
|
|
781
|
+
list) _postman_monitor_list ;;
|
|
782
|
+
get) _postman_monitor_get ;;
|
|
783
|
+
metrics) _postman_monitor_metrics ;;
|
|
784
|
+
pause) _postman_monitor_pause ;;
|
|
785
|
+
resume) _postman_monitor_resume ;;
|
|
588
786
|
esac
|
|
589
787
|
;;
|
|
590
788
|
esac
|
|
@@ -594,14 +792,228 @@ _postman_monitor_commands() {
|
|
|
594
792
|
local -a sub
|
|
595
793
|
sub=(
|
|
596
794
|
'run:Invoke a monitor run and display results.'
|
|
795
|
+
'create:Create a collection-based monitor.'
|
|
796
|
+
'update:Update a monitor'\''s schedule, runner, notifications or run options.'
|
|
797
|
+
'delete:Permanently delete a monitor. Prompts for confirmation unless --yes is passed.'
|
|
798
|
+
'jobs:Inspect a monitor'\''s jobs and their per-region runs.'
|
|
799
|
+
'runs:Inspect a monitor run'\''s attempts.'
|
|
800
|
+
'list:List the monitors visible to you.'
|
|
801
|
+
'get:Show a monitor'\''s configuration.'
|
|
802
|
+
'metrics:Show per-request latency and outcome history for a monitor.'
|
|
803
|
+
'pause:Pause a monitor, so it stops firing on schedule.'
|
|
804
|
+
'resume:Resume a paused monitor, so it fires on schedule again.'
|
|
597
805
|
)
|
|
598
806
|
_describe -t commands 'monitor command' sub
|
|
599
807
|
}
|
|
600
808
|
|
|
601
809
|
_postman_monitor_run() {
|
|
602
810
|
_arguments \
|
|
811
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
603
812
|
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Specify whether or not to override the default exit code for the current run]' \
|
|
604
813
|
'(-t --timeout)'{-t,--timeout}'[Maximum wait time for run completion in milliseconds (default\: 15 minutes) (default\: 900000)]:ms' \
|
|
814
|
+
'--async[Submit the run and return immediately with its job id and Postman URL, without waiting for completion]' \
|
|
815
|
+
'--json[Output the run'\''s verdict as JSON instead of a table, printing nothing else]' \
|
|
816
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
817
|
+
'*:monitorId:'
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
_postman_monitor_create() {
|
|
821
|
+
_arguments \
|
|
822
|
+
'(-c --collection)'{-c,--collection}'[Collection to monitor -- accepts the id shown in the Postman app, prefixed or bare]:id' \
|
|
823
|
+
'--name[Monitor name (defaults to the linked collection'\''s own name)]:name' \
|
|
824
|
+
'--environment[Environment to run the monitored collection with]:id' \
|
|
825
|
+
'(-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' \
|
|
826
|
+
'--schedule[Cron expression for the monitor'\''s schedule]:cron' \
|
|
827
|
+
'--timezone[Time zone for --schedule, e.g. America/New_York (defaults to the host machine'\''s own zone)]:tz' \
|
|
828
|
+
'--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' \
|
|
829
|
+
'--notify-email[Email to notify on a run failure or error (repeatable) (default\: \[\])]:email' \
|
|
830
|
+
'--notification-limit[Cap consecutive notifications before they are muted (service range\: 1-99)]:n' \
|
|
831
|
+
'--retry[Retries on a failed run (service caps this at 2)]:n' \
|
|
832
|
+
'--timeout[Request timeout in milliseconds]:ms' \
|
|
833
|
+
'--delay[Delay between requests in milliseconds]:ms' \
|
|
834
|
+
'--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
|
|
835
|
+
'--insecure[Skip TLS certificate verification for the monitored target]' \
|
|
836
|
+
'--follow-redirects[Follow HTTP redirects during the run]' \
|
|
837
|
+
'--block-redirects[Do not follow HTTP redirects during the run]' \
|
|
838
|
+
'--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
|
|
839
|
+
'--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
|
|
840
|
+
'--iteration-count[Number of iterations to run]:n' \
|
|
841
|
+
'--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' \
|
|
842
|
+
'--no-run-now[Do not trigger an immediate run after creating the monitor]' \
|
|
843
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
844
|
+
'--json[Output as JSON instead of a table]' \
|
|
845
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
_postman_monitor_update() {
|
|
849
|
+
_arguments \
|
|
850
|
+
'--name[New monitor name]:name' \
|
|
851
|
+
'--schedule[New cron expression for the monitor'\''s schedule]:cron' \
|
|
852
|
+
'--timezone[Time zone for --schedule, e.g. America/New_York (defaults to the host machine'\''s own zone)]:tz' \
|
|
853
|
+
'--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' \
|
|
854
|
+
'--notify-email[Email to notify on a run failure or error (repeatable; replaces the current list) (default\: \[\])]:email' \
|
|
855
|
+
'--clear-notifications[Remove every notification recipient]' \
|
|
856
|
+
'--notification-limit[Cap consecutive notifications before they are muted (service range\: 1-99)]:n' \
|
|
857
|
+
'--retry[Retries on a failed run (service caps this at 2)]:n' \
|
|
858
|
+
'--timeout[Request timeout in milliseconds]:ms' \
|
|
859
|
+
'--delay[Delay between requests in milliseconds]:ms' \
|
|
860
|
+
'--strict-ssl[Fail the run when the target'\''s TLS certificate cannot be verified]' \
|
|
861
|
+
'--insecure[Skip TLS certificate verification for the monitored target]' \
|
|
862
|
+
'--follow-redirects[Follow HTTP redirects during the run]' \
|
|
863
|
+
'--block-redirects[Do not follow HTTP redirects during the run]' \
|
|
864
|
+
'--dataset-id[Dataset to use as iteration data (used together with --dataset-view-id)]:id' \
|
|
865
|
+
'--dataset-view-id[Dataset view to iterate (used together with --dataset-id)]:id' \
|
|
866
|
+
'--iteration-count[Number of iterations to run]:n' \
|
|
867
|
+
'--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' \
|
|
868
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
869
|
+
'--json[Output as JSON instead of a table]' \
|
|
870
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
871
|
+
'*:monitorId:'
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
_postman_monitor_delete() {
|
|
875
|
+
_arguments \
|
|
876
|
+
'(-y --yes)'{-y,--yes}'[Skip the confirmation prompt]' \
|
|
877
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
878
|
+
'--json[Output the outcome, including any failure, as JSON instead of a plain message]' \
|
|
879
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
880
|
+
'*:monitorId:'
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
_postman_monitor_jobs() {
|
|
884
|
+
local context state state_descr line
|
|
885
|
+
typeset -A opt_args
|
|
886
|
+
_arguments -C \
|
|
887
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
888
|
+
'1: :_postman_monitor_jobs_commands' \
|
|
889
|
+
'*::arg:->args'
|
|
890
|
+
case $state in
|
|
891
|
+
args)
|
|
892
|
+
case $words[1] in
|
|
893
|
+
list) _postman_monitor_jobs_list ;;
|
|
894
|
+
get) _postman_monitor_jobs_get ;;
|
|
895
|
+
esac
|
|
896
|
+
;;
|
|
897
|
+
esac
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
_postman_monitor_jobs_commands() {
|
|
901
|
+
local -a sub
|
|
902
|
+
sub=(
|
|
903
|
+
'list:List a monitor'\''s recent jobs.'
|
|
904
|
+
'get:Report one job'\''s terminal state and its per-region run outcomes.'
|
|
905
|
+
)
|
|
906
|
+
_describe -t commands 'jobs command' sub
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
_postman_monitor_jobs_list() {
|
|
910
|
+
_arguments \
|
|
911
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
912
|
+
'--result[Filter by outcome, e.g. success, failure, error, abort (server-validated, not a fixed list)]:value' \
|
|
913
|
+
'--trigger[Filter by trigger, e.g. api, schedule, webhook, postman-cli (server-validated, not a fixed list)]:value' \
|
|
914
|
+
'--since[Only jobs that finished at or after this ISO 8601 date-time]:dateTime' \
|
|
915
|
+
'--limit[Maximum number of jobs to return]:n' \
|
|
916
|
+
'--cursor[Opaque pagination cursor]:token' \
|
|
917
|
+
'--json[Output as JSON instead of a table]' \
|
|
918
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
919
|
+
'*:monitorId:'
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
_postman_monitor_jobs_get() {
|
|
923
|
+
_arguments \
|
|
924
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
925
|
+
'--json[Output as JSON instead of a table]' \
|
|
926
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
927
|
+
'*:jobId:'
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
_postman_monitor_runs() {
|
|
931
|
+
local context state state_descr line
|
|
932
|
+
typeset -A opt_args
|
|
933
|
+
_arguments -C \
|
|
934
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
935
|
+
'1: :_postman_monitor_runs_commands' \
|
|
936
|
+
'*::arg:->args'
|
|
937
|
+
case $state in
|
|
938
|
+
args)
|
|
939
|
+
case $words[1] in
|
|
940
|
+
get) _postman_monitor_runs_get ;;
|
|
941
|
+
esac
|
|
942
|
+
;;
|
|
943
|
+
esac
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
_postman_monitor_runs_commands() {
|
|
947
|
+
local -a sub
|
|
948
|
+
sub=(
|
|
949
|
+
'get:Report which test assertions ran during one attempt of a run, which failed, and why.'
|
|
950
|
+
)
|
|
951
|
+
_describe -t commands 'runs command' sub
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
_postman_monitor_runs_get() {
|
|
955
|
+
_arguments \
|
|
956
|
+
'--api-key[Postman API key (defaults to the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
957
|
+
'--attempt[Which attempt of the run to show, counting from 0 (default\: the latest)]:n' \
|
|
958
|
+
'--failed-only[Show only failed assertions]' \
|
|
959
|
+
'--json[Output as JSON instead of a table]' \
|
|
960
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
961
|
+
'*:runId:'
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
_postman_monitor_list() {
|
|
965
|
+
_arguments \
|
|
966
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
967
|
+
'(-w --workspace)'{-w,--workspace}'[Filter to monitors in this workspace]:id' \
|
|
968
|
+
'(-c --collection)'{-c,--collection}'[Filter to monitors on this collection]:id' \
|
|
969
|
+
'--environment[Filter to monitors on this environment]:id' \
|
|
970
|
+
'--runner[Filter to a Self-Hosted Runner ID (not a Postman Region). Cannot be combined with --workspace, --collection, --environment, --owner, --team or --active.]:id' \
|
|
971
|
+
'--owner[Filter to monitors created by this user id (shown in the Owner column)]:id' \
|
|
972
|
+
'--team[Filter to monitors owned by your own team]' \
|
|
973
|
+
'--active[Filter by active state]:true|false' \
|
|
974
|
+
'--limit[Max monitors to return. The service caps page size and rejects a value above it with its own error.]:n' \
|
|
975
|
+
'--offset[Not supported\: the service accepts this parameter and silently ignores it. Refused locally. Use --cursor instead.]:n' \
|
|
976
|
+
'--cursor[Pagination cursor from a previous page'\''s response.]:token' \
|
|
977
|
+
'--columns[Comma-separated columns to show. Defaults to Name, Status, ID, Schedule, Owner, Collection. Also available\: State, Notifications, Environment, Runners.]:names' \
|
|
978
|
+
'--no-headers[Omit the header row]' \
|
|
979
|
+
'(-f --filter)'{-f,--filter}'[Show only monitors whose name contains this text (applies to the returned page, case-insensitive)]:text' \
|
|
980
|
+
'--sort[Sort the returned page by "name" or "active"]:field' \
|
|
981
|
+
'--json[Output as JSON instead of a table]' \
|
|
982
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
_postman_monitor_get() {
|
|
986
|
+
_arguments \
|
|
987
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
988
|
+
'--json[Output as JSON instead of a table]' \
|
|
989
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
990
|
+
'*:monitorId:'
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
_postman_monitor_metrics() {
|
|
994
|
+
_arguments \
|
|
995
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
996
|
+
'--since[Only executions at or after this ISO 8601 date-time. Defaults to 7 days ago.]:dateTime' \
|
|
997
|
+
'--until[Only executions at or before this ISO 8601 date-time. Defaults to now.]:dateTime' \
|
|
998
|
+
'(-f --filter)'{-f,--filter}'[Show only requests whose name contains this text (case-insensitive)]:text' \
|
|
999
|
+
'--limit[Cap the number of rows shown\: executions (newest first) under --json, or table rows (worst-behaving request first) otherwise. Not honoured by the service -- there is no server-side pagination on this route.]:n' \
|
|
1000
|
+
'--json[Output as JSON instead of a table]' \
|
|
1001
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1002
|
+
'*:monitorId:'
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
_postman_monitor_pause() {
|
|
1006
|
+
_arguments \
|
|
1007
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1008
|
+
'--json[Output as JSON instead of a table]' \
|
|
1009
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1010
|
+
'*:monitorId:'
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
_postman_monitor_resume() {
|
|
1014
|
+
_arguments \
|
|
1015
|
+
'--api-key[Postman API key (defaults to POSTMAN_API_KEY, then the `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1016
|
+
'--json[Output as JSON instead of a table]' \
|
|
605
1017
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
606
1018
|
'*:monitorId:'
|
|
607
1019
|
}
|
|
@@ -623,6 +1035,7 @@ _postman_workspace() {
|
|
|
623
1035
|
create) _postman_workspace_create ;;
|
|
624
1036
|
pull) _postman_workspace_pull ;;
|
|
625
1037
|
connect-git) _postman_workspace_connect_git ;;
|
|
1038
|
+
diff) _postman_workspace_diff ;;
|
|
626
1039
|
esac
|
|
627
1040
|
;;
|
|
628
1041
|
esac
|
|
@@ -638,6 +1051,7 @@ _postman_workspace_commands() {
|
|
|
638
1051
|
'create:Create a Postman workspace and bind it to this git repository.'
|
|
639
1052
|
'pull:Pull workspace entities from a Postman workspace into the local git-native folder.'
|
|
640
1053
|
'connect-git:Connect a Postman workspace to a local git repository.'
|
|
1054
|
+
'diff:Preview local-vs-cloud drift before pushing. Read-only\: nothing is created, updated or deleted.'
|
|
641
1055
|
)
|
|
642
1056
|
_describe -t commands 'workspace command' sub
|
|
643
1057
|
}
|
|
@@ -706,6 +1120,18 @@ _postman_workspace_connect_git() {
|
|
|
706
1120
|
'*:path:_files -g "*.json"'
|
|
707
1121
|
}
|
|
708
1122
|
|
|
1123
|
+
_postman_workspace_diff() {
|
|
1124
|
+
_arguments \
|
|
1125
|
+
'--push-strategy[Strategy to preview. "force-sync" also shows cloud entities that would be DELETED. Defaults to "force-sync".]:strategy' \
|
|
1126
|
+
'--summary[Skip content comparison. Faster, but updates are listed without checking whether they changed.]' \
|
|
1127
|
+
'--json[Print the diff as machine-readable JSON.]' \
|
|
1128
|
+
'--exit-code[Exit with code 1 when drift is found (for CI gates).]' \
|
|
1129
|
+
'--verbose[Show detailed logging]' \
|
|
1130
|
+
'--timeout[Abort the run after this many milliseconds. Defaults to 120000.]:ms' \
|
|
1131
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1132
|
+
'*:workspaceId:'
|
|
1133
|
+
}
|
|
1134
|
+
|
|
709
1135
|
_postman_performance() {
|
|
710
1136
|
local context state state_descr line
|
|
711
1137
|
typeset -A opt_args
|
|
@@ -717,6 +1143,7 @@ _postman_performance() {
|
|
|
717
1143
|
args)
|
|
718
1144
|
case $words[1] in
|
|
719
1145
|
run) _postman_performance_run ;;
|
|
1146
|
+
runs) _postman_performance_runs ;;
|
|
720
1147
|
esac
|
|
721
1148
|
;;
|
|
722
1149
|
esac
|
|
@@ -726,6 +1153,7 @@ _postman_performance_commands() {
|
|
|
726
1153
|
local -a sub
|
|
727
1154
|
sub=(
|
|
728
1155
|
'run:Run a performance test on a collection'
|
|
1156
|
+
'runs:List past performance runs for a collection, newest first.'
|
|
729
1157
|
)
|
|
730
1158
|
_describe -t commands 'performance command' sub
|
|
731
1159
|
}
|
|
@@ -751,6 +1179,16 @@ _postman_performance_run() {
|
|
|
751
1179
|
'*:collectionId:_files -g "*.json"'
|
|
752
1180
|
}
|
|
753
1181
|
|
|
1182
|
+
_postman_performance_runs() {
|
|
1183
|
+
_arguments \
|
|
1184
|
+
'(-c --collection-id)'{-c,--collection-id}'[Collection ID whose performance runs to list]:id' \
|
|
1185
|
+
'--cursor[Pagination cursor from a previous page'\''s response]:token' \
|
|
1186
|
+
'--json[Output as JSON instead of a table]' \
|
|
1187
|
+
'--timeout[Milliseconds to wait for the service before failing (default\: "30000")]:ms' \
|
|
1188
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1189
|
+
'*:id:'
|
|
1190
|
+
}
|
|
1191
|
+
|
|
754
1192
|
_postman_flows() {
|
|
755
1193
|
local context state state_descr line
|
|
756
1194
|
typeset -A opt_args
|
|
@@ -1103,6 +1541,7 @@ _postman_mock() {
|
|
|
1103
1541
|
case $words[1] in
|
|
1104
1542
|
generate) _postman_mock_generate ;;
|
|
1105
1543
|
run) _postman_mock_run ;;
|
|
1544
|
+
push) _postman_mock_push ;;
|
|
1106
1545
|
deploy) _postman_mock_deploy ;;
|
|
1107
1546
|
get) _postman_mock_get ;;
|
|
1108
1547
|
list) _postman_mock_list ;;
|
|
@@ -1116,26 +1555,27 @@ _postman_mock() {
|
|
|
1116
1555
|
_postman_mock_commands() {
|
|
1117
1556
|
local -a sub
|
|
1118
1557
|
sub=(
|
|
1119
|
-
'generate:Generate a
|
|
1120
|
-
'run:Start a
|
|
1121
|
-
'
|
|
1122
|
-
'
|
|
1123
|
-
'
|
|
1124
|
-
'
|
|
1125
|
-
'
|
|
1558
|
+
'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.'
|
|
1559
|
+
'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).'
|
|
1560
|
+
'push:Upload a mock from your repository to Postman cloud (creates it the first time, updates it after).'
|
|
1561
|
+
'deploy:Turn a mock in Postman cloud into a live mock server others can call over the internet.'
|
|
1562
|
+
'get:Show a mock'\''s details using its path if it lives in your repository, or its id if it lives in Postman cloud.'
|
|
1563
|
+
'list:List the mocks in your repository or Postman cloud workspace'
|
|
1564
|
+
'log:Show the requests a live mock server has received and the responses it sent, using its id.'
|
|
1565
|
+
'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
1566
|
)
|
|
1127
1567
|
_describe -t commands 'mock command' sub
|
|
1128
1568
|
}
|
|
1129
1569
|
|
|
1130
1570
|
_postman_mock_generate() {
|
|
1131
1571
|
_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
|
|
1572
|
+
'(-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"' \
|
|
1573
|
+
'(-n --name)'{-n,--name}'[Name for the mock. Taken from the source when you provide one; required for the sample.]:name' \
|
|
1574
|
+
'--port[Port the mock runs on (e.g. 4010) (default\: 4500)]:port' \
|
|
1575
|
+
'--force[Overwrite the mock'\''s files if the target folder already has one]' \
|
|
1576
|
+
'(-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"' \
|
|
1577
|
+
'(-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' \
|
|
1578
|
+
'--api-key[Postman API key to use with --workspace (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1139
1579
|
'(-x --suppress-exit-code)'{-x,--suppress-exit-code}'[Always exit with code 0, even on failure]' \
|
|
1140
1580
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1141
1581
|
'*:sourcePath:'
|
|
@@ -1143,62 +1583,70 @@ _postman_mock_generate() {
|
|
|
1143
1583
|
|
|
1144
1584
|
_postman_mock_run() {
|
|
1145
1585
|
_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
|
|
1586
|
+
'(-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"' \
|
|
1587
|
+
'(-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"' \
|
|
1588
|
+
'(-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' \
|
|
1589
|
+
'--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1150
1590
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1151
1591
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1152
1592
|
}
|
|
1153
1593
|
|
|
1594
|
+
_postman_mock_push() {
|
|
1595
|
+
_arguments \
|
|
1596
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace to upload to, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1597
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1598
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1599
|
+
'*:mockPath:_files -g "*.json"'
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1154
1602
|
_postman_mock_deploy() {
|
|
1155
1603
|
_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
|
|
1604
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace that will own the server, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1605
|
+
'(-n --name)'{-n,--name}'[Name for the mock server (you are asked for one if you skip this)]:name' \
|
|
1606
|
+
'(-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' \
|
|
1607
|
+
'--public[Let anyone with the link reach the server. Private by default (callers must send a Postman API key).]' \
|
|
1608
|
+
'--auto-deploy[Update the live server automatically whenever the mock changes (off by default)]' \
|
|
1609
|
+
'(-y --yes)'{-y,--yes}'[Use the defaults and skip all questions (private, no auto-deploy)]' \
|
|
1610
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1163
1611
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1164
1612
|
'*:mockId:_files -g "*.json"'
|
|
1165
1613
|
}
|
|
1166
1614
|
|
|
1167
1615
|
_postman_mock_get() {
|
|
1168
1616
|
_arguments \
|
|
1169
|
-
'--api-key[Postman API key (defaults to
|
|
1170
|
-
'--json[
|
|
1617
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1618
|
+
'--json[Print the details as machine-readable data instead of a table]' \
|
|
1171
1619
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1172
1620
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1173
1621
|
}
|
|
1174
1622
|
|
|
1175
1623
|
_postman_mock_list() {
|
|
1176
1624
|
_arguments \
|
|
1177
|
-
'(-w --workspace)'{-w,--workspace}'[
|
|
1178
|
-
'--api-key[Postman API key (defaults to
|
|
1179
|
-
'--json[
|
|
1625
|
+
'(-w --workspace)'{-w,--workspace}'[Postman cloud workspace whose mocks to list, by id (defaults to the workspace already linked to this project)]:id' \
|
|
1626
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1627
|
+
'--json[Print the list as machine-readable data instead of a table]' \
|
|
1180
1628
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1181
1629
|
'*:pathOrDir:_files -g "*.json"'
|
|
1182
1630
|
}
|
|
1183
1631
|
|
|
1184
1632
|
_postman_mock_log() {
|
|
1185
1633
|
_arguments \
|
|
1186
|
-
'--limit[
|
|
1187
|
-
'--method[
|
|
1188
|
-
'--status[
|
|
1189
|
-
'--path[
|
|
1190
|
-
'--since[Show
|
|
1191
|
-
'--until[
|
|
1192
|
-
'--api-key[Postman API key (defaults to
|
|
1193
|
-
'--json[
|
|
1634
|
+
'--limit[Most entries to show (defaults to 50 when printing machine-readable output)]:n' \
|
|
1635
|
+
'--method[Show only requests of this type (e.g. GET, POST)]:method' \
|
|
1636
|
+
'--status[Show only these response codes (e.g. 404, or 5xx for any 500-series)]:code|range' \
|
|
1637
|
+
'--path[Show only requests to matching addresses (use * and ? as wildcards, e.g. /users/*)]:pattern' \
|
|
1638
|
+
'--since[Show entries from this long ago until now (e.g. 2h = the last 2 hours)]:duration' \
|
|
1639
|
+
'--until[Hide entries newer than this (e.g. 30m = skip the most recent 30 minutes)]:duration' \
|
|
1640
|
+
'--api-key[Postman API key (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1641
|
+
'--json[Print entries as machine-readable data instead of the scrollable view]' \
|
|
1194
1642
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1195
1643
|
'*:mockServerId:_files -g "*.json"'
|
|
1196
1644
|
}
|
|
1197
1645
|
|
|
1198
1646
|
_postman_mock_delete() {
|
|
1199
1647
|
_arguments \
|
|
1200
|
-
'(-y --yes)'{-y,--yes}'[
|
|
1201
|
-
'--api-key[Postman API key
|
|
1648
|
+
'(-y --yes)'{-y,--yes}'[Delete without asking for confirmation first]' \
|
|
1649
|
+
'--api-key[Postman API key, used with a Postman cloud id (defaults to your `postman login` session)]:key:_files -g "*.(pem|crt|key)"' \
|
|
1202
1650
|
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
1203
1651
|
'*:mockIdOrPath:_files -g "*.json"'
|
|
1204
1652
|
}
|
|
@@ -2143,6 +2591,9 @@ _postman_dependency() {
|
|
|
2143
2591
|
args)
|
|
2144
2592
|
case $words[1] in
|
|
2145
2593
|
add) _postman_dependency_add ;;
|
|
2594
|
+
list) _postman_dependency_list ;;
|
|
2595
|
+
install) _postman_dependency_install ;;
|
|
2596
|
+
update) _postman_dependency_update ;;
|
|
2146
2597
|
esac
|
|
2147
2598
|
;;
|
|
2148
2599
|
esac
|
|
@@ -2152,6 +2603,9 @@ _postman_dependency_commands() {
|
|
|
2152
2603
|
local -a sub
|
|
2153
2604
|
sub=(
|
|
2154
2605
|
'add:Add a Postman collection, environment, or mock as a workspace dependency.'
|
|
2606
|
+
'list:List the workspace dependencies declared in .postman/resources.yaml.'
|
|
2607
|
+
'install:Materialise the dependencies declared in .postman/resources.yaml (all, or one).'
|
|
2608
|
+
'update:Refresh declared dependencies to the latest content from their source (all, or one).'
|
|
2155
2609
|
)
|
|
2156
2610
|
_describe -t commands 'dependency command' sub
|
|
2157
2611
|
}
|
|
@@ -2165,6 +2619,29 @@ _postman_dependency_add() {
|
|
|
2165
2619
|
'*:nameOrId:'
|
|
2166
2620
|
}
|
|
2167
2621
|
|
|
2622
|
+
_postman_dependency_list() {
|
|
2623
|
+
_arguments \
|
|
2624
|
+
'--type[Only list dependencies of this type (collection, environment, or mock).]:type' \
|
|
2625
|
+
'--json[Output the result as JSON.]' \
|
|
2626
|
+
'(-h --help)'{-h,--help}'[display help for command]'
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
_postman_dependency_install() {
|
|
2630
|
+
_arguments \
|
|
2631
|
+
'--type[Only install dependencies of this type (collection, environment, or mock).]:type' \
|
|
2632
|
+
'--json[Output the result as JSON.]' \
|
|
2633
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
2634
|
+
'*:nameOrId:'
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
_postman_dependency_update() {
|
|
2638
|
+
_arguments \
|
|
2639
|
+
'--type[Only update dependencies of this type (collection, environment, or mock).]:type' \
|
|
2640
|
+
'--json[Output the result as JSON.]' \
|
|
2641
|
+
'(-h --help)'{-h,--help}'[display help for command]' \
|
|
2642
|
+
'*:nameOrId:'
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2168
2645
|
# When loaded via fpath + compinit, the file body becomes the function body of
|
|
2169
2646
|
# `_postman`. In that case `funcstack[1]` is `_postman` and we must actually
|
|
2170
2647
|
# invoke the completion. When sourced directly, this is a no-op — `_postman`
|