hotcodepush 0.1.0 → 0.2.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.
Files changed (101) hide show
  1. package/dist/commands/app/create.js +1 -1
  2. package/dist/commands/app/delete.js +2 -2
  3. package/dist/commands/app/get.js +1 -1
  4. package/dist/commands/app/list.js +1 -1
  5. package/dist/commands/app/transfer.js +1 -1
  6. package/dist/commands/app/update.js +1 -1
  7. package/dist/commands/audience/get.js +2 -2
  8. package/dist/commands/audit-log/list.js +2 -2
  9. package/dist/commands/binary/create.js +11 -9
  10. package/dist/commands/binary/get.js +1 -1
  11. package/dist/commands/binary/list.js +2 -2
  12. package/dist/commands/bundle/delete.js +2 -2
  13. package/dist/commands/bundle/get.js +1 -1
  14. package/dist/commands/bundle/list.js +2 -2
  15. package/dist/commands/bundle/upload.js +7 -6
  16. package/dist/commands/channel/create.js +1 -1
  17. package/dist/commands/channel/delete.js +3 -3
  18. package/dist/commands/channel/get.js +1 -1
  19. package/dist/commands/channel/list.js +1 -1
  20. package/dist/commands/channel/pause.js +1 -1
  21. package/dist/commands/channel/resume.js +1 -1
  22. package/dist/commands/channel/update.js +1 -1
  23. package/dist/commands/checkout/create.js +1 -1
  24. package/dist/commands/completion.js +2 -1
  25. package/dist/commands/customer-portal-session/create.js +1 -1
  26. package/dist/commands/device/delete.js +2 -2
  27. package/dist/commands/device/get.js +1 -1
  28. package/dist/commands/device/list.js +3 -3
  29. package/dist/commands/device/probe.js +3 -3
  30. package/dist/commands/doctor.js +2 -1
  31. package/dist/commands/fingerprint/diff.js +3 -2
  32. package/dist/commands/fingerprint.js +3 -2
  33. package/dist/commands/init.js +4 -3
  34. package/dist/commands/invitation/accept.js +1 -1
  35. package/dist/commands/invitation/create.js +2 -2
  36. package/dist/commands/invitation/delete.js +2 -2
  37. package/dist/commands/invitation/list.js +1 -1
  38. package/dist/commands/limit/list.js +1 -1
  39. package/dist/commands/login.js +4 -153
  40. package/dist/commands/logout.js +7 -5
  41. package/dist/commands/member/delete.js +2 -2
  42. package/dist/commands/member/get.js +1 -1
  43. package/dist/commands/member/list.js +1 -1
  44. package/dist/commands/member/update.js +2 -2
  45. package/dist/commands/open.js +1 -1
  46. package/dist/commands/organization/create.js +1 -1
  47. package/dist/commands/organization/delete.js +2 -2
  48. package/dist/commands/organization/get.js +1 -1
  49. package/dist/commands/organization/list.js +1 -1
  50. package/dist/commands/organization/update.js +1 -1
  51. package/dist/commands/release/create.js +5 -5
  52. package/dist/commands/release/get.js +1 -1
  53. package/dist/commands/release/list.js +1 -1
  54. package/dist/commands/release/pause.js +1 -1
  55. package/dist/commands/release/resume.js +1 -1
  56. package/dist/commands/release/revoke.js +5 -4
  57. package/dist/commands/release/rollback.js +3 -3
  58. package/dist/commands/release/rollout.js +4 -4
  59. package/dist/commands/release/update.js +2 -2
  60. package/dist/commands/resource-file/write.js +8 -6
  61. package/dist/commands/signing-key/add.js +2 -2
  62. package/dist/commands/signing-key/create.js +2 -2
  63. package/dist/commands/signing-key/delete.js +1 -1
  64. package/dist/commands/signing-key/list.js +2 -2
  65. package/dist/commands/sso-provider/delete.js +1 -1
  66. package/dist/commands/sso-provider/get.js +1 -1
  67. package/dist/commands/sso-provider/set.js +2 -2
  68. package/dist/commands/sso-provider/verify.js +2 -2
  69. package/dist/commands/statistics/get.js +5 -5
  70. package/dist/commands/usage/get.js +1 -1
  71. package/dist/commands/usage/list.js +1 -1
  72. package/dist/commands/webhook/create.js +3 -3
  73. package/dist/commands/webhook/delete.js +1 -1
  74. package/dist/commands/webhook/get.js +2 -2
  75. package/dist/commands/webhook/list.js +1 -1
  76. package/dist/commands/webhook/test.js +1 -1
  77. package/dist/commands/webhook/update.js +3 -3
  78. package/dist/commands/webhook-delivery/list.js +2 -2
  79. package/dist/commands/webhook-delivery/redeliver.js +2 -2
  80. package/dist/commands/whoami.js +1 -1
  81. package/dist/completion/hotcodepush.fish +75 -75
  82. package/dist/completion/hotcodepush.zsh +75 -75
  83. package/dist/utils/audience.js +1 -1
  84. package/dist/utils/authentication.js +60 -0
  85. package/dist/utils/build-step.js +1 -1
  86. package/dist/utils/channel-fields.js +3 -3
  87. package/dist/utils/cli.js +5 -0
  88. package/dist/utils/command.js +4 -0
  89. package/dist/utils/diagnostics.js +20 -0
  90. package/dist/utils/error-mapping.js +10 -14
  91. package/dist/utils/login.js +153 -0
  92. package/dist/utils/output.js +2 -1
  93. package/dist/utils/release-conditions.js +3 -4
  94. package/dist/utils/release-output.js +1 -1
  95. package/dist/utils/resource-resolution.js +1 -1
  96. package/dist/utils/telemetry.js +3 -2
  97. package/dist/utils/update-notice.js +2 -1
  98. package/dist/utils/usage-month.js +1 -1
  99. package/dist/utils/user-config.js +8 -0
  100. package/dist/utils/webhook-resolution.js +1 -1
  101. package/package.json +3 -3
@@ -15,12 +15,12 @@ _hotcodepush() {
15
15
  'customer-portal-session:create'
16
16
  'device:delete, get, list, probe'
17
17
  'doctor:Check the project: its configuration, the hook wiring, the signing key, the hosts and the versions a bug report needs.'
18
- 'fingerprint:Print the project'\''s native fingerprint with the packages and the files under the extra fingerprint paths that contribute to it; local, no login.'
18
+ 'fingerprint:Print the project'\''s native fingerprint with the packages and the files under the extra fingerprint paths that contribute to it. Runs locally without a login.'
19
19
  'init:Set a React Native, Expo, Capacitor or Cordova project up from sign-in to the first release, re-runnable at any step.'
20
20
  'invitation:accept, create, delete, list'
21
21
  'limit:list'
22
22
  'login:Log in by approving a one-time code in the browser.'
23
- 'logout:End the stored session and remove its token; HOTCODEPUSH_TOKEN, when set, stays what it is.'
23
+ 'logout:End the stored session and remove its token. HOTCODEPUSH_TOKEN, when set, stays what it is.'
24
24
  'member:delete, get, list, update'
25
25
  'open:Open the app'\''s console page in the browser, or the channel'\''s, from hotcodepush.json.'
26
26
  'organization:create, delete, get, list, update'
@@ -42,7 +42,7 @@ _hotcodepush() {
42
42
  'app')
43
43
  completions=(
44
44
  'create:Create an app with its default channel, production.'
45
- 'delete:Delete an app with its channels, bundles and releases; support can restore it for seven days.'
45
+ 'delete:Delete an app with its channels, bundles and releases. Support can restore it for seven days.'
46
46
  'get:Print an app, hotcodepush.json'\''s by default.'
47
47
  'list:List an organization'\''s apps, newest first.'
48
48
  'transfer:Move an app to the organization --organization names, one you are an Admin of.'
@@ -53,7 +53,7 @@ _hotcodepush() {
53
53
  ;;
54
54
  'audience')
55
55
  completions=(
56
- 'get:Preview the devices a release'\''s conditions would reach in a channel, before it exists, the project'\''s fingerprint among them; what release create --dry-run prints.'
56
+ 'get:Preview the devices a release'\''s conditions would reach in a channel, before it exists, the project'\''s fingerprint among them. This is what release create --dry-run prints.'
57
57
  )
58
58
  _describe -t commands 'audience command' completions
59
59
  return
@@ -67,7 +67,7 @@ _hotcodepush() {
67
67
  ;;
68
68
  'binary')
69
69
  completions=(
70
- 'create:The build step of a store build: creates the binary with the embedded bundle it ships and writes the resource file the SDK reads, naming that bundle; every other build runs resource-file write. HOTCODEPUSH_OFFLINE=1 builds without the API, naming no channel unless it is given by id and creating no binary.'
70
+ 'create:The build step of a store build: creates the binary with the embedded bundle it ships and writes the resource file the SDK reads, naming that bundle. Every other build runs resource-file write. HOTCODEPUSH_OFFLINE=1 builds without the API, naming no channel unless it is given by id and creating no binary.'
71
71
  'get:Print a binary, a store build whose build created it, with the bundle it ships and the devices running it.'
72
72
  'list:List the binaries, the store builds whose build created one, with the bundle each ships and the devices running it.'
73
73
  )
@@ -76,10 +76,10 @@ _hotcodepush() {
76
76
  ;;
77
77
  'bundle')
78
78
  completions=(
79
- 'delete:Delete a bundle now; one a release serves or a store build embeds is refused.'
79
+ 'delete:Delete a bundle now. One a release serves or a store build embeds is refused.'
80
80
  'get:Print a bundle, by its number or id, with its deltas.'
81
81
  'list:List an app'\''s bundles, newest first: the uploaded ones by default, the ones binaries ship with --source binary, both with --source all.'
82
- 'upload:Upload a build as a bundle, signed where a key is configured: only the files the app lacks move, then the full pack; nothing is released.'
82
+ 'upload:Upload a build as a bundle, signed where a key is configured. Only the files the app lacks move, then the full pack. Nothing is released.'
83
83
  )
84
84
  _describe -t commands 'bundle command' completions
85
85
  return
@@ -87,7 +87,7 @@ _hotcodepush() {
87
87
  'channel')
88
88
  completions=(
89
89
  'create:Create a channel in an app, with an expiry for a preview channel and its auto-pause policy.'
90
- 'delete:Delete a channel and its releases; devices on it keep what they have.'
90
+ 'delete:Delete a channel and its releases. Devices on it keep what they have.'
91
91
  'get:Print a channel with its device counts, hotcodepush.json'\''s by default.'
92
92
  'list:List an app'\''s channels, newest first.'
93
93
  'pause:Pause a channel, the kill switch: it serves nothing new until resumed.'
@@ -113,9 +113,9 @@ _hotcodepush() {
113
113
  ;;
114
114
  'device')
115
115
  completions=(
116
- 'delete:Delete a device'\''s record, an erasure request; the device reports again with its next check.'
116
+ 'delete:Delete a device'\''s record, an erasure request. The device reports again with its next check.'
117
117
  'get:Print what a device runs and reported last, with its outcome per release, newest first.'
118
- 'list:List the app'\''s devices, the newest report first, filtered by what they reported; support and QA, never a pipeline.'
118
+ 'list:List the app'\''s devices, the newest report first, filtered by what they reported. It is for support and QA, never for a pipeline.'
119
119
  'probe:Answer why a device did not update: fetch the live index as a device would, evaluate it and mark every condition of every release.'
120
120
  )
121
121
  _describe -t commands 'device command' completions
@@ -123,7 +123,7 @@ _hotcodepush() {
123
123
  ;;
124
124
  'fingerprint')
125
125
  completions=(
126
- 'diff:Print the packages and extra fingerprint paths added, removed or moved between <file-a> and <file-b>, two files written by fingerprint --json, the earlier first; local, no login.'
126
+ 'diff:Print the packages and extra fingerprint paths added, removed or moved between <file-a> and <file-b>, two files written by fingerprint --json, the earlier first. Runs locally without a login.'
127
127
  )
128
128
  _describe -t commands 'fingerprint command' completions
129
129
  return
@@ -131,8 +131,8 @@ _hotcodepush() {
131
131
  'invitation')
132
132
  completions=(
133
133
  'accept:Accept an invitation to an organization with the token from its mail.'
134
- 'create:Invite an address to the organization with a role; the invitation mail is valid for two days.'
135
- 'delete:Withdraw a pending invitation; the link in its mail stops working at once.'
134
+ 'create:Invite an address to the organization with a role. The invitation mail is valid for two days.'
135
+ 'delete:Withdraw a pending invitation. The link in its mail stops working at once.'
136
136
  'list:List the organization'\''s pending invitations, the ones a link can still accept, newest first.'
137
137
  )
138
138
  _describe -t commands 'invitation command' completions
@@ -147,7 +147,7 @@ _hotcodepush() {
147
147
  ;;
148
148
  'member')
149
149
  completions=(
150
- 'delete:Remove a member from the organization, or yourself to leave it; the Owner leaves only after transferring the ownership.'
150
+ 'delete:Remove a member from the organization, or yourself to leave it. The Owner leaves only after transferring the ownership.'
151
151
  'get:Print a member of the organization with their role and how they sign in.'
152
152
  'list:List the organization'\''s members with their roles, newest first.'
153
153
  'update:Change a member'\''s role; --role owner transfers the ownership to them, makes you an admin and asks once, --yes confirming in scripts.'
@@ -158,7 +158,7 @@ _hotcodepush() {
158
158
  'organization')
159
159
  completions=(
160
160
  'create:Create an organization with you as its Owner.'
161
- 'delete:Delete an organization with everything in it; support can restore it for seven days.'
161
+ 'delete:Delete an organization with everything in it. Support can restore it for seven days.'
162
162
  'get:Print an organization with its plan, spending cap and region.'
163
163
  'list:List your organizations with your role in each, newest first.'
164
164
  'update:Rename an organization or set its spending cap, which applies now.'
@@ -175,7 +175,7 @@ _hotcodepush() {
175
175
  'resume:Resume a paused release: devices get it again, and a new auto-pause window starts.'
176
176
  'revoke:Revoke releases for good: devices on them move to the newest older release they qualify for or the embedded bundle.'
177
177
  'rollback:Release the channel'\''s previous bundle again, or the one of --to-release, as a new release.'
178
- 'rollout:Set a release'\''s rollout percentage in either direction, or widen it step by step with --progression; a device that has the release keeps it.'
178
+ 'rollout:Set a release'\''s rollout percentage in either direction, or widen it step by step with --progression. A device that has the release keeps it.'
179
179
  'update:Edit a published release in place: flip the mandatory flag, rewrite or clear the notes, change or clear an auto-pause override.'
180
180
  )
181
181
  _describe -t commands 'release command' completions
@@ -202,7 +202,7 @@ _hotcodepush() {
202
202
  completions=(
203
203
  'delete:Delete the organization'\''s SSO provider: password sign-in works again for its members, and the domain is forgotten.'
204
204
  'get:Print the organization'\''s SSO provider with its sign-in link and, until the domain is verified, the TXT record to set.'
205
- 'set:Set the organization'\''s OIDC or SAML provider and its email domain, replacing the one before; a new domain starts unverified.'
205
+ 'set:Set the organization'\''s OIDC or SAML provider and its email domain, replacing the one before. A new domain starts unverified.'
206
206
  'verify:Look up the domain'\''s TXT record and mark the domain verified when it is there.'
207
207
  )
208
208
  _describe -t commands 'sso-provider command' completions
@@ -210,7 +210,7 @@ _hotcodepush() {
210
210
  ;;
211
211
  'statistics')
212
212
  completions=(
213
- 'get:Print one of the app'\''s statistics: the fleet, the devices seen in 30 days; the updates per day; or the usage the bill counts.'
213
+ 'get:Print one of the app'\''s statistics: the fleet of devices seen in 30 days, the updates per day, or the usage the bill counts.'
214
214
  )
215
215
  _describe -t commands 'statistics command' completions
216
216
  return
@@ -225,20 +225,20 @@ _hotcodepush() {
225
225
  ;;
226
226
  'webhook')
227
227
  completions=(
228
- 'create:Create a webhook that posts the organization'\''s events to a URL, as signed JSON or as a Slack, Discord or Teams message; a raw webhook'\''s secret is printed this once.'
228
+ 'create:Create a webhook that posts the organization'\''s events to a URL, as signed JSON or as a Slack, Discord or Teams message. A raw webhook'\''s secret is printed this once.'
229
229
  'delete:Delete a webhook and its delivery log.'
230
- 'get:Print a webhook: its URL, format, events, app filter and whether it is enabled; never its secret.'
230
+ 'get:Print a webhook: its URL, format, events, app filter and whether it is enabled. The secret is never printed.'
231
231
  'list:List an organization'\''s webhooks, newest first.'
232
232
  'test:Send one sample event, webhook.test, to a webhook'\''s URL and print the receiver'\''s answer.'
233
- 'update:Rename a webhook or change its URL, events, app filter or whether it is enabled; the format and the secret never change.'
233
+ 'update:Rename a webhook or change its URL, events, app filter or whether it is enabled. The format and the secret never change.'
234
234
  )
235
235
  _describe -t commands 'webhook command' completions
236
236
  return
237
237
  ;;
238
238
  'webhook-delivery')
239
239
  completions=(
240
- 'list:List a webhook'\''s deliveries, newest first, filtered by status and time, to find the ones worth redelivering; each is kept for 30 days.'
241
- 'redeliver:Deliver a webhook'\''s event again, once, and print the receiver'\''s answer; a pending delivery is taken from the retries.'
240
+ 'list:List a webhook'\''s deliveries, newest first, filtered by status and time, to find the ones worth redelivering. Each is kept for 30 days.'
241
+ 'redeliver:Deliver a webhook'\''s event again, once, and print the receiver'\''s answer. A pending delivery is taken from the retries.'
242
242
  )
243
243
  _describe -t commands 'webhook-delivery command' completions
244
244
  return
@@ -319,7 +319,7 @@ _hotcodepush() {
319
319
  ;;
320
320
  'audience get')
321
321
  _hotcodepush_arguments 2 \
322
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
322
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
323
323
  '*--attribute[An attribute the app sets that the device must carry, key=value, repeatable.]:attribute:_files' \
324
324
  '--binary-version[The app versions served, a semver range such as ">=2.3.0 <3.0.0".]:binary-version:_files' \
325
325
  '*--device[A device the release is limited to, by id, repeatable.]:device:_files' \
@@ -340,7 +340,7 @@ _hotcodepush() {
340
340
  '--offset[How many to skip: the offset the previous page ended with.]:offset:_files' \
341
341
  '--actor[The user who acted, by id.]:actor:_files' \
342
342
  '--actor-type[system for the rows no user wrote, user for the rest.]:actor-type:(system user)' \
343
- '--app[The app, by id or name, to narrow the log to; the whole organization by default, never hotcodepush.json'\''s app.]:app:_files' \
343
+ '--app[The app, by id or name, to narrow the log to. Defaults to the whole organization, never to hotcodepush.json'\''s app.]:app:_files' \
344
344
  '--created-since[The earliest row, inclusive: an ISO 8601 timestamp or a duration ago such as 2h or 7d.]:created-since:_files' \
345
345
  '--created-until[The latest row, inclusive: an ISO 8601 timestamp or a duration ago such as 2h or 7d.]:created-until:_files' \
346
346
  '--type[The type, such as channel.created, or channel.* for every action on the object.]:type:_files' \
@@ -354,7 +354,7 @@ _hotcodepush() {
354
354
  ;;
355
355
  'binary create')
356
356
  _hotcodepush_arguments 2 \
357
- '--embedded-bundle-path[The directory of the embedded bundle, the files the build puts into the app; the framework'\''s build output by default.]:embedded-bundle-path:_files' \
357
+ '--embedded-bundle-path[The directory of the embedded bundle, the files the build puts into the app. Defaults to the framework'\''s build output.]:embedded-bundle-path:_files' \
358
358
  '--platform[The platform being built, ios or android.]:platform:(android ios)' \
359
359
  '--resource-file-path[Where the resource file goes, in the app the build makes.]:resource-file-path:_files' \
360
360
  '--binary-build[The store build'\''s build number, from the build'\''s variables.]:binary-build:_files' \
@@ -423,7 +423,7 @@ _hotcodepush() {
423
423
  '--limit[How many to list, at most 100; 50 by default.]:limit:_files' \
424
424
  '--offset[How many to skip: the offset the previous page ended with.]:offset:_files' \
425
425
  '--bundle-version[Only the bundles carrying this version label.]:bundle-version:_files' \
426
- '--source[upload, the bundles a release can carry, by default; binary, the ones binaries ship, which have no number; or all.]:source:(all binary upload)' \
426
+ '--source[upload is the bundles a release can carry, binary is the ones binaries ship, which have no number, and all is both. Defaults to upload.]:source:(all binary upload)' \
427
427
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
428
428
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
429
429
  '--help[Print this help.]' \
@@ -435,14 +435,14 @@ _hotcodepush() {
435
435
  ;;
436
436
  'bundle upload')
437
437
  _hotcodepush_arguments 2 \
438
- '--bundle-version[The bundle'\''s version label; the project'\''s package.json version by default.]:bundle-version:_files' \
438
+ '--bundle-version[The bundle'\''s version label. Defaults to the project'\''s package.json version.]:bundle-version:_files' \
439
439
  '--git-message[The commit message subject to record, over the detected one.]:git-message:_files' \
440
440
  '--git-ref[The branch or tag to record, over the detected one.]:git-ref:_files' \
441
441
  '--git-sha[The commit to record, over the detected one.]:git-sha:_files' \
442
- '--no-git[Detect no git provenance; the typed --git-* flags still apply.]' \
442
+ '--no-git[Detect no git provenance. The typed --git-* flags still apply.]' \
443
443
  '--path[The build to upload, the framework'\''s build output by default: on React Native and Expo one platform'\''s prepared bundle, Capacitor'\''s webDir or Cordova'\''s www.]:path:_files' \
444
444
  '--platform[The platforms the bundle serves, ios,android by default.]:platform:(android ios)' \
445
- '--private-key-path[The private key file to sign with, as signing-key create wrote it; HOTCODEPUSH_SIGNING_KEY holds its content in CI.]:private-key-path:_files' \
445
+ '--private-key-path[The private key file to sign with, as signing-key create wrote it. In CI, HOTCODEPUSH_SIGNING_KEY holds its content.]:private-key-path:_files' \
446
446
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
447
447
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
448
448
  '--help[Print this help.]' \
@@ -454,13 +454,13 @@ _hotcodepush() {
454
454
  ;;
455
455
  'channel create')
456
456
  _hotcodepush_arguments 2 \
457
- '--discoverable[Whether the app'\''s setChannel finds the channel by its name; pass false to turn it off.]' \
458
- '--expires-at[When the preview channel expires, an ISO 8601 timestamp; not on protected or default channels.]:expires-at:_files' \
457
+ '--discoverable[Whether the app'\''s setChannel finds the channel by its name. Pass false to turn it off.]' \
458
+ '--expires-at[When the preview channel expires, an ISO 8601 timestamp. Protected and default channels have none.]:expires-at:_files' \
459
459
  '--expires-in[How long until the preview channel expires, 14d or 12h.]:expires-in:_files' \
460
460
  '--failure-action[What auto-pause does when a release fails too often: pause, revoke, notify or none.]:failure-action:(none notify pause revoke)' \
461
461
  '--failure-minimum-update-count[The applied updates a release needs before auto-pause judges it.]:failure-minimum-update-count:_files' \
462
462
  '--failure-threshold-percent[The failure percentage at which auto-pause acts.]:failure-threshold-percent:_files' \
463
- '--protected[Whether only Owners and Admins change what the channel serves; pass false to turn it off.]' \
463
+ '--protected[Whether only Owners and Admins change what the channel serves. Pass false to turn it off.]' \
464
464
  '--if-not-exists[Return the channel of that name when it exists instead of failing, for re-run pipelines.]' \
465
465
  '--name[The name: letters, digits, - and _, one to 64 characters, unique in the app.]:name:_files' \
466
466
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
@@ -474,7 +474,7 @@ _hotcodepush() {
474
474
  ;;
475
475
  'channel delete')
476
476
  _hotcodepush_arguments 2 \
477
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
477
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
478
478
  '--ignore-not-found[Succeed when the channel does not exist, for re-run pipelines.]' \
479
479
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
480
480
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -487,7 +487,7 @@ _hotcodepush() {
487
487
  ;;
488
488
  'channel get')
489
489
  _hotcodepush_arguments 2 \
490
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
490
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
491
491
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
492
492
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
493
493
  '--help[Print this help.]' \
@@ -512,7 +512,7 @@ _hotcodepush() {
512
512
  ;;
513
513
  'channel pause')
514
514
  _hotcodepush_arguments 2 \
515
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
515
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
516
516
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
517
517
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
518
518
  '--help[Print this help.]' \
@@ -524,7 +524,7 @@ _hotcodepush() {
524
524
  ;;
525
525
  'channel resume')
526
526
  _hotcodepush_arguments 2 \
527
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
527
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
528
528
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
529
529
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
530
530
  '--help[Print this help.]' \
@@ -540,14 +540,14 @@ _hotcodepush() {
540
540
  '--clear-failure-action[Sets the action back to null: the default policy applies.]' \
541
541
  '--clear-failure-minimum-update-count[Sets the minimum update count back to null: the default policy applies.]' \
542
542
  '--clear-failure-threshold-percent[Sets the threshold back to null: the default policy applies.]' \
543
- '--discoverable[Whether the app'\''s setChannel finds the channel by its name; pass false to turn it off.]' \
544
- '--expires-at[When the preview channel expires, an ISO 8601 timestamp; not on protected or default channels.]:expires-at:_files' \
543
+ '--discoverable[Whether the app'\''s setChannel finds the channel by its name. Pass false to turn it off.]' \
544
+ '--expires-at[When the preview channel expires, an ISO 8601 timestamp. Protected and default channels have none.]:expires-at:_files' \
545
545
  '--expires-in[How long until the preview channel expires, 14d or 12h.]:expires-in:_files' \
546
546
  '--failure-action[What auto-pause does when a release fails too often: pause, revoke, notify or none.]:failure-action:(none notify pause revoke)' \
547
547
  '--failure-minimum-update-count[The applied updates a release needs before auto-pause judges it.]:failure-minimum-update-count:_files' \
548
548
  '--failure-threshold-percent[The failure percentage at which auto-pause acts.]:failure-threshold-percent:_files' \
549
- '--protected[Whether only Owners and Admins change what the channel serves; pass false to turn it off.]' \
550
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
549
+ '--protected[Whether only Owners and Admins change what the channel serves. Pass false to turn it off.]' \
550
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
551
551
  '--name[The channel'\''s new name: letters, digits, - and _, one to 64 characters.]:name:_files' \
552
552
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
553
553
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -628,7 +628,7 @@ _hotcodepush() {
628
628
  ;;
629
629
  'device probe')
630
630
  _hotcodepush_arguments 2 \
631
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
631
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
632
632
  '--device[The device, by the id it generated, as the debug screen and device list show it.]:device:_files' \
633
633
  '*--attribute[An attribute the app sets, key=value, repeatable.]:attribute:_files' \
634
634
  '--binary-build[The store build'\''s build number, CFBundleVersion or versionCode.]:binary-build:_files' \
@@ -829,14 +829,14 @@ _hotcodepush() {
829
829
  ;;
830
830
  'release create')
831
831
  _hotcodepush_arguments 2 \
832
- '--bundle-version[The bundle'\''s version label; the project'\''s package.json version by default.]:bundle-version:_files' \
832
+ '--bundle-version[The bundle'\''s version label. Defaults to the project'\''s package.json version.]:bundle-version:_files' \
833
833
  '--git-message[The commit message subject to record, over the detected one.]:git-message:_files' \
834
834
  '--git-ref[The branch or tag to record, over the detected one.]:git-ref:_files' \
835
835
  '--git-sha[The commit to record, over the detected one.]:git-sha:_files' \
836
- '--no-git[Detect no git provenance; the typed --git-* flags still apply.]' \
836
+ '--no-git[Detect no git provenance. The typed --git-* flags still apply.]' \
837
837
  '--path[The build to upload, the framework'\''s build output by default: on React Native and Expo one platform'\''s prepared bundle, Capacitor'\''s webDir or Cordova'\''s www.]:path:_files' \
838
838
  '--platform[The platforms the bundle serves, ios,android by default.]:platform:(android ios)' \
839
- '--private-key-path[The private key file to sign with, as signing-key create wrote it; HOTCODEPUSH_SIGNING_KEY holds its content in CI.]:private-key-path:_files' \
839
+ '--private-key-path[The private key file to sign with, as signing-key create wrote it. In CI, HOTCODEPUSH_SIGNING_KEY holds its content.]:private-key-path:_files' \
840
840
  '*--attribute[An attribute the app sets that the device must carry, key=value, repeatable.]:attribute:_files' \
841
841
  '--binary-version[The app versions served, a semver range such as ">=2.3.0 <3.0.0".]:binary-version:_files' \
842
842
  '*--device[A device the release is limited to, by id, repeatable.]:device:_files' \
@@ -848,12 +848,12 @@ _hotcodepush() {
848
848
  '--progression-minimum-seconds[The seconds a step lasts at least before the next one, with --progression; 3600 by default.]:progression-minimum-seconds:_files' \
849
849
  '--progression-minimum-update-count[The applied updates each step needs before the next one, with --progression; 50 by default.]:progression-minimum-update-count:_files' \
850
850
  '--progression-rollout-percents[The percentages the rollout widens through, rising, the last above the starting rollout, with --progression; 10,50,100 by default.]:progression-rollout-percents:_files' \
851
- '--bundle[A bundle already uploaded, by number or id; without it the build is uploaded first.]:bundle:_files' \
852
- '*--channel[The channel, by id or name, repeatable; hotcodepush.json'\''s channel by default.]:channel:_files' \
853
- '--dry-run[Validate and print the audience the release would reach; nothing is signed, uploaded or published, so no private key is needed.]' \
851
+ '--bundle[A bundle already uploaded, by number or id. Without it the build is uploaded first.]:bundle:_files' \
852
+ '*--channel[The channel, by id or name, repeatable. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
853
+ '--dry-run[Validate and print the audience the release would reach. Nothing is signed, uploaded or published, so no private key is needed.]' \
854
854
  '--from-channel[Release what this channel serves, by id or name, instead of a bundle or a build.]:from-channel:_files' \
855
855
  '--mandatory[Devices apply the release at once and restart.]' \
856
- '--notes[The release notes; they ride the public index.]:notes:_files' \
856
+ '--notes[The release notes. They ride the public index.]:notes:_files' \
857
857
  '--rollout-percent[The share of devices the release reaches, 0 to 100; 100 by default, the schedule'\''s first percentage with --progression.]:rollout-percent:_files' \
858
858
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
859
859
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -866,7 +866,7 @@ _hotcodepush() {
866
866
  ;;
867
867
  'release get')
868
868
  _hotcodepush_arguments 2 \
869
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
869
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
870
870
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
871
871
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
872
872
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -879,7 +879,7 @@ _hotcodepush() {
879
879
  ;;
880
880
  'release list')
881
881
  _hotcodepush_arguments 2 \
882
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
882
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
883
883
  '--limit[How many to list, at most 100; 50 by default.]:limit:_files' \
884
884
  '--offset[How many to skip: the offset the previous page ended with.]:offset:_files' \
885
885
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
@@ -893,7 +893,7 @@ _hotcodepush() {
893
893
  ;;
894
894
  'release pause')
895
895
  _hotcodepush_arguments 2 \
896
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
896
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
897
897
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
898
898
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
899
899
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -906,7 +906,7 @@ _hotcodepush() {
906
906
  ;;
907
907
  'release resume')
908
908
  _hotcodepush_arguments 2 \
909
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
909
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
910
910
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
911
911
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
912
912
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -919,10 +919,10 @@ _hotcodepush() {
919
919
  ;;
920
920
  'release revoke')
921
921
  _hotcodepush_arguments 2 \
922
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
922
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
923
923
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
924
- '--all[Every release of the channel; its devices return to the embedded bundle.]' \
925
- '--bundle[Every release of this bundle, by number or id, across the app'\''s channels; without --channel.]:bundle:_files' \
924
+ '--all[Every release of the channel. Its devices return to the embedded bundle.]' \
925
+ '--bundle[Every release of this bundle, by number or id, across the app'\''s channels. Takes no --channel.]:bundle:_files' \
926
926
  '--release-from[The first release revoked, by number, inclusive: that one and every newer one of the channel.]:release-from:_files' \
927
927
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
928
928
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -935,9 +935,9 @@ _hotcodepush() {
935
935
  ;;
936
936
  'release rollback')
937
937
  _hotcodepush_arguments 2 \
938
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
939
- '--mandatory[Devices apply the rollback at once and restart, the default for an incident fix; pass false to let them wait.]' \
940
- '--to-release[The release whose bundle comes back, by number or id; the channel'\''s previous one by default.]:to-release:_files' \
938
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
939
+ '--mandatory[Devices apply the rollback at once and restart, the default for an incident fix. Pass false to let them wait.]' \
940
+ '--to-release[The release whose bundle comes back, by number or id. Defaults to the channel'\''s previous one.]:to-release:_files' \
941
941
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
942
942
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
943
943
  '--help[Print this help.]' \
@@ -949,13 +949,13 @@ _hotcodepush() {
949
949
  ;;
950
950
  'release rollout')
951
951
  _hotcodepush_arguments 2 \
952
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
952
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
953
953
  '--progression[Widen the rollout step by step while the release stays healthy: 10, 50 and 100 percent by default, each step after at least an hour and 50 applied updates.]' \
954
954
  '--progression-minimum-seconds[The seconds a step lasts at least before the next one, with --progression; 3600 by default.]:progression-minimum-seconds:_files' \
955
955
  '--progression-minimum-update-count[The applied updates each step needs before the next one, with --progression; 50 by default.]:progression-minimum-update-count:_files' \
956
956
  '--progression-rollout-percents[The percentages the rollout widens through, rising, the last above the starting rollout, with --progression; 10,50,100 by default.]:progression-rollout-percents:_files' \
957
957
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
958
- '--rollout-percent[The share of devices the release reaches from now on, 0 to 100; with --progression where the schedule starts, the release'\''s own percentage by default.]:rollout-percent:_files' \
958
+ '--rollout-percent[The share of devices the release reaches from now on, 0 to 100. With --progression it is where the schedule starts. Defaults to the release'\''s own percentage.]:rollout-percent:_files' \
959
959
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
960
960
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
961
961
  '--help[Print this help.]' \
@@ -967,7 +967,7 @@ _hotcodepush() {
967
967
  ;;
968
968
  'release update')
969
969
  _hotcodepush_arguments 2 \
970
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
970
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
971
971
  '--failure-action[What auto-pause does when a release fails too often: pause, revoke, notify or none.]:failure-action:(none notify pause revoke)' \
972
972
  '--failure-minimum-update-count[The applied updates a release needs before auto-pause judges it.]:failure-minimum-update-count:_files' \
973
973
  '--failure-threshold-percent[The failure percentage at which auto-pause acts.]:failure-threshold-percent:_files' \
@@ -976,7 +976,7 @@ _hotcodepush() {
976
976
  '--clear-failure-threshold-percent[Sets the threshold back to null: the channel'\''s value applies.]' \
977
977
  '--release[The release, by its number in the channel or by its id.]:release:_files' \
978
978
  '--clear-notes[Sets the notes back to null.]' \
979
- '--mandatory[Whether devices apply the release at once and restart; pass false to turn it off.]' \
979
+ '--mandatory[Whether devices apply the release at once and restart. Pass false to turn it off.]' \
980
980
  '--notes[The new release notes.]:notes:_files' \
981
981
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
982
982
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -989,7 +989,7 @@ _hotcodepush() {
989
989
  ;;
990
990
  'resource-file write')
991
991
  _hotcodepush_arguments 2 \
992
- '--embedded-bundle-path[The directory of the embedded bundle, the files the build puts into the app; the framework'\''s build output by default.]:embedded-bundle-path:_files' \
992
+ '--embedded-bundle-path[The directory of the embedded bundle, the files the build puts into the app. Defaults to the framework'\''s build output.]:embedded-bundle-path:_files' \
993
993
  '--platform[The platform being built, ios or android.]:platform:(android ios)' \
994
994
  '--resource-file-path[Where the resource file goes, in the app the build makes.]:resource-file-path:_files' \
995
995
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
@@ -1003,7 +1003,7 @@ _hotcodepush() {
1003
1003
  ;;
1004
1004
  'signing-key add')
1005
1005
  _hotcodepush_arguments 2 \
1006
- '--private-key-path[The private key file of the pair, a PEM of PKCS #8 or PKCS #1, read on this machine; its public key is derived from it.]:private-key-path:_files' \
1006
+ '--private-key-path[The private key file of the pair, a PEM of PKCS #8 or PKCS #1, read on this machine. Its public key is derived from it.]:private-key-path:_files' \
1007
1007
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
1008
1008
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
1009
1009
  '--help[Print this help.]' \
@@ -1107,10 +1107,10 @@ _hotcodepush() {
1107
1107
  ;;
1108
1108
  'statistics get')
1109
1109
  _hotcodepush_arguments 2 \
1110
- '--channel[The channel, by id or name, to narrow the fleet or the updates to; the whole app by default.]:channel:_files' \
1110
+ '--channel[The channel, by id or name, to narrow the fleet or the updates to. Defaults to the whole app.]:channel:_files' \
1111
1111
  '--period-since[The first UTC day of the updates or the usage, YYYY-MM-DD, inclusive; 30 days before --period-until by default.]:period-since:_files' \
1112
- '--period-until[The last UTC day of the updates or the usage, YYYY-MM-DD, inclusive; today by default.]:period-until:_files' \
1113
- '--type[The statistics to print: fleet, the devices seen in 30 days; updates, per day; usage, the monthly active devices and the traffic.]:type:(fleet updates usage)' \
1112
+ '--period-until[The last UTC day of the updates or the usage, YYYY-MM-DD, inclusive. Defaults to today.]:period-until:_files' \
1113
+ '--type[The statistics to print. fleet is the devices seen in 30 days, updates is the updates per day, and usage is the monthly active devices and the traffic.]:type:(fleet updates usage)' \
1114
1114
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
1115
1115
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
1116
1116
  '--help[Print this help.]' \
@@ -1122,7 +1122,7 @@ _hotcodepush() {
1122
1122
  ;;
1123
1123
  'usage get')
1124
1124
  _hotcodepush_arguments 2 \
1125
- '--month[The month, YYYY-MM; the current one by default.]:month:_files' \
1125
+ '--month[The month, YYYY-MM. Defaults to the current one.]:month:_files' \
1126
1126
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
1127
1127
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
1128
1128
  '--help[Print this help.]' \
@@ -1134,7 +1134,7 @@ _hotcodepush() {
1134
1134
  ;;
1135
1135
  'usage list')
1136
1136
  _hotcodepush_arguments 2 \
1137
- '--month[The month, YYYY-MM; the current one by default.]:month:_files' \
1137
+ '--month[The month, YYYY-MM. Defaults to the current one.]:month:_files' \
1138
1138
  '--limit[How many to list, at most 100; 50 by default.]:limit:_files' \
1139
1139
  '--offset[How many to skip: the offset the previous page ended with.]:offset:_files' \
1140
1140
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
@@ -1148,7 +1148,7 @@ _hotcodepush() {
1148
1148
  ;;
1149
1149
  'webhook create')
1150
1150
  _hotcodepush_arguments 2 \
1151
- '--app[The app, by id or name, whose events alone the webhook receives; every app'\''s and the organization'\''s by default, never hotcodepush.json'\''s app.]:app:_files' \
1151
+ '--app[The app, by id or name, whose events alone the webhook receives. Defaults to every app'\''s and the organization'\''s events, never to hotcodepush.json'\''s app.]:app:_files' \
1152
1152
  '*--event[An event type the webhook receives, such as release.created, repeatable.]:event:_files' \
1153
1153
  '--format[raw for HotCodePush'\''s signed JSON, slack, discord or teams for a message to that service'\''s incoming-webhook URL.]:format:(raw slack discord teams)' \
1154
1154
  '--name[The name, unique in the organization.]:name:_files' \
@@ -1212,11 +1212,11 @@ _hotcodepush() {
1212
1212
  ;;
1213
1213
  'webhook update')
1214
1214
  _hotcodepush_arguments 2 \
1215
- '--app[The app, by id or name, whose events alone the webhook receives; every app'\''s and the organization'\''s by default, never hotcodepush.json'\''s app.]:app:_files' \
1215
+ '--app[The app, by id or name, whose events alone the webhook receives. Defaults to every app'\''s and the organization'\''s events, never to hotcodepush.json'\''s app.]:app:_files' \
1216
1216
  '*--event[An event type the webhook receives, such as release.created, repeatable.]:event:_files' \
1217
1217
  '--webhook[The webhook, by id or name.]:webhook:_files' \
1218
1218
  '--clear-app[Sets the app filter back to null: the webhook receives every app'\''s events and the organization'\''s.]' \
1219
- '--enabled[Whether the webhook delivers; turning it on again restarts the count of failures that disables it. Pass false to turn it off.]' \
1219
+ '--enabled[Whether the webhook delivers. Turning it on again restarts the count of failures that disables it. Pass false to turn it off.]' \
1220
1220
  '--name[The webhook'\''s new name.]:name:_files' \
1221
1221
  '--url[The https URL the events are posted to.]:url:_files' \
1222
1222
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
@@ -1308,7 +1308,7 @@ _hotcodepush() {
1308
1308
  ;;
1309
1309
  'login '*)
1310
1310
  _hotcodepush_arguments 1 \
1311
- '--api-url[The API to log in to, kept in config.json for every later command; the one kept there otherwise.]:api-url:_files' \
1311
+ '--api-url[The API to log in to, kept in config.json for every later command. Defaults to the one kept there.]:api-url:_files' \
1312
1312
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
1313
1313
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
1314
1314
  '--help[Print this help.]' \
@@ -1331,7 +1331,7 @@ _hotcodepush() {
1331
1331
  ;;
1332
1332
  'open '*)
1333
1333
  _hotcodepush_arguments 1 \
1334
- '--channel[The channel, by id or name; hotcodepush.json'\''s channel by default.]:channel:_files' \
1334
+ '--channel[The channel, by id or name. Defaults to hotcodepush.json'\''s channel.]:channel:_files' \
1335
1335
  '--app[The app, by id or name, when no hotcodepush.json is found or another app is meant.]:app:_files' \
1336
1336
  '--config[The hotcodepush.json to use, when it is not the nearest one up from the working directory.]:config:_files' \
1337
1337
  '--help[Print this help.]' \
@@ -2,7 +2,7 @@ export function resolveAudienceText(audience, channelName, rolloutPercent) {
2
2
  const reachText = `reaches ${resolveCountText(audience.reachedDeviceCount)} of ${resolveCountText(audience.deviceCount)} active devices in ${channelName}`;
3
3
  return rolloutPercent === 100
4
4
  ? reachText
5
- : `${reachText}; about ${resolveCountText(audience.estimatedDeviceCount)} at a ${rolloutPercent} percent rollout`;
5
+ : `${reachText}, about ${resolveCountText(audience.estimatedDeviceCount)} at a ${rolloutPercent} percent rollout`;
6
6
  }
7
7
  function resolveCountText(count) {
8
8
  return count.toLocaleString('en-US');
@@ -0,0 +1,60 @@
1
+ import { createApiAuthClient, fetchSession } from './auth-client.js';
2
+ import { printSuccess, printWarning } from './diagnostics.js';
3
+ import { isInteractive } from './environment.js';
4
+ import { CliError, ExitCode, NotLoggedInError } from './errors.js';
5
+ import { logIn } from './login.js';
6
+ import { promptYesNo } from './prompts.js';
7
+ import { isEnvironmentToken, readStoredToken, readToken, } from './token-store.js';
8
+ import { readUserConfig, writeStoredSession } from './user-config.js';
9
+ // Authentication is a precondition of the command, never an error inside it, so nothing is retried.
10
+ // A non-interactive run cannot log in, so it checks only that a token exists and leaves its validity to the API.
11
+ export async function ensureAuthentication(options) {
12
+ if (!isInteractive(options)) {
13
+ if (readToken() === undefined) {
14
+ throw new NotLoggedInError();
15
+ }
16
+ return;
17
+ }
18
+ const sessionState = await readSessionState();
19
+ if (sessionState === 'usable') {
20
+ return;
21
+ }
22
+ printWarning(sessionState === 'expired'
23
+ ? 'Your session has expired.'
24
+ : 'You are not logged in.');
25
+ if (!(await promptYesNo('Log in now?', options))) {
26
+ throw new NotLoggedInError();
27
+ }
28
+ const user = await logIn(options);
29
+ printSuccess(`Logged in as ${user.name} (${user.email}).`);
30
+ }
31
+ // `HOTCODEPUSH_TOKEN` is taken as it is. Its validity is the API's to judge.
32
+ // A session slides while in use, so a stored expiry that has passed is a hint, checked with one request before anyone is asked.
33
+ export async function readSessionState() {
34
+ if (isEnvironmentToken()) {
35
+ return 'usable';
36
+ }
37
+ const storedToken = readStoredToken();
38
+ if (storedToken === undefined) {
39
+ return 'missing';
40
+ }
41
+ const { sessionExpiresAt } = readUserConfig();
42
+ if (sessionExpiresAt === undefined ||
43
+ new Date(sessionExpiresAt) > new Date()) {
44
+ return 'usable';
45
+ }
46
+ return (await refreshStoredSession(storedToken)) ? 'usable' : 'expired';
47
+ }
48
+ async function refreshStoredSession(storedToken) {
49
+ try {
50
+ const { session } = await fetchSession(createApiAuthClient(storedToken));
51
+ writeStoredSession(session);
52
+ return true;
53
+ }
54
+ catch (error) {
55
+ if (error instanceof CliError && error.exitCode === ExitCode.NotLoggedIn) {
56
+ return false;
57
+ }
58
+ throw error;
59
+ }
60
+ }
@@ -21,7 +21,7 @@ export const buildStepShape = {
21
21
  embeddedBundlePath: z
22
22
  .string()
23
23
  .optional()
24
- .describe("The directory of the embedded bundle, the files the build puts into the app; the framework's build output by default."),
24
+ .describe("The directory of the embedded bundle, the files the build puts into the app. Defaults to the framework's build output."),
25
25
  platform: z
26
26
  .enum(PLATFORMS)
27
27
  .optional()