@shipstatic/ship 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,16 +22,14 @@ _ship_completions() {
22
22
  COMPREPLY=( $(compgen -f -- "${current_word}") )
23
23
  return
24
24
  ;;
25
- "get"|"remove")
26
- if [[ ${COMP_CWORD} -eq 3 ]]; then
27
- # Would ideally complete deployment IDs from API, but keep simple for now
28
- COMPREPLY=()
29
- return
30
- fi
25
+ "get"|"set"|"remove")
26
+ # Deployment ID position
27
+ COMPREPLY=()
28
+ return
31
29
  ;;
32
30
  *)
33
31
  if [[ ${COMP_CWORD} -eq 2 ]]; then
34
- completions="list create get remove"
32
+ completions="list create get set remove"
35
33
  COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
36
34
  return
37
35
  fi
@@ -41,22 +39,34 @@ _ship_completions() {
41
39
  "domains")
42
40
  case "${COMP_WORDS[2]}" in
43
41
  "set")
44
- if [[ ${COMP_CWORD} -eq 4 ]]; then
45
- # Would ideally complete deployment IDs, but keep simple
46
- COMPREPLY=()
47
- return
48
- fi
42
+ # Domain name or deployment ID positions
43
+ COMPREPLY=()
44
+ return
45
+ ;;
46
+ "get"|"validate"|"verify"|"remove")
47
+ # Domain name position
48
+ COMPREPLY=()
49
+ return
49
50
  ;;
50
- "get"|"remove")
51
- if [[ ${COMP_CWORD} -eq 3 ]]; then
52
- # Would ideally complete domain names, but keep simple
53
- COMPREPLY=()
51
+ *)
52
+ if [[ ${COMP_CWORD} -eq 2 ]]; then
53
+ completions="list get set validate verify remove"
54
+ COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
54
55
  return
55
56
  fi
56
57
  ;;
58
+ esac
59
+ ;;
60
+ "tokens")
61
+ case "${COMP_WORDS[2]}" in
62
+ "remove")
63
+ # Token ID position
64
+ COMPREPLY=()
65
+ return
66
+ ;;
57
67
  *)
58
68
  if [[ ${COMP_CWORD} -eq 2 ]]; then
59
- completions="list get set remove"
69
+ completions="list create remove"
60
70
  COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
61
71
  return
62
72
  fi
@@ -79,7 +89,7 @@ _ship_completions() {
79
89
  ;;
80
90
  esac
81
91
 
82
- # Delegate for commands that expect files, like 'create'
92
+ # Delegate for commands that expect files
83
93
  if [[ "$prev_word" == "create" || "$prev_word" == "--config" ]]; then
84
94
  COMPREPLY=( $(compgen -f -- "${current_word}") )
85
95
  return
@@ -87,14 +97,14 @@ _ship_completions() {
87
97
 
88
98
  # Flag completion
89
99
  if [[ "$current_word" == --* ]]; then
90
- completions="--api-key --config --api-url --no-path-detect --no-spa-detect --json --no-color --version --help"
100
+ completions="--api-key --deploy-token --config --api-url --label --no-path-detect --no-spa-detect --json --no-color --version --help"
91
101
  COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
92
102
  return
93
103
  fi
94
104
 
95
105
  # Top-level commands
96
106
  if [[ ${COMP_CWORD} -eq 1 ]]; then
97
- completions="ping whoami deployments domains account completion"
107
+ completions="ping whoami deployments domains tokens account config completion"
98
108
  COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
99
109
  return
100
110
  fi
@@ -104,4 +114,4 @@ _ship_completions() {
104
114
  }
105
115
 
106
116
  # Register the completion function for the 'ship' command
107
- complete -F _ship_completions ship
117
+ complete -F _ship_completions ship
@@ -35,34 +35,47 @@ complete -c ship -f -n '__fish_use_subcommand' -a 'ping' -d 'Check API connectiv
35
35
  complete -c ship -f -n '__fish_use_subcommand' -a 'whoami' -d 'Get current account information'
36
36
  complete -c ship -f -n '__fish_use_subcommand' -a 'deployments' -d 'Manage deployments'
37
37
  complete -c ship -f -n '__fish_use_subcommand' -a 'domains' -d 'Manage domains'
38
+ complete -c ship -f -n '__fish_use_subcommand' -a 'tokens' -d 'Manage deploy tokens'
38
39
  complete -c ship -f -n '__fish_use_subcommand' -a 'account' -d 'Manage account'
40
+ complete -c ship -f -n '__fish_use_subcommand' -a 'config' -d 'Create or update configuration'
39
41
  complete -c ship -f -n '__fish_use_subcommand' -a 'completion' -d 'Setup shell completion'
40
42
 
41
43
  # Global options
42
44
  complete -c ship -l api-key -d 'API key for authentication' -x
45
+ complete -c ship -l deploy-token -d 'Deploy token for single-use deployments' -x
43
46
  complete -c ship -l config -d 'Custom config file path' -r
44
47
  complete -c ship -l api-url -d 'API URL (for development)' -x
48
+ complete -c ship -l label -d 'Label (can be repeated)' -x
45
49
  complete -c ship -l json -d 'Output results in JSON format'
46
50
  complete -c ship -l no-color -d 'Disable colored output'
51
+ complete -c ship -l no-path-detect -d 'Disable automatic path optimization and flattening'
52
+ complete -c ship -l no-spa-detect -d 'Disable automatic SPA detection and configuration'
47
53
  complete -c ship -l version -d 'Show version information'
48
54
  complete -c ship -l help -d 'Display help for command'
49
55
 
50
56
  # Deployments subcommands
51
57
  complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'list' -d 'List all deployments'
52
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'create' -d 'Create deployment from file or directory'
58
+ complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'create' -d 'Create deployment from directory'
53
59
  complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'get' -d 'Show deployment information'
60
+ complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'set' -d 'Set deployment labels'
54
61
  complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'remove' -d 'Delete deployment permanently'
55
62
 
56
- # Deployments create options
57
- complete -c ship -l no-path-detect -d 'Disable automatic path optimization and flattening'
58
- complete -c ship -l no-spa-detect -d 'Disable automatic SPA detection and configuration'
59
-
60
63
  # Domains subcommands
61
64
  complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'list' -d 'List all domains'
62
65
  complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'get' -d 'Show domain information'
63
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'set' -d 'Create or update domain pointing to deployment'
66
+ complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'set' -d 'Create domain, link to deployment, or update labels'
67
+ complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'validate' -d 'Check if domain name is valid and available'
68
+ complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'verify' -d 'Trigger DNS verification for external domain'
64
69
  complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'remove' -d 'Delete domain permanently'
65
70
 
71
+ # Tokens subcommands
72
+ complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'list' -d 'List all deploy tokens'
73
+ complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'create' -d 'Create a new deploy token'
74
+ complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'remove' -d 'Delete token permanently'
75
+
76
+ # Tokens create options
77
+ complete -c ship -l ttl -d 'Time to live in seconds' -x
78
+
66
79
  # Account subcommands
67
80
  complete -c ship -f -n '__fish_seen_subcommand_from account' -a 'get' -d 'Show account information'
68
81
 
@@ -71,4 +84,4 @@ complete -c ship -f -n '__fish_seen_subcommand_from completion' -a 'install' -d
71
84
  complete -c ship -f -n '__fish_seen_subcommand_from completion' -a 'uninstall' -d 'Uninstall shell completion script'
72
85
 
73
86
  # File completion for appropriate commands (only when not a path is being typed)
74
- complete -c ship -F -n '__ship_needs_file and not __ship_is_path'
87
+ complete -c ship -F -n '__ship_needs_file and not __ship_is_path'
@@ -5,15 +5,15 @@ if [[ -n ${ZSH_VERSION-} ]]; then
5
5
  _ship() {
6
6
  local -a completions
7
7
  local state line
8
-
8
+
9
9
  # Only proceed if we're actually in a completion context
10
10
  if [[ -z ${words-} ]]; then
11
11
  return 1
12
12
  fi
13
-
13
+
14
14
  # The word being completed
15
15
  local current_word="${words[CURRENT]}"
16
- # The previous word
16
+ # The previous word
17
17
  local prev_word="${words[CURRENT-1]}"
18
18
 
19
19
  # --- File Path Logic ---
@@ -32,15 +32,13 @@ if [[ -n ${ZSH_VERSION-} ]]; then
32
32
  _files
33
33
  return
34
34
  ;;
35
- "get"|"remove")
36
- if [[ $CURRENT -eq 4 ]]; then
37
- # Would ideally complete deployment IDs from API, but keep simple for now
38
- return
39
- fi
35
+ "get"|"set"|"remove")
36
+ # Deployment ID position
37
+ return
40
38
  ;;
41
39
  *)
42
40
  if [[ $CURRENT -eq 3 ]]; then
43
- completions=("list:List all deployments" "create:Create deployment from file or directory" "get:Show deployment information" "remove:Delete deployment permanently")
41
+ completions=("list:List all deployments" "create:Create deployment from directory" "get:Show deployment information" "set:Set deployment labels" "remove:Delete deployment permanently")
44
42
  _describe 'deployments commands' completions
45
43
  return
46
44
  fi
@@ -50,21 +48,32 @@ if [[ -n ${ZSH_VERSION-} ]]; then
50
48
  "domains")
51
49
  case "${words[3]}" in
52
50
  "set")
53
- if [[ $CURRENT -eq 5 ]]; then
54
- # Would ideally complete deployment IDs, but keep simple
55
- return
56
- fi
51
+ # Domain name or deployment ID positions
52
+ return
53
+ ;;
54
+ "get"|"validate"|"verify"|"remove")
55
+ # Domain name position
56
+ return
57
57
  ;;
58
- "get"|"remove")
59
- if [[ $CURRENT -eq 4 ]]; then
60
- # Would ideally complete domain names, but keep simple
58
+ *)
59
+ if [[ $CURRENT -eq 3 ]]; then
60
+ completions=("list:List all domains" "get:Show domain information" "set:Create domain, link to deployment, or update labels" "validate:Check if domain name is valid and available" "verify:Trigger DNS verification for external domain" "remove:Delete domain permanently")
61
+ _describe 'domains commands' completions
61
62
  return
62
63
  fi
63
64
  ;;
65
+ esac
66
+ ;;
67
+ "tokens")
68
+ case "${words[3]}" in
69
+ "remove")
70
+ # Token ID position
71
+ return
72
+ ;;
64
73
  *)
65
74
  if [[ $CURRENT -eq 3 ]]; then
66
- completions=("list:List all domains" "get:Show domain information" "set:Create or update domain pointing to deployment" "remove:Delete domain permanently")
67
- _describe 'domains commands' completions
75
+ completions=("list:List all deploy tokens" "create:Create a new deploy token" "remove:Delete token permanently")
76
+ _describe 'tokens commands' completions
68
77
  return
69
78
  fi
70
79
  ;;
@@ -94,14 +103,14 @@ if [[ -n ${ZSH_VERSION-} ]]; then
94
103
 
95
104
  # Flag completion
96
105
  if [[ "$current_word" == --* ]]; then
97
- completions=("--api-key:API key for authentication" "--config:Custom config file path" "--api-url:API URL (for development)" "--no-path-detect:Disable automatic path optimization and flattening" "--no-spa-detect:Disable automatic SPA detection and configuration" "--json:Output results in JSON format" "--no-color:Disable colored output" "--version:Show version information" "--help:Display help for command")
106
+ completions=("--api-key:API key for authentication" "--deploy-token:Deploy token for single-use deployments" "--config:Custom config file path" "--api-url:API URL (for development)" "--label:Label (can be repeated)" "--no-path-detect:Disable automatic path optimization and flattening" "--no-spa-detect:Disable automatic SPA detection and configuration" "--json:Output results in JSON format" "--no-color:Disable colored output" "--version:Show version information" "--help:Display help for command")
98
107
  _describe 'options' completions
99
108
  return
100
109
  fi
101
110
 
102
111
  # Top-level commands
103
112
  if [[ $CURRENT -eq 2 ]]; then
104
- completions=("ping:Check API connectivity" "whoami:Get current account information" "deployments:Manage deployments" "domains:Manage domains" "account:Manage account" "completion:Setup shell completion")
113
+ completions=("ping:Check API connectivity" "whoami:Get current account information" "deployments:Manage deployments" "domains:Manage domains" "tokens:Manage deploy tokens" "account:Manage account" "config:Create or update configuration" "completion:Setup shell completion")
105
114
  _describe 'commands' completions
106
115
  return
107
116
  fi
@@ -114,4 +123,4 @@ if [[ -n ${ZSH_VERSION-} ]]; then
114
123
  if (( ${+functions[compdef]} )); then
115
124
  compdef _ship ship
116
125
  fi
117
- fi
126
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/ship",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "SDK & CLI for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",